incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject svn commit: r1399203 - /incubator/ooo/trunk/main/sc/source/filter/excel/xistyle.cxx
Date Wed, 17 Oct 2012 12:39:14 GMT
Author: hdu
Date: Wed Oct 17 12:39:14 2012
New Revision: 1399203

URL: http://svn.apache.org/viewvc?rev=1399203&view=rev
Log:
#i121215# fix the spreadsheet font family

Patch-by: Tan Li <litan.test@gmail.com>
Review-by: hdu@apache.org

Modified:
    incubator/ooo/trunk/main/sc/source/filter/excel/xistyle.cxx

Modified: incubator/ooo/trunk/main/sc/source/filter/excel/xistyle.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/excel/xistyle.cxx?rev=1399203&r1=1399202&r2=1399203&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/filter/excel/xistyle.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/filter/excel/xistyle.cxx Wed Oct 17 12:39:14 2012
@@ -256,9 +256,19 @@ void XclImpFont::FillToItemSet( SfxItemS
         rtl_TextEncoding eFontEnc = maData.GetFontEncoding();
         rtl_TextEncoding eTempTextEnc = (bEE && (eFontEnc == GetTextEncoding()))
?
             ScfTools::GetSystemTextEncoding() : eFontEnc;
+		
+		//add corresponding pitch for FontFamily
+		FontPitch ePitch = PITCH_DONTKNOW;
+		FontFamily eFtFamily = maData.GetScFamily( GetTextEncoding() ); 
+		switch( eFtFamily ) //refer http://msdn.microsoft.com/en-us/library/aa246306(v=VS.60).aspx
+		{
+			case FAMILY_ROMAN:				ePitch = PITCH_VARIABLE;		break;
+			case FAMILY_SWISS:				ePitch = PITCH_VARIABLE;		break;
+			case FAMILY_MODERN:				ePitch = PITCH_FIXED;			break;
+			default:						break;
+		 } 
+        SvxFontItem aFontItem( eFtFamily , maData.maName, EMPTY_STRING, ePitch, eTempTextEnc,
ATTR_FONT );
 
-        SvxFontItem aFontItem( maData.GetScFamily( GetTextEncoding() ), maData.maName, EMPTY_STRING,
-                PITCH_DONTKNOW, eTempTextEnc, ATTR_FONT );
         // #91658# set only for valid script types
         if( mbHasWstrn )
             PUTITEM( aFontItem, ATTR_FONT,      EE_CHAR_FONTINFO );



Mime
View raw message