diff options
author | August Sodora <augsod@gmail.com> | 2012-01-13 22:41:12 -0500 |
---|---|---|
committer | August Sodora <augsod@gmail.com> | 2012-01-13 22:41:12 -0500 |
commit | cad9afa15f53d547733fa55f1353772f6d696611 (patch) | |
tree | 727b3f7dcfb63331e9b67d056958577c5ff4ec99 /sw | |
parent | e4aecbdbe4e12b241da39d8e7b23dbb8db20bd2f (diff) |
SvStringsDtor->std::vector
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/utlui/initui.cxx | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx index dacbb6ebd711..1a3e6d4319d1 100644 --- a/sw/source/ui/utlui/initui.cxx +++ b/sw/source/ui/utlui/initui.cxx @@ -233,37 +233,38 @@ SwGlossaryList* GetGlossaryList() struct ImpAutoFmtNameListLoader : public Resource { - ImpAutoFmtNameListLoader( SvStringsDtor& rLst ); + ImpAutoFmtNameListLoader( std::vector<String>& rLst ); }; void ShellResource::_GetAutoFmtNameLst() const { - SvStringsDtor** ppLst = (SvStringsDtor**)&pAutoFmtNameLst; - *ppLst = new SvStringsDtor( STR_AUTOFMTREDL_END ); - ImpAutoFmtNameListLoader aTmp( **ppLst ); + std::vector<String>* pLst(pAutoFmtNameLst); + pLst = new std::vector<String>; + pLst->reserve(STR_AUTOFMTREDL_END); + ImpAutoFmtNameListLoader aTmp( *pLst ); } -ImpAutoFmtNameListLoader::ImpAutoFmtNameListLoader( SvStringsDtor& rLst ) +ImpAutoFmtNameListLoader::ImpAutoFmtNameListLoader( std::vector<String>& rLst ) : Resource( ResId(RID_SHELLRES_AUTOFMTSTRS, *pSwResMgr) ) { for( sal_uInt16 n = 0; n < STR_AUTOFMTREDL_END; ++n ) { - String* p = new String( ResId( n + 1, *pSwResMgr) ); + String p(ResId(n + 1, *pSwResMgr)); if(STR_AUTOFMTREDL_TYPO == n) { #ifdef WNT //fuer Windows Sonderbehandlung, da MS hier ein paar Zeichen im Dialogfont vergessen hat - p->SearchAndReplace(C2S("%1"), C2S(",,")); - p->SearchAndReplace(C2S("%2"), C2S("''")); + p.SearchAndReplace(C2S("%1"), C2S(",,")); + p.SearchAndReplace(C2S("%2"), C2S("''")); #else const SvtSysLocale aSysLocale; const LocaleDataWrapper& rLclD = aSysLocale.GetLocaleData(); //unter richtigen Betriebssystemen funktioniert es auch so - p->SearchAndReplace(C2S("%1"), rLclD.getDoubleQuotationMarkStart()); - p->SearchAndReplace(C2S("%2"), rLclD.getDoubleQuotationMarkEnd()); + p.SearchAndReplace(C2S("%1"), rLclD.getDoubleQuotationMarkStart()); + p.SearchAndReplace(C2S("%2"), rLclD.getDoubleQuotationMarkEnd()); #endif } - rLst.Insert( p, n ); + rLst.insert(rLst.begin() + n, p); } FreeResource(); } |