[Libreoffice-commits] .: connectivity/source embeddedobj/source filter/source idlc/source package/source scripting/source sd/source svl/source svtools/source svx/source sw/source uui/source

Michael Meeks michael at kemper.freedesktop.org
Mon Aug 6 04:24:42 PDT 2012


 connectivity/source/drivers/macab/macabutilities.hxx |    2 +-
 embeddedobj/source/msole/olecomponent.cxx            |    6 +++---
 filter/source/config/cache/filterfactory.cxx         |    2 +-
 idlc/source/idlccompile.cxx                          |    2 +-
 package/source/zippackage/ZipPackageStream.cxx       |    2 +-
 scripting/source/provider/ActiveMSPList.cxx          |    2 +-
 sd/source/core/stlsheet.cxx                          |    2 +-
 svl/source/passwordcontainer/passwordcontainer.cxx   |    2 +-
 svl/source/passwordcontainer/syscreds.cxx            |    3 +--
 svtools/source/misc/transfer.cxx                     |    2 +-
 svx/source/dialog/docrecovery.cxx                    |    2 +-
 sw/source/ui/docvw/HeaderFooterWin.cxx               |    2 +-
 uui/source/iahndl.cxx                                |    3 +--
 13 files changed, 15 insertions(+), 17 deletions(-)

New commits:
commit cf239da5c403164e75c369173fe6bed747de9e09
Author: Christophe JAILLET <christophe.jaillet at wanadoo.fr>
Date:   Mon Aug 6 10:40:32 2012 +0200

    There is not need to allocate memory just for getting the 'indexOf'
    a literal within a OUString.
    
    Change-Id: Icc8e22c43f6ddca25cb284a3d45ab39680ad6d1f

diff --git a/connectivity/source/drivers/macab/macabutilities.hxx b/connectivity/source/drivers/macab/macabutilities.hxx
index 1417a5c..d2b2ed2 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 623811c..8893091 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 8292405..30c25d6 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 68cf263..0491046 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 fa066bd..d0e63fb 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 5f1fbb2..1edc4e9 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 08fe4dc..e85e8ca 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 7e1177f..0a86600 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 ce0f0e4..f9cb530 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 aadd6bf..a85cf1f 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 32685fa..c50da38 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 5b737fb..23b2892 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 2c355e1..98b25bd 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)")


More information about the Libreoffice-commits mailing list