diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-03-08 12:37:15 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-03-08 13:04:13 +0100 |
commit | 6583305dd70e31ae745d709b8cda8c7b68219735 (patch) | |
tree | e50a38a329c161b3d3a99c11fa49a53a3dfb8330 | |
parent | Add PDF Mimetype to Draw (diff) | |
download | core-6583305dd70e31ae745d709b8cda8c7b68219735.tar.gz core-6583305dd70e31ae745d709b8cda8c7b68219735.zip |
simplify compareTo (now correct)
Change-Id: Ia4fd2f54d0bda71d472f46949500c0b23ff8e1b7
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
-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 12df6d797472..bca2b1a919de 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.compareTo( OUString( "private:stream" ), 14 ) != COMPARE_EQUAL ) + if ( bStreamFromDescr && !sURL.startsWith( "private:stream" ) ) { // 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 b33da6beaa22..b7b0a001867e 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.compareTo( aTextFieldPrexit, aTextFieldPrexit.getLength() ) == 0) || - (ServiceSpecifier.compareTo( aTextFieldPrexit2, aTextFieldPrexit2.getLength() ) == 0) ) + if( (ServiceSpecifier.startsWith( aTextFieldPrexit )) || + (ServiceSpecifier.startsWith( aTextFieldPrexit2 )) ) { OUString aFieldType( ServiceSpecifier.copy( aTextFieldPrexit.getLength() ) ); diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index 52c84c67867b..552740341265 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.compareTo(sCurrentId) == COMPARE_EQUAL)) + if (!xIdColumn->wasNull() && rName.startsWith(sCurrentId)) { bRet = sal_True; break; diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx index 730d793fb3b2..053abd151116 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 ( 0 == _rURL.Complete.compareTo( sUnoProtocolPrefix, sUnoProtocolPrefix.getLength() ) ) + if ( _rURL.Complete.startsWith( sUnoProtocolPrefix ) ) { ::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 3a9e25649c37..165e53763c58 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.compareTo( m_aXMLAttributeNamespace, m_aXMLAttributeNamespace.getLength() ) == 0 ) + if ( aName.startsWith( m_aXMLAttributeNamespace ) ) aXMLNamespaces.addNamespace( aName, xAttribs->getValueByIndex( i )); else aAttributeIndexes.push_back( i ); diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index abce09198e26..a41fe51224bf 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 (0 == rName.compareTo( aSpellCheckerList, aSpellCheckerList.getLength() )) + if (rName.startsWith( aSpellCheckerList )) { // 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 (0 == rName.compareTo( aGrammarCheckerList, aGrammarCheckerList.getLength() )) + else if (rName.startsWith( aGrammarCheckerList )) { // 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 (0 == rName.compareTo( aHyphenatorList, aHyphenatorList.getLength() )) + else if (rName.startsWith( aHyphenatorList )) { // 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 (0 == rName.compareTo( aThesaurusList, aThesaurusList.getLength() )) + else if (rName.startsWith( aThesaurusList )) { // 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 92da2002070c..007f4263069c 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.compareTo( repl->second, repl->second.getLength() ) == 0 ) // path matches + if( rIn.startsWith( repl->second ) ) // 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 76e70e9063ea..d3b12680ab85 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.compareTo( aDrawingPrefix, aDrawingPrefix.getLength() ) == 0 ) + if( rServiceSpecifier.startsWith( aDrawingPrefix ) ) { 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 dddeee6a7db0..443f37653f7f 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.compareTo( aGraphicProtocol, aGraphicProtocol.getLength() ) == 0 ) + if( aGrfUrl.startsWith( aGraphicProtocol ) ) { 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 8082f5b1d6fd..dc4a4a44825f 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.compareTo (aBad, aBad.getLength()) == 0)) + if (!aUrl.startsWith(aBad)) { // URL changed (Redirection). m_xLockBytes->SetRealURL_Impl( aUrl ); diff --git a/xmloff/source/core/nmspmap.cxx b/xmloff/source/core/nmspmap.cxx index c867818b66d9..ebf268c26dd7 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.compareTo( sURIPrefix, sURIPrefix.getLength() ) == 0 ) + if( rName.startsWith( sURIPrefix ) ) { 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( 0 != rName.compareTo( rOasisURN, rOasisURN.getLength() ) ) + if( !rName.startsWith( rOasisURN ) ) 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( 0!= sTmp.compareTo( rXMLNS, rXMLNS.getLength() ) ) + if( !sTmp.startsWith( rXMLNS ) ) return sal_False; // :urn:oasis:names:tc:[^:]:xmlns:.* diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 4ad63cbcadb7..c38f45faf326 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.compareTo( sURL, sURL.getLength() ) == 0 ) + if ( aPersistName.startsWith( sURL ) ) aPersistName = aPersistName.copy( sURL.getLength() ); xProps->setPropertyValue( OUString( "PersistName" ), |