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 <ChrRossmanith@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
Context
- [Libreoffice] [PATCH] Replace (Byte)String with O(U)String in sw · Chr. Rossmanith
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.