Kaydet (Commit) c6bc9b33 authored tarafından Mike Kaganski's avatar Mike Kaganski Kaydeden (comit) Caolán McNamara

tdf#74301: WMF: use LibreOffice locale on OEM_CHARSET/DEFAULT_CHARSET

[MS-WMF] 2.1.1.5 CharacterSet Enumeration defines DEFAULT_CHARSET
"Specifies a character set based on the current system locale;
for example, when the system locale is United States English,
the default character set is ANSI_CHARSET"

OEM_CHARSET is defined as follows: "Specifies a mapping to one of
the OEM code pages, according to the current system locale setting"

Currently, LO WMF import treats these values as synonim for
RTL_TEXTENCODING_MS_1252. This patch fixes this to use LibreOffice
locale setting instead.

Strictly speaking, this is not quite correct for OEM. E.g., for
Russian, DEFAULT_CHARSET is equal to codepage 1251, while OEM_CHARSET
is codepage 866. But I don't know how to distinguish these two.

Change-Id: Id5eaf070cde040bd6eb1db28f1a498d647ba227e
Reviewed-on: https://gerrit.libreoffice.org/15641Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 4f864949
...@@ -145,7 +145,7 @@ WinMtfFontStyle::WinMtfFontStyle( LOGFONTW& rFont ) ...@@ -145,7 +145,7 @@ WinMtfFontStyle::WinMtfFontStyle( LOGFONTW& rFont )
{ {
rtl_TextEncoding eCharSet; rtl_TextEncoding eCharSet;
if ( ( rFont.lfCharSet == OEM_CHARSET ) || ( rFont.lfCharSet == DEFAULT_CHARSET ) ) if ( ( rFont.lfCharSet == OEM_CHARSET ) || ( rFont.lfCharSet == DEFAULT_CHARSET ) )
eCharSet = RTL_TEXTENCODING_MS_1252; eCharSet = osl_getThreadTextEncoding();
else else
eCharSet = rtl_getTextEncodingFromWindowsCharset( rFont.lfCharSet ); eCharSet = rtl_getTextEncodingFromWindowsCharset( rFont.lfCharSet );
if ( eCharSet == RTL_TEXTENCODING_DONTKNOW ) if ( eCharSet == RTL_TEXTENCODING_DONTKNOW )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment