[Libreoffice-commits] .: 17 commits - basic/source comphelper/inc comphelper/source dbaccess/source desktop/source editeng/inc editeng/source filter/source formula/source framework/inc framework/Library_fwk.mk framework/source oox/source reportdesign/inc reportdesign/source rsc/source salhelper/source sax/source sc/inc sc/source sd/source svtools/source svx/inc svx/source sw/inc sw/source tools/inc tools/source ucbhelper/source unusedcode.easy uui/source vbahelper/inc vbahelper/source xmloff/inc xmloff/source

Caolán McNamara caolan at kemper.freedesktop.org
Mon Apr 2 06:54:20 PDT 2012


 basic/source/classes/sbunoobj.cxx                      |   26 -
 basic/source/runtime/iosys.cxx                         |   22 -
 basic/source/uno/dlgcont.cxx                           |   22 -
 comphelper/inc/comphelper/propertycontainerhelper.hxx  |    7 
 comphelper/source/property/propertycontainerhelper.cxx |   16 
 dbaccess/source/core/inc/core_resource.hxx             |    1 
 dbaccess/source/core/resource/core_resource.cxx        |   13 
 desktop/source/deployment/misc/dp_resource.cxx         |    6 
 editeng/inc/editeng/numitem.hxx                        |   12 
 editeng/source/editeng/editattr.hxx                    |    2 
 editeng/source/editeng/editdoc.cxx                     |   12 
 editeng/source/editeng/editdoc.hxx                     |    1 
 editeng/source/misc/SvXMLAutoCorrectImport.cxx         |    6 
 filter/source/msfilter/msvbahelper.cxx                 |   19 
 formula/source/core/inc/core_resource.hxx              |    1 
 formula/source/core/resource/core_resource.cxx         |   11 
 formula/source/ui/inc/ModuleHelper.hxx                 |    1 
 formula/source/ui/resource/ModuleHelper.cxx            |   13 
 framework/Library_fwk.mk                               |    2 
 framework/inc/services/taskcreatorsrv.hxx              |   71 +--
 framework/inc/xml/saxnamespacefilter.hxx               |    4 
 framework/inc/xml/xmlnamespaces.hxx                    |    1 
 framework/source/classes/menumanager.cxx               |    6 
 framework/source/classes/taskcreator.cxx               |   10 
 framework/source/constant/contenthandler.cxx           |   41 -
 framework/source/constant/frameloader.cxx              |   41 -
 framework/source/dispatch/closedispatcher.cxx          |   24 -
 framework/source/fwe/xml/saxnamespacefilter.cxx        |   11 
 framework/source/fwe/xml/xmlnamespaces.cxx             |    7 
 framework/source/fwi/uielement/constitemcontainer.cxx  |    6 
 framework/source/fwi/uielement/rootitemcontainer.cxx   |    4 
 framework/source/helper/uielementwrapperbase.cxx       |   12 
 framework/source/inc/constant/contenthandler.hxx       |   50 --
 framework/source/inc/constant/frameloader.hxx          |   50 --
 framework/source/loadenv/loadenv.cxx                   |   26 -
 framework/source/services/autorecovery.cxx             |  355 ++++++++---------
 framework/source/services/taskcreatorsrv.cxx           |   27 -
 oox/source/drawingml/table/tableproperties.cxx         |    9 
 reportdesign/inc/ModuleHelper.hxx                      |    1 
 reportdesign/source/core/sdr/ModuleHelper.cxx          |   15 
 rsc/source/parser/rscibas.cxx                          |    4 
 salhelper/source/timer.cxx                             |   24 -
 sax/source/tools/fastserializer.cxx                    |   71 +--
 sax/source/tools/fastserializer.hxx                    |   10 
 sc/inc/externalrefmgr.hxx                              |    1 
 sc/source/core/tool/address.cxx                        |    2 
 sc/source/core/tool/rangeutl.cxx                       |    2 
 sc/source/ui/docshell/impex.cxx                        |   14 
 sc/source/ui/vba/vbahelper.cxx                         |    8 
 sc/source/ui/vba/vbaworkbook.cxx                       |   25 -
 sc/source/ui/vba/vbaworksheet.cxx                      |    4 
 sc/source/ui/vba/vbaworksheet.hxx                      |    3 
 sc/source/ui/view/editsh.cxx                           |    3 
 sc/source/ui/view/tabvwshc.cxx                         |    2 
 sd/source/ui/dlg/TemplateScanner.cxx                   |   38 -
 sd/source/ui/tools/EventMultiplexer.cxx                |   21 -
 sd/source/ui/view/drviews3.cxx                         |    4 
 svtools/source/uno/toolboxcontroller.cxx               |   13 
 svx/inc/svx/clipfmtitem.hxx                            |    9 
 svx/inc/svx/dbtoolsclient.hxx                          |    1 
 svx/source/dialog/frmsel.cxx                           |    7 
 svx/source/form/dbtoolsclient.cxx                      |   12 
 svx/source/form/navigatortree.cxx                      |    7 
 svx/source/items/clipfmtitem.cxx                       |   15 
 svx/source/svdraw/svdotext.cxx                         |    2 
 svx/source/xoutdev/xattr.cxx                           |    4 
 sw/inc/SwRewriter.hxx                                  |   13 
 sw/inc/fmtftntx.hxx                                    |   12 
 sw/inc/ftninfo.hxx                                     |   12 
 sw/inc/unosett.hxx                                     |    3 
 sw/source/core/crsr/bookmrk.cxx                        |   17 
 sw/source/core/crsr/crossrefbookmark.cxx               |   16 
 sw/source/core/crsr/findcoll.cxx                       |    6 
 sw/source/core/doc/docredln.cxx                        |   14 
 sw/source/core/doc/poolfmt.cxx                         |    2 
 sw/source/core/edit/eddel.cxx                          |    2 
 sw/source/core/edit/edfcol.cxx                         |    2 
 sw/source/core/inc/bookmrk.hxx                         |    7 
 sw/source/core/inc/crossrefbookmark.hxx                |    2 
 sw/source/core/undo/SwRewriter.cxx                     |   15 
 sw/source/core/undo/SwUndoFmt.cxx                      |   20 
 sw/source/core/undo/SwUndoPageDesc.cxx                 |   12 
 sw/source/core/undo/unattr.cxx                         |    2 
 sw/source/core/undo/unbkmk.cxx                         |    2 
 sw/source/core/undo/undel.cxx                          |  152 ++++++-
 sw/source/core/undo/undobj.cxx                         |  108 -----
 sw/source/core/undo/undobj1.cxx                        |    4 
 sw/source/core/undo/undoflystrattr.cxx                 |    2 
 sw/source/core/undo/unfmco.cxx                         |    2 
 sw/source/core/undo/unins.cxx                          |   18 
 sw/source/core/undo/unnum.cxx                          |    2 
 sw/source/core/undo/unovwr.cxx                         |    2 
 sw/source/core/undo/untbl.cxx                          |    6 
 sw/source/core/unocore/unobkm.cxx                      |    6 
 sw/source/core/unocore/unocrsrhelper.cxx               |    4 
 sw/source/core/unocore/unosett.cxx                     |   16 
 sw/source/core/unocore/unostyle.cxx                    |    4 
 sw/source/filter/html/htmlftn.cxx                      |    6 
 sw/source/filter/rtf/rtfnum.cxx                        |    8 
 sw/source/filter/ww8/rtfexport.cxx                     |    4 
 sw/source/filter/ww8/wrtw8num.cxx                      |    4 
 sw/source/ui/app/docst.cxx                             |    2 
 sw/source/ui/app/docstyle.cxx                          |    2 
 sw/source/ui/dbui/mmconfigitem.cxx                     |   15 
 sw/source/ui/dochdl/swdtflvr.cxx                       |    6 
 sw/source/ui/docvw/AnnotationWin.cxx                   |    4 
 sw/source/ui/docvw/PostItMgr.cxx                       |    4 
 sw/source/ui/docvw/SidebarTxtControl.cxx               |    2 
 sw/source/ui/index/swuiidxmrk.cxx                      |    4 
 sw/source/ui/lingu/olmenu.cxx                          |    6 
 sw/source/ui/misc/redlndlg.cxx                         |    4 
 sw/source/ui/ribbar/drawbase.cxx                       |    2 
 sw/source/ui/shells/basesh.cxx                         |    6 
 sw/source/ui/shells/textsh.cxx                         |    4 
 sw/source/ui/uiview/view2.cxx                          |    2 
 sw/source/ui/uiview/viewsrch.cxx                       |    6 
 sw/source/ui/utlui/content.cxx                         |    8 
 sw/source/ui/wrtsh/wrtsh1.cxx                          |   14 
 sw/source/ui/wrtsh/wrtsh2.cxx                          |    2 
 tools/inc/tools/svborder.hxx                           |    1 
 tools/source/generic/svborder.cxx                      |   18 
 ucbhelper/source/client/contentbroker.cxx              |    9 
 unusedcode.easy                                        |    6 
 uui/source/iahndl-authentication.cxx                   |    3 
 uui/source/logindlg.cxx                                |   10 
 uui/source/logindlg.hxx                                |    2 
 vbahelper/inc/vbahelper/vbaglobalbase.hxx              |    1 
 vbahelper/source/vbahelper/vbaglobalbase.cxx           |   24 -
 vbahelper/source/vbahelper/vbahelper.cxx               |   16 
 xmloff/inc/xmloff/xmlimppr.hxx                         |   14 
 xmloff/source/style/xmlimppr.cxx                       |   11 
 131 files changed, 831 insertions(+), 1154 deletions(-)

New commits:
commit 791f27683311e487947b0464a0cb132b19fd0e12
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 2 14:52:47 2012 +0100

    Resolves: fdo#48129 maLangStr can have trailing nulls

diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx
index 40ee8dd..df233cc 100644
--- a/rsc/source/parser/rscibas.cxx
+++ b/rsc/source/parser/rscibas.cxx
@@ -105,8 +105,8 @@ void RscLangEnum::Init( RscNameTable& rNames )
                  pLangEntry->mnLang,
                  MsLangId::convertLanguageToIsoByteString( pLangEntry->mnLang ).getStr() );
 #endif
-        rtl::OString aLang = pLangEntry->maLangStr;
-        rtl::OString aCountry = pLangEntry->maCountry;
+        rtl::OString aLang(pLangEntry->maLangStr, strlen(pLangEntry->maLangStr));
+        rtl::OString aCountry(pLangEntry->maCountry, strlen(pLangEntry->maCountry));
         if ( aCountry.isEmpty() || aLang.equalsIgnoreAsciiCase(aCountry) )
         {
             SetConstant( rNames.Put( aLang.getStr(), CONSTNAME, mnLangId ), mnLangId );
commit ecf2926ce13db8244a198de9f69bcefcae68b4b6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 2 11:05:50 2012 +0100

    convert SvxNumberFormat to rtl::OUString

diff --git a/editeng/inc/editeng/numitem.hxx b/editeng/inc/editeng/numitem.hxx
index ea34a7f..cf7d344 100644
--- a/editeng/inc/editeng/numitem.hxx
+++ b/editeng/inc/editeng/numitem.hxx
@@ -117,8 +117,8 @@ public:
     };
 
 private:
-    String              sPrefix;
-    String              sSuffix;
+    rtl::OUString       sPrefix;
+    rtl::OUString       sSuffix;
 
     SvxAdjust           eNumAdjust;
 
@@ -182,10 +182,10 @@ public:
 
     void            SetNumAdjust(SvxAdjust eSet) {eNumAdjust = eSet;}
     SvxAdjust       GetNumAdjust() const {return eNumAdjust;}
-    void            SetPrefix(const String& rSet) { sPrefix = rSet;}
-    const String&   GetPrefix() const { return sPrefix;}
-    void            SetSuffix(const String& rSet) { sSuffix = rSet;}
-    const String&   GetSuffix() const { return sSuffix;}
+    void            SetPrefix(const rtl::OUString& rSet) { sPrefix = rSet;}
+    const rtl::OUString&   GetPrefix() const { return sPrefix;}
+    void            SetSuffix(const rtl::OUString& rSet) { sSuffix = rSet;}
+    const rtl::OUString&   GetSuffix() const { return sSuffix;}
 
     void                    SetCharFmtName(const String& rSet){ sCharStyleName = rSet; }
     virtual const String&   GetCharFmtName()const;
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index 7e30267..44786d8 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -1933,7 +1933,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
             pNewRule->Set( 1, aFmt );
 
             aFmt.SetNumberingType(SVX_NUM_CHARS_LOWER_LETTER);
-            aFmt.SetSuffix( ')');
+            aFmt.SetSuffix(rtl::OUString(static_cast<sal_Unicode>(')')));
             aFmt.SetIncludeUpperLevels( 1 );
             aFmt.SetStart( 3 );
 
diff --git a/sw/source/filter/rtf/rtfnum.cxx b/sw/source/filter/rtf/rtfnum.cxx
index dbd051c..da74753 100644
--- a/sw/source/filter/rtf/rtfnum.cxx
+++ b/sw/source/filter/rtf/rtfnum.cxx
@@ -1015,21 +1015,21 @@ NUMATTR_SETUNDERLINE:
     // Punkt ist, dann will RTF den Punkt als Trenner zwischen den Ebenen
     // haben - das haben wir aber schon als default
     if( 1 < pCurNumFmt->GetIncludeUpperLevels() &&
-        1 == pCurNumFmt->GetPrefix().Len() &&
-        '.' == pCurNumFmt->GetPrefix().GetChar( 0 ) &&
+        1 == pCurNumFmt->GetPrefix().getLength() &&
+        '.' == pCurNumFmt->GetPrefix()[0] &&
         SVX_NUM_CHAR_SPECIAL != pCurNumFmt->GetNumberingType() )
         pCurNumFmt->SetPrefix( aEmptyStr );
 
     // falls das ein nicht numerierter Absatz mit ein Prefix-Text mit
     // einem Zeichen ist, dann setze den als Bulletzeichen
     if( pCurNumFmt->GetCharFmt() && SVX_NUM_NUMBER_NONE == pCurNumFmt->GetNumberingType() &&
-        3 == nListNo && 1 == pCurNumFmt->GetPrefix().Len() )
+        3 == nListNo && 1 == pCurNumFmt->GetPrefix().getLength() )
     {
         SwCharFmt* pChFmt = pCurNumFmt->GetCharFmt();
         pCurNumFmt->SetNumberingType(SVX_NUM_CHAR_SPECIAL);
         pCurNumFmt->SetBulletFont( FindFontOfItem( pChFmt->GetFont() ) );
 
-        pCurNumFmt->SetBulletChar( pCurNumFmt->GetPrefix().GetChar( 0 ) );
+        pCurNumFmt->SetBulletChar( pCurNumFmt->GetPrefix()[0] );
         pCurNumFmt->SetPrefix( aEmptyStr );
 
         // den Font oder sogar das gesamte CharFormat loeschen?
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 93f8313..9d9cc37 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -198,8 +198,8 @@ static bool IsExportNumRule( const SwNumRule& rRule, sal_uInt8* pEnd = 0 )
 
     for( nLvl = 0; nLvl < nEnd; ++nLvl )
         if( SVX_NUM_NUMBER_NONE != ( pNFmt = &rRule.Get( nLvl ))
-                ->GetNumberingType() || pNFmt->GetPrefix().Len() ||
-                (pNFmt->GetSuffix().Len() && pNFmt->GetSuffix() != aDotStr ))
+                ->GetNumberingType() || !pNFmt->GetPrefix().isEmpty() ||
+                (!pNFmt->GetSuffix().isEmpty() && !pNFmt->GetSuffix().equals(aDotStr)) )
             break;
 
     if( pEnd )
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index b1b4714..068a27d 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -412,7 +412,7 @@ void MSWordExportBase::AbstractNumberingDefinitions()
                         xub_StrLen nFnd = sNumStr.Search( sSrch );
                         if( STRING_NOTFOUND != nFnd )
                         {
-                            *pLvlPos = (sal_uInt8)(nFnd + rFmt.GetPrefix().Len() + 1 );
+                            *pLvlPos = (sal_uInt8)(nFnd + rFmt.GetPrefix().getLength() + 1 );
                             ++pLvlPos;
                             sNumStr.SetChar( nFnd, (char)i );
                         }
