summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-10-27 14:48:26 +0200
committerEike Rathke <erack@redhat.com>2017-10-27 18:29:43 +0200
commit51a7ae749de90485f3b15a3f935f0f11d5aeff5b (patch)
tree2c188f081e6c72dc250861a70d94a82acfcd31dd
parent2c1ab132685bee9251901be38e113e129c2c3fce (diff)
Let LocaleDataWrapper::getLocaleItem() return LocaleDataItem2&, tdf#81671
Change-Id: I16cfe81dd3ce0c8c2e905d55bea13df134c7a398
-rw-r--r--include/unotools/localedatawrapper.hxx7
-rw-r--r--sc/source/core/data/column3.cxx6
-rw-r--r--sc/source/core/data/table3.cxx2
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx6
4 files changed, 11 insertions, 10 deletions
diff --git a/include/unotools/localedatawrapper.hxx b/include/unotools/localedatawrapper.hxx
index be53b7558add..398c990fe53b 100644
--- a/include/unotools/localedatawrapper.hxx
+++ b/include/unotools/localedatawrapper.hxx
@@ -60,7 +60,7 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper
LanguageTag maLanguageTag;
std::shared_ptr< css::i18n::Calendar2 > xDefaultCalendar;
std::shared_ptr< css::i18n::Calendar2 > xSecondaryCalendar;
- css::i18n::LocaleDataItem aLocaleDataItem;
+ css::i18n::LocaleDataItem2 aLocaleDataItem;
css::uno::Sequence< OUString > aReservedWordSeq;
css::uno::Sequence< OUString > aDateAcceptancePatterns;
css::uno::Sequence< sal_Int32 > aGrouping;
@@ -82,7 +82,7 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper
{
bool operator()(const css::lang::Locale& rLocale1, const css::lang::Locale& rLocale2) const;
};
- mutable std::map<css::lang::Locale, css::i18n::LocaleDataItem, Locale_Compare> maDataItemCache;
+ mutable std::map<css::lang::Locale, css::i18n::LocaleDataItem2, Locale_Compare> maDataItemCache;
// whenever Locale changes
void invalidateData();
@@ -144,7 +144,8 @@ public:
// Wrapper implementations of service LocaleData
css::i18n::LanguageCountryInfo getLanguageCountryInfo() const;
- const css::i18n::LocaleDataItem& getLocaleItem() const;
+ /// NOTE: this wraps XLocaleData5::getLocaleItem2() in fact.
+ const css::i18n::LocaleDataItem2& getLocaleItem() const;
/// NOTE: this wraps XLocaleData3::getAllCalendars2() in fact.
css::uno::Sequence< css::i18n::Calendar2 > getAllCalendars() const;
/// NOTE: this wraps XLocaleData2::getAllCurrencies2() in fact.
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 847e6f84d355..001d8d320485 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -49,7 +49,7 @@
#include <listenercontext.hxx>
#include <filterentries.hxx>
-#include <com/sun/star/i18n/LocaleDataItem.hpp>
+#include <com/sun/star/i18n/LocaleDataItem2.hpp>
#include <memory>
@@ -64,7 +64,7 @@
#include <cstdio>
-using ::com::sun::star::i18n::LocaleDataItem;
+using ::com::sun::star::i18n::LocaleDataItem2;
using namespace formula;
@@ -1803,7 +1803,7 @@ bool ScColumn::ParseString(
if (!pLocale)
break;
- const LocaleDataItem& aLocaleItem = pLocale->getLocaleItem();
+ const LocaleDataItem2& aLocaleItem = pLocale->getLocaleItem();
const OUString& rDecSep = aLocaleItem.decimalSeparator;
const OUString& rGroupSep = aLocaleItem.thousandSeparator;
if (rDecSep.getLength() != 1 || rGroupSep.getLength() != 1)
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 6347e24086ef..fba985e7d28d 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -99,7 +99,7 @@ using namespace ::com::sun::star::i18n;
bool SplitString( const OUString &sWhole,
OUString &sPrefix, OUString &sSuffix, double &fNum )
{
- i18n::LocaleDataItem aLocaleItem = ScGlobal::pLocaleData->getLocaleItem();
+ i18n::LocaleDataItem2 aLocaleItem = ScGlobal::pLocaleData->getLocaleItem();
// Get prefix element
OUString sUser = "-";
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 77940997ace6..d2552ffe4a82 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -173,7 +173,7 @@ css::i18n::LanguageCountryInfo LocaleDataWrapper::getLanguageCountryInfo() const
return css::i18n::LanguageCountryInfo();
}
-const css::i18n::LocaleDataItem& LocaleDataWrapper::getLocaleItem() const
+const css::i18n::LocaleDataItem2& LocaleDataWrapper::getLocaleItem() const
{
{
::utl::ReadWriteGuard aGuard( aMutex );
@@ -188,7 +188,7 @@ const css::i18n::LocaleDataItem& LocaleDataWrapper::getLocaleItem() const
::utl::ReadWriteGuard aGuard( aMutex );
const css::lang::Locale& rLocal = getMyLocale();
- css::i18n::LocaleDataItem aItem = xLD->getLocaleItem( rLocal );
+ css::i18n::LocaleDataItem2 aItem = xLD->getLocaleItem2( rLocal );
auto aRet = maDataItemCache.insert(std::make_pair(rLocal, aItem));
assert(aRet.second);
return aRet.first->second;
@@ -197,7 +197,7 @@ const css::i18n::LocaleDataItem& LocaleDataWrapper::getLocaleItem() const
{
SAL_WARN( "unotools.i18n", "getLocaleItem: Exception caught " << e );
}
- static css::i18n::LocaleDataItem aEmptyItem;
+ static css::i18n::LocaleDataItem2 aEmptyItem;
return aEmptyItem;
}