Hi,

could someone please review this small patch. I'll extend the replacement (and push on my own) but want to be sure that there are no mistakes. At least it seems to build :-)

Thank you,
Christina
>From 4598efcf63b30b673794c8d8aaf99797ada3117c Mon Sep 17 00:00:00 2001
From: Christina Rossmanith <chrrossman...@web.de>
Date: Sat, 1 Oct 2011 19:48:07 +0200
Subject: [PATCH] Replace (Byte)String with O(U)String in sw

---
 sw/source/core/access/acccontext.cxx |   16 ++++++----------
 sw/source/core/access/accmap.cxx     |    6 +++---
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index 47398be..ae77b95 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -54,6 +54,7 @@
 #include <acccontext.hxx>
 #include <svx/AccessibleShape.hxx>
 #include <comphelper/accessibleeventnotifier.hxx>
+#include <comphelper/string.hxx>
 #include <PostItMgr.hxx>
 
 using namespace sw::access;
@@ -1398,27 +1399,22 @@ OUString SwAccessibleContext::GetResource( sal_uInt16 nResId,
                                            const OUString *pArg1,
                                            const OUString *pArg2 )
 {
-    String sStr;
+    OUString sStr;
     {
         SolarMutexGuard aGuard;
-
-        sStr = SW_RES( nResId );
+        sStr = ResId::toString( SW_RES( nResId ) );
     }
 
     if( pArg1 )
     {
-        sStr.SearchAndReplace( String::CreateFromAscii(
-                                    RTL_CONSTASCII_STRINGPARAM( "$(ARG1)" )),
-                               String( *pArg1 ) );
+        sStr = comphelper::string::replace( sStr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$(ARG1)") ), *pArg1 );
     }
     if( pArg2 )
     {
-        sStr.SearchAndReplace( String::CreateFromAscii(
-                                    RTL_CONSTASCII_STRINGPARAM( "$(ARG2)" )),
-                               String( *pArg2 ) );
+        sStr = comphelper::string::replace( sStr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$(ARG2)") ), *pArg2 );
     }
 
-    return OUString( sStr );
+    return sStr;
 }
 
 void SwAccessibleContext::RemoveFrmFromAccessibleMap()
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 1dc2c8c..f25d480 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -185,9 +185,9 @@ void SwDrawModellListener_Impl::Notify( SfxBroadcaster& /*rBC*/,
         {
             (void)r;
 #if OSL_DEBUG_LEVEL > 1
-            ByteString aError( "Runtime exception caught while notifying shape.:\n" );
-            aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
-            OSL_FAIL( aError.GetBuffer() );
+            rtl::OString aError( "Runtime exception caught while notifying shape.:\n" );
+            aError += ::rtl::OUStringToOString( rtl::OUString( r.Message), RTL_TEXTENCODING_UTF8 );
+            OSL_FAIL( aError.getStr() );
 #endif
         }
     }
-- 
1.7.4.1

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to