@@ -429,7 +429,7 @@ void MSWordExportBase::AbstractNumberingDefinitions()
                     }
                 }
 
-                if( rFmt.GetPrefix().Len() )
+                if( !rFmt.GetPrefix().isEmpty() )
                     sNumStr.Insert( rFmt.GetPrefix(), 0 );
                 sNumStr += rFmt.GetSuffix();
             }
commit 60722c31373daaaf195dbf1ebd3414ca0db696c3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 2 10:47:23 2012 +0100

    convert Suffix/Prefix to rtl::OUString

diff --git a/sw/inc/fmtftntx.hxx b/sw/inc/fmtftntx.hxx
index 4f27387..748d53b 100644
--- a/sw/inc/fmtftntx.hxx
+++ b/sw/inc/fmtftntx.hxx
@@ -46,8 +46,8 @@ enum SwFtnEndPosEnum
 
 class SW_DLLPUBLIC SwFmtFtnEndAtTxtEnd : public SfxEnumItem
 {
-    String      sPrefix;
-    String      sSuffix;
+    rtl::OUString sPrefix;
+    rtl::OUString sSuffix;
     SvxNumberType aFmt;
     sal_uInt16      nOffset;
 
@@ -87,11 +87,11 @@ public:
     sal_uInt16 GetOffset() const                { return nOffset; }
     void SetOffset( sal_uInt16 nOff )           { nOffset = nOff; }
 
-    const String& GetPrefix() const         { return sPrefix; }
-    void SetPrefix(const String& rSet)      { sPrefix = rSet; }
+    const rtl::OUString& GetPrefix() const      { return sPrefix; }
+    void SetPrefix(const rtl::OUString& rSet)   { sPrefix = rSet; }
 
-    const String& GetSuffix() const         { return sSuffix; }
-    void SetSuffix(const String& rSet)      { sSuffix = rSet; }
+    const rtl::OUString& GetSuffix() const      { return sSuffix; }
+    void SetSuffix(const rtl::OUString& rSet)   { sSuffix = rSet; }
 };
 
 class SW_DLLPUBLIC SwFmtFtnAtTxtEnd : public SwFmtFtnEndAtTxtEnd
diff --git a/sw/inc/ftninfo.hxx b/sw/inc/ftninfo.hxx
index 95b626c..cccd6f7 100644
--- a/sw/inc/ftninfo.hxx
+++ b/sw/inc/ftninfo.hxx
@@ -42,8 +42,8 @@ class SW_DLLPUBLIC SwEndNoteInfo : public SwClient
 {
     SwDepend    aPageDescDep;
     SwDepend    aCharFmtDep, aAnchorCharFmtDep;
-    String      sPrefix;
-    String      sSuffix;
+    rtl::OUString sPrefix;
+    rtl::OUString sSuffix;
 protected:
     bool        m_bEndNote;
    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
@@ -74,11 +74,11 @@ public:
     SwEndNoteInfo( SwTxtFmtColl *pTxtColl = 0);
     SwEndNoteInfo(const SwEndNoteInfo&);
 
-    const String& GetPrefix() const         { return sPrefix; }
-    const String& GetSuffix() const         { return sSuffix; }
+    const rtl::OUString& GetPrefix() const  { return sPrefix; }
+    const rtl::OUString& GetSuffix() const  { return sSuffix; }
 
-    void SetPrefix(const String& rSet)      { sPrefix = rSet; }
-    void SetSuffix(const String& rSet)      { sSuffix = rSet; }
+    void SetPrefix(const rtl::OUString& rSet) { sPrefix = rSet; }
+    void SetSuffix(const rtl::OUString& rSet) { sSuffix = rSet; }
     void ReleaseCollection() { if ( GetRegisteredInNonConst() ) GetRegisteredInNonConst()->Remove( this ); }
 };
 
diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx
index ba2c5a7..4ca1581 100644
--- a/sw/source/filter/html/htmlftn.cxx
+++ b/sw/source/filter/html/htmlftn.cxx
@@ -515,15 +515,15 @@ sal_uInt16 lcl_html_fillEndNoteInfo( const SwEndNoteInfo& rInfo,
     }
     if( rInfo.nFtnOffset > 0 )
     {
-        pParts[1] = String::CreateFromInt32( (sal_Int32)rInfo.nFtnOffset );
+        pParts[1] = rtl::OUString::valueOf(static_cast<sal_Int32>(rInfo.nFtnOffset));
         nParts = 2;
     }
-    if( rInfo.GetPrefix().Len() > 0 )
+    if( !rInfo.GetPrefix().isEmpty() )
     {
         pParts[2] = rInfo.GetPrefix();
         nParts = 3;
     }
