summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2012-08-06 10:40:32 +0200
committerMichael Meeks <michael.meeks@suse.com>2012-08-06 12:22:10 +0100
commitcf239da5c403164e75c369173fe6bed747de9e09 (patch)
tree38999901baaf3091692d7649c7804f224b661a99
parent515ceca5153d67ea602ab8c4fb339a7b42e9063e (diff)
There is not need to allocate memory just for getting the 'indexOf'
a literal within a OUString. Change-Id: Icc8e22c43f6ddca25cb284a3d45ab39680ad6d1f
-rw-r--r--connectivity/source/drivers/macab/macabutilities.hxx2
-rw-r--r--embeddedobj/source/msole/olecomponent.cxx6
-rw-r--r--filter/source/config/cache/filterfactory.cxx2
-rw-r--r--idlc/source/idlccompile.cxx2
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx2
-rw-r--r--scripting/source/provider/ActiveMSPList.cxx2
-rw-r--r--sd/source/core/stlsheet.cxx2
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.cxx2
-rw-r--r--svl/source/passwordcontainer/syscreds.cxx3
-rw-r--r--svtools/source/misc/transfer.cxx2
-rw-r--r--svx/source/dialog/docrecovery.cxx2
-rw-r--r--sw/source/ui/docvw/HeaderFooterWin.cxx2
-rw-r--r--uui/source/iahndl.cxx3
13 files changed, 15 insertions, 17 deletions
diff --git a/connectivity/source/drivers/macab/macabutilities.hxx b/connectivity/source/drivers/macab/macabutilities.hxx
index 1417a5c99209..d2b2ed28a412 100644
--- a/connectivity/source/drivers/macab/macabutilities.hxx
+++ b/connectivity/source/drivers/macab/macabutilities.hxx
@@ -102,7 +102,7 @@ namespace connectivity
/* Get the length, and make sure that there is actually a string
* here.
*/
- if(_originalLabel.indexOf(::rtl::OUString("_$!<")) == 0)
+ if(_originalLabel.indexOf("_$!<") == 0)
{
return _originalLabel.copy(4,_originalLabel.getLength()-8);
}
diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx
index 623811ce6beb..8893091299d2 100644
--- a/embeddedobj/source/msole/olecomponent.cxx
+++ b/embeddedobj/source/msole/olecomponent.cxx
@@ -237,11 +237,11 @@ struct OleComponentNative_Impl {
//----------------------------------------------
DWORD GetAspectFromFlavor( const datatransfer::DataFlavor& aFlavor )
{
- if ( aFlavor.MimeType.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ";Aspect=THUMBNAIL" )) ) != -1 )
+ if ( aFlavor.MimeType.indexOf( ";Aspect=THUMBNAIL" ) != -1 )
return DVASPECT_THUMBNAIL;
- else if ( aFlavor.MimeType.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ";Aspect=ICON" )) ) != -1 )
+ else if ( aFlavor.MimeType.indexOf( ";Aspect=ICON" ) != -1 )
return DVASPECT_ICON;
- else if ( aFlavor.MimeType.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ";Aspect=DOCPRINT" )) ) != -1 )
+ else if ( aFlavor.MimeType.indexOf( ";Aspect=DOCPRINT" ) != -1 )
return DVASPECT_DOCPRINT;
else
return DVASPECT_CONTENT;
diff --git a/filter/source/config/cache/filterfactory.cxx b/filter/source/config/cache/filterfactory.cxx
index 82924059788a..30c25d642145 100644
--- a/filter/source/config/cache/filterfactory.cxx
+++ b/filter/source/config/cache/filterfactory.cxx
@@ -241,7 +241,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL FilterFactory::crea
// convert "_query_xxx:..." to "getByDocService=xxx:..."
::rtl::OUString sNewQuery(sQuery);
- sal_Int32 pos = sNewQuery.indexOf(::rtl::OUString( "_query_" ),0);
+ sal_Int32 pos = sNewQuery.indexOf("_query_");
if (pos != -1)
{
OSL_FAIL("DEPRECATED!\nPlease use new query format: 'matchByDocumentService=...'");
diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx
index 68cf26380aeb..0491046560a7 100644
--- a/idlc/source/idlccompile.cxx
+++ b/idlc/source/idlccompile.cxx
@@ -303,7 +303,7 @@ sal_Int32 compileFile(const OString * pathname)
OSL_ASSERT(false);
}
- sal_Int32 idx= cpp.lastIndexOf(OUString( RTL_CONSTASCII_USTRINGPARAM("idlc")) );
+ sal_Int32 idx= cpp.lastIndexOf("idlc");
cpp = cpp.copy(0, idx);
#if defined(SAL_W32)
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index fa066bd07b8c..d0e63fbda425 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -711,7 +711,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName,
{
if ( !sMediaType.isEmpty() )
{
- if ( sMediaType.indexOf ( OUString( RTL_CONSTASCII_USTRINGPARAM ( "text" ) ) ) != -1
+ if ( sMediaType.indexOf ( "text" ) != -1
|| sMediaType == "application/vnd.sun.star.oleobject" )
bToBeCompressed = sal_True;
else if ( !m_bCompressedIsSetFromOutside )
diff --git a/scripting/source/provider/ActiveMSPList.cxx b/scripting/source/provider/ActiveMSPList.cxx
index 5f1fbb225db7..1edc4e97e0a2 100644
--- a/scripting/source/provider/ActiveMSPList.cxx
+++ b/scripting/source/provider/ActiveMSPList.cxx
@@ -153,7 +153,7 @@ Reference< provider::XScriptProvider >
Reference< provider::XScriptProvider > msp;
try
{
- if ( context.indexOf( OUSTR( "vnd.sun.star.tdoc" ) ) == 0 )
+ if ( context.indexOf( "vnd.sun.star.tdoc" ) == 0 )
{
Reference< frame::XModel > xModel( MiscUtils::tDocUrlToModel( context ) );
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 08fe4dc5b75d..e85e8ca78d52 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -1149,7 +1149,7 @@ Any SAL_CALL SdStyleSheet::getPropertyValue( const OUString& PropertyName ) thro
if( nFamily == SD_STYLE_FAMILY_MASTERPAGE )
{
const OUString aLayoutName( GetName() );
- aAny <<= aLayoutName.copy( 0, aLayoutName.indexOf(OUString( SD_LT_SEPARATOR) ) );
+ aAny <<= aLayoutName.copy( 0, aLayoutName.indexOf( SD_LT_SEPARATOR) );
}
else
{
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index 7e1177f9287e..0a86600acebb 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -134,7 +134,7 @@ static vector< ::rtl::OUString > getInfoFromInd( ::rtl::OUString aInd )
static sal_Bool shorterUrl( ::rtl::OUString& aURL )
{
sal_Int32 aInd = aURL.lastIndexOf( sal_Unicode( '/' ) );
- if( aInd > 0 && aURL.indexOf( ::rtl::OUString("://") ) != aInd-2 )
+ if( aInd > 0 && aURL.indexOf( "://" ) != aInd-2 )
{
aURL = aURL.copy( 0, aInd );
return sal_True;
diff --git a/svl/source/passwordcontainer/syscreds.cxx b/svl/source/passwordcontainer/syscreds.cxx
index ce0f0e42abe4..f9cb5303dc97 100644
--- a/svl/source/passwordcontainer/syscreds.cxx
+++ b/svl/source/passwordcontainer/syscreds.cxx
@@ -110,8 +110,7 @@ namespace
if( aInd > 0 )
{
sal_Int32 aPrevInd = aURL.lastIndexOf( sal_Unicode( '/' ), aInd );
- if ( aURL.indexOf( ::rtl::OUString("://") )
- != aPrevInd - 2 ||
+ if ( aURL.indexOf( "://" ) != aPrevInd - 2 ||
aInd != aURL.getLength() - 1 )
{
aURL = aURL.copy( 0, aInd );
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index aadd6bf98b8a..a85cf1f1968b 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -2112,7 +2112,7 @@ sal_Bool TransferableDataHelper::GetFileList(
if( GetSotStorageStream( aFlavor, xStm ) )
{
- if( aFlavor.MimeType.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "text/uri-list" )) ) > -1 )
+ if( aFlavor.MimeType.indexOf( "text/uri-list" ) > -1 )
{
rtl::OString aDiskString;
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index 32685fab68ce..c50da3817a6b 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -556,7 +556,7 @@ void SAL_CALL RecoveryCore::statusChanged(const css::frame::FeatureStateEvent& a
aNew.RecoveryState = E_NOT_RECOVERED_YET;
// patch DisplayName! Because the document title contain more then the file name ...
- sal_Int32 i = aNew.DisplayName.indexOf(::rtl::OUString(" - "));
+ sal_Int32 i = aNew.DisplayName.indexOf(" - ");
if (i > 0)
aNew.DisplayName = aNew.DisplayName.copy(0, i);
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index 5b737fbce167..23b2892bcef0 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -204,7 +204,7 @@ void SwHeaderFooterWin::SetOffset( Point aOffset, long nXLineStart, long nXLineE
m_sLabel = SW_RESSTR( STR_HEADER_TITLE );
if ( !m_bIsHeader )
m_sLabel = SW_RESSTR( STR_FOOTER_TITLE );
- sal_Int32 nPos = m_sLabel.lastIndexOf( rtl::OUString::createFromAscii( "%1" ) );
+ sal_Int32 nPos = m_sLabel.lastIndexOf( "%1" );
m_sLabel = m_sLabel.replaceAt( nPos, 2, GetPageFrame()->GetPageDesc()->GetName() );
// Compute the text size and get the box position & size from it
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 2c355e1c21ae..98b25bd293f8 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -258,8 +258,7 @@ UUIInteractionHelper::replaceMessageWithArguments(
{
for (sal_Int32 i = 0;;)
{
- i = aMessage.
- indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$(ARG")), i);
+ i = aMessage.indexOf("$(ARG", i);
if (i == -1)
break;
if (aMessage.getLength() - i >= RTL_CONSTASCII_LENGTH("$(ARGx)")