Kaydet (Commit) ab5986d4 authored tarafından August Sodora's avatar August Sodora

SvStringsDtor->std::vector

üst 05fa6914
...@@ -31,12 +31,13 @@ ...@@ -31,12 +31,13 @@
#include "tools/solar.h" #include "tools/solar.h"
#include "swdllapi.h" #include "swdllapi.h"
#include <vector>
/* /*
* Forward Declarations * Forward Declarations
*/ */
class String; class String;
class SwThesaurus; class SwThesaurus;
class SvStringsDtor;
/* /*
* Extern Definitions * Extern Definitions
...@@ -57,10 +58,10 @@ SW_DLLPUBLIC String* GetOldDrwCat(); ...@@ -57,10 +58,10 @@ SW_DLLPUBLIC String* GetOldDrwCat();
SW_DLLPUBLIC String* GetCurrGlosGroup(); SW_DLLPUBLIC String* GetCurrGlosGroup();
SW_DLLPUBLIC void SetCurrGlosGroup(String* pStr); SW_DLLPUBLIC void SetCurrGlosGroup(String* pStr);
extern SvStringsDtor* pDBNameList; extern std::vector<String>* pDBNameList;
extern SvStringsDtor* pAuthFieldNameList; extern std::vector<String>* pAuthFieldNameList;
extern SvStringsDtor* pAuthFieldTypeList; extern std::vector<String>* pAuthFieldTypeList;
// provides textblock management // provides textblock management
class SwGlossaries; class SwGlossaries;
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
* *
************************************************************************/ ************************************************************************/
#include <unotools/localedatawrapper.hxx> #include <unotools/localedatawrapper.hxx>
#include <viewsh.hxx> #include <viewsh.hxx>
#include <initui.hxx> #include <initui.hxx>
...@@ -86,10 +84,10 @@ void SetCurrGlosGroup(String* pStr) ...@@ -86,10 +84,10 @@ void SetCurrGlosGroup(String* pStr)
pCurrGlosGroup = pStr; pCurrGlosGroup = pStr;
} }
SvStringsDtor* pDBNameList = 0; std::vector<String>* pDBNameList = 0;
SvStringsDtor* pAuthFieldNameList = 0; std::vector<String>* pAuthFieldNameList = 0;
SvStringsDtor* pAuthFieldTypeList = 0; std::vector<String>* pAuthFieldTypeList = 0;
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
Beschreibung: UI beenden Beschreibung: UI beenden
...@@ -128,7 +126,7 @@ void _InitUI() ...@@ -128,7 +126,7 @@ void _InitUI()
{ {
// ShellResource gibt der CORE die Moeglichkeit mit Resourcen zu arbeiten // ShellResource gibt der CORE die Moeglichkeit mit Resourcen zu arbeiten
ViewShell::SetShellRes( new ShellResource ); ViewShell::SetShellRes( new ShellResource );
pDBNameList = new SvStringsDtor( 5, 5 ); pDBNameList = new std::vector<String>;
SwEditWin::_InitStaticData(); SwEditWin::_InitStaticData();
} }
...@@ -277,29 +275,24 @@ const String& SwAuthorityFieldType::GetAuthFieldName(ToxAuthorityField eType) ...@@ -277,29 +275,24 @@ const String& SwAuthorityFieldType::GetAuthFieldName(ToxAuthorityField eType)
{ {
if(!pAuthFieldNameList) if(!pAuthFieldNameList)
{ {
pAuthFieldNameList = new SvStringsDtor(AUTH_FIELD_END, 1); pAuthFieldNameList = new std::vector<String>;
for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++) pAuthFieldNameList->reserve(AUTH_FIELD_END);
{ for(sal_uInt16 i = 0; i < AUTH_FIELD_END; ++i)
String* pTmp = new String(SW_RES(STR_AUTH_FIELD_START + i)); pAuthFieldNameList->push_back(String(SW_RES(STR_AUTH_FIELD_START + i)));
pAuthFieldNameList->Insert(pTmp, pAuthFieldNameList->Count());
}
} }
return *pAuthFieldNameList->GetObject( static_cast< sal_uInt16 >(eType) ); return (*pAuthFieldNameList)[static_cast< sal_uInt16 >(eType)];
} }
const String& SwAuthorityFieldType::GetAuthTypeName(ToxAuthorityType eType) const String& SwAuthorityFieldType::GetAuthTypeName(ToxAuthorityType eType)
{ {
if(!pAuthFieldTypeList) if(!pAuthFieldTypeList)
{ {
pAuthFieldTypeList = new SvStringsDtor(AUTH_TYPE_END, 1); pAuthFieldTypeList = new std::vector<String>;
for(sal_uInt16 i = 0; i < AUTH_TYPE_END; i++) pAuthFieldTypeList->reserve(AUTH_TYPE_END);
pAuthFieldTypeList->Insert( for(sal_uInt16 i = 0; i < AUTH_TYPE_END; ++i)
new String(SW_RES(STR_AUTH_TYPE_START + i)), pAuthFieldTypeList->push_back(String(SW_RES(STR_AUTH_TYPE_START + i)));
pAuthFieldTypeList->Count());
} }
return *pAuthFieldTypeList->GetObject( static_cast< sal_uInt16 >(eType) ); return (*pAuthFieldTypeList)[static_cast< sal_uInt16 >(eType)];
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment