summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAron Budea <baron@caesar.elte.hu>2016-10-25 01:01:01 +0200
committerEike Rathke <erack@redhat.com>2016-11-04 11:37:12 +0000
commita29d53509b48657d53f5496d2295d30343f25ab6 (patch)
tree15ffbafa1b7728aa7fe5e416e97036bede221112
parentbd47f43ce56639c891beda40d9070591b8df5ccf (diff)
tdf#79892: Pass resolved locale to transliterate calls in Calc
Instead of ScGlobal::eLnge, use ScGlobal::pSysLocale->GetLanguageTag().getLanguageType(). Change-Id: Ie0aa90098860ac2b6cee195180dbc213eaf3b5f8 Reviewed-on: https://gerrit.libreoffice.org/30240 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 8175e30b732e3f6f4f1058934e7fe8a1189f40cf) Reviewed-on: https://gerrit.libreoffice.org/30559 Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
-rw-r--r--sc/source/core/data/dpcache.cxx5
-rw-r--r--sc/source/core/tool/cellkeytranslator.cxx6
-rw-r--r--sc/source/core/tool/compare.cxx5
3 files changed, 10 insertions, 6 deletions
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 661944e09e49..040564d8474f 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -576,10 +576,11 @@ bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam) const
{
OUString aQueryStr = rEntry.GetQueryItem().maString.getString();
css::uno::Sequence< sal_Int32 > xOff;
+ const LanguageType nLang = ScGlobal::pSysLocale->GetLanguageTag().getLanguageType();
OUString aCell = pTransliteration->transliterate(
- aCellStr, ScGlobal::eLnge, 0, aCellStr.getLength(), &xOff);
+ aCellStr, nLang, 0, aCellStr.getLength(), &xOff);
OUString aQuer = pTransliteration->transliterate(
- aQueryStr, ScGlobal::eLnge, 0, aQueryStr.getLength(), &xOff);
+ aQueryStr, nLang, 0, aQueryStr.getLength(), &xOff);
bOk = (aCell.indexOf( aQuer ) != -1);
}
if (rEntry.eOp == SC_NOT_EQUAL)
diff --git a/sc/source/core/tool/cellkeytranslator.cxx b/sc/source/core/tool/cellkeytranslator.cxx
index 16ce164d1315..1e764d581570 100644
--- a/sc/source/core/tool/cellkeytranslator.cxx
+++ b/sc/source/core/tool/cellkeytranslator.cxx
@@ -22,6 +22,7 @@
#include <i18nlangtag/mslangid.hxx>
#include <i18nlangtag/lang.h>
#include <rtl/ustring.hxx>
+#include <unotools/syslocale.hxx>
#include <com/sun/star/i18n/TransliterationModules.hpp>
@@ -161,9 +162,10 @@ void ScCellKeywordTranslator::transKeyword(OUString& rName, const lang::Locale*
if ( !spInstance.get() )
spInstance.reset( new ScCellKeywordTranslator );
- LanguageType eLang = pLocale ? LanguageTag(*pLocale).makeFallback().getLanguageType() : LANGUAGE_SYSTEM;
+ LanguageType nLang = pLocale ?
+ LanguageTag(*pLocale).makeFallback().getLanguageType() : ScGlobal::pSysLocale->GetLanguageTag().getLanguageType();
Sequence<sal_Int32> aOffsets;
- rName = spInstance->maTransWrapper.transliterate(rName, eLang, 0, rName.getLength(), &aOffsets);
+ rName = spInstance->maTransWrapper.transliterate(rName, nLang, 0, rName.getLength(), &aOffsets);
lclMatchKeyword(rName, spInstance->maStringNameMap, eOpCode, pLocale);
}
diff --git a/sc/source/core/tool/compare.cxx b/sc/source/core/tool/compare.cxx
index a1dd6026ce17..41359536238e 100644
--- a/sc/source/core/tool/compare.cxx
+++ b/sc/source/core/tool/compare.cxx
@@ -161,11 +161,12 @@ double CompareFunc( const Compare& rComp, CompareOptions* pOptions )
}
else
{
+ const LanguageType nLang = ScGlobal::pSysLocale->GetLanguageTag().getLanguageType();
OUString aCell( pTransliteration->transliterate(
- rCell1.maStr.getString(), ScGlobal::eLnge, 0,
+ rCell1.maStr.getString(), nLang, 0,
rCell1.maStr.getLength(), nullptr));
OUString aQuer( pTransliteration->transliterate(
- rCell2.maStr.getString(), ScGlobal::eLnge, 0,
+ rCell2.maStr.getString(), nLang, 0,
rCell2.maStr.getLength(), nullptr));
bMatch = (aCell.indexOf( aQuer ) != -1);
}