Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 24738 → Rev 24739

/trunk/Scribus/scribus/pageitem.h
288,7 → 288,7
void DrawObj_Pre(ScPainter *p);
virtual void DrawObj_Post(ScPainter *p);
virtual void DrawObj_Decoration(ScPainter *p);
virtual void DrawObj_Item(ScPainter *p, QRectF e) = 0;
virtual void DrawObj_Item(ScPainter *p, const QRectF& e) = 0;
QImage DrawObj_toImage(double maxSize, int options = 0);
QImage DrawObj_toImage(QList<PageItem*> &emG, double scaling);
void DrawObj_Embedded(ScPainter *p, QRectF cullingArea, const CharStyle& style, PageItem* cembedded);
/trunk/Scribus/scribus/pageitem_arc.cpp
56,7 → 56,7
recalcPath();
}
 
void PageItem_Arc::DrawObj_Item(ScPainter *p, QRectF /*e*/)
void PageItem_Arc::DrawObj_Item(ScPainter *p, const QRectF& /*e*/)
{
if (!m_Doc->RePos)
{
/trunk/Scribus/scribus/pageitem_arc.h
46,13 → 46,14
void applicableActions(QStringList& actionList) override;
QString infoDescription() const override;
void recalcPath();
 
double arcHeight; //! height of the circumfering ellipse
double arcWidth; //! width of the circumfering ellipse
double arcStartAngle; //! angle where the arc starts
double arcSweepAngle; //! angle the arc spans
double arcStartAngle { 30.0 }; //! angle where the arc starts
double arcSweepAngle { 300.0 }; //! angle the arc spans
protected:
void DrawObj_Item(ScPainter *p, QRectF e) override;
void DrawObj_Item(ScPainter *p, const QRectF& e) override;
 
};
 
/trunk/Scribus/scribus/pageitem_group.cpp
168,7 → 168,7
}
}
 
void PageItem_Group::DrawObj_Item(ScPainter *p, QRectF /*e*/)
void PageItem_Group::DrawObj_Item(ScPainter *p, const QRectF& /*e*/)
{
if (m_Doc->RePos)
return;
/trunk/Scribus/scribus/pageitem_group.h
62,7 → 62,7
void layout() override;
protected:
void DrawObj_Item(ScPainter *p, QRectF e) override;
void DrawObj_Item(ScPainter *p, const QRectF& e) override;
 
};
 
/trunk/Scribus/scribus/pageitem_imageframe.cpp
70,7 → 70,7
}
}
 
