diff options
-rw-r--r-- | sw/inc/authfld.hxx | 1 | ||||
-rw-r--r-- | sw/inc/fldbas.hxx | 5 | ||||
-rw-r--r-- | sw/source/core/fields/fldbas.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldmgr.cxx | 9 |
4 files changed, 11 insertions, 12 deletions
diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx index 8e985856d6b0..2f667e804a99 100644 --- a/sw/inc/authfld.hxx +++ b/sw/inc/authfld.hxx @@ -31,6 +31,7 @@ #include "swdllapi.h" #include <fldbas.hxx> #include <toxe.hxx> +#include <svl/svstdarr.hxx> #include <vector> class SwAuthDataArr; diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index f865175990cb..583f28688f94 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -33,12 +33,11 @@ #include "swdllapi.h" #include <calbck.hxx> #include <com/sun/star/uno/Any.hxx> +#include <vector> class SwDoc; -class SvStringsDtor; class SvNumberFormatter; - enum RES_FIELDS { // For old documents the Field-Which IDs must be preserved !!! @@ -242,7 +241,7 @@ class SW_DLLPUBLIC SwFieldType : public SwModify sal_uInt16 nWhich; friend void _FinitUI(); // In order to delete pointer! - static SvStringsDtor* pFldNames; + static std::vector<String>* pFldNames; static void _GetFldName(); // Sets up FldNames; fldmgr.cxx! diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index 04c5b14054bb..144191cd2f41 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -79,8 +79,7 @@ sal_uInt16 lcl_GetLanguageOfFormat( sal_uInt16 nLng, sal_uLong nFmt, --------------------------------------------------------------------*/ // Array der Feldname -SvStringsDtor* SwFieldType::pFldNames = 0; - +std::vector<String>* SwFieldType::pFldNames = 0; sal_uInt16 aTypeTab[] = { /* RES_DBFLD */ TYP_DBFLD, @@ -133,13 +132,12 @@ const String& SwFieldType::GetTypeStr(sal_uInt16 nTypeId) if( !pFldNames ) _GetFldName(); - if( nTypeId < SwFieldType::pFldNames->Count() ) - return *SwFieldType::pFldNames->GetObject( nTypeId ); + if( nTypeId < SwFieldType::pFldNames->size() ) + return (*SwFieldType::pFldNames)[nTypeId]; else return aEmptyStr; } - /*--------------------------------------------------- Jedes Feld referenziert einen Feldtypen, der fuer jedes Dokument einmalig ist. diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index 2b71c83a6936..7c27a5069859 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -1653,12 +1653,13 @@ void SwFieldType::_GetFldName() }; // insert infos for fields - SwFieldType::pFldNames = new SvStringsDtor( (sal_uInt8)coFldCnt, 2 ); + SwFieldType::pFldNames = new std::vector<String>; + SwFieldType::pFldNames->reserve(coFldCnt); for( sal_uInt16 nIdx = 0; nIdx < coFldCnt; ++nIdx ) { - String* pTmp = new SW_RESSTR( coFldNms[ nIdx ] ); - pTmp->Assign( MnemonicGenerator::EraseAllMnemonicChars( *pTmp ) ); - SwFieldType::pFldNames->Insert(pTmp, nIdx ); + String aTmp(SW_RESSTR( coFldNms[ nIdx ] )); + aTmp.Assign( MnemonicGenerator::EraseAllMnemonicChars( aTmp ) ); + SwFieldType::pFldNames->push_back(aTmp); } } |