r22586 by craig - Some C++11 fixes, mainly for pageitem

scribus-commit scribus-commit at lists.scribus.net
Tue Jun 26 20:40:32 UTC 2018


Author: craig
Date: Tue Jun 26 20:40:32 2018
New Revision: 22586

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22586
Log:
Some C++11 fixes, mainly for pageitem

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem.h

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22586&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp	(original)
+++ trunk/Scribus/scribus/pageitem.cpp	Tue Jun 26 20:40:32 2018
@@ -2172,7 +2172,7 @@
 				p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.frameNormColor, scpInv, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 				if ((isBookmark) || (m_isAnnotation))
 					p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.frameAnnotationColor, scpInv, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-				if ((BackBox != 0) || (NextBox != 0))
+				if ((BackBox != nullptr) || (NextBox != nullptr))
 					p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.frameLinkColor, scpInv, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 				if (m_Locked)
 					p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.frameLockColor, scpInv, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
@@ -3314,7 +3314,7 @@
 	double lastStop = -1.0;
 	double actualStop = 0.0;
 	bool   isFirst = true;
-	for (uint cst = 0; cst < fill_gradient.Stops(); ++cst)
+	for (int cst = 0; cst < fill_gradient.Stops(); ++cst)
 	{
 		actualStop = cstops.at(cst)->rampPoint;
 		if ((actualStop == lastStop) && (!isFirst))
@@ -3780,7 +3780,7 @@
 		return; // nothing to do -> return
 	if (UndoManager::undoEnabled())
 	{
-		SimpleState *ss = new SimpleState(Um::BlendMode, 0, Um::IGroup);
+		SimpleState *ss = new SimpleState(Um::BlendMode, nullptr, Um::IGroup);
 		ss->set("FILLBLENDMODE", newBlendmode);
 		ss->set("FILLBLENDMODE_OLD", fillBlendmodeVal);
 		undoManager->action(this, ss);
@@ -3991,7 +3991,7 @@
 	}
 }
 
