summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-04-25 13:18:02 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-04-25 13:18:33 +0100
commitd88493adfd549ec77f08ee919df609e645011b8b (patch)
treeaea030de82e8e21231fdd5e516468b16bc16b487 /sw
parent3ba9fd39e3aa74aca63dc2ab475d37b6680e12a8 (diff)
rework GetDefaultTextEncoding etc -> getBestTextEncodingFromLocale
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index c4513f18b9dd..e7ae45cc9486 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -31,6 +31,8 @@
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XStorage.hpp>
+#include <i18npool/mslangid.hxx>
+
#include <unotools/ucbstreamhelper.hxx>
#include <tools/solar.h>
#include <rtl/tencinfo.h>
@@ -2365,7 +2367,7 @@ CharSet SwWW8ImplReader::GetCurrentCharSet()
if ((eSrcCharSet == RTL_TEXTENCODING_DONTKNOW) && StyleExists(nAktColl) && nAktColl < vColl.size())
eSrcCharSet = vColl[nAktColl].GetCharSet();
if (eSrcCharSet == RTL_TEXTENCODING_DONTKNOW)
- { // patch from cmc for #i52786#
+ {
/*
#i22206#/#i52786#
The (default) character set used for a run of text is the default
@@ -2376,7 +2378,10 @@ CharSet SwWW8ImplReader::GetCurrentCharSet()
correctly set in the character runs involved, so its hard to reproduce
documents that require this to be sure of the process involved.
*/
- eSrcCharSet = msfilter::util::GetDefaultTextEncoding();
+ const SvxLanguageItem *pLang = (const SvxLanguageItem*)GetFmtAttr(RES_CHRATR_LANGUAGE);
+ LanguageType eLang = pLang ? pLang->GetLanguage() : LANGUAGE_SYSTEM;
+ ::com::sun::star::lang::Locale aLocale(MsLangId::convertLanguageToLocale(eLang));
+ eSrcCharSet = msfilter::util::getBestTextEncodingFromLocale(aLocale);
}
}
return eSrcCharSet;