summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-02-06 12:50:59 +0200
committerEike Rathke <erack@redhat.com>2012-02-08 13:15:30 +0100
commit0979307bbf769399f97da10a29f04936a6cf117c (patch)
treef04aea01ba738e29902aceaeeb720fc73a00a408 /svx
parent809fd00863026cdff4bf2de7d02956d39e867eeb (diff)
tools/table.hxx to std::map conversion in SV, SVL and SVX modules
This patch converts one use of tools/table.hxx in svl/inc/svl/zforlist.hxx, whose use in turn spans 3 modules.
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/numfmtsh.hxx4
-rw-r--r--svx/source/items/numfmtsh.cxx35
2 files changed, 22 insertions, 17 deletions
diff --git a/svx/inc/svx/numfmtsh.hxx b/svx/inc/svx/numfmtsh.hxx
index e9b4772d713f..32a7da363a35 100644
--- a/svx/inc/svx/numfmtsh.hxx
+++ b/svx/inc/svx/numfmtsh.hxx
@@ -36,10 +36,12 @@
#include <svl/svstdarr.hxx>
#include <vector>
+#include <map>
class Color;
class SvNumberFormatter;
-class SvNumberFormatTable;
+class SvNumberformat;
+typedef std::map<sal_uInt32, SvNumberformat*> SvNumberFormatTable;
class NfCurrencyEntry;
enum SvxNumberValueType
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index c76f7a4de86e..4c23829e2cf4 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -672,7 +672,7 @@ short SvxNumberFormatShell::FillEListWithFormats_Impl( std::vector<String*>& rLi
DBG_ASSERT( pCurFmtTable != NULL, "Unbekanntes Zahlenformat!" );
- const SvNumberformat* pNumEntry = pCurFmtTable->First();
+ const SvNumberformat* pNumEntry = pCurFmtTable->empty() ? 0 : pCurFmtTable->begin()->second;
sal_uInt32 nNFEntry;
String aStrComment;
String aNewFormNInfo;
@@ -717,7 +717,7 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl( std::vector<String*>& rL
DBG_ASSERT( pCurFmtTable != NULL, "Unbekanntes Zahlenformat!" );
- const SvNumberformat* pNumEntry = pCurFmtTable->First();
+ const SvNumberformat* pNumEntry = pCurFmtTable->empty() ? 0 : pCurFmtTable->begin()->second;
sal_uInt32 nNFEntry;
String aStrComment;
String aNewFormNInfo;
@@ -801,7 +801,7 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<String*>& rLi
DBG_ASSERT( pCurFmtTable != NULL, "Unbekanntes Zahlenformat!" );
- const SvNumberformat* pNumEntry = pCurFmtTable->First();
+ const SvNumberformat* pNumEntry = pCurFmtTable->empty() ? 0 : pCurFmtTable->begin()->second;
sal_uInt32 nNFEntry;
String aStrComment;
String aNewFormNInfo;
@@ -842,10 +842,12 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<String*>& rLi
if(nCurCategory!=NUMBERFORMAT_ALL)
{
- pNumEntry = pCurFmtTable->First();
- while ( pNumEntry )
+ SvNumberFormatTable::iterator it = pCurFmtTable->begin();
+
+ while ( it != pCurFmtTable->end() )
{
- sal_uInt32 nKey = pCurFmtTable->GetCurKey();
+ sal_uInt32 nKey = it->first;
+ pNumEntry = it->second;
if ( !IsRemoved_Impl( nKey ))
{
@@ -876,7 +878,7 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<String*>& rLi
aCurEntryList.push_back( nKey );
}
}
- pNumEntry = pCurFmtTable->Next();
+ ++it;
}
}
return nSelPos;
@@ -943,11 +945,11 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<String*>& rL
pTmpCurrencyEntry->BuildSymbolString(rShortSymbol,bTmpBanking,true);
}
- const SvNumberformat* pNumEntry = pCurFmtTable->First();
-
- while ( pNumEntry )
+ SvNumberFormatTable::iterator it = pCurFmtTable->begin();
+ while ( it != pCurFmtTable->end() )
{
- sal_uInt32 nKey = pCurFmtTable->GetCurKey();
+ sal_uInt32 nKey = it->first;
+ const SvNumberformat* pNumEntry = it->second;
if ( !IsRemoved_Impl( nKey ) )
{
@@ -992,7 +994,7 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<String*>& rL
}
}
}
- pNumEntry = pCurFmtTable->Next();
+ ++it;
}
NfWSStringsDtor aWSStringsDtor;
@@ -1090,7 +1092,6 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( std::vector<String*>& rList,
DBG_ASSERT( pCurFmtTable != NULL, "Unbekanntes Zahlenformat!" );
- const SvNumberformat* pNumEntry = pCurFmtTable->First();
String aStrComment;
String aNewFormNInfo;
String aPrevString;
@@ -1100,9 +1101,11 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( std::vector<String*>& rList,
bool bAdditional = (nPrivCat != CAT_USERDEFINED &&
nCurCategory != NUMBERFORMAT_ALL);
- while ( pNumEntry )
+ SvNumberFormatTable::iterator it = pCurFmtTable->begin();
+ while ( it != pCurFmtTable->end() )
{
- sal_uInt32 nKey = pCurFmtTable->GetCurKey();
+ sal_uInt32 nKey = it->first;
+ const SvNumberformat* pNumEntry = it->second;
if ( !IsRemoved_Impl( nKey ) )
{
@@ -1131,7 +1134,7 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( std::vector<String*>& rList,
}
}
}
- pNumEntry = pCurFmtTable->Next();
+ ++it;
}
return nSelPos;
}