diff options
author | Eike Rathke <erack@redhat.com> | 2017-12-13 21:56:36 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-12-14 11:10:31 +0100 |
commit | 52274384a3de2d0a0c9023c62ed9159df965fbd0 (patch) | |
tree | d9114561fb1e31ed609622512962ec9810aa1892 /include/svl | |
parent | ofz: various html problems (diff) | |
download | core-52274384a3de2d0a0c9023c62ed9159df965fbd0.tar.gz core-52274384a3de2d0a0c9023c62ed9159df965fbd0.zip |
Move GetKeywords() and related from SvNumberformat to SvNumberFormatter
... as especially the keywords are controlled by the current state (locale) of
the ImpSvNumberformatScan instance and *not* a property of SvNumberformat. Add
a clarifying descriptive comment as well, and outline it's only for the unit
tests anyway..
Change-Id: I732918026bf9ffc25db11033d5f10bc2f51e3505
Reviewed-on: https://gerrit.libreoffice.org/46426
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'include/svl')
-rw-r--r-- | include/svl/zforlist.hxx | 27 | ||||
-rw-r--r-- | include/svl/zformat.hxx | 5 |
2 files changed, 27 insertions, 5 deletions
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx index 5ac719d5fe4d..4f27621c9b0f 100644 --- a/include/svl/zforlist.hxx +++ b/include/svl/zforlist.hxx @@ -803,6 +803,33 @@ public: /** Check if a specific locale has supported locale data. */ static bool IsLocaleInstalled( LanguageType eLang ); + /** Obtain NfKeywordTable used with a format, possibly localized. + + XXX NOTE: the content (actual keywords) is only valid as long as the + locale context of the associated ImpSvNumberformatScan instance does + not change to a locale with different keywords, which may happen + anytime with a call (implicit or explicit) to + SvNumberFormatter::ChangeIntl(). If needed longer, copy-create another + NfKeywordTable instance or copy individual elements. + + If the format specified with nKey does not exist, the content of the + NfKeywordTable matches the locale with which the SvNumberFormatter + instance was created and initialized. + + This function preliminary exists for unit tests and otherwise is + pretty much useless. + */ + const NfKeywordTable & GetKeywords( sal_uInt32 nKey ); + + /** Access for unit tests. */ + const std::vector<OUString> & GetEnglishKeywords() const; + + /** Access for unit tests. */ + const std::vector<Color> & GetStandardColors() const; + + /** Access for unit tests. */ + size_t GetMaxDefaultColors() const; + private: mutable ::osl::Mutex m_aMutex; css::uno::Reference< css::uno::XComponentContext > m_xContext; diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx index 9077e45d92ff..2b4813184c9d 100644 --- a/include/svl/zformat.hxx +++ b/include/svl/zformat.hxx @@ -473,11 +473,6 @@ public: return false; } - const NfKeywordTable & GetKeywords() const; - const ::std::vector<OUString> & GetEnglishKeywords() const; - const ::std::vector<Color> & GetStandardColor() const; - size_t GetMaxDefaultColors() const; - private: ImpSvNumFor NumFor[4]; // Array for the 4 subformats OUString sFormatstring; // The format code string |