r22009 by jghali - #14783: Cell style colour shade change has no effect after reloading file

scribus-commit scribus-commit at lists.scribus.net
Sat Apr 29 21:53:16 UTC 2017


Author: jghali
Date: Sat Apr 29 21:53:16 2017
New Revision: 22009

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22009
Log:
#14783: Cell style colour shade change has no effect after reloading file

Modified:
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22009&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	Sat Apr 29 21:53:16 2017
@@ -2917,7 +2917,7 @@
 	// The default style attribute must be correctly set before trying to assign a parent
 	if (attrs.hasAttribute("DefaultStyle"))
 		newStyle.setDefaultStyle(attrs.valueAsInt("DefaultStyle"));
-	else if (newStyle.name() == CommonStrings::DefaultTableStyle || newStyle.name() == CommonStrings::trDefaultTableStyle)
+	else if (newStyle.name() == CommonStrings::DefaultCellStyle || newStyle.name() == CommonStrings::trDefaultCellStyle)
 		newStyle.setDefaultStyle(true);
 	else
 		newStyle.setDefaultStyle(false);
@@ -5757,11 +5757,17 @@
 		QString fColor = tAtt.valueAsString("FillColor");
 		if ((fColor != CommonStrings::None) && (!fColor.isEmpty()))
 			item->cellAt(row, col).setFillColor(fColor);
-		item->cellAt(row, col).setFillShade(tAtt.valueAsInt("FillShade", 100));
-		item->cellAt(row, col).setLeftPadding(tAtt.valueAsDouble("LeftPadding", 0.0));
-		item->cellAt(row, col).setRightPadding(tAtt.valueAsDouble("RightPadding", 0.0));
-		item->cellAt(row, col).setTopPadding(tAtt.valueAsDouble("TopPadding", 0.0));
-		item->cellAt(row, col).setBottomPadding(tAtt.valueAsDouble("BottomPadding", 0.0));
+		double fShade = tAtt.valueAsDouble("FillShade", -1.0);
+		if (fShade >= 0 && fShade <= 100)
+			item->cellAt(row, col).setFillShade(tAtt.valueAsDouble("FillShade", 100));
+		if (tAtt.hasAttribute("LeftPadding"))
+			item->cellAt(row, col).setLeftPadding(tAtt.valueAsDouble("LeftPadding", 0.0));
+		if (tAtt.hasAttribute("RightPadding"))
+			item->cellAt(row, col).setRightPadding(tAtt.valueAsDouble("RightPadding", 0.0));
+		if (tAtt.hasAttribute("TopPadding"))
+			item->cellAt(row, col).setTopPadding(tAtt.valueAsDouble("TopPadding", 0.0));
+		if (tAtt.hasAttribute("BottomPadding"))
+			item->cellAt(row, col).setBottomPadding(tAtt.valueAsDouble("BottomPadding", 0.0));
 
 		PageItem* newItem = item->cellAt(row, col).textFrame();
 		newItem->Cols   = tAtt.valueAsInt("TextColumns", 1);




More information about the scribus-commit mailing list