summaryrefslogtreecommitdiff
path: root/i18npool/inc
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-18 20:43:34 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-20 14:58:10 +0100
commitf16fd6725582659602ca8b138937db7283a81bf3 (patch)
tree65bad1f1f11740ca031b20171cf94433ec3eab37 /i18npool/inc
parent516fa8464f84378f5f6441555689f468ef2e8eb9 (diff)
flatten LocaleDataImpl a little
no need to store LocaleDataLookupTableItem separately Change-Id: I06de28518fe80f6ae1a22c20af2ff32245b66acc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127112 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool/inc')
-rw-r--r--i18npool/inc/localedata.hxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/i18npool/inc/localedata.hxx b/i18npool/inc/localedata.hxx
index 5e8da5e48ee2..724cbba342a7 100644
--- a/i18npool/inc/localedata.hxx
+++ b/i18npool/inc/localedata.hxx
@@ -32,6 +32,7 @@
#include <vector>
#include <string_view>
#include <memory>
+#include <optional>
#include <osl/module.hxx>
@@ -48,6 +49,22 @@ struct LocaleDataLookupTableItem;
namespace i18npool {
+struct LocaleDataLookupTableItem
+{
+ const char* dllName;
+ osl::Module *module;
+ const char* localeName;
+ css::lang::Locale aLocale;
+
+ LocaleDataLookupTableItem(const char *name, osl::Module* m, const char* lname) : dllName(name), module(m), localeName(lname)
+ {
+ }
+ bool equals(const css::lang::Locale& rLocale) const
+ {
+ return (rLocale == aLocale);
+ }
+};
+
class LocaleDataImpl final : public cppu::WeakImplHelper
<
css::i18n::XLocaleData5,
@@ -127,7 +144,7 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
private:
- ::std::unique_ptr< LocaleDataLookupTableItem > cachedItem;
+ ::std::optional< LocaleDataLookupTableItem > moCachedItem;
css::i18n::Calendar2 ref_cal;
OUString ref_name;