void PageItem_ImageFrame::DrawObj_Item(ScPainter *p, QRectF /*e*/)
void PageItem_ImageFrame::DrawObj_Item(ScPainter *p, const QRectF& /*e*/)
{
if (m_Doc->RePos)
return;
93,120 → 93,117
p->drawLine(FPoint(0, m_height), FPoint(m_width, 0));
}
}
else
else if ((!m_imageVisible) || (!imageIsAvailable))
{
//If we are missing our image, draw a red cross in the frame
if ((!m_imageVisible) || (!imageIsAvailable))
if ((drawFrame()) && (m_Doc->guidesPrefs().framesShown))
{
if ((drawFrame()) && (m_Doc->guidesPrefs().framesShown))
p->setBrush(Qt::white);
QString htmlText = "";
QFileInfo fi(Pfile);
if (imageIsAvailable)
{
p->setBrush(Qt::white);
QString htmlText = "";
QFileInfo fi = QFileInfo(Pfile);
if (imageIsAvailable)
p->setPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
if (isInlineImage)
htmlText.append( tr("Embedded Image") + "\n");
else
htmlText.append( tr("File:") + " " + fi.fileName() + "\n");
htmlText.append( tr("Original PPI:") + " " + QString::number(pixm.imgInfo.xres)+" x "+QString::number(pixm.imgInfo.yres) + "\n");
htmlText.append( tr("Actual PPI:") + " " + QString::number(qRound(72.0 / imageXScale()))+" x "+ QString::number(qRound(72.0 / imageYScale())) + "\n");
htmlText.append( tr("Size:") + " " + QString::number(OrigW) + " x " + QString::number(OrigH) + "\n");
htmlText.append( tr("Colorspace:") + " ");
QString ext = fi.suffix().toLower();
if ((extensionIndicatesPDF(ext) || extensionIndicatesEPSorPS(ext)) && (pixm.imgInfo.type != ImageType7))
htmlText.append( tr("Unknown"));
else
htmlText.append(colorSpaceText(pixm.imgInfo.colorspace));
if (pixm.imgInfo.numberOfPages > 1)
{
p->setPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
if (isInlineImage)
htmlText.append( tr("Embedded Image") + "\n");
htmlText.append("\n");
if (pixm.imgInfo.actualPageNumber > 0)
htmlText.append( tr("Page:") + " " + QString::number(pixm.imgInfo.actualPageNumber) + "/" + QString::number(pixm.imgInfo.numberOfPages));
else
htmlText.append( tr("File:") + " " + fi.fileName() + "\n");
htmlText.append( tr("Original PPI:") + " " + QString::number(pixm.imgInfo.xres)+" x "+QString::number(pixm.imgInfo.yres) + "\n");
htmlText.append( tr("Actual PPI:") + " " + QString::number(qRound(72.0 / imageXScale()))+" x "+ QString::number(qRound(72.0 / imageYScale())) + "\n");
htmlText.append( tr("Size:") + " " + QString::number(OrigW) + " x " + QString::number(OrigH) + "\n");
htmlText.append( tr("Colorspace:") + " ");
QString ext = fi.suffix().toLower();
if ((extensionIndicatesPDF(ext) || extensionIndicatesEPSorPS(ext)) && (pixm.imgInfo.type != ImageType7))
htmlText.append( tr("Unknown"));
else
htmlText.append(colorSpaceText(pixm.imgInfo.colorspace));
if (pixm.imgInfo.numberOfPages > 1)
{
htmlText.append("\n");
if (pixm.imgInfo.actualPageNumber > 0)
htmlText.append( tr("Page:") + " " + QString::number(pixm.imgInfo.actualPageNumber) + "/" + QString::number(pixm.imgInfo.numberOfPages));
else
htmlText.append( tr("Pages:") + " " + QString::number(pixm.imgInfo.numberOfPages));
}
htmlText.append( tr("Pages:") + " " + QString::number(pixm.imgInfo.numberOfPages));
}
else
{
p->setPen(Qt::red, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
htmlText = fi.fileName();
}
p->drawLine(FPoint(0, 0), FPoint(m_width, m_height));
p->drawLine(FPoint(0, m_height), FPoint(m_width, 0));
const QFont &font = QApplication::font();
p->setFont(PrefsManager::instance().appPrefs.fontPrefs.AvailFonts.findFont(font.family(), QFontInfo(font).styleName()), font.pointSizeF());
p->drawText(QRectF(0.0, 0.0, m_width, m_height), htmlText);
}
else
{
p->setPen(Qt::red, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
htmlText = fi.fileName();
}
p->drawLine(FPoint(0, 0), FPoint(m_width, m_height));
p->drawLine(FPoint(0, m_height), FPoint(m_width, 0));
const QFont &font = QApplication::font();
p->setFont(PrefsManager::instance().appPrefs.fontPrefs.AvailFonts.findFont(font.family(), QFontInfo(font).styleName()), font.pointSizeF());
p->drawText(QRectF(0.0, 0.0, m_width, m_height), htmlText);
}
else
}
else
{
p->setupPolygon(&PoLine);
p->setClipPath();
if (imageFlippedH())
{
p->setupPolygon(&PoLine);
p->translate(m_width, 0);
p->scale(-1, 1);
}
if (imageFlippedV())
{
p->translate(0, m_height);
p->scale(1, -1);
}
if (!imageClip.empty())
{
p->setupPolygon(&imageClip);
p->setClipPath();
if (imageFlippedH())
}
p->translate(m_imageXOffset*m_imageXScale, m_imageYOffset*m_imageYScale);
p->rotate(m_imageRotation);
double mscalex = 1.0 / m_imageXScale;
double mscaley = 1.0 / m_imageYScale;
p->scale(m_imageXScale, m_imageYScale);
if (pixm.imgInfo.lowResType != 0)
{
p->scale(pixm.imgInfo.lowResScale, pixm.imgInfo.lowResScale);
mscalex *= 1.0 / pixm.imgInfo.lowResScale;
mscaley *= 1.0 / pixm.imgInfo.lowResScale;
}
if ((GrMask == GradMask_Linear) || (GrMask == GradMask_Radial) || (GrMask == GradMask_LinearLumAlpha) || (GrMask == GradMask_RadialLumAlpha))
{
if ((GrMask == GradMask_Linear) || (GrMask == GradMask_Radial))
p->setMaskMode(1);
else
p->setMaskMode(3);
if ((!gradientMaskVal.isEmpty()) && (!m_Doc->docGradients.contains(gradientMaskVal)))
gradientMaskVal = "";
if (!(gradientMaskVal.isEmpty()) && (m_Doc->docGradients.contains(gradientMaskVal)))
mask_gradient = m_Doc->docGradients[gradientMaskVal];
p->mask_gradient = mask_gradient;
if ((GrMask == GradMask_Linear) || (GrMask == GradMask_LinearLumAlpha))
p->setGradientMask(VGradient::linear, FPoint(GrMaskStartX * mscalex, GrMaskStartY * mscaley), FPoint(GrMaskEndX * mscalex, GrMaskEndY * mscaley), FPoint(GrMaskStartX * mscalex, GrMaskStartY * mscaley), GrMaskScale, GrMaskSkew);
else
p->setGradientMask(VGradient::radial, FPoint(GrMaskStartX * mscalex, GrMaskStartY * mscaley), FPoint(GrMaskEndX * mscalex, GrMaskEndY * mscaley), FPoint(GrMaskFocalX * mscalex, GrMaskFocalY * mscaley), GrMaskScale, GrMaskSkew);
}
else if ((GrMask == GradMask_Pattern) || (GrMask == GradMask_PatternLumAlpha) || (GrMask == GradMask_PatternLumAlphaInverted) || (GrMask == GradMask_PatternInverted))
{
if ((patternMaskVal.isEmpty()) || (!m_Doc->docPatterns.contains(patternMaskVal)))
p->setMaskMode(0);
else
{
p->translate(m_width, 0);
p->scale(-1, 1);
}
if (imageFlippedV())
{
p->translate(0, m_height);
p->scale(1, -1);
}
if (!imageClip.empty())
{
p->setupPolygon(&imageClip);
p->setClipPath();
}
p->translate(m_imageXOffset*m_imageXScale, m_imageYOffset*m_imageYScale);
p->rotate(m_imageRotation);
double mscalex = 1.0 / m_imageXScale;
double mscaley = 1.0 / m_imageYScale;
p->scale(m_imageXScale, m_imageYScale);
if (pixm.imgInfo.lowResType != 0)
{
p->scale(pixm.imgInfo.lowResScale, pixm.imgInfo.lowResScale);
mscalex *= 1.0 / pixm.imgInfo.lowResScale;
mscaley *= 1.0 / pixm.imgInfo.lowResScale;
}
if ((GrMask == GradMask_Linear) || (GrMask == GradMask_Radial) || (GrMask == GradMask_LinearLumAlpha) || (GrMask == GradMask_RadialLumAlpha))
{
if ((GrMask == GradMask_Linear) || (GrMask == GradMask_Radial))
p->setMaskMode(1);
p->setPatternMask(&m_Doc->docPatterns[patternMaskVal], patternMaskScaleX * mscalex, patternMaskScaleY * mscaley, patternMaskOffsetX, patternMaskOffsetY, patternMaskRotation, patternMaskSkewX, patternMaskSkewY, patternMaskMirrorX, patternMaskMirrorY);
if (GrMask == GradMask_Pattern)
p->setMaskMode(2);
else if (GrMask == GradMask_PatternLumAlpha)
p->setMaskMode(4);
else if (GrMask == GradMask_PatternLumAlphaInverted)
p->setMaskMode(5);
else
p->setMaskMode(3);
if ((!gradientMaskVal.isEmpty()) && (!m_Doc->docGradients.contains(gradientMaskVal)))
gradientMaskVal = "";
if (!(gradientMaskVal.isEmpty()) && (m_Doc->docGradients.contains(gradientMaskVal)))
mask_gradient = m_Doc->docGradients[gradientMaskVal];
p->mask_gradient = mask_gradient;
if ((GrMask == GradMask_Linear) || (GrMask == GradMask_LinearLumAlpha))
p->setGradientMask(VGradient::linear, FPoint(GrMaskStartX * mscalex, GrMaskStartY * mscaley), FPoint(GrMaskEndX * mscalex, GrMaskEndY * mscaley), FPoint(GrMaskStartX * mscalex, GrMaskStartY * mscaley), GrMaskScale, GrMaskSkew);
else
p->setGradientMask(VGradient::radial, FPoint(GrMaskStartX * mscalex, GrMaskStartY * mscaley), FPoint(GrMaskEndX * mscalex, GrMaskEndY * mscaley), FPoint(GrMaskFocalX * mscalex, GrMaskFocalY * mscaley), GrMaskScale, GrMaskSkew);
p->setMaskMode(6);
}
else if ((GrMask == GradMask_Pattern) || (GrMask == GradMask_PatternLumAlpha) || (GrMask == GradMask_PatternLumAlphaInverted) || (GrMask == GradMask_PatternInverted))
{
if ((patternMaskVal.isEmpty()) || (!m_Doc->docPatterns.contains(patternMaskVal)))
p->setMaskMode(0);
else
{
p->setPatternMask(&m_Doc->docPatterns[patternMaskVal], patternMaskScaleX * mscalex, patternMaskScaleY * mscaley, patternMaskOffsetX, patternMaskOffsetY, patternMaskRotation, patternMaskSkewX, patternMaskSkewY, patternMaskMirrorX, patternMaskMirrorY);
if (GrMask == GradMask_Pattern)
p->setMaskMode(2);
else if (GrMask == GradMask_PatternLumAlpha)
p->setMaskMode(4);
else if (GrMask == GradMask_PatternLumAlphaInverted)
p->setMaskMode(5);
else
p->setMaskMode(6);
}
}
else
p->setMaskMode(0);
p->drawImage(pixm.qImagePtr());
}
else
p->setMaskMode(0);
p->drawImage(pixm.qImagePtr());
}
p->restore();
}
215,7 → 212,7
{
if (UndoManager::undoEnabled())
{
ScItemState<ScImageEffectList> *is = new ScItemState<ScImageEffectList>(Um::ClearImage + "\n" + Pfile, "");
auto *is = new ScItemState<ScImageEffectList>(Um::ClearImage + "\n" + Pfile, "");
is->set("CLEAR_IMAGE");
is->set("CI_PFILE", Pfile);
is->set("CI_FLIPPH",imageFlippedH());
390,7 → 387,7
aPpiCT = new QLabel(infoGroup);
colT = new QLabel(infoGroup);
colCT = new QLabel(infoGroup);
QFileInfo fi = QFileInfo(Pfile);
QFileInfo fi(Pfile);
fileCT->setText( tr("File:"));
infoGroupLayout->addWidget( fileCT, 1, 0, Qt::AlignRight );
if (isInlineImage)
424,7 → 421,7
{
if (!Pfile.isEmpty())
{
QFileInfo fi = QFileInfo(Pfile);
QFileInfo fi(Pfile);
fileCT->setText( tr("File:"));
infoGroupLayout->addWidget( fileCT, 1, 0, Qt::AlignRight );
fileT = new QLabel(infoGroup);
488,7 → 485,7
if (imageIsAvailable)
{
QFileInfo fi = QFileInfo(Pfile);
QFileInfo fi(Pfile);
if (isInlineImage)
htmlText.append( tr("Embedded Image") + "<br/>");
else
514,7 → 511,7
{
if (!Pfile.isEmpty())
{
QFileInfo fi = QFileInfo(Pfile);
QFileInfo fi(Pfile);
if (isInlineImage)
htmlText.append( tr("Embedded Image missing") + "<br/>");
else if (extensionIndicatesPDF(fi.suffix().toLower()))
/trunk/Scribus/scribus/pageitem_imageframe.h
51,7 → 51,7
QString infoDescription() const override;
protected:
void DrawObj_Item(ScPainter *p, QRectF e) override;
void DrawObj_Item(ScPainter *p, const QRectF& e) override;
 
};
 
/trunk/Scribus/scribus/pageitem_latexframe.cpp
47,13 → 47,6
m_itemName = tr("Render") + QString::number(m_Doc->TotalItems);
setUName(m_itemName);
m_imgValid = false;
m_usePreamble = true;
m_err = 0;
internalEditor = nullptr;
m_killed = false;
config = nullptr;
if (PrefsManager::instance().latexConfigs().count() > 0)
setConfigFile(PrefsManager::instance().latexConfigs()[0]);
 
70,8 → 63,6
delete tempfile;
Q_ASSERT(!tempFileBase.isEmpty());
m_dpi = 0;
m_lastWidth = m_lastHeight = 0;
m_lastDpi = realDpi();
 
m_imageXScale *= (72.0 / realDpi());
127,7 → 118,7
m_imgValid = false;
}
 
void PageItem_LatexFrame::DrawObj_Item(ScPainter *p, QRectF e)
void PageItem_LatexFrame::DrawObj_Item(ScPainter *p, const QRectF& e)
{
layout();
if (!m_imgValid && !m_err)
404,7 → 395,7
m_err = 0;
if (UndoManager::undoEnabled() && undoable)
{
SimpleState *ss = new SimpleState(Um::ChangeFormula, "", Um::IChangeFormula);
auto *ss = new SimpleState(Um::ChangeFormula, "", Um::IChangeFormula);
ss->set("CHANGE_FORMULA");
ss->set("OLD_FORMULA", formulaText);
ss->set("NEW_FORMULA", formula);
528,7 → 519,7
 
void PageItem_LatexFrame::restore(UndoState *state, bool isUndo)
{
SimpleState *ss = dynamic_cast<SimpleState*>(state);
auto *ss = dynamic_cast<SimpleState*>(state);
if (!ss)
{
PageItem_ImageFrame::restore(state, isUndo);
/trunk/Scribus/scribus/pageitem_latexframe.h
99,28 → 99,33
QMap<QString,QString> editorProperties;
 
protected:
virtual void DrawObj_Item(ScPainter *p, QRectF e) override;
double m_lastWidth, m_lastHeight, m_lastDpi;
void DrawObj_Item(ScPainter *p, const QRectF& e) override;
 
double m_lastWidth { 0.0 };
double m_lastHeight { 0.0 };
double m_lastDpi { 72.0 };
QString formulaText;
 
void writeFileContents(QFile *tempfile);
void deleteImageFile();
 
/* Last error code */
int m_err;
int m_dpi;
int m_err { 0 };
int m_dpi { 0 };
QString imageFile, tempFileBase;
QString appStdout;
QString configFilename;
QProcess *latex;
LatexEditor *internalEditor;
LatexConfigParser *config;
bool m_imgValid;
bool m_usePreamble;
bool m_killed;
QProcess *latex { nullptr };
LatexEditor *internalEditor { nullptr };
LatexConfigParser *config { nullptr };
 
bool m_imgValid { false };
bool m_usePreamble { true };
bool m_killed { false };
 
signals:
void formulaAutoUpdate(QString oldText, QString newText);
void latexFinished();
/trunk/Scribus/scribus/pageitem_line.cpp
52,7 → 52,7
{
}
 
void PageItem_Line::DrawObj_Item(ScPainter *p, QRectF /*e*/)
void PageItem_Line::DrawObj_Item(ScPainter *p, const QRectF& /*e*/)
{
if (m_Doc->RePos)
return;
/trunk/Scribus/scribus/pageitem_line.h
67,7 → 67,7
double visualHeight() const override;
protected:
void DrawObj_Item(ScPainter *p, QRectF e) override;
void DrawObj_Item(ScPainter *p, const QRectF& e) override;
 
};
 
/trunk/Scribus/scribus/pageitem_pathtext.cpp
73,13 → 73,13
}
 
 
void PageItem_PathText::DrawObj_Item(ScPainter *p, QRectF cullingArea)
void PageItem_PathText::DrawObj_Item(ScPainter *p, const QRectF& cullingArea)
{
itemText.invalidateAll();
firstChar = 0;
m_maxChars = 0;
FPoint point = FPoint(0, 0);
FPoint tangent = FPoint(0, 0);
FPoint point(0, 0);
FPoint tangent(0, 0);
CurX = m_textDistanceMargins.left();
 
if (!m_Doc->layerOutline(m_layerID))
/trunk/Scribus/scribus/pageitem_pathtext.h
56,7 → 56,7
double visualHeight() const override;
 
protected:
void DrawObj_Item(ScPainter *p, QRectF e) override;
void DrawObj_Item(ScPainter *p, const QRectF& e) override;
 
};
 
/trunk/Scribus/scribus/pageitem_polygon.cpp
48,7 → 48,7
{
}
 
void PageItem_Polygon::DrawObj_Item(ScPainter *p, QRectF /*e*/)
void PageItem_Polygon::DrawObj_Item(ScPainter *p, const QRectF& /*e*/)
{
if (!m_Doc->RePos)
{
/trunk/Scribus/scribus/pageitem_polygon.h
46,7 → 46,7
QString infoDescription() const override;
protected:
void DrawObj_Item(ScPainter *p, QRectF e) override;
void DrawObj_Item(ScPainter *p, const QRectF& e) override;
 
};
 
/trunk/Scribus/scribus/pageitem_polyline.cpp
51,7 → 51,7
{
}
 
void PageItem_PolyLine::DrawObj_Item(ScPainter *p, QRectF /*e*/)
void PageItem_PolyLine::DrawObj_Item(ScPainter *p, const QRectF& /*e*/)
{
if (m_Doc->RePos || PoLine.size() < 4)
return;
222,7 → 222,7
{
PageItem::getBoundingRect(x1, y1, x2, y2);
 
QRectF totalRect = QRectF(QPointF(*x1, *y1), QPointF(*x2, *y2));
QRectF totalRect(QPointF(*x1, *y1), QPointF(*x2, *y2));
if (m_startArrowIndex != 0 && !PoLine.empty())
{
QRectF arrowRect = getStartArrowBoundingRect();
240,7 → 240,7
{
PageItem::getOldBoundingRect(x1, y1, x2, y2);
 
QRectF totalRect = QRectF(QPointF(*x1, *y1), QPointF(*x2, *y2));
QRectF totalRect(QPointF(*x1, *y1), QPointF(*x2, *y2));
if (m_startArrowIndex != 0 && !PoLine.empty())
{
QRectF arrowRect = getStartArrowOldBoundingRect();
/trunk/Scribus/scribus/pageitem_polyline.h
50,7 → 50,7
void getVisualBoundingRect(double *x1, double *y1, double *x2, double *y2) const override;
 
protected:
void DrawObj_Item(ScPainter *p, QRectF e) override;
void DrawObj_Item(ScPainter *p, const QRectF& e) override;
 
};
 
/trunk/Scribus/scribus/pageitem_regularpolygon.cpp
62,7 → 62,7
Clip = flattenPath(PoLine, Segments);
}
 
void PageItem_RegularPolygon::DrawObj_Item(ScPainter *p, QRectF /*e*/)
void PageItem_RegularPolygon::DrawObj_Item(ScPainter *p, const QRectF& /*e*/)
{
if (!m_Doc->RePos)
{
/trunk/Scribus/scribus/pageitem_regularpolygon.h
57,7 → 57,7
double polyOuterCurvature;
protected:
void DrawObj_Item(ScPainter *p, QRectF e) override;
void DrawObj_Item(ScPainter *p, const QRectF& e) override;
 
};
 
/trunk/Scribus/scribus/pageitem_spiral.cpp
56,7 → 56,7
recalcPath();
}
 
void PageItem_Spiral::DrawObj_Item(ScPainter *p, QRectF /*e*/)
void PageItem_Spiral::DrawObj_Item(ScPainter *p, const QRectF& /*e*/)
{
if (m_Doc->RePos || PoLine.size() < 4)
return;
355,7 → 355,7
{
PageItem::getBoundingRect(x1, y1, x2, y2);
 
QRectF totalRect = QRectF(QPointF(*x1, *y1), QPointF(*x2, *y2));
QRectF totalRect(QPointF(*x1, *y1), QPointF(*x2, *y2));
if (m_startArrowIndex != 0 && !PoLine.empty())
{
QRectF arrowRect = getStartArrowBoundingRect();
373,7 → 373,7
{
PageItem::getOldBoundingRect(x1, y1, x2, y2);
 
QRectF totalRect = QRectF(QPointF(*x1, *y1), QPointF(*x2, *y2));
QRectF totalRect(QPointF(*x1, *y1), QPointF(*x2, *y2));
if (m_startArrowIndex != 0 && !PoLine.empty())
{
QRectF arrowRect = getStartArrowOldBoundingRect();
/trunk/Scribus/scribus/pageitem_spiral.h
46,16 → 46,17
void applicableActions(QStringList& actionList) override;
QString infoDescription() const override;
void recalcPath();
double spiralStartAngle; //! angle where the spiral starts
double spiralEndAngle; //! angle the spiral spans
double spiralFactor; //! factor the spiral gets smaller
 
double spiralStartAngle { 0.0 }; //! angle where the spiral starts
double spiralEndAngle { 1080 }; //! angle the spiral spans
double spiralFactor { 1.2 }; //! factor the spiral gets smaller
 
void getBoundingRect(double *x1, double *y1, double *x2, double *y2) const override;
void getOldBoundingRect(double *x1, double *y1, double *x2, double *y2) const override;
void getVisualBoundingRect(double *x1, double *y1, double *x2, double *y2) const override;
protected:
void DrawObj_Item(ScPainter *p, QRectF e) override;
void DrawObj_Item(ScPainter *p, const QRectF& e) override;
 
};
 
/trunk/Scribus/scribus/pageitem_symbol.cpp
52,7 → 52,7
{
}
 
void PageItem_Symbol::DrawObj_Item(ScPainter *p, QRectF /*e*/)
void PageItem_Symbol::DrawObj_Item(ScPainter *p, const QRectF& /*e*/)
{
if (m_Doc->RePos)
return;
/trunk/Scribus/scribus/pageitem_symbol.h
47,7 → 47,7
QString infoDescription() const override;
protected:
void DrawObj_Item(ScPainter *p, QRectF e) override;
void DrawObj_Item(ScPainter *p, const QRectF& e) override;
 
};
 
/trunk/Scribus/scribus/pageitem_table.cpp
1073,7 → 1073,7
{
const QPointF framePoint = getTransform().inverted().map(point);
const QPointF gridPoint = framePoint - gridOffset();
const QRectF gridRect = QRectF(0.0, 0.0, tableWidth(), tableHeight());
const QRectF gridRect(0.0, 0.0, tableWidth(), tableHeight());
 
// Test if hit is outside frame.
if (!QRectF(0.0, 0.0, width(), height()).contains(framePoint))
1339,7 → 1339,7
actionList << "tableAdjustTableToFrame";
}
 
void PageItem_Table::DrawObj_Item(ScPainter *p, QRectF /*e*/)
void PageItem_Table::DrawObj_Item(ScPainter *p, const QRectF& /*e*/)
{
if (m_Doc->RePos)
return;
/trunk/Scribus/scribus/pageitem_table.h
542,7 → 542,7
 
protected:
/// Paints this item.
void DrawObj_Item(ScPainter *p, QRectF clipRect) override;
void DrawObj_Item(ScPainter *p, const QRectF& clipRect) override;
 
private:
/// Enum describing types of changes on a table. For internal use.
/trunk/Scribus/scribus/pageitem_textframe.cpp
361,39 → 361,39
struct LineControl {
LineSpec lineData;
QList<GlyphCluster> glyphs;
bool isEmpty;
int hyphenCount;
bool isEmpty { true };
int hyphenCount { 0 };
double colWidth;
double colGap;
double colLeft;
double colRight;
int column;
bool startOfCol;
int column { 0 };
bool startOfCol { true };
bool hasDropCap;
bool afterOverflow;
bool addLine;
bool recalculateY;
bool lastInRowLine;
bool addLeftIndent;
bool wasFirstInRow;
double leftIndent;
double rightIndent;
double rightMargin;
double mustLineEnd;
int restartIndex; //index of glyph run where line computing should be restarted
int restartRowIndex; //index of glyph run where row of text is started
double restartX; //starting X position of line if must be restarted
double rowDesc;
bool afterOverflow { false };
bool addLine { false };
bool recalculateY { false };
bool lastInRowLine { false };
bool addLeftIndent { false };
bool wasFirstInRow { false };
double leftIndent { 0.0 };
double rightIndent { 0.0 };
double rightMargin { 0.0 };
double mustLineEnd { false };
int restartIndex { 0 }; //index of glyph run where line computing should be restarted
int restartRowIndex { 0 }; //index of glyph run where row of text is started
double restartX { 0.0 }; //starting X position of line if must be restarted
double rowDesc { 0.0 };
 
double xPos;
double yPos;
int breakIndex;
double breakXPos;
double xPos { 0.0 };
double yPos { 0.0 };
int breakIndex { -1 };
double breakXPos { 0.0 };
 
double maxShrink;
double maxStretch;
ScribusDoc *doc;
ITextContext* context;
double maxShrink { 0.0 };
double maxStretch { 0.0 };
ScribusDoc* doc { nullptr };
ITextContext* context { nullptr };
 
/// remember frame dimensions and offsets
LineControl(double w, double h, const MarginStruct& extra, double lCorr, ScribusDoc* d, ITextContext* ctx, double colwidth, double colgap)
404,34 → 404,10
lineCorr = lCorr;
frameWidth = w;
frameHeight = h;
column = 0;
colWidth = colwidth;
colGap = colgap;
hyphenCount = 0;
isEmpty = true;
colLeft = insets.left() + lineCorr;
colRight = colLeft + colWidth;
startOfCol = true;
afterOverflow = false;
addLine = false;
recalculateY = false;
lastInRowLine = false;
addLeftIndent = false;
wasFirstInRow = false;
leftIndent = 0.0;
rightIndent = 0.0;
rightMargin = 0.0;
mustLineEnd = false;
restartIndex = 0;
restartRowIndex = 0;
restartX = 0.0;
rowDesc = 0.0;
xPos = 0.0;
yPos = 0.0;
breakIndex = -1;
breakXPos = 0.0;
maxShrink = 0.0;
maxStretch = 0.0;
}
 
/// move position to next column
3069,7 → 3045,7
return true;
}
 
void PageItem_TextFrame::DrawObj_Item(ScPainter *p, QRectF cullingArea)
void PageItem_TextFrame::DrawObj_Item(ScPainter *p, const QRectF& cullingArea)
{
if (invalid)
{
/trunk/Scribus/scribus/pageitem_textframe.h
89,7 → 89,7
protected:
QRegion calcAvailableRegion();
QRegion m_availableRegion;
void DrawObj_Item(ScPainter *p, QRectF e) override;
void DrawObj_Item(ScPainter *p, const QRectF& e) override;
void DrawObj_Post(ScPainter *p) override;
void DrawObj_Decoration(ScPainter *p) override;
//void drawOverflowMarker(ScPainter *p);
/trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.cpp
133,7 → 133,7
 
void ExportForm::readConfig()
{
outputDirectory->setText( QDir::toNativeSeparators(prefs->get("ExportDirectory", ScPaths::instance().userDocumentDir())) );
outputDirectory->setText( QDir::toNativeSeparators(prefs->get("ExportDirectory", ScPaths::userDocumentDir())) );
DPIBox->setValue(prefs->getUInt("DPIBox", 72));
enlargementBox->setValue(prefs->getInt("EnlargementBox", 100));
qualityBox->setValue(prefs->getUInt("QualityBox", -1));
/trunk/Scribus/scribus/plugins/import/pdf/pdfimportoptions.cpp
18,9 → 18,6
{
ui->setupUi(this);
ui->pageSelectButton->setIcon(IconManager::instance().loadIcon("ellipsis.png"));
m_plugin = nullptr;
m_maxPage = 0;
m_resized = false;
 
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onOkButtonClicked()));
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
72,7 → 69,7
QDialog::paintEvent(e);
}
 
QString PdfImportOptions::getPagesString()
QString PdfImportOptions::getPagesString() const
{
if (ui->allPages->isChecked())
return "*";
81,7 → 78,7
return ui->pageRangeString->text();
}
 
int PdfImportOptions::getCropBox()
int PdfImportOptions::getCropBox() const
{
int ret = 0;
if (ui->cropGroup->isChecked())
89,12 → 86,12
return ret;
}
 
bool PdfImportOptions::croppingEnabled()
bool PdfImportOptions::croppingEnabled() const
{
return ui->cropGroup->isChecked();
}
 
bool PdfImportOptions::getImportAsVectors()
bool PdfImportOptions::getImportAsVectors() const
{
return ui->textAsVectors->isChecked();
}
/trunk/Scribus/scribus/plugins/import/pdf/pdfimportoptions.h
23,10 → 23,10
~PdfImportOptions();
 
void setUpOptions(const QString& fileName, int actPage, int numPages, bool interact, bool cropPossible, PdfPlug* plug);
QString getPagesString();
int getCropBox();
bool croppingEnabled();
bool getImportAsVectors();
QString getPagesString() const;
int getCropBox() const;
bool croppingEnabled() const;
bool getImportAsVectors() const;
 
protected:
void paintEvent(QPaintEvent *e) override;
39,10 → 39,10
void createPageNumberRange();
 
private:
Ui::PdfImportOptions *ui;
PdfPlug* m_plugin;
int m_maxPage;
bool m_resized;
Ui::PdfImportOptions *ui { nullptr };
PdfPlug* m_plugin { nullptr };
int m_maxPage { 0 };
bool m_resized { false };
 
private slots:
void onOkButtonClicked();
/trunk/Scribus/scribus/scpageoutput.cpp
729,77 → 729,74
painter->drawLine(FPoint(0, 0), FPoint(item->width(), item->height()));
painter->drawLine(FPoint(0, item->height()), FPoint(item->width(), 0));*/
}
else if ((!item->imageVisible()) || (!item->imageIsAvailable))
{
/*painter->setPen(ScColorShade(Qt::red, 100), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
painter->drawLine(FPoint(0, 0), FPoint(item->width(), item->height()));
painter->drawLine(FPoint(0, item->height()), FPoint(item->width(), 0));*/
}
else
{
if ((!item->imageVisible()) || (!item->imageIsAvailable))
ScImage scImg;
ScImage* pImage = nullptr;
double imScaleX = item->imageXScale();
double imScaleY = item->imageYScale();
if (m_reloadImages)
{
/*painter->setPen(ScColorShade(Qt::red, 100), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
painter->drawLine(FPoint(0, 0), FPoint(item->width(), item->height()));
painter->drawLine(FPoint(0, item->height()), FPoint(item->width(), 0));*/
bool dummy;
bool useCmyk = false;
ScPainterExBase::ImageMode imageMode = painter->imageMode();
if (imageMode == ScPainterExBase::cmykImages)
useCmyk = true;
QFileInfo fInfo(item->Pfile);
QString ext = fInfo.suffix();
CMSettings cmsSettings(item->doc(), item->ImageProfile, item->ImageIntent);
cmsSettings.allowColorManagement(m_useProfiles);
cmsSettings.setUseEmbeddedProfile(item->UseEmbedded);
scImg.imgInfo.valid = false;
scImg.imgInfo.clipPath = "";
scImg.imgInfo.PDSpathData.clear();
scImg.imgInfo.layerInfo.clear();
scImg.imgInfo.RequestProps = item->pixm.imgInfo.RequestProps;
scImg.imgInfo.isRequest = item->pixm.imgInfo.isRequest;
scImg.loadPicture(item->Pfile, item->pixm.imgInfo.actualPageNumber, cmsSettings, translateImageModeToRequest(imageMode), m_imageRes, &dummy);
if (extensionIndicatesEPSorPS(ext) || extensionIndicatesPDF(ext))
{
imScaleX *= (72.0 / (double) m_imageRes);
imScaleY *= (72.0 / (double) m_imageRes);
}
scImg.applyEffect(item->effectsInUse, m_doc->PageColors, useCmyk);
mode = imageMode;
pImage = &scImg;
}
else
pImage = &item->pixm;
 
painter->save();
if (!item->imageClip.empty())
{
ScImage scImg;
ScImage* pImage = nullptr;
double imScaleX = item->imageXScale();
double imScaleY = item->imageYScale();
if (m_reloadImages)
{
bool dummy;
bool useCmyk = false;
ScPainterExBase::ImageMode imageMode = painter->imageMode();
if (imageMode == ScPainterExBase::cmykImages)
useCmyk = true;
QFileInfo fInfo(item->Pfile);
QString ext = fInfo.suffix();
CMSettings cmsSettings(item->doc(), item->ImageProfile, item->ImageIntent);
cmsSettings.allowColorManagement(m_useProfiles);
cmsSettings.setUseEmbeddedProfile(item->UseEmbedded);
scImg.imgInfo.valid = false;
scImg.imgInfo.clipPath = "";
scImg.imgInfo.PDSpathData.clear();
scImg.imgInfo.layerInfo.clear();
scImg.imgInfo.RequestProps = item->pixm.imgInfo.RequestProps;
scImg.imgInfo.isRequest = item->pixm.imgInfo.isRequest;
scImg.loadPicture(item->Pfile, item->pixm.imgInfo.actualPageNumber, cmsSettings, translateImageModeToRequest(imageMode), m_imageRes, &dummy);
if (extensionIndicatesEPSorPS(ext) || extensionIndicatesPDF(ext))
{
imScaleX *= (72.0 / (double) m_imageRes);
imScaleY *= (72.0 / (double) m_imageRes);
}
scImg.applyEffect(item->effectsInUse, m_doc->PageColors, useCmyk);
mode = imageMode;
pImage = &scImg;
}
else
pImage = &item->pixm;
 
painter->save();
if (!item->imageClip.empty())
{
painter->setupPolygon(&item->imageClip);
painter->setClipPath();
}
painter->setupPolygon(&item->PoLine);
painter->setupPolygon(&item->imageClip);
painter->setClipPath();
if (item->imageFlippedH())
{
painter->translate(item->width(), 0);
painter->scale(-1, 1);
}
if (item->imageFlippedV())
{
painter->translate(0, item->height());
painter->scale(1, -1);
}
painter->translate(item->imageXOffset() * item->imageXScale(), item->imageYOffset() * item->imageYScale());
painter->rotate(item->imageRotation());
painter->scale(imScaleX, imScaleY);
if (pImage->imgInfo.lowResType != 0)
painter->scale(pImage->imgInfo.lowResScale, pImage->imgInfo.lowResScale);
painter->drawImage(pImage, mode);
painter->restore();
}
painter->setupPolygon(&item->PoLine);
painter->setClipPath();
if (item->imageFlippedH())
{
painter->translate(item->width(), 0);
painter->scale(-1, 1);
}
if (item->imageFlippedV())
{
painter->translate(0, item->height());
painter->scale(1, -1);
}
painter->translate(item->imageXOffset() * item->imageXScale(), item->imageYOffset() * item->imageYScale());
painter->rotate(item->imageRotation());
painter->scale(imScaleX, imScaleY);
if (pImage->imgInfo.lowResType != 0)
painter->scale(pImage->imgInfo.lowResScale, pImage->imgInfo.lowResScale);
painter->drawImage(pImage, mode);
painter->restore();
}
}
 
/trunk/Scribus/scribus/ui/sclistwidgetdelegate.cpp
26,7 → 26,7
 
ScListWidgetDelegate::ScListWidgetDelegate(QListWidget *view, QWidget *parent) : QItemDelegate(parent), m_view(view)
{
m_dispIconOnly = false;
 
}
 
void ScListWidgetDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
66,7 → 66,7
m_dispIconOnly = setter;
}
 
bool ScListWidgetDelegate::iconOnly()
bool ScListWidgetDelegate::iconOnly() const
{
return m_dispIconOnly;
}
/trunk/Scribus/scribus/ui/sclistwidgetdelegate.h
31,14 → 31,16
Q_OBJECT
public:
ScListWidgetDelegate(QListWidget *view, QWidget *parent);
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
virtual QSize sizeHint(const QStyleOptionViewItem &opt, const QModelIndex &index) const;
 
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
QSize sizeHint(const QStyleOptionViewItem &opt, const QModelIndex &index) const override;
 
void setIconOnly(bool setter);
bool iconOnly();
bool iconOnly() const;
 
private:
QListWidget *m_view;
bool m_dispIconOnly;
QListWidget *m_view { nullptr };
bool m_dispIconOnly { false };
};
 
#endif // SCLISTWIDGETDELEGATE_H