summaryrefslogtreecommitdiff
path: root/svx/source/items/numfmtsh.cxx
diff options
context:
space:
mode:
authorMohammed Abdul Azeem <azeemmysore@gmail.com>2016-03-23 03:18:14 +0530
committerMichael Meeks <michael.meeks@collabora.com>2016-03-23 13:42:19 +0000
commitf9cf53a082f1d99b313ebd09c8791541859eac40 (patch)
treed201bc51b5763b15e144eda189e942553d774609 /svx/source/items/numfmtsh.cxx
parent8f61630300974b0a41e8b2ea6b9ec87f1c9faa5f (diff)
tdf#82641 Changes to currency drop-down list
Common codes have been shared in a static function. Now the list shows complete set of currency options. Change-Id: I17639b3123d2fd86c5a414df927ef5f07e37d845 Reviewed-on: https://gerrit.libreoffice.org/23444 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'svx/source/items/numfmtsh.cxx')
-rw-r--r--svx/source/items/numfmtsh.cxx79
1 files changed, 2 insertions, 77 deletions
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index 12dc40982188..7d78ecac523d 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -26,12 +26,8 @@
#include <svl/zformat.hxx>
#include <svl/currencytable.hxx>
-#include <svtools/langtab.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/settings.hxx>
-#include <comphelper/processfactory.hxx>
-
#include <svx/numfmtsh.hxx>
+#include <svx/tbcontrl.hxx>
#include <limits>
@@ -1369,7 +1365,7 @@ void SvxNumberFormatShell::GetCurrencySymbols(std::vector<OUString>& rList, sal_
bool bFlag=(pTmpCurrencyEntry==nullptr);
- GetCurrencySymbols(rList, bFlag);
+ SvxCurrencyToolBoxControl::GetCurrencySymbols( rList, bFlag, aCurCurrencyList );
if(pPos!=nullptr)
{
@@ -1402,77 +1398,6 @@ void SvxNumberFormatShell::GetCurrencySymbols(std::vector<OUString>& rList, sal_
}
-void SvxNumberFormatShell::GetCurrencySymbols(std::vector<OUString>& rList, bool bFlag)
-{
- aCurCurrencyList.clear();
-
- const NfCurrencyTable& rCurrencyTable=SvNumberFormatter::GetTheCurrencyTable();
- sal_uInt16 nCount=rCurrencyTable.size();
-
- sal_uInt16 nStart=1;
-
- OUString aString( ApplyLreOrRleEmbedding( rCurrencyTable[0].GetSymbol()));
- aString += " ";
- aString += ApplyLreOrRleEmbedding( SvtLanguageTable::GetLanguageString( rCurrencyTable[0].GetLanguage()));
-
- rList.push_back(aString);
- sal_uInt16 nAuto=(sal_uInt16)-1;
- aCurCurrencyList.push_back(nAuto);
-
- if(bFlag)
- {
- rList.push_back(aString);
- aCurCurrencyList.push_back(0);
- ++nStart;
- }
-
- CollatorWrapper aCollator( ::comphelper::getProcessComponentContext());
- aCollator.loadDefaultCollator( Application::GetSettings().GetLanguageTag().getLocale(), 0);
-
- const OUString aTwoSpace(" ");
-
- for(sal_uInt16 i = 1; i < nCount; ++i)
- {
- OUString aStr( ApplyLreOrRleEmbedding( rCurrencyTable[i].GetBankSymbol()));
- aStr += aTwoSpace;
- aStr += ApplyLreOrRleEmbedding( rCurrencyTable[i].GetSymbol());
- aStr += aTwoSpace;
- aStr += ApplyLreOrRleEmbedding( SvtLanguageTable::GetLanguageString( rCurrencyTable[i].GetLanguage()));
-
- sal_uInt16 j = nStart;
- for(; j < rList.size(); ++j)
- if (aCollator.compareString(aStr, rList[j]) < 0)
- break; // insert before first greater than
-
- rList.insert(rList.begin() + j, aStr);
- aCurCurrencyList.insert(aCurCurrencyList.begin() + j, i);
- }
-
- // Append ISO codes to symbol list.
- // XXX If this is to be changed, various other places would had to be
- // adapted that assume this order!
- sal_uInt16 nCont = rList.size();
-
- for(sal_uInt16 i = 1; i < nCount; ++i)
- {
- bool bInsert = true;
- OUString aStr(ApplyLreOrRleEmbedding(rCurrencyTable[i].GetBankSymbol()));
-
- sal_uInt16 j = nCont;
- for(; j < rList.size() && bInsert; ++j)
- {
- if(rList[j] == aStr)
- bInsert = false;
- else if (aCollator.compareString(aStr, rList[j]) < 0)
- break; // insert before first greater than
- }
- if(bInsert)
- {
- rList.insert(rList.begin() + j, aStr);
- aCurCurrencyList.insert(aCurCurrencyList.begin()+j, i);
- }
- }
-}
void SvxNumberFormatShell::SetCurrencySymbol(sal_uInt32 nPos)
{