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 --- vbahelper/source/vbahelper/vbacommandbarhelper.cxx | 2 +- vbahelper/source/vbahelper/vbacommandbars.cxx | 4 ++-- vbahelper/source/vbahelper/vbalineformat.cxx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'vbahelper/source') diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx index 75251e366919..05772c178c18 100644 --- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx @@ -207,7 +207,7 @@ rtl::OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< for( sal_Int32 i = 0; i < allNames.getLength(); i++ ) { sResourceUrl = allNames[i]; - if(sResourceUrl.indexOf( rtl::OUString( ITEM_TOOLBAR_URL ) ) == 0 ) + if(sResourceUrl.indexOf( ITEM_TOOLBAR_URL ) == 0 ) { if( hasToolbar( sResourceUrl, sName ) ) return sResourceUrl; diff --git a/vbahelper/source/vbahelper/vbacommandbars.cxx b/vbahelper/source/vbahelper/vbacommandbars.cxx index 10ba77115d36..051b5aa3d1ed 100644 --- a/vbahelper/source/vbahelper/vbacommandbars.cxx +++ b/vbahelper/source/vbahelper/vbacommandbars.cxx @@ -59,7 +59,7 @@ public: if( hasMoreElements() ) { rtl::OUString sResourceUrl( m_sNames[ m_nCurrentPosition++ ] ); - if( sResourceUrl.indexOf( rtl::OUString("private:resource/toolbar/") ) != -1 ) + if( sResourceUrl.indexOf( "private:resource/toolbar/" ) != -1 ) { uno::Reference< container::XIndexAccess > xCBarSetting = m_pCBarHelper->getSettings( sResourceUrl ); uno::Reference< XCommandBar > xCommandBar( new ScVbaCommandBar( m_xParent, m_xContext, m_pCBarHelper, xCBarSetting, sResourceUrl, sal_False, sal_False ) ); @@ -194,7 +194,7 @@ ScVbaCommandBars::getCount() throw(css::uno::RuntimeException) uno::Sequence< ::rtl::OUString > allNames = m_xNameAccess->getElementNames(); for( sal_Int32 i = 0; i < allNames.getLength(); i++ ) { - if(allNames[i].indexOf( rtl::OUString("private:resource/toolbar/") ) != -1 ) + if(allNames[i].indexOf( "private:resource/toolbar/" ) != -1 ) { nCount++; } diff --git a/vbahelper/source/vbahelper/vbalineformat.cxx b/vbahelper/source/vbahelper/vbalineformat.cxx index 68e203913730..4a84e38179cd 100644 --- a/vbahelper/source/vbahelper/vbalineformat.cxx +++ b/vbahelper/source/vbahelper/vbalineformat.cxx @@ -102,7 +102,7 @@ ScVbaLineFormat::getBeginArrowheadStyle() throw (uno::RuntimeException) sal_Int32 nLineType = office::MsoArrowheadStyle::msoArrowheadNone; rtl::OUString sLineName; m_xPropertySet->getPropertyValue( rtl::OUString("LineStartName") ) >>= sLineName; - if( ( sLineName.getLength() > 7 ) && ( sLineName.indexOf( rtl::OUString("msArray") ) ) != -1 ) + if( ( sLineName.getLength() > 7 ) && ( sLineName.indexOf( "msArray" ) ) != -1 ) { sal_Int32 nIndex = sLineName.indexOf( ' ' ); rtl::OUString sName = sLineName.copy( 0, nIndex ); -- cgit