[Libreoffice-commits] core.git: 2 commits - dbaccess/source desktop/source extensions/source framework/source include/svx include/tools reportdesign/source scripting/source sc/source svx/source sw/inc sw/source tools/source vcl/aqua

Caolán McNamara caolanm at redhat.com
Sun Jul 14 06:04:28 PDT 2013


 dbaccess/source/ui/control/opendoccontrols.cxx             |    6 -
 dbaccess/source/ui/misc/defaultobjectnamecheck.cxx         |    7 --
 desktop/source/deployment/gui/dp_gui_dialog2.cxx           |   44 ++++++-------
 desktop/source/deployment/gui/dp_gui_dialog2.hxx           |    2 
 desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx |   20 ++---
 desktop/source/deployment/inc/dp_resource.h                |    2 
 desktop/source/deployment/manager/dp_extensionmanager.cxx  |    8 +-
 desktop/source/deployment/misc/dp_resource.cxx             |   10 +-
 desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx             |   23 +++---
 extensions/source/propctrlr/formcomponenthandler.cxx       |    4 -
 framework/source/uielement/uicommanddescription.cxx        |   10 +-
 include/svx/lboxctrl.hxx                                   |    2 
 include/tools/string.hxx                                   |    1 
 reportdesign/source/ui/report/ReportController.cxx         |    4 -
 sc/source/core/tool/compiler.cxx                           |   18 ++---
 scripting/source/pyprov/mailmerge.py                       |    4 -
 svx/source/dialog/compressgraphicdialog.cxx                |   26 +++----
 svx/source/form/fmvwimp.cxx                                |    5 -
 svx/source/tbxctrls/lboxctrl.cxx                           |   11 +--
 sw/inc/shellres.hxx                                        |    2 
 sw/source/filter/ww8/ww8graf.cxx                           |   13 ++-
 sw/source/filter/ww8/ww8par.hxx                            |    2 
 sw/source/filter/ww8/ww8par5.cxx                           |   28 ++++----
 sw/source/filter/ww8/ww8par6.cxx                           |    4 -
 sw/source/ui/dbui/mmconfigitem.cxx                         |   14 +---
 sw/source/ui/docvw/edtwin2.cxx                             |   10 +-
 sw/source/ui/utlui/initui.cxx                              |   10 +-
 tools/source/string/strascii.cxx                           |   16 ----
 vcl/aqua/source/app/salsys.cxx                             |    5 -
 29 files changed, 141 insertions(+), 170 deletions(-)

New commits:
commit f460556bfa6bd55df3cd4b2288524d63db284d7e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jul 13 21:45:29 2013 +0100

    Related: fdo#66761 we want the bytes, not a str representation of them
    
    Change-Id: I3c268b0c51f7e1ddd2fa6588f40412a33f316b52

diff --git a/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py
index 6fa486d..6ed046b 100755
--- a/scripting/source/pyprov/mailmerge.py
+++ b/scripting/source/pyprov/mailmerge.py
@@ -183,9 +183,11 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
 					textmsg['MIME-Version'] = '1.0'
 
 					try:
+						#it's a string, get it as utf-8 bytes
 						textbody = textbody.encode('utf-8')
 					except:
-						textbody = str(textbody.value).encode('utf-8')
+						#it's a bytesequence, get raw bytes
+						textbody = textbody.value
 					if sys.version >= '3':
 						#http://stackoverflow.com/questions/9403265/how-do-i-use-python-3-2-email-module-to-send-unicode-messages-encoded-in-utf-8-w
 						textbody = textbody.decode('iso8859-1')
commit 82937ce3d7bc2382c4da22365d1245c9f7db178c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jul 13 20:12:42 2013 +0100

    String::SearchAndReplaceAllAscii -> OUString::replaceAll
    
    Change-Id: I5091835c9f71c712f15996e5c6263fc5f21f6f96

diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx
index 5723af6..b3136fc 100644
--- a/dbaccess/source/ui/control/opendoccontrols.cxx
+++ b/dbaccess/source/ui/control/opendoccontrols.cxx
@@ -182,10 +182,8 @@ namespace dbaui
         m_sModule = OUString::createFromAscii( _pAsciiModuleName );
 
         // our label should equal the UI text of the "Open" command
-        String sLabel( GetCommandText( ".uno:Open", m_sModule ) );
-        sLabel.SearchAndReplaceAllAscii( "~", String() );
-        sLabel.Insert( (sal_Unicode)' ', 0 );
-        SetText( sLabel );
+        OUString sLabel(GetCommandText(".uno:Open", m_sModule));
+        SetText(OUString(' ') + sLabel.replaceAll("~", OUString()));
 
         // Place icon left of text and both centered in the button.
         SetModeImage( GetCommandIcon( ".uno:Open", m_sModule ) );
diff --git a/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx b/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
index f0d03d9..59fff79 100644
--- a/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
+++ b/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
@@ -72,12 +72,11 @@ namespace dbaui
     //====================================================================
     namespace
     {
-        void    lcl_fillNameExistsError( const OUString& _rObjectName, SQLExceptionInfo& _out_rErrorToDisplay )
+        void lcl_fillNameExistsError( const OUString& _rObjectName, SQLExceptionInfo& _out_rErrorToDisplay )
         {
-            String sErrorMessage = String( ModuleRes( STR_NAMED_OBJECT_ALREADY_EXISTS ) );
-            sErrorMessage.SearchAndReplaceAllAscii( "$#$", _rObjectName );
             SQLException aError;
-            aError.Message = sErrorMessage;
+            OUString sErrorMessage = ModuleRes(STR_NAMED_OBJECT_ALREADY_EXISTS).toString();
+            aError.Message = sErrorMessage.replaceAll("$#$", _rObjectName);
             _out_rErrorToDisplay = aError;
         }
 
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 5c66a36..4939435 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -573,13 +573,13 @@ ResId DialogHelper::getResId( sal_uInt16 nId )
 }
 
 //------------------------------------------------------------------------------
