From df645a2bd8a9b5463c74f261268f0d2de7245ccc Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Sat, 14 Jul 2012 18:00:06 +0200 Subject: There is not need to allocate memory just for getting the 'indexOf' a literal within a OUString. Change-Id: I01ca30c68228f81b3d313dfca5b975448f3c4fc7 --- svx/source/form/fmdmod.cxx | 2 +- svx/source/svdraw/svdobj.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'svx') diff --git a/svx/source/form/fmdmod.cxx b/svx/source/form/fmdmod.cxx index b6fd672233f2..a461b65a1be6 100644 --- a/svx/source/form/fmdmod.cxx +++ b/svx/source/form/fmdmod.cxx @@ -40,7 +40,7 @@ using namespace ::svxform; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxFmMSFactory::createInstance(const ::rtl::OUString& ServiceSpecifier) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ) { ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xRet; - if ( ServiceSpecifier.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.")) ) == 0 ) + if ( ServiceSpecifier.indexOf( "com.sun.star.form.component." ) == 0 ) { xRet = ::comphelper::getProcessServiceFactory()->createInstance(ServiceSpecifier); } diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 8af35f0badbe..9cc99b17bbed 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1090,7 +1090,7 @@ void SdrObject::TakeObjNamePlural(XubString& rName) const void SdrObject::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, rtl::OUString& rStr, sal_uInt16 nVal) const { rStr = ImpGetResStr(nStrCacheID); - sal_Int32 nPos = rStr.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%1"))); + sal_Int32 nPos = rStr.indexOf("%1"); if (nPos >= 0) { // Replace '%1' with the object name. @@ -1099,7 +1099,7 @@ void SdrObject::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, rtl::OUString& rSt rStr = rStr.replaceAt(nPos, 2, aObjName); } - nPos = rStr.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%2"))); + nPos = rStr.indexOf("%2"); if (nPos >= 0) // Replace '%2' with the passed value. rStr = rStr.replaceAt( -- cgit