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 /svl/qa/unit/svl.cxx | |
parent | 9b26a2ea8e7968d344ae8da12b314464e282c009 (diff) |
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 'svl/qa/unit/svl.cxx')
-rw-r--r-- | svl/qa/unit/svl.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index defc53df056d..be9310db0af9 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -1393,9 +1393,8 @@ void Test::testUserDefinedNumberFormats() void Test::testNfEnglishKeywordsIntegrity() { SvNumberFormatter aFormatter(m_xContext, LANGUAGE_ENGLISH_US); - const SvNumberformat* pNumberFormat = aFormatter.GetEntry(0); - const NfKeywordTable& sKeywords = pNumberFormat->GetKeywords(); - const ::std::vector<OUString> & sEnglishKeywords = pNumberFormat->GetEnglishKeywords(); + const ::std::vector<OUString> & sEnglishKeywords = aFormatter.GetEnglishKeywords(); + const NfKeywordTable& sKeywords = aFormatter.GetKeywords(0); CPPUNIT_ASSERT_EQUAL( size_t(NF_KEYWORD_ENTRIES_COUNT), sEnglishKeywords.size() ); for (size_t i = 0; i < size_t(NF_KEYWORD_ENTRIES_COUNT); ++i) { @@ -1459,9 +1458,8 @@ void Test::testNfEnglishKeywordsIntegrity() void Test::testStandardColorIntegrity() { SvNumberFormatter aFormatter(m_xContext, LANGUAGE_ENGLISH_US); - const SvNumberformat* pNumberFormat = aFormatter.GetEntry(0); - const ::std::vector<Color> & aStandardColors = pNumberFormat->GetStandardColor(); - const size_t nMaxDefaultColors = pNumberFormat->GetMaxDefaultColors(); + const ::std::vector<Color> & aStandardColors = aFormatter.GetStandardColors(); + const size_t nMaxDefaultColors = aFormatter.GetMaxDefaultColors(); CPPUNIT_ASSERT_EQUAL( nMaxDefaultColors, size_t(NF_KEY_LASTCOLOR) - size_t(NF_KEY_FIRSTCOLOR) + 1 ); CPPUNIT_ASSERT_EQUAL( nMaxDefaultColors, aStandardColors.size() ); // Colors must follow same order as in sEnglishKeyword @@ -1480,9 +1478,8 @@ void Test::testStandardColorIntegrity() void Test::testColorNamesConversion() { SvNumberFormatter aFormatter(m_xContext, LANGUAGE_GERMAN); - const SvNumberformat* pNumberFormat = aFormatter.GetEntry(0); - const ::std::vector<OUString> & rEnglishKeywords = pNumberFormat->GetEnglishKeywords(); - const NfKeywordTable& rKeywords = pNumberFormat->GetKeywords(); + const ::std::vector<OUString> & rEnglishKeywords = aFormatter.GetEnglishKeywords(); + const NfKeywordTable& rKeywords = aFormatter.GetKeywords(0); // Holding a reference to the NfKeywordTable doesn't help if we switch // locales internally, so copy the relevant parts in advance. |