summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2012-01-13 17:51:41 -0500
committerAugust Sodora <augsod@gmail.com>2012-01-13 22:21:02 -0500
commitc0d93b267f56d06cd464f3e49af368164e6cd164 (patch)
tree5c16c7cbb8d600d3dbbbaec44d26f53f044cd227 /sw
parent08443f12858bc4ff902d8d8400b8696161ced7cf (diff)
SvStringsDtor->std::vector
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/authfld.hxx1
-rw-r--r--sw/inc/fldbas.hxx5
-rw-r--r--sw/source/core/fields/fldbas.cxx8
-rw-r--r--sw/source/ui/fldui/fldmgr.cxx9
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);
}
}