diff options
author | Eike Rathke <erack@redhat.com> | 2012-02-08 13:04:17 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-02-08 13:15:30 +0100 |
commit | 9472e9c77d55a0b9cdf75ce91375765243c0e1f1 (patch) | |
tree | 3aa6fea6c5eadf7b42b24f669568c98e9b67ca86 /svx | |
parent | tools/table.hxx to std::map conversion in SV, SVL and SVX modules (diff) | |
download | core-9472e9c77d55a0b9cdf75ce91375765243c0e1f1.tar.gz core-9472e9c77d55a0b9cdf75ce91375765243c0e1f1.zip |
changes to "tools/table.hxx to std::map conversion"
* use consistent indenting with 4 spaces (instead of tabs (plus one space))
* use erase(it++) instead of erase(it); ++it to not access invalidated
iterator
* for First(); Remove(); Next() loops over entire Table use map::clear()
at the end if it isn't in a dtor
* use existing typedef SvNumberFormatTable in numfmtsh.hxx instead of
redefining, which means include zforlist.hxx now and some other forward
declarations can be removed
* removed inlined duplicated code of GetEntry(), implemented it in
zforlist.cxx instead and made const GetFormatEntry() just call GetEntry()
* removed the temporary sal_uIntPtr nFormat to be used as key, the sal_uIntPtr
was only used because Table effectively had pointer size as keys.
* made initial assignments of nDefaultFormat and nDefaultCurrencyFormat use
the ternary conditional operator
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/svx/numfmtsh.hxx | 5 | ||||
-rw-r--r-- | svx/source/items/numfmtsh.cxx | 20 |
2 files changed, 11 insertions, 14 deletions
diff --git a/svx/inc/svx/numfmtsh.hxx b/svx/inc/svx/numfmtsh.hxx index 32a7da363a35..850b46d48667 100644 --- a/svx/inc/svx/numfmtsh.hxx +++ b/svx/inc/svx/numfmtsh.hxx @@ -34,15 +34,12 @@ #include "svx/svxdllapi.h" #include <svl/svstdarr.hxx> +#include <svl/zforlist.hxx> #include <vector> #include <map> class Color; -class SvNumberFormatter; -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 4c23829e2cf4..d3fe22dea8da 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -842,12 +842,12 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<String*>& rLi if(nCurCategory!=NUMBERFORMAT_ALL) { - SvNumberFormatTable::iterator it = pCurFmtTable->begin(); + SvNumberFormatTable::iterator it = pCurFmtTable->begin(); while ( it != pCurFmtTable->end() ) { sal_uInt32 nKey = it->first; - pNumEntry = it->second; + pNumEntry = it->second; if ( !IsRemoved_Impl( nKey )) { @@ -878,7 +878,7 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<String*>& rLi aCurEntryList.push_back( nKey ); } } - ++it; + ++it; } } return nSelPos; @@ -945,11 +945,11 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<String*>& rL pTmpCurrencyEntry->BuildSymbolString(rShortSymbol,bTmpBanking,true); } - SvNumberFormatTable::iterator it = pCurFmtTable->begin(); + SvNumberFormatTable::iterator it = pCurFmtTable->begin(); while ( it != pCurFmtTable->end() ) { sal_uInt32 nKey = it->first; - const SvNumberformat* pNumEntry = it->second; + const SvNumberformat* pNumEntry = it->second; if ( !IsRemoved_Impl( nKey ) ) { @@ -964,7 +964,7 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<String*>& rL bool bInsFlag = false; if ( pNumEntry->HasNewCurrency() ) { - bInsFlag = true; // merge locale formats into currency selection + bInsFlag = true; // merge locale formats into currency selection } else if( (!bTmpBanking && aNewFormNInfo.Search(rSymbol)!=STRING_NOTFOUND) || (bTmpBanking && aNewFormNInfo.Search(rBankSymbol)!=STRING_NOTFOUND) ) @@ -994,7 +994,7 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<String*>& rL } } } - ++it; + ++it; } NfWSStringsDtor aWSStringsDtor; @@ -1101,11 +1101,11 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( std::vector<String*>& rList, bool bAdditional = (nPrivCat != CAT_USERDEFINED && nCurCategory != NUMBERFORMAT_ALL); - SvNumberFormatTable::iterator it = pCurFmtTable->begin(); + SvNumberFormatTable::iterator it = pCurFmtTable->begin(); while ( it != pCurFmtTable->end() ) { sal_uInt32 nKey = it->first; - const SvNumberformat* pNumEntry = it->second; + const SvNumberformat* pNumEntry = it->second; if ( !IsRemoved_Impl( nKey ) ) { @@ -1134,7 +1134,7 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( std::vector<String*>& rList, } } } - ++it; + ++it; } return nSelPos; } |