-String DialogHelper::getResourceString( sal_uInt16 id )
+OUString DialogHelper::getResourceString(sal_uInt16 id)
 {
     const SolarMutexGuard guard;
-    String ret( ResId( id, *DeploymentGuiResMgr::get() ) );
-    if (ret.SearchAscii( "%PRODUCTNAME" ) != STRING_NOTFOUND) {
-        ret.SearchAndReplaceAllAscii(
-            "%PRODUCTNAME", utl::ConfigManager::getProductName() );
+    OUString ret(ResId(id, *DeploymentGuiResMgr::get()).toString());
+    if (ret.indexOf("%PRODUCTNAME" ) != -1)
+    {
+        ret = ret.replaceAll("%PRODUCTNAME", utl::ConfigManager::getProductName());
     }
     return ret;
 }
@@ -603,9 +603,9 @@ bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment::
     {
         const SolarMutexGuard guard;
         WarningBox aInfoBox( pParent, getResId( nResID ) );
-        String aMsgText = aInfoBox.GetMessText();
-        aMsgText.SearchAndReplaceAllAscii(
-            "%PRODUCTNAME", utl::ConfigManager::getProductName() );
+        OUString aMsgText = aInfoBox.GetMessText();
+        aMsgText = aMsgText.replaceAll(
+            "%PRODUCTNAME", utl::ConfigManager::getProductName());
         aInfoBox.SetMessText( aMsgText );
 
         bHadWarning = true;
@@ -649,9 +649,9 @@ bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const
     const SolarMutexGuard guard;
     WarningBox aInfo( m_pVCLWindow, getResId( RID_WARNINGBOX_INSTALL_EXTENSION ) );
 
-    String sText( aInfo.GetMessText() );
-    sText.SearchAndReplaceAllAscii( "%NAME", rExtensionName );
-    aInfo.SetMessText( sText );
+    OUString sText(aInfo.GetMessText());
+    sText = sText.replaceAll("%NAME", rExtensionName);
+    aInfo.SetMessText(sText);
 
     return ( RET_OK == aInfo.Execute() );
 }
@@ -662,10 +662,10 @@ bool DialogHelper::installForAllUsers( bool &bInstallForAll ) const
     const SolarMutexGuard guard;
     QueryBox aQuery( m_pVCLWindow, getResId( RID_QUERYBOX_INSTALL_FOR_ALL ) );
 
-    String sMsgText = aQuery.GetMessText();
-    sMsgText.SearchAndReplaceAllAscii(
-        "%PRODUCTNAME", utl::ConfigManager::getProductName() );
-    aQuery.SetMessText( sMsgText );
+    OUString sMsgText(aQuery.GetMessText());
+    sMsgText = sMsgText.replaceAll(
+        "%PRODUCTNAME", utl::ConfigManager::getProductName());
+    aQuery.SetMessText(sMsgText);
 
     sal_uInt16 nYesBtnID = aQuery.GetButtonId( 0 );
     sal_uInt16 nNoBtnID = aQuery.GetButtonId( 1 );
@@ -808,9 +808,9 @@ bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const
     const SolarMutexGuard guard;
     WarningBox aInfo( const_cast< ExtMgrDialog* >(this), getResId( RID_WARNINGBOX_REMOVE_EXTENSION ) );
 
-    String sText( aInfo.GetMessText() );
-    sText.SearchAndReplaceAllAscii( "%NAME", rExtensionName );
-    aInfo.SetMessText( sText );
+    OUString sText(aInfo.GetMessText());
+    sText = sText.replaceAll("%NAME", rExtensionName);
+    aInfo.SetMessText(sText);
 
     return ( RET_OK == aInfo.Execute() );
 }