-void PageItem::setHatchParameters(int mode, double distance, double angle, bool useBackground, QString background, QString foreground)
+void PageItem::setHatchParameters(int mode, double distance, double angle, bool useBackground, const QString& background, const QString& foreground)
 {
 	hatchType = mode;
 	hatchDistance = distance;
@@ -4054,7 +4054,7 @@
 		return; // nothing to do -> return
 	if (UndoManager::undoEnabled())
 	{
-		SimpleState *ss = new SimpleState(Um::BlendMode, 0, Um::IGroup);
+		SimpleState *ss = new SimpleState(Um::BlendMode, nullptr, Um::IGroup);
 		ss->set("LINEBLENDMODE", newBlendmode);
 		ss->set("LINEBLENDMODE_OLD", lineBlendmodeVal);
 		undoManager->action(this, ss);
@@ -4212,7 +4212,7 @@
 {
 	if (UndoManager::undoEnabled())
 	{
-		SimpleState *ss = new SimpleState(Um::FlipH, 0, Um::IFlipH);
+		SimpleState *ss = new SimpleState(Um::FlipH, nullptr, Um::IFlipH);
 		ss->set("IMAGEFLIPH");
 		undoManager->action(this, ss);
 	}
@@ -4229,7 +4229,7 @@
 {
 	if (UndoManager::undoEnabled())
 	{
-		SimpleState *ss = new SimpleState(Um::FlipV, 0, Um::IFlipV);
+		SimpleState *ss = new SimpleState(Um::FlipV, nullptr, Um::IFlipV);
 		ss->set("IMAGEFLIPV");
 		undoManager->action(this, ss);
 	}
@@ -4357,7 +4357,7 @@
 
 	if (UndoManager::undoEnabled())
 	{
-		SimpleState *ss = new SimpleState(Um::SoftShadowXOffset, 0, Um::IGroup);
+		SimpleState *ss = new SimpleState(Um::SoftShadowXOffset, nullptr, Um::IGroup);
 		ss->set("SOFT_SHADOW_XOFFSET");
 		ss->set("NEW_VALUE", val);
 		ss->set("OLD_VALUE", m_softShadowXOffset);
@@ -4373,7 +4373,7 @@
 
 	if (UndoManager::undoEnabled())
 	{
-		SimpleState *ss = new SimpleState(Um::SoftShadowYOffset, 0, Um::IGroup);
+		SimpleState *ss = new SimpleState(Um::SoftShadowYOffset, nullptr, Um::IGroup);
 		ss->set("SOFT_SHADOW_YOFFSET");
 		ss->set("NEW_VALUE", val);
 		ss->set("OLD_VALUE", m_softShadowYOffset);
@@ -4389,7 +4389,7 @@
 
 	if (UndoManager::undoEnabled())
 	{
-		SimpleState *ss = new SimpleState(Um::SoftShadowOpacity, 0, Um::IGroup);
+		SimpleState *ss = new SimpleState(Um::SoftShadowOpacity, nullptr, Um::IGroup);
 		ss->set("SOFT_SHADOW_OPACITY");
 		ss->set("NEW_VALUE", val);
 		ss->set("OLD_VALUE", m_softShadowOpacity);
@@ -4405,7 +4405,7 @@
 
 	if (UndoManager::undoEnabled())
 	{
-		SimpleState *ss = new SimpleState(Um::SoftShadowBlendMode, 0, Um::IGroup);
+		SimpleState *ss = new SimpleState(Um::SoftShadowBlendMode, nullptr, Um::IGroup);
 		ss->set("SOFT_SHADOW_BLEND_MODE");
 		ss->set("NEW_VALUE", val);
 		ss->set("OLD_VALUE", m_softShadowBlendMode);
@@ -4421,7 +4421,7 @@
 
 	if (UndoManager::undoEnabled())
 	{
-		SimpleState *ss = new SimpleState(Um::SoftShadowErase, 0, Um::IGroup);
+		SimpleState *ss = new SimpleState(Um::SoftShadowErase, nullptr, Um::IGroup);
 		ss->set("SOFT_SHADOW_ERASE");
 		ss->set("NEW_VALUE", val);
 		ss->set("OLD_VALUE", m_softShadowErasedByObject);
@@ -4437,7 +4437,7 @@
 
 	if (UndoManager::undoEnabled())
 	{
-		SimpleState *ss = new SimpleState(Um::SoftShadowObjectTrans, 0, Um::IGroup);
+		SimpleState *ss = new SimpleState(Um::SoftShadowObjectTrans, nullptr, Um::IGroup);
 		ss->set("SOFT_SHADOW_OBJTRANS");
 		ss->set("NEW_VALUE", val);
 		ss->set("OLD_VALUE", m_softShadowHasObjectTransparency);
@@ -4452,9 +4452,9 @@
 	{
 		SimpleState *ss;
 		if (m_Locked)
-			ss = new SimpleState(Um::UnLock, 0, Um::IUnLock);
+			ss = new SimpleState(Um::UnLock, nullptr, Um::IUnLock);
 		else
-			ss = new SimpleState(Um::Lock, 0, Um::ILock);
+			ss = new SimpleState(Um::Lock, nullptr, Um::ILock);
 		ss->set("LOCK");
 		undoManager->action(this, ss);
 	}
@@ -4486,9 +4486,9 @@
 	{
 		SimpleState *ss;
 		if (m_SizeLocked)
-			ss = new SimpleState(Um::SizeUnLock, 0, Um::IUnLock);
+			ss = new SimpleState(Um::SizeUnLock, nullptr, Um::IUnLock);
 		else
-			ss = new SimpleState(Um::SizeLock, 0, Um::ILock);
+			ss = new SimpleState(Um::SizeLock, nullptr, Um::ILock);
 		ss->set("SIZE_LOCK");
 		undoManager->action(this, ss);
 	}
@@ -4515,9 +4515,9 @@
 	{
 		SimpleState *ss;
 		if (m_PrintEnabled)
-			ss = new SimpleState(Um::DisablePrint, 0, Um::IDisablePrint);
+			ss = new SimpleState(Um::DisablePrint, nullptr, Um::IDisablePrint);
 		else
-			ss = new SimpleState(Um::EnablePrint, 0, Um::IEnablePrint);
+			ss = new SimpleState(Um::EnablePrint, nullptr, Um::IEnablePrint);
 		ss->set("PRINT_ENABLED");
 		undoManager->action(this, ss);
 	}
@@ -6698,9 +6698,9 @@
 	int length = is->getInt("LENGTH");
 	int start = is->getInt("START");
 	if (isUndo)
-		itemText.setCharStyle(start,length, is->getItem().second);
-	else
-		itemText.setCharStyle(start,length, is->getItem().first);
+		itemText.setCharStyle(start, length, is->getItem().second);
+	else
+		itemText.setCharStyle(start, length, is->getItem().first);
 }
 
 void PageItem::restoreSetParagraphStyle(SimpleState *ss, bool isUndo)
@@ -7246,11 +7246,11 @@
 		}
 
 		// update auto pointers
-		if (isAutoText && NextBox == 0)
+		if (isAutoText && NextBox == nullptr)
 		{
 			m_Doc->LastAuto = this;
 		}
-		if (isAutoText && BackBox == 0)
+		if (isAutoText && BackBox == nullptr)
 		{
 			m_Doc->FirstAuto = this;
 		}
@@ -7625,7 +7625,7 @@
 	return &pageItemAttributes;
 }
 
-QList<ObjectAttribute> PageItem::getObjectAttributes(QString attributeName) const
+QList<ObjectAttribute> PageItem::getObjectAttributes(const QString& attributeName) const
 {
 	QList<ObjectAttribute> attributes;
 	for(ObjAttrVector::const_iterator objAttrIt = pageItemAttributes.begin() ; objAttrIt != pageItemAttributes.end(); ++objAttrIt )
@@ -7638,7 +7638,7 @@
 	return attributes;
 }
 
-ObjectAttribute PageItem::getObjectAttribute(QString attributeName) const
+ObjectAttribute PageItem::getObjectAttribute(const QString& attributeName) const
 {
 	int countFound=0;
 	ObjAttrVector::const_iterator foundIt = pageItemAttributes.begin();
@@ -7665,7 +7665,7 @@
 }
 
 //if not `prependCopy` then string "Copy of" wil not be prepended
-QString PageItem::generateUniqueCopyName(const QString originalName, bool prependCopy) const
+QString PageItem::generateUniqueCopyName(const QString& originalName, bool prependCopy) const
 {
 	if (!m_Doc->itemNameExists(originalName))
 		return originalName;
@@ -7745,7 +7745,7 @@
 		GrColorP4 = *it;
 
 	QList<VColorStop*> cstops = fill_gradient.colorStops();
-	for (uint cst = 0; cst < fill_gradient.Stops(); ++cst)
+	for (int cst = 0; cst < fill_gradient.Stops(); ++cst)
 	{
 		it = newNames.colors().find(cstops.at(cst)->name);
 		if (it != newNames.colors().end())
@@ -7780,7 +7780,7 @@
 			meshGradientPatches[col].BR.colorName = *it;
 	}
 	cstops = stroke_gradient.colorStops();
-	for (uint cst = 0; cst < stroke_gradient.Stops(); ++cst)
+	for (int cst = 0; cst < stroke_gradient.Stops(); ++cst)
 	{
 		it = newNames.colors().find(cstops.at(cst)->name);
 		if (it != newNames.colors().end())
@@ -7790,7 +7790,7 @@
 		}
 	}
 	cstops = mask_gradient.colorStops();
-	for (uint cst = 0; cst < mask_gradient.Stops(); ++cst)
+	for (int cst = 0; cst < mask_gradient.Stops(); ++cst)
 	{
 		it = newNames.colors().find(cstops.at(cst)->name);
 		if (it != newNames.colors().end())
@@ -8272,7 +8272,8 @@
 	snapToPatchGrid = val;
 }
 
-void PageItem::setGradientStartX(double val){
+void PageItem::setGradientStartX(double val)
+{
 	if (GrStartX==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8286,7 +8287,8 @@
 	GrStartX = val;
 }
 
-void PageItem::setGradientStartY(double val){
+void PageItem::setGradientStartY(double val)
+{
 	if (GrStartY==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8300,7 +8302,8 @@
 	GrStartY = val;
 }
 
-void PageItem::setGradientEndX(double val){
+void PageItem::setGradientEndX(double val)
+{
 	if (GrEndX==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8314,7 +8317,8 @@
 	GrEndX = val;
 }
 
-void PageItem::setGradientEndY(double val){
+void PageItem::setGradientEndY(double val)
+{
 	if (GrEndY==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8328,7 +8332,8 @@
 	GrEndY = val;
 }
 
-void PageItem::setGradientFocalX(double val){
+void PageItem::setGradientFocalX(double val)
+{
 	if (GrFocalX==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8342,7 +8347,8 @@
 	GrFocalX = val;
 }
 
-void PageItem::setGradientFocalY(double val){
+void PageItem::setGradientFocalY(double val)
+{
 	if (GrFocalY==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8356,7 +8362,8 @@
 	GrFocalY = val;
 }
 
-void PageItem::setGradientScale(double val){
+void PageItem::setGradientScale(double val)
+{
 	if (GrScale==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8370,7 +8377,8 @@
 	GrScale = val;
 }
 
-void PageItem::setGradientSkew(double val){
+void PageItem::setGradientSkew(double val)
+{
 	if (GrSkew==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8384,7 +8392,8 @@
 	GrSkew = val;
 }
 
-void PageItem::setGradientMaskStartX(double val){
+void PageItem::setGradientMaskStartX(double val)
+{
 	if (GrMaskStartX==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8398,7 +8407,8 @@
 	GrMaskStartX = val;
 }
 
-void PageItem::setGradientMaskStartY(double val){
+void PageItem::setGradientMaskStartY(double val)
+{
 	if (GrMaskStartY==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8412,7 +8422,8 @@
 	GrMaskStartY = val;
 }
 
-void PageItem::setGradientMaskEndX(double val){
+void PageItem::setGradientMaskEndX(double val)
+{
 	if (GrMaskEndX==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8426,7 +8437,8 @@
 	GrMaskEndX = val;
 }
 
-void PageItem::setGradientMaskEndY(double val){
+void PageItem::setGradientMaskEndY(double val)
+{
 	if (GrMaskEndY==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8440,7 +8452,8 @@
 	GrMaskEndY = val;
 }
 
-void PageItem::setGradientMaskFocalX(double val){
+void PageItem::setGradientMaskFocalX(double val)
+{
 	if (GrMaskFocalX==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8454,7 +8467,8 @@
 	GrMaskFocalX = val;
 }
 
-void PageItem::setGradientMaskFocalY(double val){
+void PageItem::setGradientMaskFocalY(double val)
+{
 	if (GrMaskFocalY==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8468,7 +8482,8 @@
 	GrMaskFocalY = val;
 }
 
-void PageItem::setGradientMaskScale(double val){
+void PageItem::setGradientMaskScale(double val)
+{
 	if (GrMaskScale==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8482,7 +8497,8 @@
 	GrMaskScale = val;
 }
 
-void PageItem::setGradientMaskSkew(double val){
+void PageItem::setGradientMaskSkew(double val)
+{
 	if (GrMaskSkew==val)
 		return;
 	if (UndoManager::undoEnabled())
@@ -8698,7 +8714,7 @@
 		if ((!gradientVal.isEmpty()) && (m_Doc->docGradients.contains(gradientVal)))
 			lists.collectGradient(gradientVal);
 		QList<VColorStop*> cstops = fill_gradient.colorStops();
-		for (uint cst = 0; cst < fill_gradient.Stops(); ++cst)
+		for (int cst = 0; cst < fill_gradient.Stops(); ++cst)
 		{
 			lists.collectColor(cstops.at(cst)->name);
 		}
@@ -8738,7 +8754,7 @@
 		if ((!gradientStrokeVal.isEmpty()) && (m_Doc->docGradients.contains(gradientStrokeVal)))
 			lists.collectGradient(gradientStrokeVal);
 		QList<VColorStop*> cstops = stroke_gradient.colorStops();
-		for (uint cst = 0; cst < stroke_gradient.Stops(); ++cst)
+		for (int cst = 0; cst < stroke_gradient.Stops(); ++cst)
 		{
 			lists.collectColor(cstops.at(cst)->name);
 		}
@@ -8746,7 +8762,7 @@
 	if ((GrMask == 1) || (GrMask == 2) || (GrMask == 4) || (GrMask == 5))
 	{
 		QList<VColorStop*> cstops = mask_gradient.colorStops();
-		for (uint cst = 0; cst < mask_gradient.Stops(); ++cst)
+		for (int cst = 0; cst < mask_gradient.Stops(); ++cst)
 		{
 			lists.collectColor(cstops.at(cst)->name);
 		}
@@ -9049,7 +9065,7 @@
 		pb.addPoint(FPoint(visualWidth()-extraSpace,	-extraSpace,				xPos(), yPos(), m_rotation, 1.0, 1.0));
 		pb.addPoint(FPoint(visualWidth()-extraSpace,	visualHeight()-extraSpace,	xPos(), yPos(), m_rotation, 1.0, 1.0));
 		pb.addPoint(FPoint(-extraSpace, 				visualHeight()-extraSpace,	xPos(), yPos(), m_rotation, 1.0, 1.0));
-		for (uint pc = 0; pc < 4; ++pc)
+		for (int pc = 0; pc < 4; ++pc)
 		{
 			minx = qMin(minx, pb.point(pc).x());
 			miny = qMin(miny, pb.point(pc).y());
@@ -9464,7 +9480,7 @@
 				efVal += " "+tmp;
 				for (int p = 0; p < Vals.size(); p++)
 				{
-					FPoint pv = Vals.point(p);
+					const FPoint& pv = Vals.point(p);
 					efVal += QString(" %1 %2").arg(pv.x()).arg(pv.y());
 				}
 				efVal += " 0";
@@ -9473,7 +9489,7 @@
 				efVal += " "+tmp;
 				for (int p = 0; p < Vals.size(); p++)
 				{
-					FPoint pv = Vals.point(p);
+					const FPoint& pv = Vals.point(p);
 					efVal += QString(" %1 %2").arg(pv.x()).arg(pv.y());
 				}
 				efVal += " 0";
@@ -9489,7 +9505,7 @@
 				efVal += " "+tmp;
 				for (int p = 0; p < Vals.size(); p++)
 				{
-					FPoint pv = Vals.point(p);
+					const FPoint& pv = Vals.point(p);
 					efVal += QString(" %1 %2").arg(pv.x()).arg(pv.y());
 				}
 				efVal += " 0";
@@ -9498,7 +9514,7 @@
 				efVal += " "+tmp;
 				for (int p = 0; p < Vals.size(); p++)
 				{
-					FPoint pv = Vals.point(p);
+					const FPoint& pv = Vals.point(p);
 					efVal += QString(" %1 %2").arg(pv.x()).arg(pv.y());
 				}
 				efVal += " 0";
@@ -9507,7 +9523,7 @@
 				efVal += " "+tmp;
 				for (int p = 0; p < Vals.size(); p++)
 				{
-					FPoint pv = Vals.point(p);
+					const FPoint& pv = Vals.point(p);
 					efVal += QString(" %1 %2").arg(pv.x()).arg(pv.y());
 				}
 				efVal += " 0";
@@ -9523,7 +9539,7 @@
 				efVal += " "+tmp;
 				for (int p = 0; p < Vals.size(); p++)
 				{
-					FPoint pv = Vals.point(p);
+					const FPoint& pv = Vals.point(p);
 					efVal += QString(" %1 %2").arg(pv.x()).arg(pv.y());
 				}
 				efVal += " 0";
@@ -9532,7 +9548,7 @@
 				efVal += " "+tmp;
 				for (int p = 0; p < Vals.size(); p++)
 				{
-					FPoint pv = Vals.point(p);
+					const FPoint& pv = Vals.point(p);
 					efVal += QString(" %1 %2").arg(pv.x()).arg(pv.y());
 				}
 				efVal += " 0";
@@ -9541,7 +9557,7 @@
 				efVal += " "+tmp;
 				for (int p = 0; p < Vals.size(); p++)
 				{
-					FPoint pv = Vals.point(p);
+					const FPoint& pv = Vals.point(p);
 					efVal += QString(" %1 %2").arg(pv.x()).arg(pv.y());
 				}
 				efVal += " 0";
@@ -9550,7 +9566,7 @@
 				efVal += " "+tmp;
 				for (int p = 0; p < Vals.size(); p++)
 				{
-					FPoint pv = Vals.point(p);
+					const FPoint& pv = Vals.point(p);
 					efVal += QString(" %1 %2").arg(pv.x()).arg(pv.y());
 				}
 				efVal += " 0";
@@ -9813,9 +9829,9 @@
 	}
 }
 
-void PageItem::setExternalFile(QString val)
-{
-	Pfile = val;
+void PageItem::setExternalFile(const QString& filename)
+{
+	Pfile = filename;
 	if (!Pfile.isEmpty())
 	{
 		QString test = Pfile;
@@ -9827,9 +9843,9 @@
 	}
 }
 
-void PageItem::setFileIconPressed(const QString& val)
-{
-	Pfile2 = val;
+void PageItem::setFileIconPressed(const QString& filename)
+{
+	Pfile2 = filename;
 	if (!Pfile2.isEmpty())
 	{
 		QString test = QDir::cleanPath(QDir::toNativeSeparators(QDir::homePath()+"/"+Pfile2));
@@ -9838,9 +9854,9 @@
 	}
 }
 
-void PageItem::setFileIconRollover(const QString& val)
-{
-	Pfile3 = val;
+void PageItem::setFileIconRollover(const QString& filename)
+{
+	Pfile3 = filename;
 	if (!Pfile3.isEmpty())
 	{
 		QString test = QDir::cleanPath(QDir::toNativeSeparators(QDir::homePath()+"/"+Pfile3));
@@ -10005,10 +10021,10 @@
 {
 	int asce = 1;
 	int desc = 1;
-	uint itemTextCount=itemText.length();
-	for (uint a = 0; a < itemTextCount; ++a)
-	{
-		const CharStyle& hl (itemText.charStyle(a));
+	int itemTextCount=itemText.length();
+	for (int i = 0; i < itemTextCount; ++i)
+	{
+		const CharStyle& hl (itemText.charStyle(i));
 		int des = static_cast<int>(hl.font().descent(hl.fontSize() / 10.0));
 		int asc = static_cast<int>(hl.font().ascent(hl.fontSize() / 10.0));
 		asce = qMax(asce, asc);
@@ -10078,7 +10094,7 @@
 		return; // nothing to do -> return
 	if (UndoManager::undoEnabled())
 	{
-		SimpleState *ss = new SimpleState(Um::ActionPDF, 0, Um::IGroup);
+		SimpleState *ss = new SimpleState(Um::ActionPDF, nullptr, Um::IGroup);
 		ss->set("ACTIONPDFANNOTATION", isAnnot);
 		undoManager->action(this, ss);
 	}
@@ -10091,7 +10107,7 @@
 		return; // nothing to do -> return
 	if (UndoManager::undoEnabled())
 	{
-		SimpleState *ss = new SimpleState(Um::ActionPDF, 0, Um::IGroup);
+		SimpleState *ss = new SimpleState(Um::ActionPDF, nullptr, Um::IGroup);
 		ss->set("ACTIONPDFBOOKMARK", isBM);
 		undoManager->action(this, ss);
 	}

Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22586&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h	(original)
+++ trunk/Scribus/scribus/pageitem.h	Tue Jun 26 20:40:32 2018
@@ -373,11 +373,11 @@
 	/*!
 	 * brief Returns a list of attributes with specified name
 	 */
-	QList<ObjectAttribute> getObjectAttributes(QString attributeName) const;
+	QList<ObjectAttribute> getObjectAttributes(const QString& attributeName) const;
 	/*!
 	 * brief Returns a complete ObjectAttribute struct if 1 is found, or ObjectAttribute.name will be QString::null if 0 or >1 are found
 	 */
-	ObjectAttribute getObjectAttribute(QString) const;
+	ObjectAttribute getObjectAttribute(const QString&) const;
 	void setObjectAttributes(ObjAttrVector*);
 
 
@@ -437,15 +437,15 @@
 	void setEmbeddedImageProfile(const QString& val) { EmProfile = val; }
 	bool drawFrame() { return ((m_ItemType == TextFrame && !m_sampleItem) || (m_ItemType == ImageFrame) || (m_ItemType == PathText)); }
 	QString externalFile() const { return Pfile; }
-	void setExternalFile(QString val);
+	void setExternalFile(const QString& filename);
 	void setImagePagenumber(int num) { pixm.imgInfo.actualPageNumber = num; }
 	void setResolution(int);
 
 	//FIXME: maybe these should go into annotation?
 	QString fileIconPressed() const { return Pfile2; }
-	void setFileIconPressed(const QString& val);
+	void setFileIconPressed(const QString& filename);
 	QString fileIconRollover() const { return Pfile3; }
-	void setFileIconRollover(const QString& val);
+	void setFileIconRollover(const QString& filename);
 	int  cmsRenderingIntent() const { return IRender; }
 	void setCmsRenderingIntent(eRenderIntent val) { IRender = val; }
 	QString cmsProfile() const { return IProfile; }
@@ -901,7 +901,7 @@
 	 */
 	void setLineTransparency(double newTransparency);
 
-	void setHatchParameters(int mode, double distance, double angle, bool useBackground, QString background, QString foreground);
+	void setHatchParameters(int mode, double distance, double angle, bool useBackground, const QString& background, const QString& foreground);
 
 	/** @brief Get the name of the stroke pattern of the object */
 	QString strokePattern() const { return patternStrokeVal; }
@@ -1162,7 +1162,7 @@
 	 * Usually of the form 'Copy of [name]' or 'Copy of [name] (n)'
 	 * cezaryece: if prependCopy is false then form '[name] (n)' is generated
 	 */
-	QString generateUniqueCopyName(const QString originalName, bool prependCopy = true) const;
+	QString generateUniqueCopyName(const QString& originalName, bool prependCopy = true) const;
 	/**
 	 * @brief Is this item printed?
 	 * @sa setPrintEnabled()




More information about the scribus-commit mailing list