sw/source/ui/utlui/initui.cxx |   23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

New commits:
commit cad9afa15f53d547733fa55f1353772f6d696611
Author: August Sodora <aug...@gmail.com>
Date:   Fri Jan 13 22:41:12 2012 -0500

    SvStringsDtor->std::vector

diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx
index dacbb6e..1a3e6d4 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();
 }
_______________________________________________
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to