r19647 by jghali - #12832: Setting Fill Shade of Cell/Char to "Parent Value" crashes Scribus

scribus-commit scribus-commit at lists.scribus.net
Wed Nov 26 23:05:23 UTC 2014


Author: jghali
Date: Wed Nov 26 23:05:23 2014
New Revision: 19647

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19647
Log:
#12832: Setting Fill Shade of Cell/Char to "Parent Value" crashes Scribus

Modified:
    branches/Version14x/Scribus/scribus/smshadebutton.cpp
    branches/Version14x/Scribus/scribus/smshadebutton.h

Modified: branches/Version14x/Scribus/scribus/smshadebutton.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19647&path=/branches/Version14x/Scribus/scribus/smshadebutton.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/smshadebutton.cpp (original)
+++ branches/Version14x/Scribus/scribus/smshadebutton.cpp Wed Nov 26 23:05:23 2014
@@ -51,11 +51,18 @@
 	{
 		setValue(pValue_, true);
 		QList<QAction*> actList = FillSh->actions();
-		FillSh->removeAction(actList.last());
+		if (actList.last()->text() == useParentValueText())
+			FillSh->removeAction(actList.last());
 	}
 	
 
 	return ret;
+}
+
+QString SMShadeButton::useParentValueText()
+{
+	QString trText = tr("Use Parent Value");
+	return trText;
 }
 
 void SMShadeButton::setFont(bool wantBold)
@@ -71,7 +78,7 @@
 	if (hasParent_)
 	{
 		setFont(true);
-		QString upv = tr("Use Parent Value");
+		QString upv = useParentValueText();
 		QList<QAction*> actList = FillSh->actions();
 		if (actList.last()->text() != upv)
 			FillSh->addAction(upv, this, SLOT(slotUseParent()));
@@ -82,6 +89,7 @@
 {
 	useParentValue_ = true;
 	QList<QAction*> actList = FillSh->actions();
-	FillSh->removeAction(actList.last());
+	if (actList.last()->text() == useParentValueText())
+		FillSh->removeAction(actList.last());
 	emit clicked();
 }

Modified: branches/Version14x/Scribus/scribus/smshadebutton.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19647&path=/branches/Version14x/Scribus/scribus/smshadebutton.h
==============================================================================
--- branches/Version14x/Scribus/scribus/smshadebutton.h (original)
+++ branches/Version14x/Scribus/scribus/smshadebutton.h Wed Nov 26 23:05:23 2014
@@ -28,6 +28,8 @@
 	bool   hasParent_;
 	bool   useParentValue_;
 	int    pValue_;
+
+	QString useParentValueText();
 	void setFont(bool wantBold);
 
 private slots:




More information about the scribus-commit mailing list