[Libreoffice-commits] core.git: dbaccess/source editeng/source extensions/source forms/source framework/source linguistic/source rsc/source svx/source sw/source unotools/source xmloff/source

Stephan Bergmann sbergman at redhat.com
Fri Mar 8 00:04:35 PST 2013


 dbaccess/source/filter/xml/dbloader2.cxx        |    2 +-
 editeng/source/uno/unofield.cxx                 |    4 ++--
 extensions/source/bibliography/bibload.cxx      |    2 +-
 forms/source/richtext/richtextcontrol.cxx       |    2 +-
 framework/source/fwe/xml/saxnamespacefilter.cxx |    2 +-
 linguistic/source/lngsvcmgr.cxx                 |    8 ++++----
 rsc/source/rsc/rsc.cxx                          |    2 +-
 svx/source/unodraw/unomod.cxx                   |    2 +-
 sw/source/core/unocore/unoframe.cxx             |    2 +-
 unotools/source/ucbhelper/ucblockbytes.cxx      |    2 +-
 xmloff/source/core/nmspmap.cxx                  |    6 +++---
 xmloff/source/draw/ximpshap.cxx                 |    2 +-
 12 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 3d4723f80a37e719359ad78ad063bc39ac28cd32
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Mar 8 09:03:10 2013 +0100

    Revert "simplify some compareTo"
    
    This reverts commit 19020191cbf3e3c7a7bf98d0958d86d931ae687b,
    
      s1.compareTo(s2, length-of-s2)
    
    is *not* equivalent to
    
      s1 == s2

diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx
index 38def3a..12df6d7 100644
--- a/dbaccess/source/filter/xml/dbloader2.cxx
+++ b/dbaccess/source/filter/xml/dbloader2.cxx
@@ -157,7 +157,7 @@ OUString SAL_CALL DBTypeDetection::detect( ::com::sun::star::uno::Sequence< ::co
             xStorageProperties->getPropertyValue( INFO_MEDIATYPE ) >>= sMediaType;
             if ( sMediaType == MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII || sMediaType == MIMETYPE_VND_SUN_XML_BASE_ASCII )
             {
-                if ( bStreamFromDescr && (sURL != "private:stream") )
+                if ( bStreamFromDescr && sURL.compareTo( OUString( "private:stream" ), 14 ) != COMPARE_EQUAL )
                 {
                     // After fixing of the i88522 issue ( use the new file locking for database files ) the stream from the type detection can be used further
                     // for now the file should be reopened to have read/write access
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index eee7c6e..b33da6b 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -886,8 +886,8 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoTextCreateTextField( const ::rt
     // fixed since OOo 3.2 but for compatibility we will still provide support for the wrong notation.
     const OUString aTextFieldPrexit2( "com.sun.star.text.TextField." );
 
-    if( (ServiceSpecifier == aTextFieldPrexit) ||
-        (ServiceSpecifier == aTextFieldPrexit2) )
+    if( (ServiceSpecifier.compareTo( aTextFieldPrexit, aTextFieldPrexit.getLength() ) == 0) ||
+        (ServiceSpecifier.compareTo( aTextFieldPrexit2, aTextFieldPrexit2.getLength() ) == 0) )
     {
         OUString aFieldType( ServiceSpecifier.copy( aTextFieldPrexit.getLength() ) );
 
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx
index 1e6bba0..52c84c6 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -550,7 +550,7 @@ sal_Bool BibliographyLoader::hasByName(const rtl::OUString& rName) throw ( Runti
             do
             {
                 rtl::OUString sCurrentId = xIdColumn->getString();
-                if (!xIdColumn->wasNull() && (rName == sCurrentId))
+                if (!xIdColumn->wasNull() && (rName.compareTo(sCurrentId) == COMPARE_EQUAL))
                 {
                     bRet = sal_True;
                     break;
diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx
index 34e49da..730d793 100644
--- a/forms/source/richtext/richtextcontrol.cxx
+++ b/forms/source/richtext/richtextcontrol.cxx
@@ -694,7 +694,7 @@ namespace frm
 
         // is it an UNO slot?
         ::rtl::OUString sUnoProtocolPrefix( RTL_CONSTASCII_USTRINGPARAM( ".uno:" ) );
-        if ( _rURL.Complete == sUnoProtocolPrefix )
+        if ( 0 == _rURL.Complete.compareTo( sUnoProtocolPrefix, sUnoProtocolPrefix.getLength() ) )
         {
             ::rtl::OUString sUnoSlotName = _rURL.Complete.copy( sUnoProtocolPrefix.getLength() );
             SfxSlotId nSlotId = lcl_getSlotFromUnoName( SfxSlotPool::GetSlotPool( NULL ), sUnoSlotName );
diff --git a/framework/source/fwe/xml/saxnamespacefilter.cxx b/framework/source/fwe/xml/saxnamespacefilter.cxx
index ccd8fda..3a9e256 100644
--- a/framework/source/fwe/xml/saxnamespacefilter.cxx
+++ b/framework/source/fwe/xml/saxnamespacefilter.cxx
@@ -79,7 +79,7 @@ void SAL_CALL SaxNamespaceFilter::startElement(
         for ( sal_Int16 i=0; i< xAttribs->getLength(); i++ )
         {
             OUString aName = xAttribs->getNameByIndex( i );
-            if ( aName == m_aXMLAttributeNamespace )
+            if ( aName.compareTo( m_aXMLAttributeNamespace, m_aXMLAttributeNamespace.getLength() ) == 0 )
                 aXMLNamespaces.addNamespace( aName, xAttribs->getValueByIndex( i ));
             else
                 aAttributeIndexes.push_back( i );
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index d33a593..abce091 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -860,7 +860,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
         if (nKeyStart != -1)
             aKeyText = rName.copy( nKeyStart + 1 );
         DBG_ASSERT( !aKeyText.isEmpty(), "unexpected key (lang::Locale) string" );
-        if (rName == aSpellCheckerList)
+        if (0 == rName.compareTo( aSpellCheckerList, aSpellCheckerList.getLength() ))
         {
             // delete old cached data, needs to be acquired new on demand
             clearSvcInfoArray(pAvailSpellSvcs);
@@ -885,7 +885,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
                 pSpellDsp->SetServiceList( LanguageTag(nLang).getLocale(), aSvcImplNames );
             }
         }
-        else if (rName == aGrammarCheckerList)
+        else if (0 == rName.compareTo( aGrammarCheckerList, aGrammarCheckerList.getLength() ))
         {
             // delete old cached data, needs to be acquired new on demand
             clearSvcInfoArray(pAvailGrammarSvcs);
@@ -913,7 +913,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
                 }
             }
         }
-        else if (rName == aHyphenatorList)
+        else if (0 == rName.compareTo( aHyphenatorList, aHyphenatorList.getLength() ))
         {
             // delete old cached data, needs to be acquired new on demand
             clearSvcInfoArray(pAvailHyphSvcs);
@@ -938,7 +938,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
                 pHyphDsp->SetServiceList( LanguageTag(nLang).getLocale(), aSvcImplNames );
             }
         }
-        else if (rName == aThesaurusList)
+        else if (0 == rName.compareTo( aThesaurusList, aThesaurusList.getLength() ))
         {
             // delete old cached data, needs to be acquired new on demand
             clearSvcInfoArray(pAvailThesSvcs);
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index fbaa659..92da200 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -345,7 +345,7 @@ OString RscCmdLine::substitutePaths( const OString& rIn )
     // search for longest replacement match
     for( std::list< std::pair< OString, OString > >::const_iterator repl = m_aReplacements.begin(); repl != m_aReplacements.end(); ++repl )
     {
-        if( rIn == repl->second ) // path matches
+        if( rIn.compareTo( repl->second, repl->second.getLength() ) == 0 ) // path matches
         {
             if( last_match == m_aReplacements.end() || last_match->second.getLength() < repl->second.getLength() )
                 last_match = repl;
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index 32ce6e6..76e70e9 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -172,7 +172,7 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createInstance(
 {
     const OUString aDrawingPrefix( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.") );
 
-    if( rServiceSpecifier == aDrawingPrefix )
+    if( rServiceSpecifier.compareTo( aDrawingPrefix, aDrawingPrefix.getLength() ) == 0 )
     {
         sal_uInt32 nType = UHashMap::getId( rServiceSpecifier );
         if( nType != UHASHMAP_NOTFOUND )
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index a732aa8..dddeee6 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1257,7 +1257,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
                 // the package URL based graphics are handled in different way currently
                 // TODO/LATER: actually this is the correct place to handle them
                 ::rtl::OUString aGraphicProtocol( RTL_CONSTASCII_USTRINGPARAM( sGraphicObjectProtocol ) );
-                if( aGrfUrl ==  aGraphicProtocol )
+                if( aGrfUrl.compareTo( aGraphicProtocol, aGraphicProtocol.getLength() ) == 0 )
                 {
                     rtl::OString sId(rtl::OUStringToOString(
                         aGrfUrl.copy(sizeof(sGraphicObjectProtocol)-1),
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx
index 8d38da8..8082f5b 100644
--- a/unotools/source/ucbhelper/ucblockbytes.cxx
+++ b/unotools/source/ucbhelper/ucblockbytes.cxx
@@ -217,7 +217,7 @@ void SAL_CALL UcbPropertiesChangeListener_Impl::propertiesChange ( const Sequenc
             if (evt.NewValue >>= aUrl)
             {
                 ::rtl::OUString aBad (RTL_CONSTASCII_USTRINGPARAM ("private:"));
-                if (aUrl != aBad)
+                if (!(aUrl.compareTo (aBad, aBad.getLength()) == 0))
                 {
                     // URL changed (Redirection).
                     m_xLockBytes->SetRealURL_Impl( aUrl );
diff --git a/xmloff/source/core/nmspmap.cxx b/xmloff/source/core/nmspmap.cxx
index 31ba464..c867818 100644
--- a/xmloff/source/core/nmspmap.cxx
+++ b/xmloff/source/core/nmspmap.cxx
@@ -463,7 +463,7 @@ sal_Bool SvXMLNamespaceMap::NormalizeW3URI( ::rtl::OUString& rName )
 
     sal_Bool bSuccess = sal_False;
     const OUString sURIPrefix = GetXMLToken( XML_URI_W3_PREFIX );
-    if( rName == sURIPrefix )
+    if( rName.compareTo( sURIPrefix, sURIPrefix.getLength() ) == 0 )
     {
         const OUString sURISuffix = GetXMLToken( XML_URI_XFORMS_SUFFIX );
         sal_Int32 nCompareFrom = rName.getLength() - sURISuffix.getLength();
@@ -508,7 +508,7 @@ sal_Bool SvXMLNamespaceMap::NormalizeOasisURN( ::rtl::OUString& rName )
     sal_Int32 nNameLen = rName.getLength();
     // :urn:oasis:names:tc.*
     const OUString& rOasisURN = GetXMLToken( XML_URN_OASIS_NAMES_TC );
-    if( rName != rOasisURN )
+    if( 0 != rName.compareTo( rOasisURN, rOasisURN.getLength() ) )
         return sal_False;
 
     // :urn:oasis:names:tc:.*
@@ -526,7 +526,7 @@ sal_Bool SvXMLNamespaceMap::NormalizeOasisURN( ::rtl::OUString& rName )
     nPos = nTCIdEnd + 1;
     OUString sTmp( rName.copy( nPos ) );
     const OUString& rXMLNS = GetXMLToken( XML_XMLNS );
-    if( sTmp != rXMLNS )
+    if( 0!= sTmp.compareTo( rXMLNS, rXMLNS.getLength() ) )
         return sal_False;
 
     // :urn:oasis:names:tc:[^:]:xmlns:.*
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 562fe8a..4ad63cb 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -2670,7 +2670,7 @@ void SdXMLObjectShapeContext::StartElement( const ::com::sun::star::uno::Referen
                 {
                     const OUString  sURL( "vnd.sun.star.EmbeddedObject:" );
 
-                    if ( aPersistName == sURL )
+                    if ( aPersistName.compareTo( sURL, sURL.getLength() ) == 0 )
                         aPersistName = aPersistName.copy( sURL.getLength() );
 
                     xProps->setPropertyValue( OUString(  "PersistName"  ),


More information about the Libreoffice-commits mailing list