diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-04-27 08:02:53 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-04-27 09:38:27 +0200 |
commit | e6df5847379a97ad2de95a3c01cb11380c56e0f7 (patch) | |
tree | 6f30900e4890c3408a87761a043cec51acb4eecf /filter | |
parent | Make upcasting css::uno::Reference ctor require complete types (diff) | |
download | core-e6df5847379a97ad2de95a3c01cb11380c56e0f7.tar.gz core-e6df5847379a97ad2de95a3c01cb11380c56e0f7.zip |
Extract getting default locale for filters into separate unotools function
Change-Id: Ic97b1a4507d5629963f360147ecc20eb10f5d391
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92957
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/graphicfilter/idxf/dxfreprd.cxx | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/filter/source/graphicfilter/idxf/dxfreprd.cxx b/filter/source/graphicfilter/idxf/dxfreprd.cxx index 8e4c9bc73560..e20e407cc013 100644 --- a/filter/source/graphicfilter/idxf/dxfreprd.cxx +++ b/filter/source/graphicfilter/idxf/dxfreprd.cxx @@ -20,8 +20,7 @@ #include "dxfreprd.hxx" #include <osl/nlsupport.h> -#include <officecfg/Setup.hxx> -#include <officecfg/Office/Linguistic.hxx> +#include <unotools/defaultencoding.hxx> #include <unotools/wincodepage.hxx> #include <unotools/configmgr.hxx> @@ -134,21 +133,6 @@ DXFRepresentation::~DXFRepresentation() { } -namespace { - -OUString getLODefaultLanguage() -{ - if (utl::ConfigManager::IsFuzzing()) - return "en-US"; - - OUString result(officecfg::Office::Linguistic::General::DefaultLocale::get()); - if (result.isEmpty()) - result = officecfg::Setup::L10N::ooSetupSystemLocale::get(); - return result; -} - -} - rtl_TextEncoding DXFRepresentation::getTextEncoding() const { return (isTextEncodingSet()) ? @@ -229,7 +213,8 @@ void DXFRepresentation::ReadHeader(DXFGroupReader & rDGR) // only if the encoding is not set yet // e.g. by previous $DWGCODEPAGE if (!isTextEncodingSet()) - setTextEncoding(utl_getWinTextEncodingFromLangStr(getLODefaultLanguage(), true)); + setTextEncoding(utl_getWinTextEncodingFromLangStr( + utl_getLocaleForGlobalDefaultEncoding(), true)); } else if (rDGR.GetS() >= "AC1021") setTextEncoding(RTL_TEXTENCODING_UTF8); @@ -239,7 +224,8 @@ void DXFRepresentation::ReadHeader(DXFGroupReader & rDGR) // only if the encoding is not set yet // e.g. by previous $DWGCODEPAGE if (!isTextEncodingSet()) - setTextEncoding(utl_getWinTextEncodingFromLangStr(getLODefaultLanguage())); + setTextEncoding(utl_getWinTextEncodingFromLangStr( + utl_getLocaleForGlobalDefaultEncoding())); } } else if (rDGR.GetS() == "$DWGCODEPAGE") |