r17436 by jghali - svg import : store font size as a double + some minor refactoring

scribus-commit scribus-commit at lists.scribus.net
Thu Apr 12 19:33:24 UTC 2012


Author: jghali
Date: Thu Apr 12 19:33:23 2012
New Revision: 17436

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17436
Log:
svg import : store font size as a double + some minor refactoring

Modified:
    trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
    trunk/Scribus/scribus/plugins/import/svg/svgplugin.h

Modified: trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17436&path=/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp Thu Apr 12 19:33:23 2012
@@ -1898,7 +1898,7 @@
 		font.setOverline(overline);
 		font.setStrikeOut(strikeOut);
 	}
-	font.setPointSizeF(style.FontSize / 10.0);
+	font.setPointSizeF(style.FontSize);
 	return font;
 }
 
@@ -1981,30 +1981,30 @@
 {
 	bool noUnit = false;
 	QString unitval=unit;
-	if( unit.right( 2 ) == "pt" )
-		unitval.replace( "pt", "" );
-	else if( unit.right( 2 ) == "cm" )
+	if (unit.right( 2 ) == "pt")
+		unitval.replace( "pt", "");
+	else if (unit.right( 2 ) == "cm")
 		unitval.replace( "cm", "" );
-	else if( unit.right( 2 ) == "mm" )
-		unitval.replace( "mm" , "" );
-	else if( unit.right( 2 ) == "in" )
+	else if (unit.right( 2 ) == "mm")
+		unitval.replace( "mm" , "");
+	else if (unit.right( 2 ) == "in")
 		unitval.replace( "in", "" );
-	else if( unit.right( 2 ) == "px" )
+	else if (unit.right( 2 ) == "px")
 		unitval.replace( "px", "" );
 	if (unitval == unit)
 		noUnit = true;
 	double value = ScCLocale::toDoubleC(unitval);
-	if( unit.right( 2 ) == "pt" )
+	if (unit.right( 2 ) == "pt")
 		value = value;
-	else if( unit.right( 2 ) == "cm" )
+	else if (unit.right( 2 ) == "cm")
 		value = ( value / 2.54 ) * 72;
-	else if( unit.right( 2 ) == "mm" )
+	else if (unit.right( 2 ) == "mm")
 		value = ( value / 25.4 ) * 72;
-	else if( unit.right( 2 ) == "in" )
+	else if (unit.right( 2 ) == "in")
 		value = value * 72;
-	else if( unit.right( 2 ) == "px" )
+	else if (unit.right( 2 ) == "px")
 		value = value * 0.8;
-	else if(noUnit)
+	else if (noUnit)
 		value = value;
 	return value;
 }
@@ -2557,7 +2557,7 @@
 	else if( command == "font-stretch" )
 		obj->FontStretch = params;
 	else if( command == "font-size" )
-		obj->FontSize = static_cast<int>(parseFontSize(params) * 10.0);
+		obj->FontSize = parseFontSize(params);
 	else if( command == "text-anchor" )
 		obj->textAnchor = params;
 	else if( command == "text-decoration" )

Modified: trunk/Scribus/scribus/plugins/import/svg/svgplugin.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17436&path=/trunk/Scribus/scribus/plugins/import/svg/svgplugin.h
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svg/svgplugin.h (original)
+++ trunk/Scribus/scribus/plugins/import/svg/svgplugin.h Thu Apr 12 19:33:23 2012
@@ -176,7 +176,7 @@
 	QString FontStyle;
 	QString FontWeight;
 	QString FontStretch;
-	int FontSize;
+	double  FontSize;
 	QString FillCol;
 	QString fillRule;
 	QString GFillCol1;




More information about the scribus-commit mailing list