diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-03-08 09:03:10 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-03-08 09:03:10 +0100 |
commit | 3d4723f80a37e719359ad78ad063bc39ac28cd32 (patch) | |
tree | 87963e60947a5d61854d733dccd3779bad05545b | |
parent | b62541a083158cf1d30337ba5e751c1cbd2c649e (diff) |
Revert "simplify some compareTo"
This reverts commit 19020191cbf3e3c7a7bf98d0958d86d931ae687b,
s1.compareTo(s2, length-of-s2)
is *not* equivalent to
s1 == s2
-rw-r--r-- | dbaccess/source/filter/xml/dbloader2.cxx | 2 | ||||
-rw-r--r-- | editeng/source/uno/unofield.cxx | 4 | ||||
-rw-r--r-- | extensions/source/bibliography/bibload.cxx | 2 | ||||
-rw-r--r-- | forms/source/richtext/richtextcontrol.cxx | 2 | ||||
-rw-r--r-- | framework/source/fwe/xml/saxnamespacefilter.cxx | 2 | ||||
-rw-r--r-- | linguistic/source/lngsvcmgr.cxx | 8 | ||||
-rw-r--r-- | rsc/source/rsc/rsc.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unomod.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 2 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucblockbytes.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/core/nmspmap.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 2 |
12 files changed, 18 insertions, 18 deletions
diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx index 38def3a62bd1..12df6d797472 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 eee7c6e1d234..b33da6beaa22 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 1e6bba01121a..52c84c67867b 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 34e49da2b60d..730d793fb3b2 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 ccd8fda5464e..3a9e25649c37 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 d33a5936a8e4..abce09198e26 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 fbaa6592657c..92da2002070c 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 32ce6e627faf..76e70e9063ea 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 a732aa81bb87..dddeee6a7db0 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 8d38da802f10..8082f5b1d6fd 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 31ba464fd612..c867818b66d9 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 562fe8a53937..4ad63cbcadb7 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" ), |