[PATCH] String=>OUString clean-up header include in tools and misc t...

Norbert Thiebaud (via Code Review) gerrit at gerrit.libreoffice.org
Thu Jun 13 06:20:30 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/4265

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/65/4265/1

String=>OUString clean-up header include in tools and misc touch-up

Change-Id: I8c2220e21c58739ea41702101e0d533dc56f1208
---
M include/sfx2/docfilt.hxx
M include/sot/storinfo.hxx
M include/svtools/ehdl.hxx
M include/tools/errinf.hxx
M include/tools/inetmime.hxx
M include/tools/wldcrd.hxx
M include/unotools/fontcvt.hxx
M include/unotools/fontdefs.hxx
M sfx2/source/doc/docfilt.cxx
M sot/source/sdstor/stg.cxx
M svtools/source/misc/ehdl.cxx
M tools/source/inet/inetmsg.cxx
M unotools/source/config/pathoptions.cxx
M unotools/source/misc/syslocale.cxx
14 files changed, 36 insertions(+), 28 deletions(-)



diff --git a/include/sfx2/docfilt.hxx b/include/sfx2/docfilt.hxx
index cc6f6b8..b92fd0d 100644
--- a/include/sfx2/docfilt.hxx
+++ b/include/sfx2/docfilt.hxx
@@ -22,6 +22,7 @@
 #include "sal/config.h"
 #include "sfx2/dllapi.h"
 #include "sal/types.h"
+#include <tools/solar.h>
 #include <com/sun/star/plugin/PluginDescription.hpp>
 #include <com/sun/star/embed/XStorage.hpp>
 #include <com/sun/star/beans/UnknownPropertyException.hpp>
@@ -96,11 +97,11 @@
     sal_uInt16          GetDocIconId() const { return nDocIcon; }
     const OUString& GetUserData() const { return aUserData; }
     const OUString& GetDefaultTemplate() const { return aDefaultTemplate; }
-    void            SetDefaultTemplate( const String& rStr ) { aDefaultTemplate = rStr; }
+    void            SetDefaultTemplate( const OUString& rStr ) { aDefaultTemplate = rStr; }
     bool            UsesStorage() const { return GetFormat() != 0; }
     void SetURLPattern( const OUString& rStr );
     OUString GetURLPattern() const { return aPattern; }
-    void            SetUIName( const String& rName ) { aUIName = rName; }
+    void            SetUIName( const OUString& rName ) { aUIName = rName; }
     void            SetVersion( sal_uIntPtr nVersionP ) { nVersion = nVersionP; }
     sal_uIntPtr           GetVersion() const { return nVersion; }
     OUString GetSuffixes() const;
@@ -108,9 +109,9 @@
     const OUString& GetServiceName() const { return aServiceName; }
     const OUString& GetProviderName() const;
 
-    static const SfxFilter* GetDefaultFilter( const String& rName );
-    static const SfxFilter* GetFilterByName( const String& rName );
-    static const SfxFilter* GetDefaultFilterFromFactory( const String& rServiceName );
+    static const SfxFilter* GetDefaultFilter( const OUString& rName );
+    static const SfxFilter* GetFilterByName( const OUString& rName );
+    static const SfxFilter* GetDefaultFilterFromFactory( const OUString& rServiceName );
 
     static OUString GetTypeFromStorage( const SotStorage& rStg );
     static OUString GetTypeFromStorage(
diff --git a/include/sot/storinfo.hxx b/include/sot/storinfo.hxx
index f9ad436..6784e04 100644
--- a/include/sot/storinfo.hxx
+++ b/include/sot/storinfo.hxx
@@ -21,6 +21,7 @@
 #define _SOT_STORINFO_HXX
 
 #include <tools/globname.hxx>
+#include <tools/solar.h>
 #include <vector>
 #include "sot/sotdllapi.h"
 
diff --git a/include/svtools/ehdl.hxx b/include/svtools/ehdl.hxx
index 4b06a6e..5772edf 100644
--- a/include/svtools/ehdl.hxx
+++ b/include/svtools/ehdl.hxx
@@ -36,7 +36,7 @@
             sal_uInt16 nCtxIdP, Window *pWin=0,
             sal_uInt16 nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
     SfxErrorContext(
-            sal_uInt16 nCtxIdP, const String &aArg1, Window *pWin=0,
+            sal_uInt16 nCtxIdP, const OUString &aArg1, Window *pWin=0,
             sal_uInt16 nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
     virtual sal_Bool GetString(sal_uLong nErrId, OUString &rStr);
 
@@ -44,7 +44,7 @@
     sal_uInt16 nCtxId;
     sal_uInt16 nResId;
     ResMgr *pMgr;
-    String aArg1;
+    OUString aArg1;
 };
 
 class SVT_DLLPUBLIC SfxErrorHandler : private ErrorHandler
@@ -65,7 +65,7 @@
     ResMgr          *pMgr;
     ResMgr          *pFreeMgr;
 
-    SVT_DLLPRIVATE sal_Bool             GetClassString(sal_uLong lErrId, String &) const;
+    SVT_DLLPRIVATE sal_Bool             GetClassString(sal_uLong lErrId, OUString &) const;
     virtual sal_Bool     CreateString(
                          const ErrorInfo *, OUString &, sal_uInt16 &) const;
 };
