summaryrefslogtreecommitdiff
path: root/svl/inc
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 /svl/inc
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 'svl/inc')
-rw-r--r--svl/inc/svl/zforlist.hxx26
1 files changed, 17 insertions, 9 deletions
diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx
index ac387d472f35..14229a06c6d1 100644
--- a/svl/inc/svl/zforlist.hxx
+++ b/svl/inc/svl/zforlist.hxx
@@ -30,7 +30,6 @@
#include "svl/svldllapi.h"
#include <tools/string.hxx>
-#include <tools/table.hxx>
#include <i18npool/lang.h>
#include <svl/svarray.hxx>
#include <com/sun/star/uno/Reference.hxx>
@@ -214,10 +213,10 @@ enum NfEvalDateFormat
};
-DECLARE_TABLE (SvNumberFormatTable, SvNumberformat*)
-DECLARE_TABLE (SvNumberFormatterIndexTable, sal_uInt32*)
+typedef std::map<sal_uInt32, SvNumberformat*> SvNumberFormatTable;
+typedef std::map<sal_uInt16, sal_uInt32> SvNumberFormatterIndexTable;
-typedef ::std::map< sal_uInt32, sal_uInt32 > SvNumberFormatterMergeMap;
+typedef ::std::map< sal_uInt32, sal_uInt32> SvNumberFormatterMergeMap;
typedef ::std::set< LanguageType > NfInstalledLocales;
@@ -563,7 +562,7 @@ public:
/// Return the format for a format index
const SvNumberformat* GetEntry(sal_uInt32 nKey) const
- { return (SvNumberformat*) aFTable.Get(nKey); }
+ { SvNumberFormatTable::const_iterator it = aFTable.find(nKey); return it == aFTable.end() ? 0 : it->second; }
/// Return the format index of the standard default number format for language/country
sal_uInt32 GetStandardIndex(LanguageType eLnge = LANGUAGE_DONTKNOW);
@@ -801,7 +800,8 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager;
::com::sun::star::lang::Locale aLocale;
SvNumberFormatTable aFTable; // Table of format keys to format entries
- Table aDefaultFormatKeys; // Table of default standard to format keys
+ typedef std::map<sal_uInt32, sal_uInt32> DefaultFormatKeysMap;
+ DefaultFormatKeysMap aDefaultFormatKeys; // Table of default standard to format keys
SvNumberFormatTable* pFormatTable; // For the UI dialog
SvNumberFormatterIndexTable* pMergeTable; // List of indices for merging two formatters
CharClass* pCharClass; // CharacterClassification
@@ -913,6 +913,9 @@ private:
sal_Int32 nCount, bool bCheckCorrectness = true
);
+ SVL_DLLPRIVATE SvNumberformat* GetFormatEntry(sal_uInt32 nKey);
+ SVL_DLLPRIVATE const SvNumberformat* GetFormatEntry(sal_uInt32 nKey) const;
+
// used as a loop body inside of GetNewCurrencySymbolString() and GetCurrencyEntry()
#ifndef DBG_UTIL
inline
@@ -998,13 +1001,18 @@ public:
inline sal_uInt32 SvNumberFormatter::GetMergeFmtIndex( sal_uInt32 nOldFmt ) const
{
- sal_uInt32* pU = (pMergeTable && pMergeTable->Count()) ? (sal_uInt32*)pMergeTable->Get( nOldFmt ) : 0;
- return pU ? *pU : nOldFmt;
+ if (pMergeTable)
+ {
+ SvNumberFormatterIndexTable::iterator it = pMergeTable->find(nOldFmt);
+ if (it != pMergeTable->end())
+ return it->second;
+ }
+ return nOldFmt;
}
inline bool SvNumberFormatter::HasMergeFmtTbl() const
{
- return pMergeTable && (0 != pMergeTable->Count());
+ return pMergeTable && !pMergeTable->empty();
}