-    if( rInfo.GetSuffix().Len() > 0 )
+    if( !rInfo.GetSuffix().isEmpty() )
     {
         pParts[3] = rInfo.GetSuffix();
         nParts = 4;
commit e9a467cafbffb380c54e90b24f9ee20cd4adc7e8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 2 09:38:26 2012 +0100

    remove static objects from static_initialization_and_destruction chain

diff --git a/dbaccess/source/core/inc/core_resource.hxx b/dbaccess/source/core/inc/core_resource.hxx
index 42677cd..81e8baf 100644
--- a/dbaccess/source/core/inc/core_resource.hxx
+++ b/dbaccess/source/core/inc/core_resource.hxx
@@ -51,7 +51,6 @@ namespace dbaccess
     class ResourceManager
     {
         friend class OModuleClient;
-        static ::osl::Mutex s_aMutex;       /// access safety
         static sal_Int32    s_nClients;     /// number of registered clients
         static ResMgr*  m_pImpl;
 
diff --git a/dbaccess/source/core/resource/core_resource.cxx b/dbaccess/source/core/resource/core_resource.cxx
index fdaa168..e42ad53 100644
--- a/dbaccess/source/core/resource/core_resource.cxx
+++ b/dbaccess/source/core/resource/core_resource.cxx
@@ -34,7 +34,7 @@
 // ---- needed as long as we have no contexts for components ---
 #include <vcl/svapp.hxx>
 //---------------------------------------------------
-
+#include <rtl/instance.hxx>
 #include <svl/solar.hrc>
 
 //.........................................................................
@@ -44,7 +44,12 @@ namespace dbaccess
     //==================================================================
     //= ResourceManager
     //==================================================================
-    ::osl::Mutex    ResourceManager::s_aMutex;
+    namespace
+    {
+        // access safety
+        struct theResourceManagerMutex : public rtl::Static< osl::Mutex, theResourceManagerMutex > {};
+    }
+
     sal_Int32       ResourceManager::s_nClients = 0;
     ResMgr*         ResourceManager::m_pImpl = NULL;
 
@@ -92,14 +97,14 @@ namespace dbaccess
     //-------------------------------------------------------------------------
     void ResourceManager::registerClient()
     {
-        ::osl::MutexGuard aGuard(s_aMutex);
+        ::osl::MutexGuard aGuard(theResourceManagerMutex::get());
         ++s_nClients;
     }
 
     //-------------------------------------------------------------------------
     void ResourceManager::revokeClient()
     {
-        ::osl::MutexGuard aGuard(s_aMutex);
+        ::osl::MutexGuard aGuard(theResourceManagerMutex::get());
         if (!--s_nClients && m_pImpl)
         {
             delete m_pImpl;
diff --git a/formula/source/core/inc/core_resource.hxx b/formula/source/core/inc/core_resource.hxx
index 6dc198d..a78fc39 100644
--- a/formula/source/core/inc/core_resource.hxx
+++ b/formula/source/core/inc/core_resource.hxx
@@ -43,7 +43,6 @@ namespace formula
     class ResourceManager
     {
         friend class OModuleClient;
-        static ::osl::Mutex s_aMutex;       /// access safety
         static sal_Int32    s_nClients;     /// number of registered clients
         static ResMgr*  m_pImpl;
 
diff --git a/formula/source/core/resource/core_resource.cxx b/formula/source/core/resource/core_resource.cxx
index 9521db8..e0c31a6 100644
--- a/formula/source/core/resource/core_resource.cxx
+++ b/formula/source/core/resource/core_resource.cxx
@@ -32,6 +32,7 @@
 
 // ---- needed as long as we have no contexts for components ---
 #include <vcl/svapp.hxx>
+#include <rtl/instance.hxx>
 #include <svl/solar.hrc>
 
 //.........................................................................
@@ -41,7 +42,11 @@ namespace formula
     //==================================================================
     //= ResourceManager
     //==================================================================
-    ::osl::Mutex    ResourceManager::s_aMutex;
+    namespace
+    {
+        // access safety
+        struct theResourceManagerMutex : public rtl::Static< osl::Mutex, theResourceManagerMutex > {};
+    }
     sal_Int32       ResourceManager::s_nClients = 0;
     ResMgr*         ResourceManager::m_pImpl = NULL;
 
@@ -59,14 +64,14 @@ namespace formula
     //-------------------------------------------------------------------------
     void ResourceManager::registerClient()
     {
-        ::osl::MutexGuard aGuard(s_aMutex);
+        ::osl::MutexGuard aGuard(theResourceManagerMutex::get());
         ++s_nClients;
     }
 
     //-------------------------------------------------------------------------
     void ResourceManager::revokeClient()
     {
-        ::osl::MutexGuard aGuard(s_aMutex);
+        ::osl::MutexGuard aGuard(theResourceManagerMutex::get());
         if (!--s_nClients && m_pImpl)
         {
             delete m_pImpl;
diff --git a/formula/source/ui/inc/ModuleHelper.hxx b/formula/source/ui/inc/ModuleHelper.hxx
index 6599c38..80944de 100644
--- a/formula/source/ui/inc/ModuleHelper.hxx
+++ b/formula/source/ui/inc/ModuleHelper.hxx
@@ -49,7 +49,6 @@ namespace formula
             // not implemented. OModule is a static class
 
     protected:
-        static ::osl::Mutex s_aMutex;       /// access safety
         static sal_Int32    s_nClients;     /// number of registered clients
         static OModuleImpl* s_pImpl;        /// impl class. lives as long as at least one client for the module is registered
 
diff --git a/formula/source/ui/resource/ModuleHelper.cxx b/formula/source/ui/resource/ModuleHelper.cxx
index a0c2ae6..f30f588 100644
--- a/formula/source/ui/resource/ModuleHelper.cxx
+++ b/formula/source/ui/resource/ModuleHelper.cxx
@@ -32,13 +32,14 @@
 #include <com/sun/star/util/XMacroExpander.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
+#include <rtl/instance.hxx>
 #include <rtl/uri.hxx>
 #include <tools/debug.hxx>
 #include <svl/solar.hrc>
 
 #define EXPAND_PROTOCOL     "vnd.sun.star.expand:"
 #define ENTER_MOD_METHOD()  \
-    ::osl::MutexGuard aGuard(s_aMutex); \
+    ::osl::MutexGuard aGuard(theOModuleMutex::get()); \
     ensureImpl()
 
 //.........................................................................
@@ -98,7 +99,11 @@ ResMgr* OModuleImpl::getResManager()
 //=========================================================================
 //= OModule
 //=========================================================================
-::osl::Mutex    OModule::s_aMutex;
+namespace
+{
+    // access safety
+    struct theOModuleMutex : public rtl::Static< osl::Mutex, theOModuleMutex > {};
+}
 sal_Int32       OModule::s_nClients = 0;
 OModuleImpl*    OModule::s_pImpl = NULL;
 //-------------------------------------------------------------------------
@@ -111,14 +116,14 @@ ResMgr* OModule::getResManager()
 //-------------------------------------------------------------------------
 void OModule::registerClient()
 {
-    ::osl::MutexGuard aGuard(s_aMutex);
+    ::osl::MutexGuard aGuard(theOModuleMutex::get());
     ++s_nClients;
 }
 
 //-------------------------------------------------------------------------
 void OModule::revokeClient()
 {
-    ::osl::MutexGuard aGuard(s_aMutex);
+    ::osl::MutexGuard aGuard(theOModuleMutex::get());
     if (!--s_nClients && s_pImpl)
     {
         delete s_pImpl;
diff --git a/reportdesign/inc/ModuleHelper.hxx b/reportdesign/inc/ModuleHelper.hxx
index b3ed017..ad1cb67 100644
--- a/reportdesign/inc/ModuleHelper.hxx
+++ b/reportdesign/inc/ModuleHelper.hxx
@@ -50,7 +50,6 @@ namespace rptui
             // not implemented. OModule is a static class
 
     protected:
-        static ::osl::Mutex s_aMutex;       /// access safety
         static sal_Int32    s_nClients;     /// number of registered clients
         static OModuleImpl* s_pImpl;        /// impl class. lives as long as at least one client for the module is registered
 
diff --git a/reportdesign/source/core/sdr/ModuleHelper.cxx b/reportdesign/source/core/sdr/ModuleHelper.cxx
index 9c78d9e..58a2860 100644
--- a/reportdesign/source/core/sdr/ModuleHelper.cxx
+++ b/reportdesign/source/core/sdr/ModuleHelper.cxx
@@ -32,13 +32,14 @@
 #include <com/sun/star/util/XMacroExpander.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
+#include <rtl/instance.hxx>
 #include <rtl/uri.hxx>
 #include <tools/debug.hxx>
 #include <svl/solar.hrc>
 
 #define EXPAND_PROTOCOL     "vnd.sun.star.expand:"
 #define ENTER_MOD_METHOD()  \
-    ::osl::MutexGuard aGuard(s_aMutex); \
+    ::osl::MutexGuard aGuard(theOModuleMutex::get()); \
     ensureImpl()
 
 //.........................................................................
@@ -98,7 +99,13 @@ ResMgr* OModuleImpl::getResManager()
 //=========================================================================
 //= OModule
 //=========================================================================
-::osl::Mutex    OModule::s_aMutex;
+
+namespace
+{
+    // access safety
+    struct theOModuleMutex : public rtl::Static< osl::Mutex, theOModuleMutex > {};
+}
+
 sal_Int32       OModule::s_nClients = 0;
 OModuleImpl*    OModule::s_pImpl = NULL;
 //-------------------------------------------------------------------------
@@ -111,14 +118,14 @@ ResMgr* OModule::getResManager()
 //-------------------------------------------------------------------------
 void OModule::registerClient()
 {
-    ::osl::MutexGuard aGuard(s_aMutex);
+    ::osl::MutexGuard aGuard(theOModuleMutex::get());
     ++s_nClients;
 }
 
 //-------------------------------------------------------------------------
 void OModule::revokeClient()
 {
-    ::osl::MutexGuard aGuard(s_aMutex);
+    ::osl::MutexGuard aGuard(theOModuleMutex::get());
     if (!--s_nClients && s_pImpl)
     {
         delete s_pImpl;
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index ff2929f..eecae51 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -89,9 +89,9 @@ class StarBASIC;
 
 namespace
 {
-    const String SYLK_LF = String::CreateFromAscii("\x1b :");
-    const String DOUBLE_SEMICOLON = String::CreateFromAscii(";;");
-    const String DOUBLE_DOUBLEQUOTE = String::CreateFromAscii("\"\"");
+    const char SYLK_LF[]  = "\x1b :";
+    const char DOUBLE_SEMICOLON[] = ";;";
+    const char DOUBLE_DOUBLEQUOTE[] = "\"\"";
 }
 
 enum SylkVersion
@@ -624,11 +624,11 @@ void lcl_UnescapeSylk( String & rString, SylkVersion eVersion )
     // Older versions quoted the string and doubled embedded quotes, but not
     // the semicolons, which was plain wrong.
     if (eVersion >= SYLK_OOO32)
-        rString.SearchAndReplaceAll( DOUBLE_SEMICOLON, ';' );
+        rString.SearchAndReplaceAll( rtl::OUString(DOUBLE_SEMICOLON), ';' );
     else
-        rString.SearchAndReplaceAll( DOUBLE_DOUBLEQUOTE, '"' );
+        rString.SearchAndReplaceAll( rtl::OUString(DOUBLE_DOUBLEQUOTE), '"' );
 
-    rString.SearchAndReplaceAll( SYLK_LF, _LF );
+    rString.SearchAndReplaceAll( rtl::OUString(SYLK_LF), _LF );
 }
 
 static const sal_Unicode* lcl_ScanSylkString( const sal_Unicode* p,
@@ -1857,7 +1857,7 @@ sal_Bool ScImportExport::Doc2Sylk( SvStream& rStrm )
                 case CELLTYPE_EDIT:
                 hasstring:
                     pDoc->GetString( nCol, nRow, aRange.aStart.Tab(), aCellStr );
-                    aCellStr.SearchAndReplaceAll( _LF, SYLK_LF );
+                    aCellStr.SearchAndReplaceAll( _LF, rtl::OUString(SYLK_LF) );
 
                     aBufStr.AssignAscii(RTL_CONSTASCII_STRINGPARAM( "C;X" ));
                     aBufStr += String::CreateFromInt32( c );
diff --git a/sd/source/ui/dlg/TemplateScanner.cxx b/sd/source/ui/dlg/TemplateScanner.cxx
index 20013b0..c0adcfe 100644
--- a/sd/source/ui/dlg/TemplateScanner.cxx
+++ b/sd/source/ui/dlg/TemplateScanner.cxx
@@ -52,20 +52,20 @@ using namespace ::com::sun::star::uno;
 
 namespace {
 
-const ::rtl::OUString TITLE(RTL_CONSTASCII_USTRINGPARAM ("Title"));
-const ::rtl::OUString TARGET_DIR_URL(RTL_CONSTASCII_USTRINGPARAM ("TargetDirURL"));
-const ::rtl::OUString DESCRIPTION(RTL_CONSTASCII_USTRINGPARAM ("TypeDescription"));
-const ::rtl::OUString TARGET_URL(RTL_CONSTASCII_USTRINGPARAM ("TargetURL"));
+const char TITLE[] = "Title";
+const char TARGET_DIR_URL[] = "TargetDirURL";
+const char DESCRIPTION[] = "TypeDescription";
+const char TARGET_URL[] = "TargetURL";
 
-const ::rtl::OUString DOCTEMPLATES(RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.frame.DocumentTemplates"));
+const char DOCTEMPLATES[] = "com.sun.star.frame.DocumentTemplates";
 
 //  These strings are used to find impress templates in the tree of
 //  template files.  Should probably be determined dynamically.
-const ::rtl::OUString IMPRESS_BIN_TEMPLATE(RTL_CONSTASCII_USTRINGPARAM ("application/vnd.stardivision.impress"));
-const ::rtl::OUString IMPRESS_XML_TEMPLATE = MIMETYPE_VND_SUN_XML_IMPRESS;
+const char IMPRESS_BIN_TEMPLATE[] = "application/vnd.stardivision.impress";
+const char IMPRESS_XML_TEMPLATE[] = MIMETYPE_VND_SUN_XML_IMPRESS_ASCII;
 // The following id comes from the bugdoc in #i2764#.
-const ::rtl::OUString IMPRESS_XML_TEMPLATE_B(RTL_CONSTASCII_USTRINGPARAM ("Impress 2.0"));
-const ::rtl::OUString IMPRESS_XML_TEMPLATE_OASIS = MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION;
+const char IMPRESS_XML_TEMPLATE_B[] = "Impress 2.0";
+const char IMPRESS_XML_TEMPLATE_OASIS[] = MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII;
 
 
 class FolderDescriptor
@@ -225,7 +225,7 @@ TemplateScanner::State TemplateScanner::GetTemplateRoot (void)
     if (xFactory.is())
     {
         Reference<frame::XDocumentTemplates> xTemplates (
-            xFactory->createInstance (DOCTEMPLATES), UNO_QUERY);
+            xFactory->createInstance (rtl::OUString(DOCTEMPLATES)), UNO_QUERY);
         DBG_ASSERT (xTemplates.is(), "TemplateScanner::GetTemplateRoot: xTemplates is NULL");
 
         if (xTemplates.is())
@@ -253,9 +253,9 @@ TemplateScanner::State TemplateScanner::InitializeEntryScanning (void)
         //  We are interested only in three properties: the entry's name,
         //  its URL, and its content type.
         Sequence<rtl::OUString> aProps (3);
-        aProps[0] = TITLE;
-        aProps[1] = TARGET_URL;
-        aProps[2] = DESCRIPTION;
+        aProps[0] = rtl::OUString(TITLE);
+        aProps[1] = rtl::OUString(TARGET_URL);
+        aProps[2] = rtl::OUString(DESCRIPTION);
 
         //  Create a cursor to iterate over the templates in this folders.
         ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_DOCUMENTS_ONLY;
@@ -294,10 +294,10 @@ TemplateScanner::State TemplateScanner::ScanEntry (void)
                 //  add a new entry to the resulting list (which is created
                 //  first if necessary).
                 if (    (sContentType == MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE)
-                    ||  (sContentType == IMPRESS_XML_TEMPLATE_OASIS)
-                    ||  (sContentType == IMPRESS_BIN_TEMPLATE)
-                    ||  (sContentType == IMPRESS_XML_TEMPLATE)
-                    ||  (sContentType == IMPRESS_XML_TEMPLATE_B))
+                    ||  (sContentType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(IMPRESS_XML_TEMPLATE_OASIS)))
+                    ||  (sContentType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(IMPRESS_BIN_TEMPLATE)))
+                    ||  (sContentType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(IMPRESS_XML_TEMPLATE)))
+                    ||  (sContentType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(IMPRESS_XML_TEMPLATE_B))))
                 {
                     ::rtl::OUString sLocalisedTitle = SfxDocumentTemplates::ConvertResourceString(
                         STR_TEMPLATE_NAME1_DEF, STR_TEMPLATE_NAME1, NUM_TEMPLATE_NAMES, sTitle );
@@ -347,8 +347,8 @@ TemplateScanner::State TemplateScanner::InitializeFolderScanning (void)
 
         //  Define the list of properties we are interested in.
         Sequence<rtl::OUString> aProps (2);
-        aProps[0] = TITLE;
-        aProps[1] = TARGET_DIR_URL;
+        aProps[0] = rtl::OUString(TITLE);
+        aProps[1] = rtl::OUString(TARGET_DIR_URL);
 
         //  Create an cursor to iterate over the template folders.
         ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_ONLY;
diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx
index d6a2953..2de0896 100644
--- a/sd/source/ui/tools/EventMultiplexer.cxx
+++ b/sd/source/ui/tools/EventMultiplexer.cxx
@@ -153,9 +153,6 @@ private:
         ::com::sun::star::drawing::framework::XConfigurationController>
         mxConfigurationControllerWeak;
 
-    static const ::rtl::OUString msCurrentPagePropertyName;
-    static const ::rtl::OUString msEditModePropertyName;
-
     void ReleaseListeners (void);
 
     void ConnectToController (void);
@@ -175,10 +172,8 @@ private:
 };
 
 
-const ::rtl::OUString EventMultiplexer::Implementation::msCurrentPagePropertyName (
-    RTL_CONSTASCII_USTRINGPARAM("CurrentPage"));
-const ::rtl::OUString EventMultiplexer::Implementation::msEditModePropertyName (
-    RTL_CONSTASCII_USTRINGPARAM("IsMasterPageMode"));
+const char aCurrentPagePropertyName[] = "CurrentPage";
+const char aEditModePropertyName[] = "IsMasterPageMode";
 
 
 //===== EventMultiplexer ======================================================
@@ -441,7 +436,7 @@ void EventMultiplexer::Implementation::ConnectToController (void)
         {
                 try
                 {
-                    xSet->addPropertyChangeListener(msCurrentPagePropertyName, this);
+                    xSet->addPropertyChangeListener(rtl::OUString(aCurrentPagePropertyName), this);
                 }
                 catch (const beans::UnknownPropertyException&)
                 {
@@ -450,7 +445,7 @@ void EventMultiplexer::Implementation::ConnectToController (void)
 
                 try
                 {
-                    xSet->addPropertyChangeListener(msEditModePropertyName, this);
+                    xSet->addPropertyChangeListener(rtl::OUString(aEditModePropertyName), this);
                 }
                 catch (const beans::UnknownPropertyException&)
                 {
@@ -488,7 +483,7 @@ void EventMultiplexer::Implementation::DisconnectFromController (void)
         {
             try
             {
-                xSet->removePropertyChangeListener(msCurrentPagePropertyName, this);
+                xSet->removePropertyChangeListener(rtl::OUString(aCurrentPagePropertyName), this);
             }
             catch (const beans::UnknownPropertyException&)
             {
@@ -497,7 +492,7 @@ void EventMultiplexer::Implementation::DisconnectFromController (void)
 
             try
             {
-                xSet->removePropertyChangeListener(msEditModePropertyName, this);
+                xSet->removePropertyChangeListener(rtl::OUString(aEditModePropertyName), this);
             }
             catch (const beans::UnknownPropertyException&)
             {
@@ -560,11 +555,11 @@ void SAL_CALL EventMultiplexer::Implementation::propertyChange (
 {
     ThrowIfDisposed();
 
-    if (rEvent.PropertyName.equals(msCurrentPagePropertyName))
+    if (rEvent.PropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(aCurrentPagePropertyName)))
     {
         CallListeners(EventMultiplexerEvent::EID_CURRENT_PAGE);
     }
-    else if (rEvent.PropertyName.equals(msEditModePropertyName))
+    else if (rEvent.PropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(aEditModePropertyName)))
     {
         bool bIsMasterPageMode (false);
         rEvent.NewValue >>= bIsMasterPageMode;
commit e6409de0f879df204de7b07117798e2d77235458
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 2 09:37:26 2012 +0100

    don't leak pDefaultTableStyle

diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx
index 97ed6e7..23c9ccd 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -34,6 +34,7 @@
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/table/XMergeableCellRange.hpp>
 #include <com/sun/star/table/BorderLine2.hpp>
+#include <rtl/instance.hxx>
 #include "oox/core/xmlfilterbase.hxx"
 #include "oox/helper/propertyset.hxx"
 
@@ -103,7 +104,10 @@ void MergeCells( const uno::Reference< XTable >& xTable, sal_Int32 nCol, sal_Int
    }
 }
 
-static TableStyle* pDefaultTableStyle = new TableStyle();
+namespace
+{
+    struct theDefaultTableStyle : public ::rtl::Static< TableStyle, theDefaultTableStyle > {};
+}
 
 const TableStyle& TableProperties::getUsedTableStyle( const ::oox::core::XmlFilterBase& rFilterBase )
 {
@@ -127,8 +131,9 @@ const TableStyle& TableProperties::getUsedTableStyle( const ::oox::core::XmlFilt
             ++aIter;
         }
     }
+
     if ( !pTableStyle )
-        pTableStyle = pDefaultTableStyle;
+        return theDefaultTableStyle::get();
 
     return *pTableStyle;
 }
commit 02b2c38acc2374abd0b38d56cd8d92b19b644105
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 2 09:36:29 2012 +0100

    only include iostream if you need to

diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 69ab855..30558bd 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -59,8 +59,6 @@ ScAddress::Details::Details ( const ScDocument* pDoc,
 
 ////////////////////////////////////////////////////////////////////////////
 
-#include <iostream>
-
 /**
  * Parse from the opening single quote to the closing single quote.  Inside
  * the quotes, a single quote character is encoded by double single-quote
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index edb85aa..f76e59c 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -42,8 +42,6 @@
 #include "externalrefmgr.hxx"
 #include "compiler.hxx"
 
-#include <iostream>
-
 using ::rtl::OUString;
 using ::rtl::OUStringBuffer;
 using ::formula::FormulaGrammar;
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index e339b2c..9f3dfe1 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -92,9 +92,6 @@
 #include "scui_def.hxx"
 #include "scabstdlg.hxx"
 
-#include <iostream>
-
-
 using namespace ::com::sun::star;
 
 
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 2430225..64fc9b5 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -71,8 +71,6 @@
 #include "markdata.hxx"
 #include "reffact.hxx"
 
-#include <iostream>
-
 //------------------------------------------------------------------
 
 void ScTabViewShell::SetCurRefDlgId( sal_uInt16 nNew )
commit cf98d30de84e8ca8b45a83ac2319a09f9e70a2f7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 2 09:34:41 2012 +0100

    refactor the Rewriter rules using enums

diff --git a/sw/inc/SwRewriter.hxx b/sw/inc/SwRewriter.hxx
index 36981e4..d1ce1e3 100644
--- a/sw/inc/SwRewriter.hxx
+++ b/sw/inc/SwRewriter.hxx
@@ -33,11 +33,14 @@
 #include <tools/string.hxx>
 #include <swdllapi.h>
 
-extern SW_DLLPUBLIC String const UNDO_ARG1;
-extern SW_DLLPUBLIC String const UNDO_ARG2;
-extern SW_DLLPUBLIC String const UNDO_ARG3;
+enum SwUndoArg
+{
+    UndoArg1,
+    UndoArg2,
+    UndoArg3
+};
 
-typedef std::pair<String, String> SwRewriteRule;
+typedef std::pair<SwUndoArg, String> SwRewriteRule;
 
 class SW_DLLPUBLIC SwRewriter
 {
@@ -48,7 +51,7 @@ public:
     SwRewriter(const SwRewriter & rSrc);
     ~SwRewriter();
 
-    void AddRule(const String & rWhat, const String & rWith);
+    void AddRule(SwUndoArg eWhat, const String & rWith);
 
     String Apply(const String & rStr) const;
 };
diff --git a/sw/source/core/crsr/findcoll.cxx b/sw/source/core/crsr/findcoll.cxx
index 2dfb63b..756e216 100644
--- a/sw/source/core/crsr/findcoll.cxx
+++ b/sw/source/core/crsr/findcoll.cxx
@@ -95,9 +95,9 @@ sal_uLong SwCursor::Find( const SwTxtFmtColl& rFmtColl,
     if (bStartUndo)
     {
         SwRewriter aRewriter;
-        aRewriter.AddRule(UNDO_ARG1, rFmtColl.GetName());
-        aRewriter.AddRule(UNDO_ARG2, SW_RES(STR_YIELDS));
-        aRewriter.AddRule(UNDO_ARG3, pReplFmtColl->GetName());
+        aRewriter.AddRule(UndoArg1, rFmtColl.GetName());
+        aRewriter.AddRule(UndoArg2, SW_RES(STR_YIELDS));
+        aRewriter.AddRule(UndoArg3, pReplFmtColl->GetName());
 
         pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_UI_REPLACE_STYLE,
                 &aRewriter );
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index ae671ba..5ca28ec 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -2076,7 +2076,7 @@ bool SwDoc::AcceptRedline( sal_uInt16 nPos, bool bCallDelete )
         {
             SwRewriter aRewriter;
 
-            aRewriter.AddRule(UNDO_ARG1, pTmp->GetDescr());
+            aRewriter.AddRule(UndoArg1, pTmp->GetDescr());
             GetIDocumentUndoRedo().StartUndo(UNDO_ACCEPT_REDLINE, &aRewriter);
         }
 
@@ -2158,12 +2158,12 @@ bool SwDoc::AcceptRedline( const SwPaM& rPam, bool bCallDelete )
 
         {
             SwRewriter aRewriter;
-            aRewriter.AddRule(UNDO_ARG1, String::CreateFromInt32(nRet));
+            aRewriter.AddRule(UndoArg1, String::CreateFromInt32(nRet));
             aTmpStr = aRewriter.Apply(String(SW_RES(STR_N_REDLINES)));
         }
 
         SwRewriter aRewriter;
-        aRewriter.AddRule(UNDO_ARG1, aTmpStr);
+        aRewriter.AddRule(UndoArg1, aTmpStr);
 
         GetIDocumentUndoRedo().EndUndo( UNDO_ACCEPT_REDLINE, &aRewriter );
     }
@@ -2186,7 +2186,7 @@ bool SwDoc::RejectRedline( sal_uInt16 nPos, bool bCallDelete )
         {
             SwRewriter aRewriter;
 
-            aRewriter.AddRule(UNDO_ARG1, pTmp->GetDescr());
+            aRewriter.AddRule(UndoArg1, pTmp->GetDescr());
             GetIDocumentUndoRedo().StartUndo(UNDO_REJECT_REDLINE, &aRewriter);
         }
 
@@ -2268,12 +2268,12 @@ bool SwDoc::RejectRedline( const SwPaM& rPam, bool bCallDelete )
 
         {
             SwRewriter aRewriter;
-            aRewriter.AddRule(UNDO_ARG1, String::CreateFromInt32(nRet));
+            aRewriter.AddRule(UndoArg1, String::CreateFromInt32(nRet));
             aTmpStr = aRewriter.Apply(String(SW_RES(STR_N_REDLINES)));
         }
 
         SwRewriter aRewriter;
-        aRewriter.AddRule(UNDO_ARG1, aTmpStr);
+        aRewriter.AddRule(UndoArg1, aTmpStr);
 
         GetIDocumentUndoRedo().EndUndo( UNDO_REJECT_REDLINE, &aRewriter );
     }
@@ -3809,7 +3809,7 @@ String SwRedline::GetDescr(sal_uInt16 nPos)
     aTmpStr += String(SW_RES(STR_END_QUOTE));
 
     SwRewriter aRewriter;
-    aRewriter.AddRule(UNDO_ARG1, aTmpStr);
+    aRewriter.AddRule(UndoArg1, aTmpStr);
 
     aResult = aRewriter.Apply(aResult);
 
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index 67deb43..70c7339 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -126,7 +126,7 @@ long SwEditShell::Delete()
         if( bUndo )     // mehr als eine Selection ?
         {
             SwRewriter aRewriter;
-            aRewriter.AddRule(UNDO_ARG1, String(SW_RES(STR_MULTISEL)));
+            aRewriter.AddRule(UndoArg1, SW_RESSTR(STR_MULTISEL));
 
             GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_DELETE, &aRewriter);
         }
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 2e5bc4d..8393a80 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -73,7 +73,7 @@ void SwEditShell::SetTxtFmtColl( SwTxtFmtColl *pFmt,
     StartAllAction();
 
     SwRewriter aRewriter;
-    aRewriter.AddRule(UNDO_ARG1, pLocal->GetName());
+    aRewriter.AddRule(UndoArg1, pLocal->GetName());
 
     GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_SETFMTCOLL, &aRewriter);
     FOREACHPAM_START(this)
diff --git a/sw/source/core/undo/SwRewriter.cxx b/sw/source/core/undo/SwRewriter.cxx
index e01aedc..9eda961 100644
--- a/sw/source/core/undo/SwRewriter.cxx
+++ b/sw/source/core/undo/SwRewriter.cxx
@@ -50,9 +50,9 @@ SwRewriter::~SwRewriter()
 {
 }
 
-void SwRewriter::AddRule(const String & rWhat, const String & rWith)
+void SwRewriter::AddRule(SwUndoArg eWhat, const String & rWith)
 {
-    SwRewriteRule aRule(rWhat, rWith);
+    SwRewriteRule aRule(eWhat, rWith);
 
     vector<SwRewriteRule>::iterator aIt;
 
@@ -64,15 +64,4 @@ void SwRewriter::AddRule(const String & rWhat, const String & rWith)
         mRules.push_back(aRule);
 }
 
-String SwRewriter::Apply(const String & rStr) const
-{
-    String aResult = rStr;
-    vector<SwRewriteRule>::const_iterator aIt;
-
-    for (aIt = mRules.begin(); aIt != mRules.end(); ++aIt)
-        aResult.SearchAndReplaceAll(aIt->first, aIt->second);
-
-    return aResult;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/SwUndoFmt.cxx b/sw/source/core/undo/SwUndoFmt.cxx
index 0464950..3dfb373 100644
--- a/sw/source/core/undo/SwUndoFmt.cxx
+++ b/sw/source/core/undo/SwUndoFmt.cxx
@@ -102,7 +102,7 @@ SwRewriter SwUndoFmtCreate::GetRewriter() const
 
     SwRewriter aRewriter;
 
-    aRewriter.AddRule(UNDO_ARG1, sNewName);
+    aRewriter.AddRule(UndoArg1, sNewName);
 
     return aRewriter;
 }
@@ -152,7 +152,7 @@ SwRewriter SwUndoFmtDelete::GetRewriter() const
 {
     SwRewriter aRewriter;
 
-    aRewriter.AddRule(UNDO_ARG1, sOldName);
+    aRewriter.AddRule(UndoArg1, sOldName);
 
     return aRewriter;
 }
@@ -195,9 +195,9 @@ SwRewriter SwUndoRenameFmt::GetRewriter() const
 {
     SwRewriter aRewriter;
 
-    aRewriter.AddRule(UNDO_ARG1, sOldName);
-    aRewriter.AddRule(UNDO_ARG2, SW_RES(STR_YIELDS));
-    aRewriter.AddRule(UNDO_ARG3, sNewName);
+    aRewriter.AddRule(UndoArg1, sOldName);
+    aRewriter.AddRule(UndoArg2, SW_RES(STR_YIELDS));
+    aRewriter.AddRule(UndoArg3, sNewName);
 
     return aRewriter;
 }
@@ -398,7 +398,7 @@ SwRewriter SwUndoNumruleCreate::GetRewriter() const
         bInitialized = true;
     }
 
-    aResult.AddRule(UNDO_ARG1, aNew.GetName());
+    aResult.AddRule(UndoArg1, aNew.GetName());
 
     return aResult;
 }
@@ -423,7 +423,7 @@ SwRewriter SwUndoNumruleDelete::GetRewriter() const
 {
     SwRewriter aResult;
 
-    aResult.AddRule(UNDO_ARG1, aOld.GetName());
+    aResult.AddRule(UndoArg1, aOld.GetName());
 
     return aResult;
 }
@@ -450,9 +450,9 @@ SwRewriter SwUndoNumruleRename::GetRewriter() const
 {
     SwRewriter aRewriter;
 
-    aRewriter.AddRule(UNDO_ARG1, aOldName);
-    aRewriter.AddRule(UNDO_ARG2, SW_RES(STR_YIELDS));
-    aRewriter.AddRule(UNDO_ARG3, aNewName);
+    aRewriter.AddRule(UndoArg1, aOldName);
+    aRewriter.AddRule(UndoArg2, SW_RESSTR(STR_YIELDS));
+    aRewriter.AddRule(UndoArg3, aNewName);
 
     return aRewriter;
 }
diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx
index ef85c9c..a48414d 100644
--- a/sw/source/core/undo/SwUndoPageDesc.cxx
+++ b/sw/source/core/undo/SwUndoPageDesc.cxx
@@ -312,9 +312,9 @@ SwRewriter SwUndoPageDesc::GetRewriter() const
 {
     SwRewriter aResult;
 
-    aResult.AddRule(UNDO_ARG1, aOld.GetName());
-    aResult.AddRule(UNDO_ARG2, SW_RES(STR_YIELDS));
-    aResult.AddRule(UNDO_ARG3, aNew.GetName());
+    aResult.AddRule(UndoArg1, aOld.GetName());
+    aResult.AddRule(UndoArg2, SW_RESSTR(STR_YIELDS));
+    aResult.AddRule(UndoArg3, aNew.GetName());
 
     return aResult;
 }
@@ -367,9 +367,9 @@ SwRewriter SwUndoPageDescCreate::GetRewriter() const
     SwRewriter aResult;
 
     if (pDesc)
-        aResult.AddRule(UNDO_ARG1, pDesc->GetName());
+        aResult.AddRule(UndoArg1, pDesc->GetName());
     else
-        aResult.AddRule(UNDO_ARG1, aNew.GetName());
+        aResult.AddRule(UndoArg1, aNew.GetName());
 
 
     return aResult;
@@ -412,7 +412,7 @@ SwRewriter SwUndoPageDescDelete::GetRewriter() const
 {
     SwRewriter aResult;
 
-    aResult.AddRule(UNDO_ARG1, aOld.GetName());
+    aResult.AddRule(UndoArg1, aOld.GetName());
 
     return aResult;
 }
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index cb3c035..309fbe9 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -406,7 +406,7 @@ SwRewriter SwUndoFmtAttr::GetRewriter() const
 
     if (m_pFmt)
     {
-        aRewriter.AddRule(UNDO_ARG1, m_pFmt->GetName());
+        aRewriter.AddRule(UndoArg1, m_pFmt->GetName());
     }
 
     return aRewriter;
diff --git a/sw/source/core/undo/unbkmk.cxx b/sw/source/core/undo/unbkmk.cxx
index 6215f8f..62d8ab9 100644
--- a/sw/source/core/undo/unbkmk.cxx
+++ b/sw/source/core/undo/unbkmk.cxx
@@ -77,7 +77,7 @@ SwRewriter SwUndoBookmark::GetRewriter() const
 {
     SwRewriter aResult;
 
-    aResult.AddRule(UNDO_ARG1, m_pHistoryBookmark->GetName());
+    aResult.AddRule(UndoArg1, m_pHistoryBookmark->GetName());
 
     return aResult;
 }
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index f6105b4..4f88c79 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -52,6 +52,7 @@
 #include <fmtfld.hxx>
 #include <comcore.hrc> // #111827#
 #include <undo.hrc>
+#include <vector>
 
 
 // DELETE
@@ -532,7 +533,7 @@ static SwRewriter lcl_RewriterFromHistory(SwHistory & rHistory)
 
         if (aDescr.Len() > 0)
         {
-            aRewriter.AddRule(UNDO_ARG2, aDescr);
+            aRewriter.AddRule(UndoArg2, aDescr);
 
             bDone = true;
             break;
@@ -541,12 +542,120 @@ static SwRewriter lcl_RewriterFromHistory(SwHistory & rHistory)
 
     if (! bDone)
     {
-        aRewriter.AddRule(UNDO_ARG2, SW_RES(STR_FIELD));
+        aRewriter.AddRule(UndoArg2, SW_RESSTR(STR_FIELD));
     }
 
     return aRewriter;
 }
 
+static bool lcl_IsSpecialCharacter(sal_Unicode nChar)
+{
+    switch (nChar)
+    {
+    case CH_TXTATR_BREAKWORD:
+    case CH_TXTATR_INWORD:
+    case CH_TXTATR_TAB:
+    case CH_TXTATR_NEWLINE:
+        return true;
+
+    default:
+        break;
+    }
+
+    return false;
+}
+
+const char UNDO_ARG1[] = "$1";
+const char UNDO_ARG2[] = "$2";
+const char UNDO_ARG3[] = "$3";
+
+static String lcl_DenotedPortion(String rStr, xub_StrLen nStart,
+                                 xub_StrLen nEnd)
+{
+    String aResult;
+
+    if (nEnd - nStart > 0)
+    {
+        sal_Unicode cLast = rStr.GetChar(nEnd - 1);
+        if (lcl_IsSpecialCharacter(cLast))
+        {
+            switch(cLast)
+            {
+            case CH_TXTATR_TAB:
+                aResult = SW_RESSTR(STR_UNDO_TABS);
+
+                break;
+            case CH_TXTATR_NEWLINE:
+                aResult = SW_RESSTR(STR_UNDO_NLS);
+
+                break;
+
+            case CH_TXTATR_INWORD:
+            case CH_TXTATR_BREAKWORD:
+                aResult = rtl::OUString(UNDO_ARG2);
+
+                break;
+
+            }
+            SwRewriter aRewriter;
+            aRewriter.AddRule(UndoArg1,
+                              String::CreateFromInt32(nEnd - nStart));
+            aResult = aRewriter.Apply(aResult);
+        }
+        else
+        {
+            aResult = SW_RESSTR(STR_START_QUOTE);
+            aResult += rStr.Copy(nStart, nEnd - nStart);
+            aResult += SW_RESSTR(STR_END_QUOTE);
+        }
+    }
+
+    return aResult;
+}
+
+String DenoteSpecialCharacters(const String & rStr)
+{
+    String aResult;
+
+    if (rStr.Len() > 0)
+    {
+        bool bStart = false;
+        xub_StrLen nStart = 0;
+        sal_Unicode cLast = 0;
+
+        for (xub_StrLen i = 0; i < rStr.Len(); i++)
+        {
+            if (lcl_IsSpecialCharacter(rStr.GetChar(i)))
+            {
+                if (cLast != rStr.GetChar(i))
+                    bStart = true;
+
+            }
+            else
+            {
+                if (lcl_IsSpecialCharacter(cLast))
+                    bStart = true;
+            }
+
+            if (bStart)
+            {
+                aResult += lcl_DenotedPortion(rStr, nStart, i);
+
+                nStart = i;
+                bStart = false;
+            }
+
+            cLast = rStr.GetChar(i);
+        }
+
+        aResult += lcl_DenotedPortion(rStr, nStart, rStr.Len());
+    }
+    else
+        aResult = rtl::OUString(UNDO_ARG2);
+
+    return aResult;
+}
+
 SwRewriter SwUndoDelete::GetRewriter() const
 {
     SwRewriter aResult;
@@ -558,15 +667,15 @@ SwRewriter SwUndoDelete::GetRewriter() const
         {
 
             SwRewriter aRewriter;
-            aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_START_QUOTE));
-            aRewriter.AddRule(UNDO_ARG2, sTableName);
-            aRewriter.AddRule(UNDO_ARG3, SW_RES(STR_END_QUOTE));
+            aRewriter.AddRule(UndoArg1, SW_RESSTR(STR_START_QUOTE));
+            aRewriter.AddRule(UndoArg2, sTableName);
+            aRewriter.AddRule(UndoArg3, SW_RESSTR(STR_END_QUOTE));
 
             String sTmp = aRewriter.Apply(SW_RES(STR_TABLE_NAME));
-            aResult.AddRule(UNDO_ARG1, sTmp);
+            aResult.AddRule(UndoArg1, sTmp);
         }
         else
-            aResult.AddRule(UNDO_ARG1, String(SW_RES(STR_PARAGRAPHS)));
+            aResult.AddRule(UndoArg1, SW_RESSTR(STR_PARAGRAPHS));
     }
     else
     {
@@ -590,7 +699,7 @@ SwRewriter SwUndoDelete::GetRewriter() const
             }
             else
             {
-                aStr = UNDO_ARG2;
+                aStr = rtl::OUString(UNDO_ARG2);
             }
         }
 
@@ -601,7 +710,7 @@ SwRewriter SwUndoDelete::GetRewriter() const
             aStr = aRewriter.Apply(aStr);
         }
 
-        aResult.AddRule(UNDO_ARG1, aStr);
+        aResult.AddRule(UndoArg1, aStr);
     }
 
     return aResult;
@@ -986,4 +1095,29 @@ void SwUndoDelete::SetTableName(const String & rName)
     sTableName = rName;
 }
 
+String SwRewriter::Apply(const String & rStr) const
+{
+    rtl::OUString aResult = rStr;
+    std::vector<SwRewriteRule>::const_iterator aIt;
+
+    for (aIt = mRules.begin(); aIt != mRules.end(); ++aIt)
+    {
+        switch (aIt->first)
+        {
+            case UndoArg1:
+            default:
+                aResult = aResult.replaceAll(UNDO_ARG1, aIt->second);
+                break;
+            case UndoArg2:
+                aResult = aResult.replaceAll(UNDO_ARG2, aIt->second);
+                break;
+            case UndoArg3:
+                aResult = aResult.replaceAll(UNDO_ARG3, aIt->second);
+                break;
+        }
+    }
+
+    return aResult;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 2671511..9b169d8 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1212,110 +1212,6 @@ String ShortenString(const String & rStr, xub_StrLen nLength, const String & rFi
     return aResult;
 }
 
-static bool lcl_IsSpecialCharacter(sal_Unicode nChar)
-{
-    switch (nChar)
-    {
-    case CH_TXTATR_BREAKWORD:
-    case CH_TXTATR_INWORD:
-    case CH_TXTATR_TAB:
-    case CH_TXTATR_NEWLINE:
-        return true;
-
-    default:
-        break;
-    }
-
-    return false;
-}
-
-static String lcl_DenotedPortion(String rStr, xub_StrLen nStart,
-                                 xub_StrLen nEnd)
-{
-    String aResult;
-
-    if (nEnd - nStart > 0)
-    {
-        sal_Unicode cLast = rStr.GetChar(nEnd - 1);
-        if (lcl_IsSpecialCharacter(cLast))
-        {
-            switch(cLast)
-            {
-            case CH_TXTATR_TAB:
-                aResult += String(SW_RES(STR_UNDO_TABS));
-
-                break;
-            case CH_TXTATR_NEWLINE:
-                aResult += String(SW_RES(STR_UNDO_NLS));
-
-                break;
-
-            case CH_TXTATR_INWORD:
-            case CH_TXTATR_BREAKWORD:
-                aResult += UNDO_ARG2;
-
-                break;
-
-            }
-            SwRewriter aRewriter;
-            aRewriter.AddRule(UNDO_ARG1,
-                              String::CreateFromInt32(nEnd - nStart));
-            aResult = aRewriter.Apply(aResult);
-        }
-        else
-        {
-            aResult = String(SW_RES(STR_START_QUOTE));
-            aResult += rStr.Copy(nStart, nEnd - nStart);
-            aResult += String(SW_RES(STR_END_QUOTE));
-        }
-    }
-
-    return aResult;
-}
-
-String DenoteSpecialCharacters(const String & rStr)
-{
-    String aResult;
-
-    if (rStr.Len() > 0)
-    {
-        bool bStart = false;
-        xub_StrLen nStart = 0;
-        sal_Unicode cLast = 0;
-
-        for (xub_StrLen i = 0; i < rStr.Len(); i++)
-        {
-            if (lcl_IsSpecialCharacter(rStr.GetChar(i)))
-            {
-                if (cLast != rStr.GetChar(i))
-                    bStart = true;
-
-            }
-            else
-            {
-                if (lcl_IsSpecialCharacter(cLast))
-                    bStart = true;
-            }
-
-            if (bStart)
-            {
-                aResult += lcl_DenotedPortion(rStr, nStart, i);
-
-                nStart = i;
-                bStart = false;
-            }
-
-            cLast = rStr.GetChar(i);
-        }
-
-        aResult += lcl_DenotedPortion(rStr, nStart, rStr.Len());
-    }
-    else
-        aResult = UNDO_ARG2;
-
-    return aResult;
-}
-
 bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
         SwPosition const & rStart, SwPosition const & rEnd,
         DelCntntType const nDelCntntType)
@@ -1332,8 +1228,4 @@ bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
             );
 }
 
-const String UNDO_ARG1("$1", RTL_TEXTENCODING_ASCII_US);
-const String UNDO_ARG2("$2", RTL_TEXTENCODING_ASCII_US);
-const String UNDO_ARG3("$3", RTL_TEXTENCODING_ASCII_US);
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 3bcaf34..429bf49 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -438,7 +438,7 @@ SwRewriter SwUndoDelLayFmt::GetRewriter() const
             {
                 SwOLENode * pOLENd = pNd->GetOLENode();
 
-                aRewriter.AddRule(UNDO_ARG1, pOLENd->GetDescription());
+                aRewriter.AddRule(UndoArg1, pOLENd->GetDescription());
             }
         }
     }
@@ -491,7 +491,7 @@ SwRewriter SwUndoSetFlyFmt::GetRewriter() const
     SwRewriter aRewriter;
 
     if (pNewFmt)
-        aRewriter.AddRule(UNDO_ARG1, pNewFmt->GetName());
+        aRewriter.AddRule(UndoArg1, pNewFmt->GetName());
 
     return aRewriter;
 }
diff --git a/sw/source/core/undo/undoflystrattr.cxx b/sw/source/core/undo/undoflystrattr.cxx
index 8f760b7..4da6833 100644
--- a/sw/source/core/undo/undoflystrattr.cxx
+++ b/sw/source/core/undo/undoflystrattr.cxx
@@ -92,7 +92,7 @@ SwRewriter SwUndoFlyStrAttr::GetRewriter() const
 {
     SwRewriter aResult;
 
-    aResult.AddRule( UNDO_ARG1, mrFlyFrmFmt.GetName() );
+    aResult.AddRule( UndoArg1, mrFlyFrmFmt.GetName() );
 
     return aResult;
 }
diff --git a/sw/source/core/undo/unfmco.cxx b/sw/source/core/undo/unfmco.cxx
index 4278121..e23dd97 100644
--- a/sw/source/core/undo/unfmco.cxx
+++ b/sw/source/core/undo/unfmco.cxx
@@ -110,7 +110,7 @@ SwRewriter SwUndoFmtColl::GetRewriter() const
     // #i31191# Use stored format name instead of
     // pFmtColl->GetName(), because pFmtColl does not have to be available
     // anymore.
-    aResult.AddRule(UNDO_ARG1, aFmtName );
+    aResult.AddRule(UndoArg1, aFmtName );
 
     return aResult;
 }
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index f08cfa0..8a451c4 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -461,14 +461,14 @@ SwRewriter SwUndoInsert::GetRewriter() const
                                        nUndoStringLength,
                                        String(SW_RES(STR_LDOTS)));
 
-        aResult.AddRule(UNDO_ARG1, aString);
+        aResult.AddRule(UndoArg1, aString);
 
         bDone = true;
     }
 
     if ( ! bDone )
     {
-        aResult.AddRule(UNDO_ARG1, String("??", RTL_TEXTENCODING_ASCII_US));
+        aResult.AddRule(UndoArg1, String("??", RTL_TEXTENCODING_ASCII_US));
     }
 
     return aResult;
@@ -536,15 +536,15 @@ MakeUndoReplaceRewriter(sal_uLong const occurrences,
 
     if (1 < occurrences)
     {
-        aResult.AddRule(UNDO_ARG1, String::CreateFromInt32(occurrences));
-        aResult.AddRule(UNDO_ARG2, String(SW_RES(STR_OCCURRENCES_OF)));
+        aResult.AddRule(UndoArg1, String::CreateFromInt32(occurrences));
+        aResult.AddRule(UndoArg2, String(SW_RES(STR_OCCURRENCES_OF)));
 
         String aTmpStr;
         aTmpStr += String(SW_RES(STR_START_QUOTE));
         aTmpStr += ShortenString(sOld, nUndoStringLength,
                                  SW_RES(STR_LDOTS));
         aTmpStr += String(SW_RES(STR_END_QUOTE));
-        aResult.AddRule(UNDO_ARG3, aTmpStr);
+        aResult.AddRule(UndoArg3, aTmpStr);
     }
     else if (1 == occurrences)
     {
@@ -556,10 +556,10 @@ MakeUndoReplaceRewriter(sal_uLong const occurrences,
             aTmpStr += ShortenString(sOld, nUndoStringLength,
                                      SW_RES(STR_LDOTS));
             aTmpStr += String(SW_RES(STR_END_QUOTE));
-            aResult.AddRule(UNDO_ARG1, aTmpStr);
+            aResult.AddRule(UndoArg1, aTmpStr);
         }
 
-        aResult.AddRule(UNDO_ARG2, String(SW_RES(STR_YIELDS)));
+        aResult.AddRule(UndoArg2, String(SW_RES(STR_YIELDS)));
 
         {
             String aTmpStr;
@@ -569,7 +569,7 @@ MakeUndoReplaceRewriter(sal_uLong const occurrences,
             aTmpStr += ShortenString(sNew, nUndoStringLength,
                                      SW_RES(STR_LDOTS));
             aTmpStr += String(SW_RES(STR_END_QUOTE));
-            aResult.AddRule(UNDO_ARG3, aTmpStr);
+            aResult.AddRule(UndoArg3, aTmpStr);
         }
     }
 
@@ -1037,7 +1037,7 @@ SwRewriter SwUndoInsertLabel::GetRewriter() const
                              String(SW_RES(STR_LDOTS)));
     aTmpStr += String(SW_RES(STR_END_QUOTE));
 
-    aRewriter.AddRule(UNDO_ARG1, aTmpStr);
+    aRewriter.AddRule(UndoArg1, aTmpStr);
 
     return aRewriter;
 }
diff --git a/sw/source/core/undo/unnum.cxx b/sw/source/core/undo/unnum.cxx
index 4267874..e9cce98 100644
--- a/sw/source/core/undo/unnum.cxx
+++ b/sw/source/core/undo/unnum.cxx
@@ -83,7 +83,7 @@ SwRewriter SwUndoInsNum::GetRewriter() const
 {
     SwRewriter aResult;
     if( UNDO_INSFMTATTR == GetId() )
-        aResult.AddRule(UNDO_ARG1, aNumRule.GetName());
+        aResult.AddRule(UndoArg1, aNumRule.GetName());
     return aResult;
 }
 
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index 1faf9bd..562ebbb 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -337,7 +337,7 @@ SwRewriter SwUndoOverwrite::GetRewriter() const
                              String(SW_RES(STR_LDOTS)));
     aString += String(SW_RES(STR_END_QUOTE));
 
-    aResult.AddRule(UNDO_ARG1, aString);
+    aResult.AddRule(UndoArg1, aString);
 
     return aResult;
 }
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 6243bea..0f295a1 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -370,9 +370,9 @@ SwRewriter SwUndoInsTbl::GetRewriter() const
 {
     SwRewriter aRewriter;
 
-    aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_START_QUOTE));
-    aRewriter.AddRule(UNDO_ARG2, sTblNm);
-    aRewriter.AddRule(UNDO_ARG3, SW_RES(STR_END_QUOTE));
+    aRewriter.AddRule(UndoArg1, SW_RES(STR_START_QUOTE));
+    aRewriter.AddRule(UndoArg2, sTblNm);
+    aRewriter.AddRule(UndoArg3, SW_RES(STR_END_QUOTE));
 
     return aRewriter;
 }
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index 9b33568..f54775e 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -378,9 +378,9 @@ throw (uno::RuntimeException)
     }
 
     SwRewriter aRewriter;
-    aRewriter.AddRule(UNDO_ARG1, lcl_QuoteName(getName()));
-    aRewriter.AddRule(UNDO_ARG2, SW_RES(STR_YIELDS));
-    aRewriter.AddRule(UNDO_ARG3, lcl_QuoteName(rName));
+    aRewriter.AddRule(UndoArg1, lcl_QuoteName(getName()));
+    aRewriter.AddRule(UndoArg2, SW_RES(STR_YIELDS));
+    aRewriter.AddRule(UndoArg3, lcl_QuoteName(rName));
 
     m_pImpl->m_pDoc->GetIDocumentUndoRedo().StartUndo(
             UNDO_BOOKMARK_RENAME, &aRewriter);
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index 74bd20e..8f90a15 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -981,7 +981,7 @@ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWr
                 GetWrtShell()->StartAllAction();
 
                 SwRewriter aRewriter;
-                aRewriter.AddRule(UNDO_ARG1, pColl->GetName());
+                aRewriter.AddRule(UndoArg1, pColl->GetName());
 
                 GetWrtShell()->StartUndo(UNDO_INSFMTATTR, &aRewriter);
                 GetWrtShell()->FillByEx(pColl);
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index 810021d..4f6290f 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -1112,7 +1112,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
     if (rDoc.GetIDocumentUndoRedo().DoesUndo())
     {
         SwRewriter aRewriter;
-        aRewriter.AddRule( UNDO_ARG1, GetName() );
+        aRewriter.AddRule( UndoArg1, GetName() );
         rDoc.GetIDocumentUndoRedo().StartUndo( UNDO_INSFMTATTR, &aRewriter );
     }
 
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 15c5d33..3da5f50 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -3217,7 +3217,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
 
     SwRewriter aRewriter;
 
-    aRewriter.AddRule(UNDO_ARG1, rSrcSh.GetSelDescr());
+    aRewriter.AddRule(UndoArg1, rSrcSh.GetSelDescr());
 
     if(rSrcSh.GetDoc() != rSh.GetDoc())
         rSrcSh.StartUndo( eUndoId, &aRewriter );
diff --git a/sw/source/ui/docvw/AnnotationWin.cxx b/sw/source/ui/docvw/AnnotationWin.cxx
index d3d243d..a4cee7e 100644
--- a/sw/source/ui/docvw/AnnotationWin.cxx
+++ b/sw/source/ui/docvw/AnnotationWin.cxx
@@ -204,7 +204,7 @@ MenuButton* SwAnnotationWin::CreateMenuButton()
     mpButtonPopup = new PopupMenu(SW_RES(MN_ANNOTATION_BUTTON));
     XubString aText = mpButtonPopup->GetItemText( FN_DELETE_NOTE_AUTHOR );
     SwRewriter aRewriter;
-    aRewriter.AddRule(UNDO_ARG1,GetAuthor());
+    aRewriter.AddRule(UndoArg1,GetAuthor());
     aText = aRewriter.Apply(aText);
     mpButtonPopup->SetItemText(FN_DELETE_NOTE_AUTHOR,aText);
     MenuButton* pMenuButton = new AnnotationMenuButton( *this );
@@ -221,7 +221,7 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject* pText)
     const LocaleDataWrapper& rLocalData = aSysLocale.GetLocaleData();
     String aText = String(SW_RES(STR_REPLY));
         SwRewriter aRewriter;
-        aRewriter.AddRule(UNDO_ARG1, pWin->GetAuthor());
+        aRewriter.AddRule(UndoArg1, pWin->GetAuthor());
         aText = aRewriter.Apply(aText);
         aText.Append(String(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (")) +
         String(rLocalData.getDate( pWin->GetDate())) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(", ")) +
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 259ec8a..6d42563 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -1146,7 +1146,7 @@ void SwPostItMgr::Delete(String aAuthor)
     SwRewriter aRewriter;
     String aUndoString = SW_RES(STR_DELETE_AUTHOR_NOTES);
     aUndoString += aAuthor;
-    aRewriter.AddRule(UNDO_ARG1, aUndoString);
+    aRewriter.AddRule(UndoArg1, aUndoString);
     mpWrtShell->StartUndo( UNDO_DELETE, &aRewriter );
 
     std::vector<SwFmtFld*> aTmp;
@@ -1174,7 +1174,7 @@ void SwPostItMgr::Delete()
     mpWrtShell->StartAllAction();
     SetActiveSidebarWin(0);
     SwRewriter aRewriter;
-    aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_DELETE_ALL_NOTES) );
+    aRewriter.AddRule(UndoArg1, SW_RES(STR_DELETE_ALL_NOTES) );
     mpWrtShell->StartUndo( UNDO_DELETE, &aRewriter );
 
     std::vector<SwFmtFld*> aTmp;
diff --git a/sw/source/ui/docvw/SidebarTxtControl.cxx b/sw/source/ui/docvw/SidebarTxtControl.cxx
index c1c99a7..5938a24 100644
--- a/sw/source/ui/docvw/SidebarTxtControl.cxx
+++ b/sw/source/ui/docvw/SidebarTxtControl.cxx
@@ -342,7 +342,7 @@ void SidebarTxtControl::Command( const CommandEvent& rCEvt )
             {
                 XubString aText = ((PopupMenu*)pMgr->GetSVMenu())->GetItemText( FN_DELETE_NOTE_AUTHOR );
                 SwRewriter aRewriter;
-                aRewriter.AddRule(UNDO_ARG1, mrSidebarWin.GetAuthor());
+                aRewriter.AddRule(UndoArg1, mrSidebarWin.GetAuthor());
                 aText = aRewriter.Apply(aText);
                 ((PopupMenu*)pMgr->GetSVMenu())->SetItemText(FN_DELETE_NOTE_AUTHOR,aText);
             }
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index 9e7a604..a3d64a4 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -455,12 +455,12 @@ void SwIndexMarkDlg::InsertUpdate()
         InsertMark();
 
         if ( pTOXMgr->GetCurTOXMark())
-            aRewriter.AddRule(UNDO_ARG1, pTOXMgr->GetCurTOXMark()->GetText());
+            aRewriter.AddRule(UndoArg1, pTOXMgr->GetCurTOXMark()->GetText());
     }
     else if( !pSh->HasReadonlySel() )
     {
         if ( pTOXMgr->GetCurTOXMark())
-            aRewriter.AddRule(UNDO_ARG1,
+            aRewriter.AddRule(UndoArg1,
                               pTOXMgr->GetCurTOXMark()->GetText());
 
         if( bDel )
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index 49f7e5e..f5ddbb5 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -744,13 +744,13 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
             // #111827#
             SwRewriter aRewriter;
 
-            aRewriter.AddRule(UNDO_ARG1, pSh->GetCrsrDescr());
-            aRewriter.AddRule(UNDO_ARG2, String(SW_RES(STR_YIELDS)));
+            aRewriter.AddRule(UndoArg1, pSh->GetCrsrDescr());
+            aRewriter.AddRule(UndoArg2, String(SW_RES(STR_YIELDS)));
 
             String aTmpStr( SW_RES(STR_START_QUOTE) );
             aTmpStr += aTmp;
             aTmpStr += String(SW_RES(STR_END_QUOTE));
-            aRewriter.AddRule(UNDO_ARG3, aTmpStr);
+            aRewriter.AddRule(UndoArg3, aTmpStr);
 
             pSh->StartUndo(UNDO_UI_REPLACE, &aRewriter);
             pSh->StartAction();
diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx
index bd7c726..cff5f3f 100644
--- a/sw/source/ui/misc/redlndlg.cxx
+++ b/sw/source/ui/misc/redlndlg.cxx
@@ -830,13 +830,13 @@ void SwRedlineAcceptDlg::CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept )
         String aTmpStr;
         {
             SwRewriter aRewriter;
-            aRewriter.AddRule(UNDO_ARG1,
+            aRewriter.AddRule(UndoArg1,
                               String::CreateFromInt32(aRedlines.size()));
             aTmpStr = aRewriter.Apply(String(SW_RES(STR_N_REDLINES)));
         }
 
         SwRewriter aRewriter;
-        aRewriter.AddRule(UNDO_ARG1, aTmpStr);
+        aRewriter.AddRule(UndoArg1, aTmpStr);
 
         pSh->StartUndo(bAccept? UNDO_ACCEPT_REDLINE : UNDO_REJECT_REDLINE,
                        &aRewriter);
diff --git a/sw/source/ui/ribbar/drawbase.cxx b/sw/source/ui/ribbar/drawbase.cxx
index 15c57ed..677e419 100644
--- a/sw/source/ui/ribbar/drawbase.cxx
+++ b/sw/source/ui/ribbar/drawbase.cxx
@@ -322,7 +322,7 @@ sal_Bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt)
             {
                 SwRewriter aRewriter;
 
-                aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_FRAME));
+                aRewriter.AddRule(UndoArg1, SW_RES(STR_FRAME));
                 m_pSh->StartUndo(UNDO_INSERT, &aRewriter);
             }
 
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index e78f2a3..0246d90 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -2669,9 +2669,9 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
 
             if (rSh.GetTableFmt())
             {
-                aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_START_QUOTE));
-                aRewriter.AddRule(UNDO_ARG2, rSh.GetTableFmt()->GetName());
-                aRewriter.AddRule(UNDO_ARG3, SW_RES(STR_END_QUOTE));
+                aRewriter.AddRule(UndoArg1, SW_RESSTR(STR_START_QUOTE));
+                aRewriter.AddRule(UndoArg2, rSh.GetTableFmt()->GetName());
+                aRewriter.AddRule(UndoArg3, SW_RESSTR(STR_END_QUOTE));
 
             }
             rSh.EndUndo(UNDO_INSTABLE, &aRewriter); // wegen moegl. Shellwechsel
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index 6e36f23..07b5622 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -631,7 +631,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
                 {
                     SwRewriter aRewriter;
 
-                    aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_FRAME));
+                    aRewriter.AddRule(UndoArg1, SW_RESSTR(STR_FRAME));
 
                     rShell.EndUndo(UNDO_INSERT, &aRewriter);
                 }
@@ -1096,7 +1096,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
 
         // Selektierten Inhalt loeschen
         SwRewriter aRewriter;
-        aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_SPECIALCHAR));
+        aRewriter.AddRule(UndoArg1, SW_RESSTR(STR_SPECIALCHAR));
 
         rSh.StartUndo( UNDO_INSERT, &aRewriter );
         if ( rSh.HasSelection() )
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 08e5cb8..64dccd6 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -410,7 +410,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
         rSh.StartAction();
 
         SwRewriter aRewriter;
-        aRewriter.AddRule(UNDO_ARG1, String(SW_RES(STR_GRAPHIC_DEFNAME)));
+        aRewriter.AddRule(UndoArg1, SW_RESSTR(STR_GRAPHIC_DEFNAME));
 
         rSh.StartUndo(UNDO_INSERT, &aRewriter);
 
diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index 29d33c1..d0f6079 100644
--- a/sw/source/ui/uiview/viewsrch.cxx
+++ b/sw/source/ui/uiview/viewsrch.cxx
@@ -586,9 +586,9 @@ void SwView::Replace()
     if( pSrchItem->GetPattern() ) // Vorlagen?
     {
         SwRewriter aRewriter;
-        aRewriter.AddRule(UNDO_ARG1, pSrchItem->GetSearchString());
-        aRewriter.AddRule(UNDO_ARG2, SW_RES(STR_YIELDS));
-        aRewriter.AddRule(UNDO_ARG3, pSrchItem->GetReplaceString());
+        aRewriter.AddRule(UndoArg1, pSrchItem->GetSearchString());
+        aRewriter.AddRule(UndoArg2, SW_RESSTR(STR_YIELDS));
+        aRewriter.AddRule(UndoArg3, pSrchItem->GetReplaceString());
 
         pWrtShell->StartUndo(UNDO_UI_REPLACE_STYLE, &aRewriter);
 
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index cde36a8..7458b7b 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -2769,13 +2769,13 @@ void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode)
                 pActiveShell->StartAction();
                 String sTable = SW_RES(STR_TABLE_NAME);
                 SwRewriter aRewriterTableName;
-                aRewriterTableName.AddRule(UNDO_ARG1, SW_RES(STR_START_QUOTE));
-                aRewriterTableName.AddRule(UNDO_ARG2, pCnt->GetName());
-                aRewriterTableName.AddRule(UNDO_ARG3, SW_RES(STR_END_QUOTE));
+                aRewriterTableName.AddRule(UndoArg1, SW_RES(STR_START_QUOTE));
+                aRewriterTableName.AddRule(UndoArg2, pCnt->GetName());
+                aRewriterTableName.AddRule(UndoArg3, SW_RES(STR_END_QUOTE));
                 sTable = aRewriterTableName.Apply(sTable);
 
                 SwRewriter aRewriter;
-                aRewriter.AddRule(UNDO_ARG1, sTable);
+                aRewriter.AddRule(UndoArg1, sTable);
                 pActiveShell->StartUndo(UNDO_DELETE, &aRewriter);
                 pActiveShell->GetView().GetViewFrame()->GetDispatcher()->Execute(FN_TABLE_SELECT_ALL);
                 pActiveShell->DeleteRow();
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 47541de..0809ed2 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -229,15 +229,15 @@ void SwWrtShell::Insert( const String &rStr )
         // #111827#
         SwRewriter aRewriter;
 
-        aRewriter.AddRule(UNDO_ARG1, GetCrsrDescr());
-        aRewriter.AddRule(UNDO_ARG2, String(SW_RES(STR_YIELDS)));
+        aRewriter.AddRule(UndoArg1, GetCrsrDescr());
+        aRewriter.AddRule(UndoArg2, String(SW_RES(STR_YIELDS)));
         {
             String aTmpStr;
             aTmpStr += String(SW_RES(STR_START_QUOTE));
             aTmpStr += rStr;
             aTmpStr += String(SW_RES(STR_END_QUOTE));
 
-            aRewriter.AddRule(UNDO_ARG3, rStr);
+            aRewriter.AddRule(UndoArg3, rStr);
         }
 
         StartUndo(UNDO_REPLACE, &aRewriter);
@@ -272,7 +272,7 @@ void SwWrtShell::Insert( const String &rPath, const String &rFilter,
     StartAllAction();
 
     SwRewriter aRewriter;
-    aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_GRAPHIC));
+    aRewriter.AddRule(UndoArg1, SW_RES(STR_GRAPHIC));
 
     StartUndo(UNDO_INSERT, &aRewriter);
 
@@ -586,11 +586,11 @@ sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyF
     SwRewriter aRewriter;
 
     if ( bStarMath )
-        aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_MATH_FORMULA));
+        aRewriter.AddRule(UndoArg1, SW_RES(STR_MATH_FORMULA));
     else if ( SotExchange::IsChart( aCLSID ) )
-        aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_CHART));
+        aRewriter.AddRule(UndoArg1, SW_RES(STR_CHART));
     else
-        aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_OLE));
+        aRewriter.AddRule(UndoArg1, SW_RES(STR_OLE));
 
     EndUndo(UNDO_INSERT, &aRewriter);
 
diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx
index 7fb33e7..3d7264b 100644
--- a/sw/source/ui/wrtsh/wrtsh2.cxx
+++ b/sw/source/ui/wrtsh/wrtsh2.cxx
@@ -80,7 +80,7 @@ void SwWrtShell::Insert(SwField &rFld)
     StartAllAction();
 
     SwRewriter aRewriter;
-    aRewriter.AddRule(UNDO_ARG1, rFld.GetDescription());
+    aRewriter.AddRule(UndoArg1, rFld.GetDescription());
 
     StartUndo(UNDO_INSERT, &aRewriter);
 
commit 2560e6bc6df31e97de50f857b6fd2a30f3e68bae
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Apr 1 22:56:40 2012 +0100

    rtl::OUStrings already have a global empty string

diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 1067b96..cf8070e 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -76,8 +76,6 @@ using namespace ::com::sun::star;
 
 /************************************************************************/
 
-XubString aNameOrIndexEmptyString;
-
 TYPEINIT1_AUTOFACTORY(NameOrIndex, SfxStringItem);
 
 /*************************************************************************
@@ -109,7 +107,7 @@ long ScaleMetricValue( long nVal, long nMul, long nDiv )
 *************************************************************************/
 
 NameOrIndex::NameOrIndex(sal_uInt16 _nWhich, sal_Int32 nIndex) :
-    SfxStringItem(_nWhich, aNameOrIndexEmptyString),
+    SfxStringItem(_nWhich, rtl::OUString()),
     nPalIndex(nIndex)
 {
 }
commit 39ff18d07bea2363cd6cbf1c960be103ec1376c1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Apr 1 22:45:46 2012 +0100

    UniString->rtl::OUString and drop globals

diff --git a/svx/inc/svx/clipfmtitem.hxx b/svx/inc/svx/clipfmtitem.hxx
index acff3d8..41cbc99 100644
--- a/svx/inc/svx/clipfmtitem.hxx
+++ b/svx/inc/svx/clipfmtitem.hxx
@@ -28,13 +28,10 @@
 #ifndef _SVX_CLIPFMTITEM_HXX
 #define _SVX_CLIPFMTITEM_HXX
 
-// include ---------------------------------------------------------------
-
-#include <tools/gen.hxx>
+#include <rtl/ustring.hxx>
 #include <svl/poolitem.hxx>
 #include "svx/svxdllapi.h"
 
-// class SvxClipboardFmtItem ----------------------------------------------
 struct SvxClipboardFmtItem_Impl;
 
 class SVX_DLLPUBLIC SvxClipboardFmtItem : public SfxPoolItem
@@ -55,12 +52,12 @@ public:
     virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId );
 
     void AddClipbrdFormat( sal_uIntPtr nId, sal_uInt16 nPos = USHRT_MAX );
-    void AddClipbrdFormat( sal_uIntPtr nId, const String& rName,
+    void AddClipbrdFormat( sal_uIntPtr nId, const rtl::OUString& rName,
                             sal_uInt16 nPos = USHRT_MAX );
     sal_uInt16 Count() const;
 
     sal_uIntPtr GetClipbrdFormatId( sal_uInt16 nPos ) const;
-    const String& GetClipbrdFormatName( sal_uInt16 nPos ) const;
+    const rtl::OUString GetClipbrdFormatName( sal_uInt16 nPos ) const;
 };
 
 
diff --git a/svx/source/items/clipfmtitem.cxx b/svx/source/items/clipfmtitem.cxx
index 77273b3..bb9e858 100644
--- a/svx/source/items/clipfmtitem.cxx
+++ b/svx/source/items/clipfmtitem.cxx
@@ -34,16 +34,13 @@
 
 struct SvxClipboardFmtItem_Impl
 {
-    boost::ptr_vector< boost::nullable<String> > aFmtNms;
+    boost::ptr_vector< boost::nullable<rtl::OUString> > aFmtNms;
     std::vector<sal_uIntPtr> aFmtIds;
-    static String sEmptyStr;
 
     SvxClipboardFmtItem_Impl() {}
     SvxClipboardFmtItem_Impl( const SvxClipboardFmtItem_Impl& );
 };
 
-String SvxClipboardFmtItem_Impl::sEmptyStr;
-
 TYPEINIT1_FACTORY( SvxClipboardFmtItem, SfxPoolItem , new  SvxClipboardFmtItem(0));
 
 SvxClipboardFmtItem_Impl::SvxClipboardFmtItem_Impl(
@@ -96,7 +93,7 @@ bool SvxClipboardFmtItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_
 
         pImpl->aFmtIds.clear();
         pImpl->aFmtNms.clear();
-        for ( sal_uInt16 n=0; n < nCount; n++ )
+        for ( sal_uInt16 n=0; n < nCount; ++n )
             AddClipbrdFormat( sal_uIntPtr( aClipFormats.Identifiers[n] ), aClipFormats.Names[n], n );
 
         return true;
@@ -140,13 +137,13 @@ void SvxClipboardFmtItem::AddClipbrdFormat( sal_uIntPtr nId, sal_uInt16 nPos )
     pImpl->aFmtIds.insert( pImpl->aFmtIds.begin()+nPos, nId );
 }
 
-void SvxClipboardFmtItem::AddClipbrdFormat( sal_uIntPtr nId, const String& rName,
+void SvxClipboardFmtItem::AddClipbrdFormat( sal_uIntPtr nId, const rtl::OUString& rName,
                             sal_uInt16 nPos )
 {
     if( nPos > pImpl->aFmtNms.size() )
         nPos = pImpl->aFmtNms.size();
 
-    pImpl->aFmtNms.insert(pImpl->aFmtNms.begin() + nPos, new String(rName));
+    pImpl->aFmtNms.insert(pImpl->aFmtNms.begin() + nPos, new rtl::OUString(rName));
     pImpl->aFmtIds.insert( pImpl->aFmtIds.begin()+nPos, nId );
 }
 
@@ -160,9 +157,9 @@ sal_uIntPtr SvxClipboardFmtItem::GetClipbrdFormatId( sal_uInt16 nPos ) const
     return pImpl->aFmtIds[ nPos ];
 }
 
-const String& SvxClipboardFmtItem::GetClipbrdFormatName( sal_uInt16 nPos ) const
+const rtl::OUString SvxClipboardFmtItem::GetClipbrdFormatName( sal_uInt16 nPos ) const
 {
-    return pImpl->aFmtNms.is_null(nPos) ? SvxClipboardFmtItem_Impl::sEmptyStr : pImpl->aFmtNms[nPos];
+    return pImpl->aFmtNms.is_null(nPos) ? rtl::OUString() : pImpl->aFmtNms[nPos];
 }
 
 
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 2760a7d..15c5d33 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -2831,7 +2831,7 @@ void SwTransferable::FillClipFmtItem( const SwWrtShell& rSh,
 
         if( nResId )
             rToFill.AddClipbrdFormat( SOT_FORMATSTR_ID_EMBED_SOURCE,
-                                        SW_RES( nResId ) );
+                                        SW_RESSTR( nResId ) );
     }
     else
     {
@@ -2856,7 +2856,7 @@ void SwTransferable::FillClipFmtItem( const SwWrtShell& rSh,
     }
 
     if( SwTransferable::_TestAllowedFormat( rData, SOT_FORMATSTR_ID_LINK, nDest ))
-        rToFill.AddClipbrdFormat( SOT_FORMATSTR_ID_LINK, SW_RES(STR_DDEFORMAT) );
+        rToFill.AddClipbrdFormat( SOT_FORMATSTR_ID_LINK, SW_RESSTR(STR_DDEFORMAT) );
 
     for( sal_uInt16* pIds = aPasteSpecialIds; *pIds; ++pIds )
         if( SwTransferable::_TestAllowedFormat( rData, *pIds, nDest ))
commit b6ceb0a8ee690d95ca54490b98fdd3f30eba1309
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Apr 1 22:41:35 2012 +0100

    don't include iostream unless you really need it

diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx
index d5f6720..1f7b132 100644
--- a/sc/inc/externalrefmgr.hxx
+++ b/sc/inc/externalrefmgr.hxx
@@ -48,7 +48,6 @@
 #include <vector>
 #include <list>
 #include <set>
-#include <iostream>
 #include <formula/ExternalReferenceHelper.hxx>
 
 class ScDocument;
commit 09bdea8900c5ce79df3e8f2b7fbeeed06a5b4111
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Apr 1 21:25:49 2012 +0100

    remove static objects from static_initialization_and_destruction chain

diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx
index b707158..8fec414 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -53,21 +53,26 @@ using namespace ::com::sun::star;
 namespace ooo {
 namespace vba {
 
-const static rtl::OUString sUrlPart0( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.script:" ));
-const static rtl::OUString sUrlPart1( RTL_CONSTASCII_USTRINGPARAM( "?language=Basic&location=document" ));
+const char sUrlPart0[] = "vnd.sun.star.script:";
+const char sUrlPart1[] = "?language=Basic&location=document";
 
 String makeMacroURL( const String& sMacroName )
 {
-    return sUrlPart0.concat( sMacroName ).concat( sUrlPart1 ) ;
+    return rtl::OUStringBuffer().
+        appendAscii(RTL_CONSTASCII_STRINGPARAM(sUrlPart0)).
+        append(sMacroName).
+        appendAscii(RTL_CONSTASCII_STRINGPARAM(sUrlPart1)).
+        makeStringAndClear();
 }
 
 ::rtl::OUString extractMacroName( const ::rtl::OUString& rMacroUrl )
 {
-    if( (rMacroUrl.getLength() > sUrlPart0.getLength() + sUrlPart1.getLength()) &&
-        rMacroUrl.match( sUrlPart0 ) &&
-        rMacroUrl.match( sUrlPart1, rMacroUrl.getLength() - sUrlPart1.getLength() ) )
+    if( (rMacroUrl.getLength() > RTL_CONSTASCII_LENGTH(sUrlPart0) + RTL_CONSTASCII_LENGTH(sUrlPart1)) &&
+        rMacroUrl.matchAsciiL( RTL_CONSTASCII_STRINGPARAM(sUrlPart0) ) &&
+        rMacroUrl.matchAsciiL( RTL_CONSTASCII_STRINGPARAM(sUrlPart1), rMacroUrl.getLength() - RTL_CONSTASCII_LENGTH(sUrlPart1) ) )
     {
-        return rMacroUrl.copy( sUrlPart0.getLength(), rMacroUrl.getLength() - sUrlPart0.getLength() - sUrlPart1.getLength() );
+        return rMacroUrl.copy( RTL_CONSTASCII_LENGTH(sUrlPart0),
+            rMacroUrl.getLength() - RTL_CONSTASCII_LENGTH(sUrlPart0) - RTL_CONSTASCII_LENGTH(sUrlPart1) );
     }
     return ::rtl::OUString();
 }
diff --git a/framework/inc/services/taskcreatorsrv.hxx b/framework/inc/services/taskcreatorsrv.hxx
index ebabdd1..1d7de6c 100644
--- a/framework/inc/services/taskcreatorsrv.hxx
+++ b/framework/inc/services/taskcreatorsrv.hxx
@@ -57,6 +57,40 @@
 //_______________________________________________
 // definition
 
+/// [XFrame] if it's set, it will be used as parent frame for the new created frame.
+const char ARGUMENT_PARENTFRAME[] = "ParentFrame"; // XFrame
+
+/** [OUString] if it's not a special name (beginning with "_" ... which are not allowed here!)
+               it will be set as the API name of the new created frame.
+ */
+const char ARGUMENT_FRAMENAME[] = "FrameName"; // OUString
+
+/// [sal_Bool] If its set to sal_True we will make the new created frame visible.
+const char ARGUMENT_MAKEVISIBLE[] = "MakeVisible"; // sal_Bool
+
+/** [sal_Bool] If not "ContainerWindow" property is set it force creation of a
+               top level window as new container window.
+ */
+const char ARGUMENT_CREATETOPWINDOW[] = "CreateTopWindow"; // sal_Bool
+
+/// [Rectangle] Place the new created frame on this place and resize the container window.
+const char ARGUMENT_POSSIZE[] = "PosSize"; // Rectangle
+
+/// [XWindow] an outside created window, used as container window of the new created frame.
+const char ARGUMENT_CONTAINERWINDOW[] = "ContainerWindow"; // XWindow
+
+/** [sal_Bool] enable/disable special mode, where this frame will be part of
+               the persistent window state feature suitable for any office module window
+ */
+const char ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE[] = "SupportPersistentWindowState"; // sal_Bool
+
+/** [sal_Bool] enable/disable special mode, where the title bar of our
+               the new created frame will be updated automaticly.
+               Default = ON !
+ */
+const char ARGUMENT_ENABLE_TITLEBARUPDATE[] = "EnableTitleBarUpdate"; // sal_Bool
+
+
 namespace framework
 {
 
@@ -72,43 +106,6 @@ class TaskCreatorService : public  css::lang::XTypeProvider
                          , public  ::cppu::OWeakObject
 {
     //___________________________________________
-    // types
-
-    public:
-
-        /// [XFrame] if it's set, it will be used as parent frame for the new created frame.
-        static const ::rtl::OUString ARGUMENT_PARENTFRAME;
-
-        /** [OUString] if it's not a special name (beginning with "_" ... which are not allowed here!)
-                       it will be set as the API name of the new created frame.
-         */
-        static const ::rtl::OUString ARGUMENT_FRAMENAME;
-
-        /// [sal_Bool] If its set to sal_True we will make the new created frame visible.
-        static const ::rtl::OUString ARGUMENT_MAKEVISIBLE;
-
-        /** [sal_Bool] If not "ContainerWindow" property is set it force creation of a
-                       top level window as new container window.
-         */
-        static const ::rtl::OUString ARGUMENT_CREATETOPWINDOW;
-
-        /// [Rectangle] Place the new created frame on this place and resize the container window.
-        static const ::rtl::OUString ARGUMENT_POSSIZE;
-
-        /// [XWindow] an outside created window, used as container window of the new created frame.
-        static const ::rtl::OUString ARGUMENT_CONTAINERWINDOW;
-
-        /** [sal_Bool] enable/disable special mode, where this frame will be part of
-                       the persistent window state feature suitable for any office module window
-         */
-        static const ::rtl::OUString ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE;
-
-        /** [sal_Bool] enable/disable special mode, where the title bar of our
-                       the new created frame will be updated automaticly.
-                       Default = ON !
-         */
-        static const ::rtl::OUString ARGUMENT_ENABLE_TITLEBARUPDATE;
-    //___________________________________________
     // member
 
     private:
diff --git a/framework/source/classes/taskcreator.cxx b/framework/source/classes/taskcreator.cxx
index 6c3d529..05aa9b4 100644
--- a/framework/source/classes/taskcreator.cxx
+++ b/framework/source/classes/taskcreator.cxx
@@ -143,23 +143,23 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const ::rtl::
     css::uno::Sequence< css::uno::Any > lArgs(5);
     css::beans::NamedValue              aArg    ;
 
-    aArg.Name    = TaskCreatorService::ARGUMENT_PARENTFRAME;
+    aArg.Name    = rtl::OUString(ARGUMENT_PARENTFRAME);
     aArg.Value <<= css::uno::Reference< css::frame::XFrame >(xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW);
     lArgs[0]   <<= aArg;
 
-    aArg.Name    = TaskCreatorService::ARGUMENT_CREATETOPWINDOW;
+    aArg.Name    = rtl::OUString(ARGUMENT_CREATETOPWINDOW);
     aArg.Value <<= sal_True;
     lArgs[1]   <<= aArg;
 
-    aArg.Name    = TaskCreatorService::ARGUMENT_MAKEVISIBLE;
+    aArg.Name    = rtl::OUString(ARGUMENT_MAKEVISIBLE);
     aArg.Value <<= bVisible;
     lArgs[2]   <<= aArg;
 
-    aArg.Name    = TaskCreatorService::ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE;
+    aArg.Name    = rtl::OUString(ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE);
     aArg.Value <<= sal_True;
     lArgs[3]   <<= aArg;
 
-    aArg.Name    = TaskCreatorService::ARGUMENT_FRAMENAME;
+    aArg.Name    = rtl::OUString(ARGUMENT_FRAMENAME);
     aArg.Value <<= sName;
     lArgs[4]   <<= aArg;
 
diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx
index dd14cf3..2f5d4fe 100644
--- a/framework/source/services/taskcreatorsrv.cxx
+++ b/framework/source/services/taskcreatorsrv.cxx
@@ -62,17 +62,6 @@
 
 namespace framework
 {
-
-//-----------------------------------------------
-const ::rtl::OUString TaskCreatorService::ARGUMENT_PARENTFRAME(RTL_CONSTASCII_USTRINGPARAM("ParentFrame")); // XFrame
-const ::rtl::OUString TaskCreatorService::ARGUMENT_FRAMENAME(RTL_CONSTASCII_USTRINGPARAM("FrameName")); // OUString
-const ::rtl::OUString TaskCreatorService::ARGUMENT_MAKEVISIBLE(RTL_CONSTASCII_USTRINGPARAM("MakeVisible")); // sal_Bool
-const ::rtl::OUString TaskCreatorService::ARGUMENT_CREATETOPWINDOW(RTL_CONSTASCII_USTRINGPARAM("CreateTopWindow")); // sal_Bool
-const ::rtl::OUString TaskCreatorService::ARGUMENT_POSSIZE(RTL_CONSTASCII_USTRINGPARAM("PosSize")); // Rectangle
-const ::rtl::OUString TaskCreatorService::ARGUMENT_CONTAINERWINDOW(RTL_CONSTASCII_USTRINGPARAM("ContainerWindow")); // XWindow
-const ::rtl::OUString TaskCreatorService::ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE(RTL_CONSTASCII_USTRINGPARAM("SupportPersistentWindowState")); // sal_Bool
-const ::rtl::OUString TaskCreatorService::ARGUMENT_ENABLE_TITLEBARUPDATE(RTL_CONSTASCII_USTRINGPARAM("EnableTitleBarUpdate")); // sal_Bool
-
 //-----------------------------------------------
 DEFINE_XINTERFACE_3(TaskCreatorService                                ,
                     OWeakObject                                       ,
@@ -139,14 +128,14 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL TaskCreatorService::createI
 
     ::comphelper::SequenceAsHashMap lArgs(lArguments);
 
-    css::uno::Reference< css::frame::XFrame > xParentFrame                  = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_PARENTFRAME                  , css::uno::Reference< css::frame::XFrame >());
-    ::rtl::OUString                           sFrameName                    = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_FRAMENAME                    , DEFAULTVAL_FRAMENAME                       );
-    sal_Bool                                  bVisible                      = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_MAKEVISIBLE                  , DEFAULTVAL_MAKEVISIBLE                     );
-    sal_Bool                                  bCreateTopWindow              = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_CREATETOPWINDOW              , DEFAULTVAL_CREATETOPWINDOW                 );
-    css::awt::Rectangle                       aPosSize                      = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_POSSIZE                      , DEFAULTVAL_POSSIZE                         );
-    css::uno::Reference< css::awt::XWindow >  xContainerWindow              = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_CONTAINERWINDOW              , css::uno::Reference< css::awt::XWindow >() );
-    sal_Bool                                  bSupportPersistentWindowState = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE , DEFAULTVAL_SUPPORTPERSSISTENTWINDOWSTATE   );
-    sal_Bool                                  bEnableTitleBarUpdate         = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_ENABLE_TITLEBARUPDATE        , DEFAULTVAL_ENABLE_TITLEBARUPDATE           );
+    css::uno::Reference< css::frame::XFrame > xParentFrame                  = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_PARENTFRAME)                  , css::uno::Reference< css::frame::XFrame >());
+    ::rtl::OUString                           sFrameName                    = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_FRAMENAME)                    , DEFAULTVAL_FRAMENAME                       );
+    sal_Bool                                  bVisible                      = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_MAKEVISIBLE)                  , DEFAULTVAL_MAKEVISIBLE                     );
+    sal_Bool                                  bCreateTopWindow              = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_CREATETOPWINDOW)              , DEFAULTVAL_CREATETOPWINDOW                 );
+    css::awt::Rectangle                       aPosSize                      = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_POSSIZE)                      , DEFAULTVAL_POSSIZE                         );
+    css::uno::Reference< css::awt::XWindow >  xContainerWindow              = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_CONTAINERWINDOW)              , css::uno::Reference< css::awt::XWindow >() );
+    sal_Bool                                  bSupportPersistentWindowState = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE) , DEFAULTVAL_SUPPORTPERSSISTENTWINDOWSTATE   );
+    sal_Bool                                  bEnableTitleBarUpdate         = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_ENABLE_TITLEBARUPDATE)        , DEFAULTVAL_ENABLE_TITLEBARUPDATE           );
 
     /* SAFE { */
     ReadGuard aReadLock( m_aLock );
