r20666 by fschmid -

scribus-commit scribus-commit at lists.scribus.net
Wed Jan 6 12:30:22 UTC 2016


Author: fschmid
Date: Wed Jan  6 12:30:22 2016
New Revision: 20666

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20666
Log:
ODT Importer: parse fontsize in percentage correctly.

Modified:
    trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp

Modified: trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20666&path=/trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp	(original)
+++ trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp	Wed Jan  6 12:30:22 2016
@@ -927,7 +927,19 @@
 				if (currStyle.fontName.valid)
 					actStyle.fontName = AttributeValue(currStyle.fontName.value);
 				if (currStyle.fontSize.valid)
-					actStyle.fontSize = AttributeValue(currStyle.fontSize.value);
+				{
+					if (currStyle.fontSize.value.right(1) == "%")
+					{
+						double perc = parseUnit(currStyle.fontSize.value);
+						if (actStyle.fontSize.valid)
+						{
+							double value = parseUnit(actStyle.fontSize.value) * perc;
+							actStyle.fontSize = AttributeValue(QString("%1pt").arg(value));
+						}
+					}
+					else
+						actStyle.fontSize = AttributeValue(currStyle.fontSize.value);
+				}
 				if (currStyle.fontStyle.valid)
 					actStyle.fontStyle = AttributeValue(currStyle.fontStyle.value);
 				if (currStyle.fontWeight.valid)
@@ -1079,7 +1091,7 @@
 			}
 			else
 			{
-				tmpOStyle.lineHeight = parseUnit(actStyle.lineHeight.value);
+				tmpOStyle.lineHeight = parseUnit(actStyle.lineHeight.value) * tmpOStyle.fontSize;
 				tmpOStyle.absLineHeight = false;
 			}
 		}




More information about the scribus-commit mailing list