diff options
Diffstat (limited to 'i18npool/inc/breakiterator_unicode.hxx')
-rw-r--r-- | i18npool/inc/breakiterator_unicode.hxx | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/i18npool/inc/breakiterator_unicode.hxx b/i18npool/inc/breakiterator_unicode.hxx index 8783764cb0e1..c9e644e31f42 100644 --- a/i18npool/inc/breakiterator_unicode.hxx +++ b/i18npool/inc/breakiterator_unicode.hxx @@ -23,6 +23,7 @@ #include <unicode/brkiter.h> #include <memory> +#include <unordered_map> namespace com { namespace sun { namespace star { namespace i18n { @@ -71,27 +72,35 @@ public: protected: const sal_Char *cBreakIterator, *lineRule; - struct BI_Data + /** Used as map value. */ + struct BI_ValueData { - OUString aICUText; - UText* ut; - std::unique_ptr<icu::BreakIterator> aBreakIterator; - css::lang::Locale maLocale; + OUString maICUText; + UText* mpUt; + std::shared_ptr< icu::BreakIterator > mpBreakIterator; - BI_Data() : ut(nullptr) + BI_ValueData() : mpUt(nullptr) { } - ~BI_Data() + ~BI_ValueData() { - utext_close(ut); + utext_close(mpUt); } + }; + struct BI_Data + { + std::shared_ptr< BI_ValueData > mpValue; + OString maBIMapKey; } character, sentence, line, *icuBI; BI_Data words[4]; // 4 is css::i18n::WordType enumeration size /// @throws css::uno::RuntimeException void SAL_CALL loadICUBreakIterator(const css::lang::Locale& rLocale, sal_Int16 rBreakType, sal_Int16 rWordType, const sal_Char* name, const OUString& rText); + +public: + typedef std::unordered_map< OString, std::shared_ptr< BI_ValueData >, OStringHash > BIMap; }; } } } } |