diff --git a/include/tools/errinf.hxx b/include/tools/errinf.hxx
index 815447b..9ca3ff0 100644
--- a/include/tools/errinf.hxx
+++ b/include/tools/errinf.hxx
@@ -23,9 +23,10 @@
 #define _EINF_HXX
 
 #include <limits.h>
+#include <rtl/ustring.hxx>
+#include <tools/lineend.hxx>
 #include <tools/rtti.hxx>
 #include <tools/errcode.hxx>
-#include <tools/string.hxx>
 #include "tools/toolsdllapi.h"
 
 class EDcr_Impl;
diff --git a/include/tools/inetmime.hxx b/include/tools/inetmime.hxx
index afe4247..347bb78 100644
--- a/include/tools/inetmime.hxx
+++ b/include/tools/inetmime.hxx
@@ -26,6 +26,7 @@
 #include <rtl/character.hxx>
 #include <rtl/string.hxx>
 #include <rtl/strbuf.hxx>
+#include <rtl/ustring.hxx>
 #include <rtl/tencinfo.h>
 #include <tools/debug.hxx>
 #include <tools/errcode.hxx>
diff --git a/include/tools/wldcrd.hxx b/include/tools/wldcrd.hxx
index c47d918..8d4edb5 100644
--- a/include/tools/wldcrd.hxx
+++ b/include/tools/wldcrd.hxx
@@ -20,7 +20,7 @@
 #define _WLDCRD_HXX
 
 #include "tools/toolsdllapi.h"
-#include <tools/string.hxx>
+#include <rtl/ustring.hxx>
 #include <osl/thread.h>
 
 class TOOLS_DLLPUBLIC WildCard
diff --git a/include/unotools/fontcvt.hxx b/include/unotools/fontcvt.hxx
index 004215c..ea575ad 100644
--- a/include/unotools/fontcvt.hxx
+++ b/include/unotools/fontcvt.hxx
@@ -21,7 +21,8 @@
 #define _UNOTOOLS_FONTCVT_HXX
 
 #include <unotools/unotoolsdllapi.h>
-#include <tools/string.hxx>
+#include <rtl/ustring.hxx>
+#include <tools/solar.h>
 
 // ------------------
 // - FontToSubsFont -
diff --git a/include/unotools/fontdefs.hxx b/include/unotools/fontdefs.hxx
index d46c8e2..1e88372 100644
--- a/include/unotools/fontdefs.hxx
+++ b/include/unotools/fontdefs.hxx
@@ -21,7 +21,7 @@
 
 #include <unotools/unotoolsdllapi.h>
 #include <sal/types.h>
-#include <tools/string.hxx>
+#include <tools/solar.h>
 #include <rtl/ustring.hxx>
 #include <rtl/ustrbuf.hxx>
 
diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx
index d642f02..dc9da42 100644
--- a/sfx2/source/doc/docfilt.cxx
+++ b/sfx2/source/doc/docfilt.cxx
@@ -125,17 +125,17 @@
     return aRet;
 }
 
-const SfxFilter* SfxFilter::GetDefaultFilter( const String& rName )
+const SfxFilter* SfxFilter::GetDefaultFilter( const OUString& rName )
 {
     return SfxFilterContainer::GetDefaultFilter_Impl( rName );
 }
 
-const SfxFilter* SfxFilter::GetDefaultFilterFromFactory( const String& rFact )
+const SfxFilter* SfxFilter::GetDefaultFilterFromFactory( const OUString& rFact )
 {
     return GetDefaultFilter( SfxObjectShell::GetServiceNameFromFactory( rFact ) );
 }
 
-const SfxFilter* SfxFilter::GetFilterByName( const String& rName )
+const SfxFilter* SfxFilter::GetFilterByName( const OUString& rName )
 {
     SfxFilterMatcher aMatch;
     return aMatch.GetFilter4FilterName( rName, 0, 0 );
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx
index 4fd30b9..e8c9863 100644
--- a/sot/source/sdstor/stg.cxx
+++ b/sot/source/sdstor/stg.cxx
@@ -21,7 +21,7 @@
 #include <sot/storinfo.hxx>
 #include <osl/file.hxx>
 #include <tools/tempfile.hxx>
-#include <tools/string.hxx>
+#include <tools/solar.h>
 #include <tools/stream.hxx>
 #include <tools/debug.hxx>
 
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index e6a9eff..e42b40a 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -81,12 +81,12 @@
             break;
     }
 
