r17435 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:31:47 UTC 2012


Author: jghali
Date: Thu Apr 12 19:31:47 2012
New Revision: 17435

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

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

Modified: branches/Version14x/Scribus/scribus/plugins/import/svg/svgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17435&path=/branches/Version14x/Scribus/scribus/plugins/import/svg/svgplugin.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/import/svg/svgplugin.cpp (original)
+++ branches/Version14x/Scribus/scribus/plugins/import/svg/svgplugin.cpp Thu Apr 12 19:31:47 2012
@@ -1677,7 +1677,7 @@
 		font.setOverline(overline);
 		font.setStrikeOut(strikeOut);
 	}
-	font.setPointSizeF(style.FontSize / 10.0);
+	font.setPointSizeF(style.FontSize);
 	return font;
 }
 
@@ -1760,30 +1760,30 @@
 {
 	bool noUnit = false;
 	QString unitval=unit;
-	if( unit.right( 2 ) == "pt" )
+	if (unit.right( 2 ) == "pt")
 		unitval.replace( "pt", "" );
-	else if( unit.right( 2 ) == "cm" )
+	else if (unit.right( 2 ) == "cm")
 		unitval.replace( "cm", "" );
-	else if( unit.right( 2 ) == "mm" )
+	else if (unit.right( 2 ) == "mm")
 		unitval.replace( "mm" , "" );
-	else if( unit.right( 2 ) == "in" )
+	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;
 }
@@ -2281,7 +2281,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: branches/Version14x/Scribus/scribus/plugins/import/svg/svgplugin.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17435&path=/branches/Version14x/Scribus/scribus/plugins/import/svg/svgplugin.h
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/import/svg/svgplugin.h (original)
+++ branches/Version14x/Scribus/scribus/plugins/import/svg/svgplugin.h Thu Apr 12 19:31:47 2012
@@ -153,7 +153,7 @@
 	QString FontStyle;
 	QString FontWeight;
 	QString FontStretch;
-	int FontSize;
+	double  FontSize;
 	QString FillCol;
 	QString fillRule;
 	QString GCol1;




More information about the scribus-commit mailing list