diff --git a/salhelper/source/timer.cxx b/salhelper/source/timer.cxx
index aff006c..d7ad3ed 100644
--- a/salhelper/source/timer.cxx
+++ b/salhelper/source/timer.cxx
@@ -32,6 +32,7 @@
 #include <osl/thread.hxx>
 #include <osl/conditn.hxx>
 #include <osl/mutex.hxx>
+#include <rtl/instance.hxx>
 
 using namespace salhelper;
 
@@ -77,9 +78,6 @@ protected:
     // Signal the insertion of a timer
     osl::Condition              m_notEmpty;
 
-    // Synchronize access to TimerManager
-    static osl::Mutex           m_Access;
-
     // "Singleton Pattern"
     static salhelper::TimerManager* m_pManager;
 
@@ -251,13 +249,17 @@ TTimeValue Timer::getRemainingTime() const
 //
 // Timer manager
 //
+namespace
+{
+    // Synchronize access to TimerManager
+    struct theTimerManagerMutex : public rtl::Static< osl::Mutex, theTimerManagerMutex> {};
+}
 
-osl::Mutex salhelper::TimerManager::m_Access;
 TimerManager* salhelper::TimerManager::m_pManager = NULL;
 
 TimerManager::TimerManager()
 {
-    osl::MutexGuard Guard(&m_Access);
+    osl::MutexGuard Guard(theTimerManagerMutex::get());
 
     OSL_ASSERT(m_pManager == 0);
 
@@ -273,7 +275,7 @@ TimerManager::TimerManager()
 
 TimerManager::~TimerManager()
 {
-    osl::MutexGuard Guard(&m_Access);
+    osl::MutexGuard Guard(theTimerManagerMutex::get());
 
     if ( m_pManager == this )
         m_pManager = 0;
@@ -286,12 +288,12 @@ void TimerManager::onTerminated()
 
 TimerManager* TimerManager::getTimerManager()
 {
-    osl::MutexGuard Guard(&m_Access);
+    osl::MutexGuard Guard(theTimerManagerMutex::get());
 
     if (! m_pManager)
         new TimerManager;
 
-    return (m_pManager);
+    return m_pManager;
 }
 
 sal_Bool TimerManager::registerTimer(Timer* pTimer)
@@ -303,7 +305,7 @@ sal_Bool TimerManager::registerTimer(Timer* pTimer)
         return sal_False;
     }
 
-    osl::MutexGuard Guard(&m_Lock);
+    osl::MutexGuard Guard(m_Lock);
 
     // try to find one with equal or lower remaining time.
     Timer** ppIter = &m_pHead;
@@ -345,7 +347,7 @@ sal_Bool TimerManager::unregisterTimer(Timer* pTimer)
     }
 
     // lock access