-    String aErr(SvtResId(STR_ERR_HDLMESS).toString());
-    String aAction(rAction);
-    if ( aAction.Len() )
+    OUString aErr(SvtResId(STR_ERR_HDLMESS).toString());
+    OUString aAction(rAction);
+    if ( !aAction.isEmpty() )
         aAction += OUString(":\n");
-    aErr.SearchAndReplace(OUString("$(ACTION)"), aAction);
-    aErr.SearchAndReplace(OUString("$(ERROR)"), rErr);
+    aErr = aErr.replaceFirst(OUString("$(ACTION)"), aAction);
+    aErr = aErr.replaceFirst(OUString("$(ERROR)"), rErr);
 
     MessBox* pBox;
     switch ( nFlags & 0xf000 )
@@ -211,7 +211,7 @@
 
 //-------------------------------------------------------------------------
 
-class ResString: public String
+class ResString: public OUString
 
 /*  [Beschreibung]
 
@@ -224,14 +224,14 @@
     sal_uInt16 nFlags;
   public:
     sal_uInt16 GetFlags() const {return nFlags;}
-    const String & GetString() const {return *this;}
+    const OUString & GetString() const {return *this;}
     ResString( ResId &rId);
 };
 
 //-------------------------------------------------------------------------
 
 ResString::ResString(ResId & rId):
-    String(rId.SetAutoRelease(sal_False).toString()),
+    OUString(rId.SetAutoRelease(sal_False).toString()),
     nFlags(0)
 {
     ResMgr * pResMgr = rId.GetResMgr();
@@ -266,7 +266,7 @@
 };
 
 
-sal_Bool SfxErrorHandler::GetClassString(sal_uLong lClassId, String &rStr) const
+sal_Bool SfxErrorHandler::GetClassString(sal_uLong lClassId, OUString &rStr) const
 
 /*  [Beschreibung]
 
@@ -358,10 +358,10 @@
 
     if( bRet )
     {
-        String aErrStr;
+        OUString aErrStr;
         GetClassString(lErrId & ERRCODE_CLASS_MASK,
                        aErrStr);
-        if(aErrStr.Len())
+        if(!aErrStr.isEmpty())
             aErrStr += OUString(".\n");
         rStr = rStr.replaceAll(OUString("$(CLASS)"),aErrStr);
     }
@@ -382,7 +382,7 @@
 //-------------------------------------------------------------------------
 
 SfxErrorContext::SfxErrorContext(
-    sal_uInt16 nCtxIdP, const String &aArg1P, Window *pWindow,
+    sal_uInt16 nCtxIdP, const OUString &aArg1P, Window *pWindow,
     sal_uInt16 nResIdP, ResMgr *pMgrP)
 :   ErrorContext(pWindow), nCtxId(nCtxIdP), nResId(nResIdP), pMgr(pMgrP),
     aArg1(aArg1P)
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx
index 2a70cd9..eb750ba 100644
--- a/tools/source/inet/inetmsg.cxx
+++ b/tools/source/inet/inetmsg.cxx
@@ -25,6 +25,7 @@
 #include <tools/contnr.hxx>
 #include <rtl/instance.hxx>
 #include <rtl/strbuf.hxx>
+#include <osl/thread.h>
 #include <comphelper/string.hxx>
 
 #include <stdio.h>
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx
index bfa473a..9b357c4 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -21,6 +21,7 @@
 #include <unotools/configitem.hxx>
 #include <unotools/configmgr.hxx>
 #include <tools/urlobj.hxx>
+#include <tools/solar.h>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
 #include <osl/mutex.hxx>
diff --git a/unotools/source/misc/syslocale.cxx b/unotools/source/misc/syslocale.cxx
index bf67a4d..700c56a 100644
--- a/unotools/source/misc/syslocale.cxx
+++ b/unotools/source/misc/syslocale.cxx
@@ -24,6 +24,7 @@
 #include <rtl/tencinfo.h>
 #include <rtl/locale.h>
 #include <osl/nlsupport.h>
+#include <osl/thread.h>
 #include <vector>
 
 using namespace osl;

-- 
To view, visit https://gerrit.libreoffice.org/4265
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c2220e21c58739ea41702101e0d533dc56f1208
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Norbert Thiebaud <nthiebaud at gmail.com>



More information about the LibreOffice mailing list