@@ -1224,10 +1224,10 @@ UpdateRequiredDialog::UpdateRequiredDialog( Window *pParent, TheExtensionManager
     m_aCloseBtn.SetClickHdl( LINK( this, UpdateRequiredDialog, HandleCloseBtn ) );
     m_aCancelBtn.SetClickHdl( LINK( this, UpdateRequiredDialog, HandleCancelBtn ) );
 
-    String aText = m_aUpdateNeeded.GetText();
-    aText.SearchAndReplaceAllAscii(
-        "%PRODUCTNAME", utl::ConfigManager::getProductName() );
-    m_aUpdateNeeded.SetText( aText );
+    OUString aText = m_aUpdateNeeded.GetText();
+    aText = aText.replaceAll(
+        "%PRODUCTNAME", utl::ConfigManager::getProductName());
+    m_aUpdateNeeded.SetText(aText);
 
     // resize update button
     Size aBtnSize = m_aUpdateBtn.GetSizePixel();
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
index b5a5aa4..436879b 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
@@ -81,7 +81,7 @@ public:
     virtual void    checkEntries() = 0;
 
     static ResId    getResId( sal_uInt16 nId );
-    static String   getResourceString( sal_uInt16 id );
+    static OUString getResourceString( sal_uInt16 id );
     static bool     IsSharedPkgMgr( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &);
     static bool     continueOnSharedExtension( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &,
                                                Window *pParent,
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index c9bdf06..8b2cd33 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -456,7 +456,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
         {
             SolarMutexGuard guard;
             WarningBox box( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, ResId(id, *DeploymentGuiResMgr::get()));
-            String s;
+            OUString s;
             if (bEqualNames)
             {
                 s = box.GetMessText();
@@ -466,20 +466,20 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
                 //hypothetical: requires two instances of an extension with the same
                 //version to have different display names. Probably the developer forgot
                 //to change the version.
-                s = String(ResId(RID_STR_WARNINGBOX_VERSION_EQUAL_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
+                s = ResId(RID_STR_WARNINGBOX_VERSION_EQUAL_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()).toString();
             }
             else if (id == RID_WARNINGBOX_VERSION_LESS)
             {
-                s = String(ResId(RID_STR_WARNINGBOX_VERSION_LESS_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
+                s = ResId(RID_STR_WARNINGBOX_VERSION_LESS_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()).toString();
             }
             else if (id == RID_WARNINGBOX_VERSION_GREATER)
             {
-               s = String(ResId(RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
+               s = ResId(RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()).toString();
             }
-            s.SearchAndReplaceAllAscii( "$NAME", verExc.NewDisplayName);
-            s.SearchAndReplaceAllAscii( "$OLDNAME", verExc.Deployed->getDisplayName());
-            s.SearchAndReplaceAllAscii( "$NEW", getVersion(verExc.NewVersion) );
-            s.SearchAndReplaceAllAscii( "$DEPLOYED", getVersion(verExc.Deployed) );
+            s = s.replaceAll("$NAME", verExc.NewDisplayName);
+            s = s.replaceAll("$OLDNAME", verExc.Deployed->getDisplayName());
+            s = s.replaceAll("$NEW", getVersion(verExc.NewVersion));
+            s = s.replaceAll("$DEPLOYED", getVersion(verExc.Deployed));
             box.SetMessText(s);
             approve = box.Execute() == RET_OK;
             abort = !approve;
@@ -507,8 +507,8 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
     else if (request >>= platExc)
     {
         SolarMutexGuard guard;
-        String sMsg( ResId( RID_STR_UNSUPPORTED_PLATFORM, *DeploymentGuiResMgr::get() ) );
-        sMsg.SearchAndReplaceAllAscii( "%Name", platExc.package->getDisplayName() );
+        OUString sMsg(ResId(RID_STR_UNSUPPORTED_PLATFORM, *DeploymentGuiResMgr::get()).toString());
+        sMsg = sMsg.replaceAll("%Name", platExc.package->getDisplayName());
         ErrorBox box( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, WB_OK, sMsg );
         box.Execute();
         approve = true;
diff --git a/desktop/source/deployment/inc/dp_resource.h b/desktop/source/deployment/inc/dp_resource.h
index 04dc52c..ebd8331 100644
--- a/desktop/source/deployment/inc/dp_resource.h
+++ b/desktop/source/deployment/inc/dp_resource.h
@@ -33,7 +33,7 @@ namespace dp_misc {
 ResId getResId( sal_uInt16 id );
 
 //==============================================================================
-DESKTOP_DEPLOYMENTMISC_DLLPUBLIC String getResourceString( sal_uInt16 id );
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString getResourceString( sal_uInt16 id );
 
 template <typename Unique, sal_uInt16 id>
 struct StaticResourceString :
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index 85f0566..7811aab 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -1307,14 +1307,14 @@ sal_Bool ExtensionManager::synchronize(
     try
     {
         ::osl::MutexGuard guard(getMutex());
-        String sSynchronizingShared(StrSyncRepository::get());
-        sSynchronizingShared.SearchAndReplaceAllAscii( "%NAME", OUString("shared"));
+        OUString sSynchronizingShared(StrSyncRepository::get());
+        sSynchronizingShared = sSynchronizingShared.replaceAll("%NAME", "shared");
         dp_misc::ProgressLevel progressShared(xCmdEnv, sSynchronizingShared);
         sal_Bool bModified = getSharedRepository()->synchronize(xAbortChannel, xCmdEnv);
         progressShared.update("\n\n");
 
-        String sSynchronizingBundled(StrSyncRepository::get());
-        sSynchronizingBundled.SearchAndReplaceAllAscii( "%NAME", OUString("bundled"));
+        OUString sSynchronizingBundled(StrSyncRepository::get());
+        sSynchronizingBundled = sSynchronizingBundled.replaceAll("%NAME", "bundled");
         dp_misc::ProgressLevel progressBundled(xCmdEnv, sSynchronizingBundled);
         bModified |= getBundledRepository()->synchronize(xAbortChannel, xCmdEnv);
         progressBundled.update("\n\n");
diff --git a/desktop/source/deployment/misc/dp_resource.cxx b/desktop/source/deployment/misc/dp_resource.cxx
index 802e37f..f8c43d7 100644
--- a/desktop/source/deployment/misc/dp_resource.cxx
+++ b/desktop/source/deployment/misc/dp_resource.cxx
@@ -66,13 +66,11 @@ ResId getResId( sal_uInt16 id )
 }
 
 //==============================================================================
-String getResourceString( sal_uInt16 id )
+OUString getResourceString( sal_uInt16 id )
 {
-    const osl::MutexGuard guard( theResourceMutex::get() );
-    String ret( ResId( id, *DeploymentResMgr::get() ) );
-    ret.SearchAndReplaceAllAscii(
-        "%PRODUCTNAME", utl::ConfigManager::getProductName() );
-    return ret;
+    const osl::MutexGuard guard(theResourceMutex::get());
+    OUString ret(ResId(id, *DeploymentResMgr::get()).toString());
+    return ret.replaceAll("%PRODUCTNAME", utl::ConfigManager::getProductName());
 }
 
 //==============================================================================
diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
index 430401f..35ae4ec 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
@@ -139,16 +139,15 @@ void CommandEnvironmentImpl::printLicense(
     const OUString & sName, const OUString& sLicense, bool & accept, bool &decline)
 {
     ResMgr * pResMgr = DeploymentResMgr::get();
-    String s1tmp(ResId(RID_STR_UNOPKG_ACCEPT_LIC_1, *pResMgr));
-    s1tmp.SearchAndReplaceAllAscii( "$NAME", sName );
-    OUString s1(s1tmp);
-    OUString s2 = String(ResId(RID_STR_UNOPKG_ACCEPT_LIC_2, *pResMgr));
-    OUString s3 = String(ResId(RID_STR_UNOPKG_ACCEPT_LIC_3, *pResMgr));
-    OUString s4 = String(ResId(RID_STR_UNOPKG_ACCEPT_LIC_4, *pResMgr));
-    OUString sYES = String(ResId(RID_STR_UNOPKG_ACCEPT_LIC_YES, *pResMgr));
-    OUString sY = String(ResId(RID_STR_UNOPKG_ACCEPT_LIC_Y, *pResMgr));
-    OUString sNO = String(ResId(RID_STR_UNOPKG_ACCEPT_LIC_NO, *pResMgr));
-    OUString sN = String(ResId(RID_STR_UNOPKG_ACCEPT_LIC_N, *pResMgr));
+    OUString s1tmp(ResId(RID_STR_UNOPKG_ACCEPT_LIC_1, *pResMgr).toString());
+    OUString s1(s1tmp.replaceAll("$NAME", sName));
+    OUString s2 = ResId(RID_STR_UNOPKG_ACCEPT_LIC_2, *pResMgr).toString();
+    OUString s3 = ResId(RID_STR_UNOPKG_ACCEPT_LIC_3, *pResMgr).toString();
+    OUString s4 = ResId(RID_STR_UNOPKG_ACCEPT_LIC_4, *pResMgr).toString();
+    OUString sYES = ResId(RID_STR_UNOPKG_ACCEPT_LIC_YES, *pResMgr).toString();
+    OUString sY = ResId(RID_STR_UNOPKG_ACCEPT_LIC_Y, *pResMgr).toString();
+    OUString sNO = ResId(RID_STR_UNOPKG_ACCEPT_LIC_NO, *pResMgr).toString();
+    OUString sN = ResId(RID_STR_UNOPKG_ACCEPT_LIC_N, *pResMgr).toString();
 
     OUString sNewLine("\n");
 
@@ -270,8 +269,8 @@ void CommandEnvironmentImpl::handle(
     }
     else if (request >>= platExc)
     {
-        String sMsg(ResId(RID_STR_UNSUPPORTED_PLATFORM, *dp_gui::DeploymentGuiResMgr::get()));
-        sMsg.SearchAndReplaceAllAscii("%Name", platExc.package->getDisplayName());
+        OUString sMsg(ResId(RID_STR_UNSUPPORTED_PLATFORM, *dp_gui::DeploymentGuiResMgr::get()).toString());
+        sMsg = sMsg.replaceAll("%Name", platExc.package->getDisplayName());
         dp_misc::writeConsole(OUString("\n") + sMsg + "\n\n");
         approve = true;
     }
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index bdf86f6..b324eda 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2425,12 +2425,10 @@ namespace pcr
                 OSL_FAIL( "FormComponentPropertyHandler::impl_ensureRowsetConnection_nothrow: caught an exception during error handling!" );
             }
             // additional info about what happended
-            String sInfo( PcrRes( RID_STR_UNABLETOCONNECT ) );
             INetURLObject aParser( sDataSourceName );
             if ( aParser.GetProtocol() != INET_PROT_NOT_VALID )
                 sDataSourceName = aParser.getBase( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
-            sInfo.SearchAndReplaceAllAscii( "$name$", sDataSourceName );
-
+            OUString sInfo(PcrRes(RID_STR_UNABLETOCONNECT).toString().replaceAll("$name$", sDataSourceName));
             SQLContext aContext;
             aContext.Message = sInfo;
             aContext.NextException = aError.get();
diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx
index f48fb94..c44b3c5 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ b/framework/source/uielement/uicommanddescription.cxx
@@ -303,12 +303,10 @@ throw ( RuntimeException )
 
 void ConfigurationAccess_UICommand::fillInfoFromResult( CmdToInfoMap& rCmdInfo, const OUString& aLabel )
 {
-    String rStr( aLabel );
-    rStr.SearchAndReplaceAllAscii(
-        "%PRODUCTNAME", utl::ConfigManager::getProductName() );
-    rCmdInfo.aLabel       = OUString( rStr );
-    rStr = comphelper::string::stripEnd(rStr, '.'); // Remove "..." from string
-    rCmdInfo.aCommandName = OUString( MnemonicGenerator::EraseAllMnemonicChars( rStr ));
+    OUString aStr(aLabel.replaceAll("%PRODUCTNAME", utl::ConfigManager::getProductName()));
+    rCmdInfo.aLabel = aStr;
+    aStr = comphelper::string::stripEnd(aStr, '.'); // Remove "..." from string
+    rCmdInfo.aCommandName = MnemonicGenerator::EraseAllMnemonicChars(aStr);
     rCmdInfo.bCommandNameCreated = sal_True;
 }
 
diff --git a/include/svx/lboxctrl.hxx b/include/svx/lboxctrl.hxx
index 2c449b0..d717b1e 100644
--- a/include/svx/lboxctrl.hxx
+++ b/include/svx/lboxctrl.hxx
@@ -33,7 +33,7 @@ class SvxPopupWindowListBox;
 class SvxListBoxControl : public SfxToolBoxControl
 {
 protected:
-    String                  aActionStr;
+    OUString                aActionStr;
     SvxPopupWindowListBox * pPopupWin;
 
     void    Impl_SetInfo( sal_uInt16 nCount );
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index 5efcd3e..33f6522 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -270,7 +270,6 @@ public:
                                                xub_StrLen nIndex = 0 );
     void                SearchAndReplaceAll( sal_Unicode c, sal_Unicode cRep );
     void                SearchAndReplaceAll( const UniString& rStr, const UniString& rRepStr );
-    void                SearchAndReplaceAllAscii( const sal_Char* pAsciiStr, const UniString& rRepStr );
 
     void                SetToken( xub_StrLen nToken, sal_Unicode cTok, const UniString& rStr,
                                   xub_StrLen nIndex = 0 );
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 05c9520..0785f0e 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -2925,8 +2925,8 @@ uno::Reference<frame::XModel> OReportController::executeReport()
 
                 // our first message says: we caught an exception
                 sdb::SQLContext aFirstMessage;
-                String sInfo = String( ModuleRes( RID_STR_CAUGHT_FOREIGN_EXCEPTION ) );
-                sInfo.SearchAndReplaceAllAscii( "$type$", aCaughtException.getValueTypeName() );
+                OUString sInfo(ModuleRes(RID_STR_CAUGHT_FOREIGN_EXCEPTION).toString());
+                sInfo = sInfo.replaceAll("$type$", aCaughtException.getValueTypeName());
                 aFirstMessage.Message = sInfo;
 
                 // our second message: the message of the exception we caught
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index ca10424..3c64b81 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -633,14 +633,15 @@ static bool lcl_parseExternalName(
     return true;
 }
 
-static String lcl_makeExternalNameStr( const String& rFile, const String& rName,
+static OUString lcl_makeExternalNameStr(const OUString& rFile, const OUString& rName,
         const sal_Unicode cSep, bool bODF )
 {
-    String aFile( rFile), aName( rName), aEscQuote( "''");
-    aFile.SearchAndReplaceAllAscii( "'", aEscQuote);
+    OUString aEscQuote("''");
+    OUString aFile(rFile.replaceAll("'", aEscQuote));
+    OUString aName(rName);
     if (bODF)
-        aName.SearchAndReplaceAllAscii( "'", aEscQuote);
-    OUStringBuffer aBuf( aFile.Len() + aName.Len() + 9);
+        aName = aName.replaceAll("'", aEscQuote);
+    OUStringBuffer aBuf(aFile.getLength() + aName.getLength() + 9);
     if (bODF)
         aBuf.append( sal_Unicode( '['));
     aBuf.append( sal_Unicode( '\''));
@@ -652,7 +653,7 @@ static String lcl_makeExternalNameStr( const String& rFile, const String& rName,
     aBuf.append( aName);
     if (bODF)
         aBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "']"));
-    return String( aBuf.makeStringAndClear());
+    return aBuf.makeStringAndClear();
 }
 
 static bool lcl_getLastTabName( OUString& rTabName2, const OUString& rTabName1,
@@ -879,7 +880,7 @@ struct ConventionOOO_A1 : public Convention_A1
     {
         if (bDisplayTabName)
         {
-            String aFile;
+            OUString aFile;
             const OUString* p = pRefMgr->getExternalFileName(nFileId);
             if (p)
             {
@@ -888,10 +889,9 @@ struct ConventionOOO_A1 : public Convention_A1
                 else
                     aFile = INetURLObject::decode(*p, INET_HEX_ESCAPE, INetURLObject::DECODE_UNAMBIGUOUS);
             }
-            aFile.SearchAndReplaceAllAscii("'", OUString("''"));
 
             rBuffer.append(sal_Unicode('\''));
-            rBuffer.append(aFile);
+            rBuffer.append(aFile.replaceAll("'", "''"));
             rBuffer.append(sal_Unicode('\''));
             rBuffer.append(sal_Unicode('#'));
 
diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx
index 597bd29..efc480a 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -155,24 +155,24 @@ void CompressGraphicsDialog::Update()
     Size aPixelSize = m_aGraphic.GetSizePixel();
     Size aOriginalSize100mm( pDummyVDev->PixelToLogic( m_aGraphic.GetSizePixel(), MAP_100TH_MM ) );
 
-    String aBitmapSizeString = String(SVX_RES(STR_IMAGE_ORIGINAL_SIZE));
+    OUString aBitmapSizeString = SVX_RESSTR(STR_IMAGE_ORIGINAL_SIZE);
     OUString aWidthString  = GetUnitString( aOriginalSize100mm.Width(),  eFieldUnit, cSeparator );
     OUString aHeightString = GetUnitString( aOriginalSize100mm.Height(), eFieldUnit, cSeparator );
-    aBitmapSizeString.SearchAndReplaceAllAscii( "$(WIDTH)",  aWidthString );
-    aBitmapSizeString.SearchAndReplaceAllAscii( "$(HEIGHT)", aHeightString );
-    aBitmapSizeString.SearchAndReplaceAllAscii( "$(WIDTH_IN_PX)",  OUString::valueOf(aPixelSize.Width()) );
-    aBitmapSizeString.SearchAndReplaceAllAscii( "$(HEIGHT_IN_PX)", OUString::valueOf(aPixelSize.Height()) );
+    aBitmapSizeString = aBitmapSizeString.replaceAll("$(WIDTH)",  aWidthString);
+    aBitmapSizeString = aBitmapSizeString.replaceAll("$(HEIGHT)", aHeightString);
+    aBitmapSizeString = aBitmapSizeString.replaceAll("$(WIDTH_IN_PX)",  OUString::valueOf(aPixelSize.Width()));
+    aBitmapSizeString = aBitmapSizeString.replaceAll("$(HEIGHT_IN_PX)", OUString::valueOf(aPixelSize.Height()));
     m_pFixedText2->SetText(aBitmapSizeString);
 
     int aValX = (int) (aPixelSize.Width() / GetViewWidthInch());
 
-    String aViewSizeString = String(SVX_RES(STR_IMAGE_VIEW_SIZE));
+    OUString aViewSizeString = SVX_RESSTR(STR_IMAGE_VIEW_SIZE);
 
     aWidthString  = GetUnitString( m_aViewSize100mm.Width(),  eFieldUnit, cSeparator );
     aHeightString = GetUnitString( m_aViewSize100mm.Height(), eFieldUnit, cSeparator );
-    aViewSizeString.SearchAndReplaceAllAscii( "$(WIDTH)",  aWidthString );
-    aViewSizeString.SearchAndReplaceAllAscii( "$(HEIGHT)", aHeightString );
-    aViewSizeString.SearchAndReplaceAllAscii( "$(DPI)", OUString::number( aValX) );
+    aViewSizeString = aViewSizeString.replaceAll("$(WIDTH)",  aWidthString);
+    aViewSizeString = aViewSizeString.replaceAll("$(HEIGHT)", aHeightString);
+    aViewSizeString = aViewSizeString.replaceAll("$(DPI)", OUString::number(aValX));
     m_pFixedText3->SetText(aViewSizeString);
 
     SvMemoryStream aMemStream;
@@ -181,8 +181,8 @@ void CompressGraphicsDialog::Update()
     aMemStream.Seek( STREAM_SEEK_TO_END );
     sal_Int32 aNativeSize = aMemStream.Tell();
 
-    String aNativeSizeString = String(SVX_RES(STR_IMAGE_CAPACITY));
-    aNativeSizeString.SearchAndReplaceAllAscii( "$(CAPACITY)",  OUString::valueOf(aNativeSize / 1024) );
+    OUString aNativeSizeString = SVX_RESSTR(STR_IMAGE_CAPACITY);
+    aNativeSizeString = aNativeSizeString.replaceAll("$(CAPACITY)",  OUString::valueOf(aNativeSize / 1024));
     m_pFixedText5->SetText(aNativeSizeString);
 
     m_pFixedText6->SetText(String("??"));
@@ -328,8 +328,8 @@ IMPL_LINK_NOARG( CompressGraphicsDialog, CalculateClickHdl )
     {
         OUString aSizeAsString = OUString::valueOf(aSize / 1024);
 
-        String aNewSizeString = String(SVX_RES(STR_IMAGE_CAPACITY));
-        aNewSizeString.SearchAndReplaceAllAscii( "$(CAPACITY)",  aSizeAsString );
+        OUString aNewSizeString = SVX_RESSTR(STR_IMAGE_CAPACITY);
+        aNewSizeString = aNewSizeString.replaceAll("$(CAPACITY)", aSizeAsString);
         m_pFixedText6->SetText(aNewSizeString);
     }
     return 0L;
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index 2bec286..7e6e52e 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -1574,9 +1574,8 @@ bool FmXFormView::createControlLabelPair( OutputDevice& _rOutDev, sal_Int32 _nXO
                 sLabel = sFieldName;
 
             xLabelModel->setPropertyValue( FM_PROP_LABEL, makeAny( sLabel + _rFieldPostfix ) );
-            String sObjectLabel( SVX_RES( RID_STR_OBJECT_LABEL ) );
-            sObjectLabel.SearchAndReplaceAllAscii( "#object#", sFieldName );
-            xLabelModel->setPropertyValue( FM_PROP_NAME, makeAny( OUString( sObjectLabel ) ) );
+            OUString sObjectLabel(SVX_RESSTR(RID_STR_OBJECT_LABEL).replaceAll("#object#", sFieldName));
+            xLabelModel->setPropertyValue(FM_PROP_NAME, makeAny(sObjectLabel));
         }
 
         pLabel->SetLogicRect( ::Rectangle(
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index 758c9bb..34fd302 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -213,11 +213,10 @@ void SvxListBoxControl::Impl_SetInfo( sal_uInt16 nCount )
     else
         nId = SID_UNDO == GetSlotId() ? RID_SVXSTR_NUM_UNDO_ACTIONS : RID_SVXSTR_NUM_REDO_ACTIONS;
 
-    aActionStr = String(SVX_RES(nId));
+    aActionStr = SVX_RESSTR(nId);
 
-    String aText( aActionStr );
-    aText.SearchAndReplaceAllAscii( "$(ARG1)", OUString::number( nCount ) );
-    pPopupWin->SetText( aText );
+    OUString aText = aActionStr.replaceAll("$(ARG1)", OUString::number(nCount));
+    pPopupWin->SetText(aText);
 }
 
 
@@ -310,8 +309,8 @@ SfxPopupWindow* SvxUndoRedoControl::CreatePopupWindow()
         rListBox.InsertEntry( String( aUndoRedoList[n] ));
 
     rListBox.SelectEntryPos( 0 );
-    aActionStr = String( SVX_RES( SID_UNDO == GetSlotId() ?
-                                  RID_SVXSTR_NUM_UNDO_ACTIONS : RID_SVXSTR_NUM_REDO_ACTIONS ) );
+    aActionStr = SVX_RESSTR(SID_UNDO == GetSlotId() ?
+                                  RID_SVXSTR_NUM_UNDO_ACTIONS : RID_SVXSTR_NUM_REDO_ACTIONS);
     Impl_SetInfo( rListBox.GetSelectEntryCount() );
 
     // move focus in floating window without
diff --git a/sw/inc/shellres.hxx b/sw/inc/shellres.hxx
index 253c85d..1122334 100644
--- a/sw/inc/shellres.hxx
+++ b/sw/inc/shellres.hxx
@@ -64,7 +64,7 @@ struct SW_DLLPUBLIC ShellResource : public Resource
     String          aTOXTablesName;
     String          aTOXAuthoritiesName;
 
-    String          aHyperlinkClick;
+    OUString        aHyperlinkClick;
 
     std::vector<String> aDocInfoLst;
 
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 3004bbb..ba92b6d 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -951,13 +951,14 @@ OutlinerParaObject* SwWW8ImplReader::ImportAsOutliner(String &rString, WW8_CP nS
         //Strip out fields, leaving the result
         long nDummy(0);
         lcl_StripFields(rString, nDummy);
+        OUString aString(rString);
         //Strip out word's special characters for the simple string
-        rString = comphelper::string::remove(rString, 0x1);
-        rString = comphelper::string::remove(rString, 0x5);
-        rString = comphelper::string::remove(rString, 0x8);
-        rString.SearchAndReplaceAllAscii("\007\007", OUString("\007\012"));
-        rString.SearchAndReplaceAll(0x7, ' ');
-
+        aString = comphelper::string::remove(aString, 0x1);
+        aString = comphelper::string::remove(aString, 0x5);
+        aString = comphelper::string::remove(aString, 0x8);
+        aString = aString.replaceAll(OUString("\007\007"), OUString("\007\012"));
+        aString = aString.replace(0x7, ' ');
+        rString = aString;
     }
 
     return pRet;
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 61663e2..26e5683 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1535,7 +1535,7 @@ private:
     String GetFieldResult( WW8FieldDesc* pF );
     void MakeTagString( String& rStr, const String& rOrg );
     void UpdateFields();
-    void ConvertFFileName( String& rName, const String& rRaw );
+    OUString ConvertFFileName(const OUString& rRaw);
     long Read_F_Tag( WW8FieldDesc* pF );
     void InsertTagField( const sal_uInt16 nId, const String& rTagText );
     long ImportExtSprm(WW8PLCFManResult* pRes);
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index de7cb1b..09e957c 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -418,20 +418,22 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
 // ConvertFFileName uebersetzt FeldParameter-Namen u. ae. in den
 // System-Zeichensatz.
 // Gleichzeitig werden doppelte Backslashes in einzelne uebersetzt.
-void SwWW8ImplReader::ConvertFFileName( String& rName, const String& rOrg )
+OUString SwWW8ImplReader::ConvertFFileName(const OUString& rOrg)
 {
-    rName = rOrg;
-    rName.SearchAndReplaceAllAscii( "\\\\", OUString( '\\' ));
-    rName.SearchAndReplaceAllAscii( "%20", OUString( ' ' ));
+    OUString aName = rOrg;
+    aName = aName.replaceAll("\\\\", OUString('\\'));
+    aName = aName.replaceAll("%20", OUString(' '));
 
     // ggfs. anhaengende Anfuehrungszeichen entfernen
-    if( rName.Len() &&  '"' == rName.GetChar( rName.Len()-1 ))
-        rName.Erase( rName.Len()-1, 1);
+    if (!aName.isEmpty() &&  '"' == aName[aName.getLength()-1])
+        aName = aName.copy(0, aName.getLength()-1);
 
-    // Need the more sophisticated url converter. cmc
-    if (rName.Len())
-        rName = URIHelper::SmartRel2Abs(
-            INetURLObject(sBaseURL), rName, Link(), false);
+    // Need the more sophisticated url converter.
+    if (!aName.isEmpty())
+        aName = URIHelper::SmartRel2Abs(
+            INetURLObject(sBaseURL), aName, Link(), false);
+
+    return aName;
 }
 
 // ConvertUFNneme uebersetzt FeldParameter-Namen u. ae. in den
@@ -2409,7 +2411,7 @@ eF_ResT SwWW8ImplReader::Read_F_IncludePicture( WW8FieldDesc*, String& rStr )
         {
         case -2:
             if (!aGrfName.Len())
-                ConvertFFileName(aGrfName, aReadParam.GetResult());
+                aGrfName = ConvertFFileName(aReadParam.GetResult());
             break;
 
         case 'd':
@@ -2485,7 +2487,7 @@ eF_ResT SwWW8ImplReader::Read_F_IncludeText( WW8FieldDesc* /*pF*/, String& rStr
                 break;
         }
     }
-    ConvertFFileName(aPara, aPara);
+    aPara = ConvertFFileName(aPara);
 
     if (aBook.Len() && aBook.GetChar( 0 ) != '\\')
     {
@@ -3540,7 +3542,7 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, String& rStr )
             {
                 case -2:
                     if (!sURL.Len() && !bOptions)
-                        ConvertFFileName(sURL, aReadParam.GetResult());
+                        sURL = ConvertFFileName(aReadParam.GetResult());
                     break;
 
                 case 'n':
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 4f981d4..5f1a8f5 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -809,8 +809,8 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/)
         void* pData;
         WW8_CP nTest;
         pWkb->Get(nTest, pData);
-        String sSectionName = mrReader.aLinkStringMap[SVBT16ToShort( ((WW8_WKB*)pData)->nLinkId) ];
-        mrReader.ConvertFFileName(sSectionName, sSectionName);
+        OUString sSectionName = mrReader.aLinkStringMap[SVBT16ToShort( ((WW8_WKB*)pData)->nLinkId) ];
+        sSectionName = mrReader.ConvertFFileName(sSectionName);
         SwSectionData aSection(FILE_LINK_SECTION, sSectionName);
         aSection.SetLinkFileName( sSectionName );
         aSection.SetProtectFlag(true);
diff --git a/sw/source/ui/dbui/mmconfigitem.cxx b/sw/source/ui/dbui/mmconfigitem.cxx
index 1cc6e6f..6fd70e5 100644
--- a/sw/source/ui/dbui/mmconfigitem.cxx
+++ b/sw/source/ui/dbui/mmconfigitem.cxx
@@ -390,8 +390,7 @@ static OUString lcl_CreateNodeName(Sequence<OUString>& rAssignments )
 static void lcl_ConvertToNumbers(OUString& rBlock, const ResStringArray& rHeaders )
 {
     //convert the strings used for UI to numbers used for the configuration
-    String sBlock(rBlock);
-    sBlock.SearchAndReplaceAllAscii("\n", OUString("\\n"));
+    OUString sBlock(rBlock.replaceAll("\n", OUString("\\n")));
     for(sal_uInt16 i = 0; i < rHeaders.Count(); ++i)
     {
         String sHeader = rHeaders.GetString( i );
@@ -399,7 +398,7 @@ static void lcl_ConvertToNumbers(OUString& rBlock, const ResStringArray& rHeader
         sHeader += '>';
         String sReplace("<>");
         sReplace.Insert('0' + i, 1);
-        sBlock.SearchAndReplaceAll(sHeader, sReplace);
+        sBlock = sBlock.replaceAll(sHeader, sReplace);
     }
     rBlock = sBlock;
 }
@@ -408,10 +407,9 @@ static void lcl_ConvertFromNumbers(OUString& rBlock, const ResStringArray& rHead
 {
     //convert the numbers used for the configuration to strings used for UI to numbers
     //doesn't use ReplaceAll to prevent expansion of numbers inside of the headers
-    String sBlock(rBlock);
-    sBlock.SearchAndReplaceAllAscii("\\n", OUString('\n'));
+    OUString sBlock(rBlock.replaceAll("\\n", OUString('\n')));
     SwAddressIterator aGreetingIter(sBlock);
-    sBlock.Erase();
+    sBlock = OUString();
     while(aGreetingIter.HasMore())
     {
         SwMergeAddressItem aNext = aGreetingIter.Next();
@@ -421,11 +419,11 @@ static void lcl_ConvertFromNumbers(OUString& rBlock, const ResStringArray& rHead
             sal_Unicode cChar = aNext.sText.GetChar(0);
             if(cChar >= '0' && cChar <= 'c')
             {
-                sBlock += '<';
+                sBlock += "<";
                 sal_uInt16 nHeader = cChar - '0';
                 if(nHeader < rHeaders.Count())
                     sBlock += rHeaders.GetString( nHeader );
-                sBlock += '>';
+                sBlock += ">";
             }
             else
             {
diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx
index eb97eed..644ee08 100644
--- a/sw/source/ui/docvw/edtwin2.cxx
+++ b/sw/source/ui/docvw/edtwin2.cxx
@@ -224,14 +224,12 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
             }
             case SwContentAtPos::SW_SMARTTAG:
             {
-                sTxt = SW_RESSTR(STR_SMARTTAG_CLICK);
-
                 KeyCode aCode( KEY_SPACE );
                 KeyCode aModifiedCode( KEY_SPACE, KEY_MOD1 );
-                String aModStr( aModifiedCode.GetName() );
-                aModStr.SearchAndReplace( aCode.GetName(), String() );
-                aModStr.SearchAndReplaceAllAscii( "+", String() );
-                sTxt.SearchAndReplaceAllAscii( "%s", aModStr );
+                OUString aModStr( aModifiedCode.GetName() );
+                aModStr = aModStr.replaceFirst(aCode.GetName(), OUString());
+                aModStr = aModStr.replaceAll("+", OUString());
+                sTxt = SW_RESSTR(STR_SMARTTAG_CLICK).replaceAll("%s", aModStr);
             }
             break;
 
diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx
index dda31eb..42ad626 100644
--- a/sw/source/ui/utlui/initui.cxx
+++ b/sw/source/ui/utlui/initui.cxx
@@ -146,7 +146,7 @@ ShellResource::ShellResource()
     aTOXObjectsName(        SW_RES(STR_TOX_OBJ)),
     aTOXTablesName(         SW_RES(STR_TOX_TBL)),
     aTOXAuthoritiesName(    SW_RES(STR_TOX_AUTH)),
-    aHyperlinkClick( SW_RES( STR_HYPERLINK_CLICK)),
+    aHyperlinkClick(SW_RESSTR(STR_HYPERLINK_CLICK)),
     pAutoFmtNameLst(0),
     sPageDescFirstName(     SW_RES(STR_PAGEDESC_FIRSTNAME)),
     sPageDescFollowName(    SW_RES(STR_PAGEDESC_FOLLOWNAME)),
@@ -156,10 +156,10 @@ ShellResource::ShellResource()
 
     KeyCode aCode( KEY_SPACE );
     KeyCode aModifiedCode( KEY_SPACE, KEY_MOD1 );
-    String aModStr( aModifiedCode.GetName() );
-    aModStr.SearchAndReplace( aCode.GetName(), String() );
-    aModStr.SearchAndReplaceAllAscii( "+", String() );
-    aHyperlinkClick.SearchAndReplaceAllAscii( "%s", aModStr );
+    OUString aModStr( aModifiedCode.GetName() );
+    aModStr = aModStr.replaceFirst(aCode.GetName(), OUString());
+    aModStr = aModStr.replaceAll("+", OUString());
+    aHyperlinkClick = aHyperlinkClick.replaceAll("%s", aModStr);
 
     for(sal_uInt16 i = 0; i < nCount; ++i)
         aDocInfoLst.push_back(String(SW_RESSTR(FLD_DOCINFO_BEGIN + i)));
diff --git a/tools/source/string/strascii.cxx b/tools/source/string/strascii.cxx
index e057c03..fe43542 100644
--- a/tools/source/string/strascii.cxx
+++ b/tools/source/string/strascii.cxx
@@ -526,20 +526,4 @@ xub_StrLen UniString::SearchAndReplaceAscii( const sal_Char* pAsciiStr, const Un
     return nSPos;
 }
 
-void UniString::SearchAndReplaceAllAscii( const sal_Char* pAsciiStr, const UniString& rRepStr )
-{
-    DBG_CHKTHIS( UniString, DbgCheckUniString );
-    DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, STRING_LEN ),
-                "UniString::SearchAndReplaceAllAscii() - pAsciiStr include characters > 127" );
-
-    xub_StrLen nCharLen = ImplStringLen( pAsciiStr );
-    xub_StrLen nSPos = SearchAscii( pAsciiStr, 0 );
-    while ( nSPos != STRING_NOTFOUND )
-    {
-        Replace( nSPos, nCharLen, rRepStr );
-        nSPos = nSPos + rRepStr.Len();
-        nSPos = SearchAscii( pAsciiStr, nSPos );
-    }
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/app/salsys.cxx b/vcl/aqua/source/app/salsys.cxx
index 9886ecd..d1c553a 100644
--- a/vcl/aqua/source/app/salsys.cxx
+++ b/vcl/aqua/source/app/salsys.cxx
@@ -89,9 +89,8 @@ OUString AquaSalSystem::GetDisplayScreenName( unsigned int nScreen )
         ResMgr* pMgr = ImplGetResMgr();
         if( pMgr )
         {
-            String aScreenName( ResId( SV_MAC_SCREENNNAME, *pMgr ) );
-            aScreenName.SearchAndReplaceAllAscii( "%d", OUString::number( nScreen ) );
-            aRet = aScreenName;
+            OUString aScreenName(ResId(SV_MAC_SCREENNNAME, *pMgr).toString());
+            aRet = aScreenName.replaceAll("%d", OUString::number(nScreen));
         }
    }
    return aRet;


More information about the Libreoffice-commits mailing list