Index: source/filter/ww8/writerwordglue.cxx =================================================================== --- source/filter/ww8/writerwordglue.cxx (revision 270629) +++ source/filter/ww8/writerwordglue.cxx (working copy) @@ -42,10 +42,8 @@ #include //ubidi_getLogicalRun # include //GetExtendedTextEncoding -# include //unicode::getUnicodeScriptType -#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ +# include //winenchelper::getBestLegacyWindowsTextEncodingByScriptType # include //ScriptType -#endif #ifndef SV_FONTCVT_HXX # include //GetSubsFontName @@ -356,33 +354,6 @@ return sRet; } - /* - Utility to categorize unicode characters into the best fit windows charset - range for exporting to ww6, or as a hint to non \u unicode token aware rtf - readers - */ - rtl_TextEncoding getScriptClass(sal_Unicode cChar) - { - using namespace ::com::sun::star::i18n; - - static ScriptTypeList aScripts[] = - { - { UnicodeScript_kBasicLatin, UnicodeScript_kBasicLatin, RTL_TEXTENCODING_MS_1252}, - { UnicodeScript_kLatin1Supplement, UnicodeScript_kLatin1Supplement, RTL_TEXTENCODING_MS_1252}, - { UnicodeScript_kLatinExtendedA, UnicodeScript_kLatinExtendedA, RTL_TEXTENCODING_MS_1250}, - { UnicodeScript_kLatinExtendedB, UnicodeScript_kLatinExtendedB, RTL_TEXTENCODING_MS_1257}, - { UnicodeScript_kGreek, UnicodeScript_kGreek, RTL_TEXTENCODING_MS_1253}, - { UnicodeScript_kCyrillic, UnicodeScript_kCyrillic, RTL_TEXTENCODING_MS_1251}, - { UnicodeScript_kHebrew, UnicodeScript_kHebrew, RTL_TEXTENCODING_MS_1255}, - { UnicodeScript_kArabic, UnicodeScript_kArabic, RTL_TEXTENCODING_MS_1256}, - { UnicodeScript_kThai, UnicodeScript_kThai, RTL_TEXTENCODING_MS_1258}, - { UnicodeScript_kScriptCount, UnicodeScript_kScriptCount, RTL_TEXTENCODING_MS_1252} - }; - - return unicode::getUnicodeScriptType(cChar, aScripts, - RTL_TEXTENCODING_MS_1252); - } - //Utility to remove entries before a given starting position class IfBeforeStart : public std::unary_function @@ -595,8 +566,9 @@ } using namespace ::com::sun::star::i18n; + using namespace ::winenchelper; - sal_uInt16 nScript = i18n::ScriptType::LATIN; + sal_uInt16 nScript = i18n::ScriptType::LATIN; if (rTxt.Len() && pBreakIt && pBreakIt->xBreak.is()) nScript = pBreakIt->xBreak->getScriptType(rTxt, 0); @@ -669,10 +641,10 @@ while (nPos != nLen) { rtl_TextEncoding ScriptType = - myImplHelpers::getScriptClass(rTxt.GetChar(nPos++)); + getBestLegacyWindowsTextEncodingByScriptType(rTxt.GetChar(nPos++)); while ( (nPos != nLen) && - (ScriptType == myImplHelpers::getScriptClass(rTxt.GetChar(nPos))) + (ScriptType == getBestLegacyWindowsTextEncodingByScriptType(rTxt.GetChar(nPos))) ) { ++nPos;