-    osl::MutexGuard Guard(&m_Lock);
+    osl::MutexGuard Guard(m_Lock);
 
     Timer** ppIter = &m_pHead;
 
@@ -373,7 +375,7 @@ sal_Bool TimerManager::lookupTimer(const Timer* pTimer)
     }
 
     // lock access
-    osl::MutexGuard Guard(&m_Lock);
+    osl::MutexGuard Guard(m_Lock);
 
     // check the list
     for (Timer* pIter = m_pHead; pIter != 0; pIter= pIter->m_pNext)
diff --git a/svx/inc/svx/dbtoolsclient.hxx b/svx/inc/svx/dbtoolsclient.hxx
index 8c86223..661f8d8 100644
--- a/svx/inc/svx/dbtoolsclient.hxx
+++ b/svx/inc/svx/dbtoolsclient.hxx
@@ -52,7 +52,6 @@ namespace svxform
     class SVX_DLLPUBLIC ODbtoolsClient
     {
     private:
-        static  ::osl::Mutex    s_aMutex;
         static  sal_Int32       s_nClients;
         static oslModule        s_hDbtoolsModule;
         static ::connectivity::simple::createDataAccessToolsFactoryFunction
diff --git a/svx/source/form/dbtoolsclient.cxx b/svx/source/form/dbtoolsclient.cxx
index e71025c..78c0444 100644
--- a/svx/source/form/dbtoolsclient.cxx
+++ b/svx/source/form/dbtoolsclient.cxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/sdb/SQLContext.hpp>
 #include "svx/dbtoolsclient.hxx"
 #include <osl/diagnose.h>
+#include <rtl/instance.hxx>
 #include <connectivity/formattedcolumnvalue.hxx>
 
 //........................................................................
@@ -51,7 +52,12 @@ namespace svxform
     //====================================================================
     //= ODbtoolsClient
     //====================================================================
-    ::osl::Mutex    ODbtoolsClient::s_aMutex;
+
+    namespace
+    {
+        struct theODbtoolsClientMutex : public rtl::Static< osl::Mutex, theODbtoolsClientMutex> {};
+    }
+
     sal_Int32       ODbtoolsClient::s_nClients = 0;
     oslModule       ODbtoolsClient::s_hDbtoolsModule = NULL;
     createDataAccessToolsFactoryFunction
@@ -103,7 +109,7 @@ namespace svxform
 
     void ODbtoolsClient::registerClient()
     {
-        ::osl::MutexGuard aGuard(s_aMutex);
+        ::osl::MutexGuard aGuard(theODbtoolsClientMutex::get());
         if (1 == ++s_nClients)
         {
             OSL_ENSURE(NULL == s_hDbtoolsModule, "ODbtoolsClient::registerClient: inconsistence: already have a module!");
@@ -138,7 +144,7 @@ namespace svxform
     //--------------------------------------------------------------------
     void ODbtoolsClient::revokeClient()
     {
-        ::osl::MutexGuard aGuard(s_aMutex);
+        ::osl::MutexGuard aGuard(theODbtoolsClientMutex::get());
         if (0 == --s_nClients)
         {
             s_pFactoryCreationFunc = NULL;
diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx
index b227830..a3073f2 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -159,7 +159,6 @@ class SwXNumberingRules : public cppu::WeakAggImplHelper5
     SwNumRule*                  pNumRule;
     const SfxItemPropertySet*   m_pPropertySet;
     sal_Bool                    bOwnNumRuleCreated;
-    static String               sInvalidStyle;
 protected:
     virtual ~SwXNumberingRules();
 
@@ -217,7 +216,7 @@ public:
     const String*           GetBulletFontNames() const {return sNewBulletFontNames;}
     const SwNumRule*        GetNumRule() {return pNumRule;}
 
-    static const String&    GetInvalidStyle();
+    static bool             isInvalidStyle(const rtl::OUString &rName);
     void    Invalidate()    {pDocShell = 0;}
     const String&           GetCreatedNumRuleName() const{return sCreatedNumRuleName; }
 };
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index b4a5c6d..d5b8a64 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -599,7 +599,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam)
                 {
                     SwNumFmt aFmt(aRule.Get( i ));
                     if( pNewCharStyles[i].Len() &&
-                        pNewCharStyles[i] != SwXNumberingRules::GetInvalidStyle() &&
+                        !SwXNumberingRules::isInvalidStyle(pNewCharStyles[i]) &&
                         (!aFmt.GetCharFmt() || pNewCharStyles[i] != aFmt.GetCharFmt()->GetName()))
                     {
                         if(!pNewCharStyles[i].Len())
@@ -636,7 +636,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam)
                     }
                     //Now again for fonts
                     if(
-                       pBulletFontNames[i] != SwXNumberingRules::GetInvalidStyle() &&
+                       !SwXNumberingRules::isInvalidStyle(pBulletFontNames[i]) &&
                        (
                         (pBulletFontNames[i].Len() && !aFmt.GetBulletFont()) ||
                         (pBulletFontNames[i].Len() &&
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 12664bd..74bc40d 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1124,11 +1124,11 @@ OSL_FAIL("not implemented");
 /******************************************************************
  * SwXNumberingRules
  ******************************************************************/
-String  SwXNumberingRules::sInvalidStyle(String::CreateFromAscii("__XXX___invalid"));
+const char aInvalidStyle[] = "__XXX___invalid";
 
-const String&   SwXNumberingRules::GetInvalidStyle()
+bool SwXNumberingRules::isInvalidStyle(const rtl::OUString &rName)
 {
-    return sInvalidStyle;
+    return rName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(aInvalidStyle));
 }
 
 namespace
@@ -1196,8 +1196,8 @@ SwXNumberingRules::SwXNumberingRules(const SwNumRule& rRule) :
         pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
     for(i = 0; i < MAXLEVEL; i++)
     {
-        sNewCharStyleNames[i] = SwXNumberingRules::GetInvalidStyle();
-        sNewBulletFontNames[i] = SwXNumberingRules::GetInvalidStyle();
+        sNewCharStyleNames[i] = rtl::OUString(aInvalidStyle);
+        sNewBulletFontNames[i] = rtl::OUString(aInvalidStyle);
     }
 }
 
@@ -1399,7 +1399,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
         CharStyleName = pCharFmt->GetName();
     //egal ob ein Style vorhanden ist oder nicht ueberschreibt der Array-Eintrag diesen String
     if(sNewCharStyleNames[(sal_uInt16)nIndex].Len() &&
-        SwXNumberingRules::sInvalidStyle != sNewCharStyleNames[(sal_uInt16)nIndex])
+        !SwXNumberingRules::isInvalidStyle(sNewCharStyleNames[(sal_uInt16)nIndex]))
         CharStyleName = sNewCharStyleNames[(sal_uInt16)nIndex];
 
     String aString;

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list