diff --git a/framework/source/fwe/xml/xmlnamespaces.cxx b/framework/source/fwe/xml/xmlnamespaces.cxx index d44c06c7c1ec..da01d4f4e35f 100644 --- a/framework/source/fwe/xml/xmlnamespaces.cxx +++ b/framework/source/fwe/xml/xmlnamespaces.cxx @@ -47,7 +47,7 @@ void XMLNamespaces::addNamespace( const OUString& aName, const OUString& aValue sal_Int32 nXMLNamespaceLength = m_aXMLAttributeNamespace.getLength(); // delete preceding "xmlns" - if ( aNamespaceName.compareTo( m_aXMLAttributeNamespace, nXMLNamespaceLength ) == 0 ) + if ( aNamespaceName.startsWith( m_aXMLAttributeNamespace ) ) { if ( aNamespaceName.getLength() == nXMLNamespaceLength ) { diff --git a/odk/examples/DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java b/odk/examples/DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java index 27a97ec40345..1e3fd149ee12 100644 --- a/odk/examples/DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java +++ b/odk/examples/DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java @@ -125,7 +125,7 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor // XJobExecutor public void trigger(String sEvent) { - if ( sEvent.compareTo( "execute" ) == 0 ) { + if ( sEvent.equals( "execute" ) ) { try { createDialog(); } diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java index f4f3b7cf6a95..0653ee11055d 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java +++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java @@ -150,12 +150,12 @@ public class ProtocolHandlerAddon { /*IN*/String sTargetFrameName, /*IN*/int iSearchFlags ) { XDispatch xRet = null; - if ( aURL.Protocol.compareTo("org.openoffice.Office.addon.example:") == 0 ) { - if ( aURL.Path.compareTo( "Function1" ) == 0 ) + if ( aURL.Protocol.equals("org.openoffice.Office.addon.example:") ) { + if ( aURL.Path.equals( "Function1" ) ) xRet = this; - if ( aURL.Path.compareTo( "Function2" ) == 0 ) + if ( aURL.Path.equals( "Function2" ) ) xRet = this; - if ( aURL.Path.compareTo( "Help" ) == 0 ) + if ( aURL.Path.equals( "Help" ) ) xRet = this; } return xRet; @@ -177,17 +177,17 @@ public class ProtocolHandlerAddon { public void dispatch( /*IN*/com.sun.star.util.URL aURL, /*IN*/com.sun.star.beans.PropertyValue[] aArguments ) { - if ( aURL.Protocol.compareTo("org.openoffice.Office.addon.example:") == 0 ) + if ( aURL.Protocol.equals("org.openoffice.Office.addon.example:") ) { - if ( aURL.Path.compareTo( "Function1" ) == 0 ) + if ( aURL.Path.equals( "Function1" ) ) { showMessageBox("SDK DevGuide Add-On example", "Function 1 activated"); } - if ( aURL.Path.compareTo( "Function2" ) == 0 ) + if ( aURL.Path.equals( "Function2" ) ) { showMessageBox("SDK DevGuide Add-On example", "Function 2 activated"); } - if ( aURL.Path.compareTo( "Help" ) == 0 ) + if ( aURL.Path.equals( "Help" ) ) { showMessageBox("About SDK DevGuide Add-On example", "This is the SDK Add-On example"); } diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Desk.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Desk.java index 101540ee748f..7b20bb4e56a6 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Desk.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Desk.java @@ -75,7 +75,7 @@ public class Desk sFile = lArguments[i].substring(5); } - ViewContainer.mbInplace = (sMode.compareTo("inplace")==0); + ViewContainer.mbInplace = sMode.equals("inplace"); // Connect to remote office. OfficeConnect.createConnection(); diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java index 0fb4ecb6c578..b72f30ac755c 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java @@ -390,7 +390,7 @@ public class DocumentView extends JFrame String sCommand = aEvent.getActionCommand(); // open any file from disk - if( sCommand.compareTo(COMMAND_OPEN) == 0 ) + if( sCommand.equals(COMMAND_OPEN) ) { String sURL = FunctionHelper.askUserForFileURL(DocumentView.this,true); if(sURL!=null) @@ -399,14 +399,14 @@ public class DocumentView extends JFrame else // save current document - if( sCommand.compareTo(COMMAND_SAVE) == 0 ) + if( sCommand.equals(COMMAND_SAVE) ) { DocumentView.this.save(); } else // export current document to html - if( sCommand.compareTo(COMMAND_EXPORT) == 0 ) + if( sCommand.equals(COMMAND_EXPORT)) { String sURL = FunctionHelper.askUserForFileURL(DocumentView.this,false); if(sURL!=null) @@ -415,7 +415,7 @@ public class DocumentView extends JFrame else // exit application - if( sCommand.compareTo(COMMAND_EXIT) == 0 ) + if( sCommand.equals(COMMAND_EXIT) ) { // This will force deleting of this and // all other currently opened views automatically! diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/FunctionHelper.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/FunctionHelper.java index 43f98d232d83..2f9b8e153bee 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/FunctionHelper.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/FunctionHelper.java @@ -958,7 +958,7 @@ public class FunctionHelper { com.sun.star.frame.XFrame xFrame = (com.sun.star.frame.XFrame)AnyConverter.toObject(new com.sun.star.uno.Type(com.sun.star.frame.XFrame.class), xContainer.getByIndex(i)); sName = new String(BASEFRAMENAME+mnViewCount); - while(sName.compareTo(xFrame.getName())==0) + while(sName.equals(xFrame.getName())) { ++mnViewCount; sName = new String(BASEFRAMENAME+mnViewCount); diff --git a/odk/examples/java/Inspector/InspectorAddon.java b/odk/examples/java/Inspector/InspectorAddon.java index 6ca6c4260438..b32bde1d2dfc 100644 --- a/odk/examples/java/Inspector/InspectorAddon.java +++ b/odk/examples/java/Inspector/InspectorAddon.java @@ -72,8 +72,8 @@ public class InspectorAddon { public XDispatch queryDispatch( /*IN*/com.sun.star.util.URL aURL, /*IN*/String sTargetFrameName, /*IN*/int iSearchFlags ) { XDispatch xRet = null; - if ( aURL.Protocol.compareTo("org.openoffice.Office.addon.Inspector:") == 0 ) { - if ( aURL.Path.compareTo( "inspect" ) == 0 ){ + if ( aURL.Protocol.equals("org.openoffice.Office.addon.Inspector:") ) { + if ( aURL.Path.equals( "inspect" ) ){ // Todo: Check if the frame is already administered (use hashtable) xRet = new Dispatcher(m_xFrame); } @@ -114,7 +114,7 @@ public class InspectorAddon { // XDispatch public void dispatch( /*IN*/com.sun.star.util.URL _aURL, /*IN*/com.sun.star.beans.PropertyValue[] aArguments ) { try{ - if ( _aURL.Protocol.compareTo("org.openoffice.Office.addon.Inspector:") == 0 ){ + if ( _aURL.Protocol.equals("org.openoffice.Office.addon.Inspector:") ){ if ( _aURL.Path.equals("inspect")){ Object oUnoInspectObject = xModel; com.sun.star.lang.XMultiComponentFactory xMCF = m_xContext.getServiceManager(); diff --git a/odk/examples/java/Inspector/ProtocolHandlerAddon.java b/odk/examples/java/Inspector/ProtocolHandlerAddon.java index 00bc253cb703..518ab913e674 100644 --- a/odk/examples/java/Inspector/ProtocolHandlerAddon.java +++ b/odk/examples/java/Inspector/ProtocolHandlerAddon.java @@ -151,12 +151,12 @@ public class ProtocolHandlerAddon { /*IN*/String sTargetFrameName, /*IN*/int iSearchFlags ) { XDispatch xRet = null; - if ( aURL.Protocol.compareTo("org.openoffice.Office.addon.example:") == 0 ) { - if ( aURL.Path.compareTo( "Function1" ) == 0 ) + if ( aURL.Protocol.equals("org.openoffice.Office.addon.example:") ) { + if ( aURL.Path.equals( "Function1" ) ) xRet = this; - if ( aURL.Path.compareTo( "Function2" ) == 0 ) + if ( aURL.Path.equals( "Function2" ) ) xRet = this; - if ( aURL.Path.compareTo( "Help" ) == 0 ) + if ( aURL.Path.equals( "Help" ) ) xRet = this; } return xRet; @@ -178,17 +178,17 @@ public class ProtocolHandlerAddon { public void dispatch( /*IN*/com.sun.star.util.URL aURL, /*IN*/com.sun.star.beans.PropertyValue[] aArguments ) { - if ( aURL.Protocol.compareTo("org.openoffice.Office.addon.example:") == 0 ) + if ( aURL.Protocol.equals("org.openoffice.Office.addon.example:") ) { - if ( aURL.Path.compareTo( "Function1" ) == 0 ) + if ( aURL.Path.equals( "Function1" ) ) { showMessageBox("SDK DevGuide Add-On example", "Function 1 activated"); } - if ( aURL.Path.compareTo( "Function2" ) == 0 ) + if ( aURL.Path.equals( "Function2" ) ) { showMessageBox("SDK DevGuide Add-On example", "Function 2 activated"); } - if ( aURL.Path.compareTo( "Help" ) == 0 ) + if ( aURL.Path.equals( "Help" ) ) { showMessageBox("About SDK DevGuide Add-On example", "This is the SDK Add-On example"); } diff --git a/odk/examples/java/Spreadsheet/EuroAdaption.java b/odk/examples/java/Spreadsheet/EuroAdaption.java index 8168aee4f1a4..fddaaf16b3a7 100644 --- a/odk/examples/java/Spreadsheet/EuroAdaption.java +++ b/odk/examples/java/Spreadsheet/EuroAdaption.java @@ -189,7 +189,7 @@ public class EuroAdaption { // change the numberformat only on cellranges with a // currency numberformat if( ( (fType & com.sun.star.util.NumberFormat.CURRENCY) > 0) && - ( sCurrencySymbol.compareTo( sOldSymbol ) == 0 ) ) { + ( sCurrencySymbol.equals( sOldSymbol ) ) ) { boolean bThousandSep = AnyConverter.toBoolean( xFormat.getPropertyValue("ThousandsSeparator")); boolean bNegativeRed = AnyConverter.toBoolean( diff --git a/odk/examples/java/Text/StyleInitialization.java b/odk/examples/java/Text/StyleInitialization.java index 5acf7559d673..f743c471e5ed 100644 --- a/odk/examples/java/Text/StyleInitialization.java +++ b/odk/examples/java/Text/StyleInitialization.java @@ -206,7 +206,7 @@ public class StyleInitialization { sFontname = sFontname.toLowerCase(); // if the style use the font 'Albany', apply it to the current paragraph - if( sFontname.compareTo("albany") == 0 ) { + if( sFontname.equals("albany") ) { // create a property set from the current paragraph, to change the paragraph style xPropertySet = UnoRuntime.queryInterface( com.sun.star.beans.XPropertySet.class, xTextRange ); diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 8b664c75647c..93afb641ba10 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -249,12 +249,12 @@ HashedEntry::~HashedEntry() inline bool HashedEntry::operator ==( const HashedEntry& rRef ) const { - return mnHashCode == rRef.mnHashCode && maName.reverseCompareTo( rRef.maName ) == 0; + return mnHashCode == rRef.mnHashCode && maName == rRef.maName; } inline bool HashedEntry::operator !=( const HashedEntry& rRef ) const { - return mnHashCode != rRef.mnHashCode || maName.reverseCompareTo( rRef.maName ) != 0; + return mnHashCode != rRef.mnHashCode || maName != rRef.maName; } inline bool HashedEntry::operator <( const HashedEntry& rRef ) const @@ -2468,7 +2468,7 @@ bool SvtFileView_Impl::SearchNextEntry( sal_uInt32& nIndex, const OUString& rTit while ( nIndex < nEnd ) { SortingData_Impl* pData = maContent[ nIndex ]; - if ( rTitle.compareTo( pData->GetLowerTitle(), rTitle.getLength() ) == 0 ) + if ( pData->GetLowerTitle().startsWith( rTitle ) ) return true; nIndex += 1; } @@ -2479,7 +2479,7 @@ bool SvtFileView_Impl::SearchNextEntry( sal_uInt32& nIndex, const OUString& rTit while ( nIndex < nEnd && nIndex <= nStart ) { SortingData_Impl* pData = maContent[ nIndex ]; - if ( rTitle.compareTo( pData->GetLowerTitle(), rTitle.getLength() ) == 0 ) + if ( pData->GetLowerTitle().startsWith( rTitle ) ) return true; nIndex += 1; } diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx index c800c6c4db04..6141fae75de2 100644 --- a/svtools/source/contnr/templwin.cxx +++ b/svtools/source/contnr/templwin.cxx @@ -537,7 +537,7 @@ void SvtFileViewWindow_Impl::OpenFolder( const OUString& rURL ) { sal_Int32 nSampFoldLen = aSamplesFolderURL.getLength(); aFileView.EnableNameReplacing( - nSampFoldLen && rURL.compareTo( aSamplesFolderURL, nSampFoldLen ) == 0 ); + nSampFoldLen && rURL.startsWith( aSamplesFolderURL ) ); aFileView.Initialize( rURL, "", NULL ); } aNewFolderLink.Call( this ); diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index 93e8c2df55ae..c9d70c9d9c62 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -883,8 +883,7 @@ int HTMLParser::_GetNextRawToken() { if( !bReadComment ) { - if( aTok.compareTo( OOO_STRING_SVTOOLS_HTML_comment, 3 ) - == 0 ) + if( aTok.startsWith( OOO_STRING_SVTOOLS_HTML_comment ) ) { bReadComment = true; } @@ -893,9 +892,9 @@ int HTMLParser::_GetNextRawToken() // A script has to end with "". But // ">" is optional for security reasons bDone = bOffState && - 0 == ( bReadScript - ? aTok.compareTo(OOO_STRING_SVTOOLS_HTML_script) - : aTok.compareTo(aEndToken) ); + ( bReadScript + ? aTok.equals(OOO_STRING_SVTOOLS_HTML_script) + : aTok.equals(aEndToken) ); } } if( bReadComment && '>'==nNextCh && aTok.endsWith( "--" ) ) @@ -908,13 +907,11 @@ int HTMLParser::_GetNextRawToken() { // Style sheets can be closed by , or
if( bOffState ) - bDone = aTok.compareTo(OOO_STRING_SVTOOLS_HTML_style) - == 0 || - aTok.compareTo(OOO_STRING_SVTOOLS_HTML_head) - == 0; + bDone = aTok.equals(OOO_STRING_SVTOOLS_HTML_style) || + aTok.equals(OOO_STRING_SVTOOLS_HTML_head); else bDone = - aTok.compareTo(OOO_STRING_SVTOOLS_HTML_body) == 0; + aTok.equals(OOO_STRING_SVTOOLS_HTML_body); } if( bDone ) @@ -1958,7 +1955,7 @@ bool HTMLParser::InternalImgToPrivateURL( OUString& rURL ) bool bFound = false; - if( rURL.compareTo( OOO_STRING_SVTOOLS_HTML_internal_gopher,16) == 0 ) + if( rURL.startsWith( OOO_STRING_SVTOOLS_HTML_internal_gopher ) ) { OUString aName( rURL.copy(16) ); switch( aName[0] ) @@ -1986,7 +1983,7 @@ bool HTMLParser::InternalImgToPrivateURL( OUString& rURL ) break; } } - else if( rURL.compareTo( OOO_STRING_SVTOOLS_HTML_internal_icon,14) == 0 ) + else if( rURL.startsWith( OOO_STRING_SVTOOLS_HTML_internal_icon ) ) { OUString aName( rURL.copy(14) ); switch( aName[0] ) diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index ff5bad3abe54..21a08a108d6c 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -2244,13 +2244,13 @@ void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex, { PropertyValue& rValue = pValues[i]; - if (rValue.Name.compareTo( ChangeAttr.Name )==0) + if (rValue.Name == ChangeAttr.Name ) { rValue.Value = ChangeAttr.Value; continue; } - if (rValue.Name.compareTo( ChangeAttrColor.Name )==0) + if (rValue.Name == ChangeAttrColor.Name ) { rValue.Value = ChangeAttrColor.Value; continue; diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx index 6faafb969f0d..6d7bdcb7f7bb 100644 --- a/ucb/source/ucp/file/bc.cxx +++ b/ucb/source/ucp/file/bc.cxx @@ -625,11 +625,10 @@ BaseContent::createNewContent( if ( Info.Type.isEmpty() ) return Reference< XContent >(); - bool bFolder - = ( Info.Type.compareTo( m_pMyShell->FolderContentType ) == 0 ); + bool bFolder = Info.Type == m_pMyShell->FolderContentType; if ( !bFolder ) { - if ( Info.Type.compareTo( m_pMyShell->FileContentType ) != 0 ) + if ( Info.Type != m_pMyShell->FileContentType ) { // Neither folder nor file to create! return Reference< XContent >(); diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index ea12bf72d97f..2d074c927ac9 100644 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx @@ -166,7 +166,7 @@ namespace fileaccess { || ( ( dstL > srcL ) && - ( srcUnqPath.compareTo( dstUnqPath, srcL ) == 0 ) + dstUnqPath.startsWith(srcUnqPath) && ( dstUnqPath[ srcL ] == slash ) ) ); diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx index adba80d8fae0..2d5acc09d595 100644 --- a/ucb/source/ucp/gio/gio_content.cxx +++ b/ucb/source/ucp/gio/gio_content.cxx @@ -563,7 +563,7 @@ void Content::queryChildren( ContentRefList& rChildren ) OUString aChildURL = xChild->getIdentifier()->getContentIdentifier(); // Is aURL a prefix of aChildURL? - if ( ( aChildURL.getLength() > nLen ) && ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) + if ( ( aChildURL.getLength() > nLen ) && aChildURL.startsWith( aURL ) ) { sal_Int32 nPos = nLen; nPos = aChildURL.indexOf( '/', nPos ); diff --git a/ucb/source/ucp/gvfs/gvfs_content.cxx b/ucb/source/ucp/gvfs/gvfs_content.cxx index 8f82888d124f..68f2e1d340cd 100644 --- a/ucb/source/ucp/gvfs/gvfs_content.cxx +++ b/ucb/source/ucp/gvfs/gvfs_content.cxx @@ -896,7 +896,7 @@ void Content::queryChildren( ContentRefList& rChildren ) // Is aURL a prefix of aChildURL? if ( ( aChildURL.getLength() > nLen ) && - ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) { + ( aChildURL.startsWith( aURL ) ) ) { sal_Int32 nPos = nLen; nPos = aChildURL.indexOf( '/', nPos ); diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index e541288dc411..9a00a14a2f76 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -814,7 +814,7 @@ void HierarchyContent::queryChildren( HierarchyContentRefList& rChildren ) // Is aURL a prefix of aChildURL? if ( ( aChildURL.getLength() > nLen ) && - ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) + ( aChildURL.startsWith( aURL ) ) ) { sal_Int32 nPos = nLen; nPos = aChildURL.indexOf( '/', nPos ); @@ -1621,8 +1621,7 @@ void HierarchyContent::transfer( if ( rInfo.SourceURL.getLength() <= aId.getLength() ) { - if ( aId.compareTo( - rInfo.SourceURL, rInfo.SourceURL.getLength() ) == 0 ) + if ( aId.startsWith( rInfo.SourceURL ) ) { uno::Any aProps = uno::makeAny(beans::PropertyValue( diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index 2b85a29025ec..288525bdefd5 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -1839,8 +1839,7 @@ void Content::transfer( if ( rInfo.SourceURL.getLength() <= aId.getLength() ) { - if ( aId.compareTo( - rInfo.SourceURL, rInfo.SourceURL.getLength() ) == 0 ) + if ( aId.startsWith( rInfo.SourceURL ) ) { uno::Any aProps = uno::makeAny(beans::PropertyValue( @@ -2193,7 +2192,7 @@ void Content::queryChildren( ContentRefList& rChildren ) // Is aURL a prefix of aChildURL? if ( ( aChildURL.getLength() > nLen ) && - ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) + ( aChildURL.startsWith( aURL ) ) ) { if ( aChildURL.indexOf( '/', nLen ) == -1 ) { diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index 5b3b0420c310..6a2676b62a77 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -799,7 +799,7 @@ void Content::queryChildren( ContentRefList& rChildren ) // Is aURL a prefix of aChildURL? if ( ( aChildURL.getLength() > nLen ) && - ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) + ( aChildURL.startsWith( aURL ) ) ) { sal_Int32 nPos = nLen; nPos = aChildURL.indexOf( '/', nPos ); @@ -1985,8 +1985,7 @@ void Content::transfer( if ( rInfo.SourceURL.getLength() <= aId.getLength() ) { - if ( aId.compareTo( - rInfo.SourceURL, rInfo.SourceURL.getLength() ) == 0 ) + if ( aId.startsWith( rInfo.SourceURL ) ) { uno::Any aProps = uno::makeAny(beans::PropertyValue( diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index f67c85240b80..fe49180627da 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -2240,7 +2240,7 @@ void Content::queryChildren( ContentRefList& rChildren ) // Is aURL a prefix of aChildURL? if ( ( aChildURL.getLength() > nLen ) && - ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) + ( aChildURL.startsWith( aURL ) ) ) { sal_Int32 nPos = nLen; nPos = aChildURL.indexOf( '/', nPos ); diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index cf1a55e601b1..b783e166a52a 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -2367,7 +2367,7 @@ void Content::queryChildren( ContentRefList& rChildren ) // Is aURL a prefix of aChildURL? if ( ( aChildURL.getLength() > nLen ) && - ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) + ( aChildURL.startsWith( aURL ) ) ) { sal_Int32 nPos = nLen; nPos = aChildURL.indexOf( '/', nPos ); diff --git a/unodevtools/source/skeletonmaker/javacompskeleton.cxx b/unodevtools/source/skeletonmaker/javacompskeleton.cxx index 42d1da160110..1777dab117fd 100644 --- a/unodevtools/source/skeletonmaker/javacompskeleton.cxx +++ b/unodevtools/source/skeletonmaker/javacompskeleton.cxx @@ -428,12 +428,12 @@ void generateXDispatchBodies(std::ostream& o, ProgramOptions const & options) ProtocolCmdMap::const_iterator iter = options.protocolCmdMap.begin(); while (iter != options.protocolCmdMap.end()) { - o << " if ( aURL.Protocol.compareTo(\"" << (*iter).first - << "\") == 0 )\n {\n"; + o << " if ( aURL.Protocol.equals(\"" << (*iter).first + << "\") )\n {\n"; for (std::vector< OString >::const_iterator i = (*iter).second.begin(); i != (*iter).second.end(); ++i) { - o << " if ( aURL.Path.compareTo(\"" << (*i) << "\") == 0 )\n" + o << " if ( aURL.Path.equals(\"" << (*i) << "\") )\n" " {\n // add your own code here\n" " return;\n }\n"; } @@ -465,12 +465,12 @@ void generateXDispatchProviderBodies(std::ostream& o, ProgramOptions const & opt ProtocolCmdMap::const_iterator iter = options.protocolCmdMap.begin(); while (iter != options.protocolCmdMap.end()) { - o << " if ( aURL.Protocol.compareTo(\"" << (*iter).first - << "\") == 0 )\n {\n"; + o << " if ( aURL.Protocol.equals(\"" << (*iter).first + << "\") )\n {\n"; for (std::vector< OString >::const_iterator i = (*iter).second.begin(); i != (*iter).second.end(); ++i) { - o << " if ( aURL.Path.compareTo(\"" << (*i) << "\") == 0 )\n" + o << " if ( aURL.Path.equals(\"" << (*i) << "\") )\n" " return this;\n"; } diff --git a/unotools/source/config/configpaths.cxx b/unotools/source/config/configpaths.cxx index ae4f77c049f2..73d33fc93a9e 100644 --- a/unotools/source/config/configpaths.cxx +++ b/unotools/source/config/configpaths.cxx @@ -190,7 +190,7 @@ sal_Int32 lcl_findPrefixEnd(OUString const& _sNestedPath, OUString const& _sPref if (_sNestedPath.getLength() > nPrefixLength) { bIsPrefix = _sNestedPath[nPrefixLength] == '/' && - _sNestedPath.compareTo(_sPrefixPath,nPrefixLength) == 0; + _sNestedPath.startsWith(_sPrefixPath); ++nPrefixLength; } else if (_sNestedPath.getLength() == nPrefixLength) diff --git a/winaccessibility/source/UAccCOM/AccEditableText.cxx b/winaccessibility/source/UAccCOM/AccEditableText.cxx index 054c3c9e9449..4d30994ee61b 100644 --- a/winaccessibility/source/UAccCOM/AccEditableText.cxx +++ b/winaccessibility/source/UAccCOM/AccEditableText.cxx @@ -261,56 +261,56 @@ STDMETHODIMP CAccEditableText::setAttributes(long startOffset, long endOffset, B */ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const ::rtl::OUString &ouValue, Any &rAny) { - if(ouName.compareTo(L"CharBackColor") == 0 || - ouName.compareTo(L"CharColor") == 0 || - ouName.compareTo(L"ParaAdjust") == 0 || - ouName.compareTo(L"ParaFirstLineIndent") == 0 || - ouName.compareTo(L"ParaLeftMargin") == 0 || - ouName.compareTo(L"ParaRightMargin") == 0 || - ouName.compareTo(L"ParaTopMargin") == 0 || - ouName.compareTo(L"ParaBottomMargin") == 0 || - ouName.compareTo(L"CharFontPitch") == 0) + if(ouName.equals(L"CharBackColor") || + ouName.equals(L"CharColor") || + ouName.equals(L"ParaAdjust") || + ouName.equals(L"ParaFirstLineIndent") || + ouName.equals(L"ParaLeftMargin") || + ouName.equals(L"ParaRightMargin") || + ouName.equals(L"ParaTopMargin") || + ouName.equals(L"ParaBottomMargin") || + ouName.equals(L"CharFontPitch") ) { // Convert to int. // NOTE: CharFontPitch is not implemented in java file. sal_Int32 nValue = ouValue.toInt32(); rAny.setValue(&nValue, cppu::UnoType