[Libreoffice-commits] .: svtools/source
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Dec 22 02:47:38 PST 2010
svtools/source/filter.vcl/wmf/winmtf.cxx | 6 +++---
svtools/source/filter.vcl/wmf/wmfwr.cxx | 9 +++++----
2 files changed, 8 insertions(+), 7 deletions(-)
New commits:
commit 8e1934afe18a270b0042afc5fdb9cb19e83a28c3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Dec 22 10:38:04 2010 +0000
Resolves: #i76587# DEFAULT encodings can't be assumed to be system encoding
See:
http://qa.openoffice.org/issues/show_bug.cgi?id=76587
and a practical example of
http://www.openoffice.org/nonav/issues/showattachment.cgi/44588/MSformula.doc
which must remain working if this is found to not be sufficient
diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx
index 007a56e..b17c7c1 100644
--- a/svtools/source/filter.vcl/wmf/winmtf.cxx
+++ b/svtools/source/filter.vcl/wmf/winmtf.cxx
@@ -153,11 +153,11 @@ WinMtfFontStyle::WinMtfFontStyle( LOGFONTW& rFont )
{
CharSet eCharSet;
if ( ( rFont.lfCharSet == OEM_CHARSET ) || ( rFont.lfCharSet == DEFAULT_CHARSET ) )
- eCharSet = gsl_getSystemTextEncoding();
+ eCharSet = RTL_TEXTENCODING_MS_1252;
else
eCharSet = rtl_getTextEncodingFromWindowsCharset( rFont.lfCharSet );
if ( eCharSet == RTL_TEXTENCODING_DONTKNOW )
- eCharSet = gsl_getSystemTextEncoding();
+ eCharSet = RTL_TEXTENCODING_MS_1252;
aFont.SetCharSet( eCharSet );
aFont.SetName( rFont.alfFaceName );
FontFamily eFamily;
@@ -914,7 +914,7 @@ WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) :
// SetClipRgn( NULL ) and similar ClipRgn actions (SJ)
maFont.SetName( String( RTL_CONSTASCII_USTRINGPARAM( "Arial" )) ); // sj: #i57205#, we do have some scaling problems if using
- maFont.SetCharSet( gsl_getSystemTextEncoding() ); // the default font then most times a x11 font is used, we
+ maFont.SetCharSet( RTL_TEXTENCODING_MS_1252 ); // the default font then most times a x11 font is used, we
maFont.SetHeight( 423 ); // will prevent this defining a font
maLatestLineStyle.aLineColor = Color( 0x12, 0x34, 0x56 );
diff --git a/svtools/source/filter.vcl/wmf/wmfwr.cxx b/svtools/source/filter.vcl/wmf/wmfwr.cxx
index 6ea6743..abf8b8c 100644
--- a/svtools/source/filter.vcl/wmf/wmfwr.cxx
+++ b/svtools/source/filter.vcl/wmf/wmfwr.cxx
@@ -1584,10 +1584,11 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
const MetaFontAction* pA = (const MetaFontAction*) pMA;
aSrcFont = pA->GetFont();
- if ( aSrcFont.GetCharSet() == RTL_TEXTENCODING_DONTKNOW )
- aSrcFont.SetCharSet( GetExtendedTextEncoding( gsl_getSystemTextEncoding() ) );
- if ( aSrcFont.GetCharSet() == RTL_TEXTENCODING_UNICODE )
+ if ( (aSrcFont.GetCharSet() == RTL_TEXTENCODING_DONTKNOW)
+ || (aSrcFont.GetCharSet() == RTL_TEXTENCODING_UNICODE) )
+ {
aSrcFont.SetCharSet( RTL_TEXTENCODING_MS_1252 );
+ }
eSrcTextAlign = aSrcFont.GetAlign();
aSrcTextColor = aSrcFont.GetColor();
aSrcFont.SetAlign( ALIGN_BASELINE );
@@ -1921,7 +1922,7 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
bDstIsClipping = bSrcIsClipping = FALSE;
Font aFont;
- aFont.SetCharSet( GetExtendedTextEncoding( gsl_getSystemTextEncoding() ) );
+ aFont.SetCharSet( GetExtendedTextEncoding( RTL_TEXTENCODING_MS_1252 ) );
aFont.SetColor( Color( COL_WHITE ) );
aFont.SetAlign( ALIGN_BASELINE );
aDstFont = aSrcFont = aFont;
More information about the Libreoffice-commits
mailing list