[Libreoffice-commits] core.git: 2 commits - extensions/source framework/source include/connectivity include/vbahelper lingucomponent/source odk/examples scaddins/source scripting/source sc/source svtools/source sw/source ucb/source unodevtools/source unotools/source winaccessibility/source wizards/com writerfilter/source xmerge/source xmlhelp/source
Noel Grandin
noel at peralex.com
Wed Jun 4 02:53:18 PDT 2014
extensions/source/dbpilots/unoautopilot.inl | 2
framework/source/fwe/xml/xmlnamespaces.cxx | 2
include/connectivity/sqlnode.hxx | 2
include/vbahelper/vbaaccesshelper.hxx | 2
lingucomponent/source/spellcheck/macosxspell/macspellimp.mm | 2
odk/examples/DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java | 2
odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java | 16 +--
odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Desk.java | 2
odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java | 8 -
odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/FunctionHelper.java | 2
odk/examples/java/Inspector/InspectorAddon.java | 6 -
odk/examples/java/Inspector/ProtocolHandlerAddon.java | 16 +--
odk/examples/java/Spreadsheet/EuroAdaption.java | 2
odk/examples/java/Text/StyleInitialization.java | 2
sc/source/ui/unoobj/eventuno.cxx | 2
scaddins/source/analysis/analysis.cxx | 2
scripting/source/protocolhandler/scripthandler.cxx | 2
svtools/source/contnr/fileview.cxx | 8 -
svtools/source/contnr/templwin.cxx | 2
svtools/source/svhtml/parhtml.cxx | 21 ++---
sw/source/core/access/accpara.cxx | 4
sw/source/filter/html/htmlforw.cxx | 2
ucb/source/ucp/file/bc.cxx | 5 -
ucb/source/ucp/file/filglob.cxx | 2
ucb/source/ucp/file/filrset.cxx | 3
ucb/source/ucp/gio/gio_content.cxx | 2
ucb/source/ucp/gvfs/gvfs_content.cxx | 2
ucb/source/ucp/hierarchy/hierarchycontent.cxx | 5 -
ucb/source/ucp/package/pkgcontent.cxx | 5 -
ucb/source/ucp/tdoc/tdoc_content.cxx | 5 -
ucb/source/ucp/webdav-neon/webdavcontent.cxx | 2
ucb/source/ucp/webdav/webdavcontent.cxx | 2
unodevtools/source/skeletonmaker/javacompskeleton.cxx | 12 +-
unotools/source/config/configpaths.cxx | 2
unotools/source/ucbhelper/ucblockbytes.cxx | 6 -
winaccessibility/source/UAccCOM/AccEditableText.cxx | 42 +++++-----
wizards/com/sun/star/wizards/common/JavaTools.java | 6 -
wizards/com/sun/star/wizards/form/CallFormWizard.java | 2
wizards/com/sun/star/wizards/query/CallQueryWizard.java | 2
wizards/com/sun/star/wizards/report/CallReportWizard.java | 4
wizards/com/sun/star/wizards/table/CallTableWizard.java | 2
wizards/com/sun/star/wizards/text/TextStyleHandler.java | 2
writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 42 +++++-----
writerfilter/source/ooxml/OOXMLStreamImpl.cxx | 22 ++---
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2
xmerge/source/bridge/java/XMergeBridge.java | 10 +-
xmlhelp/source/cxxhelp/provider/databases.cxx | 2
xmlhelp/source/cxxhelp/provider/provider.cxx | 2
xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 2
xmlhelp/source/treeview/tvfactory.cxx | 2
50 files changed, 149 insertions(+), 157 deletions(-)
New commits:
commit cc25f70ef1e9fa7637b4bfd332ebdc33844a41c2
Author: Noel Grandin <noel at peralex.com>
Date: Wed Jun 4 11:43:58 2014 +0200
compareTo -> equals
convert OUString::compareTo usage to equals to startsWith where it
is more appropriate
Change-Id: I6f5b5b7942429c0099ad082ba4984fd18e422121
diff --git a/framework/source/fwe/xml/xmlnamespaces.cxx b/framework/source/fwe/xml/xmlnamespaces.cxx
index d44c06c..da01d4f 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 27a97ec..1e3fd14 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 f4f3b7c..0653ee1 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 101540e..7b20bb4 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 0fb4ecb6..b72f30a 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 43f98d2..2f9b8e1 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 6ca6c42..b32bde1 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 00bc253..518ab91 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 8168aee..fddaaf1 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 5acf755..f743c47 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 8b664c7..93afb64 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 c800c6c..6141fae 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 93e8c2d..c9d70c9 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 "</SCRIPT>". 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 </STYLE>, </HEAD> or <BODY>
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 ff5bad3a..21a08a1 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 6faafb9..6d7bdcb 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 ea12bf7..2d074c9 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 adba80d..2d5acc0 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 8f82888..68f2e1d 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 e541288..9a00a14 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 2b85a29..288525b 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 5b3b042..6a2676b 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 f67c852..fe49180 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 cf1a55e6..b783e16 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 42d1da1..1777dab 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 ae4f77c..73d33fc 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 054c3c9..4d30994 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<sal_Int32>::get());
}
- else if(ouName.compareTo(L"CharShadowed") == 0 ||
- ouName.compareTo(L"CharContoured") == 0)
+ else if(ouName.equals(L"CharShadowed") ||
+ ouName.equals(L"CharContoured") )
{
// Convert to boolean.
boolean nValue = (boolean)ouValue.toBoolean();
rAny.setValue(&nValue, cppu::UnoType<sal_Bool>::get() );
}
- else if(ouName.compareTo(L"CharEscapement") == 0 ||
- ouName.compareTo(L"CharStrikeout") == 0 ||
- ouName.compareTo(L"CharUnderline") == 0 ||
- ouName.compareTo(L"CharFontPitch") == 0)
+ else if(ouName.equals(L"CharEscapement") ||
+ ouName.equals(L"CharStrikeout") ||
+ ouName.equals(L"CharUnderline") ||
+ ouName.equals(L"CharFontPitch") )
{
// Convert to short.
short nValue = (short)ouValue.toInt32();
rAny.setValue(&nValue, cppu::UnoType<short>::get());
}
- else if(ouName.compareTo(L"CharHeight") == 0 ||
- ouName.compareTo(L"CharWeight") == 0)
+ else if(ouName.equals(L"CharHeight") ||
+ ouName.equals(L"CharWeight") )
{
// Convert to float.
float fValue = ouValue.toFloat();
rAny.setValue(&fValue, cppu::UnoType<float>::get());
}
- else if(ouName.compareTo(L"CharFontName") == 0)
+ else if(ouName.equals(L"CharFontName") )
{
// Convert to string.
rAny.setValue(&ouValue, cppu::UnoType<rtl::OUString>::get());
}
- else if(ouName.compareTo(L"CharPosture") == 0)
+ else if(ouName.equals(L"CharPosture") )
{
// Convert to FontSlant.
::com::sun::star::awt::FontSlant fontSlant = (::com::sun::star::awt::FontSlant)ouValue.toInt32();
rAny.setValue(&fontSlant, cppu::UnoType<com::sun::star::awt::FontSlant>::get());
}
- else if(ouName.compareTo(L"ParaTabStops") == 0)
+ else if(ouName.equals(L"ParaTabStops") )
{
// Convert to the Sequence with TabStop element.
@@ -420,7 +420,7 @@ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const :
// Assign to Any object.
rAny.setValue(&seqTabStop, getCppuType((Sequence< ::com::sun::star::style::TabStop >*)0));
}
- else if(ouName.compareTo(L"ParaLineSpacing") == 0)
+ else if(ouName.equals(L"ParaLineSpacing") )
{
// Parse value string.
::com::sun::star::style::LineSpacing lineSpacing;
diff --git a/wizards/com/sun/star/wizards/common/JavaTools.java b/wizards/com/sun/star/wizards/common/JavaTools.java
index 5436983..11656ba 100644
--- a/wizards/com/sun/star/wizards/common/JavaTools.java
+++ b/wizards/com/sun/star/wizards/common/JavaTools.java
@@ -200,7 +200,7 @@ public class JavaTools
int retvalue = -1;
for (int i = 0; i < FieldLen; i++)
{
- if (SearchList[i].compareTo(SearchString) == 0)
+ if (SearchList[i].equals(SearchString))
{
retvalue = i;
break;
@@ -217,7 +217,7 @@ public class JavaTools
{
for (int i = StartIndex; i < FieldLen; i++)
{
- if (SearchList[i].compareTo(SearchString) == 0)
+ if (SearchList[i].equals(SearchString))
{
retvalue = i;
break;
@@ -238,7 +238,7 @@ public class JavaTools
{
if (SearchList[i][0] != null)
{
- if (SearchList[i][0].compareTo(SearchString) == 0)
+ if (SearchList[i][0].equals(SearchString))
{
retvalue = i;
break;
diff --git a/wizards/com/sun/star/wizards/form/CallFormWizard.java b/wizards/com/sun/star/wizards/form/CallFormWizard.java
index f990142..4445937 100644
--- a/wizards/com/sun/star/wizards/form/CallFormWizard.java
+++ b/wizards/com/sun/star/wizards/form/CallFormWizard.java
@@ -69,7 +69,7 @@ public class CallFormWizard
{
try
{
- if (sEvent.compareTo(PropertyNames.START) == 0)
+ if (sEvent.equals(PropertyNames.START))
{
FormWizard CurFormWizard = new FormWizard( m_serviceFactory, m_wizardContext );
CurFormWizard.start();
diff --git a/wizards/com/sun/star/wizards/query/CallQueryWizard.java b/wizards/com/sun/star/wizards/query/CallQueryWizard.java
index 315e763..204fe28 100644
--- a/wizards/com/sun/star/wizards/query/CallQueryWizard.java
+++ b/wizards/com/sun/star/wizards/query/CallQueryWizard.java
@@ -74,7 +74,7 @@ public class CallQueryWizard
{
try
{
- if (sEvent.compareTo(PropertyNames.START) == 0)
+ if (sEvent.equals(PropertyNames.START))
{
QueryWizard CurQueryWizard = new QueryWizard( m_serviceFactory, m_wizardContext );
Command = CurQueryWizard.start();
diff --git a/wizards/com/sun/star/wizards/report/CallReportWizard.java b/wizards/com/sun/star/wizards/report/CallReportWizard.java
index af9623c..9ac3ac3 100644
--- a/wizards/com/sun/star/wizards/report/CallReportWizard.java
+++ b/wizards/com/sun/star/wizards/report/CallReportWizard.java
@@ -82,7 +82,7 @@ public class CallReportWizard
{
try
{
- if (sEvent.compareTo(PropertyNames.START) == 0)
+ if (sEvent.equals(PropertyNames.START))
{
if (!bWizardstartedalready)
{
@@ -91,7 +91,7 @@ public class CallReportWizard
}
bWizardstartedalready = false;
}
- else if (sEvent.compareTo("fill") == 0)
+ else if (sEvent.equals("fill"))
{
Dataimport CurDataimport = new Dataimport(xmultiservicefactory);
if (m_wizardContext != null)
diff --git a/wizards/com/sun/star/wizards/table/CallTableWizard.java b/wizards/com/sun/star/wizards/table/CallTableWizard.java
index c092d0f..0674ff7 100644
--- a/wizards/com/sun/star/wizards/table/CallTableWizard.java
+++ b/wizards/com/sun/star/wizards/table/CallTableWizard.java
@@ -76,7 +76,7 @@ public class CallTableWizard
{
try
{
- if ( sEvent.compareTo(PropertyNames.START) == 0 )
+ if ( sEvent.equals(PropertyNames.START) )
{
TableWizard CurTableWizard = new TableWizard( m_serviceFactory, m_wizardContext );
Command = CurTableWizard.startTableWizard();
diff --git a/wizards/com/sun/star/wizards/text/TextStyleHandler.java b/wizards/com/sun/star/wizards/text/TextStyleHandler.java
index b1ebdc5..c9225df 100644
--- a/wizards/com/sun/star/wizards/text/TextStyleHandler.java
+++ b/wizards/com/sun/star/wizards/text/TextStyleHandler.java
@@ -55,7 +55,7 @@ public class TextStyleHandler
for (int i = 0; i < PropCount; i++)
{
CurOptionName = StyleOptions[i].Name;
- StyleOptions[i].Value = Boolean.valueOf((CurOptionName.compareTo(OptionString) == 0) || (CurOptionName.compareTo("OverwriteStyles") == 0));
+ StyleOptions[i].Value = Boolean.valueOf(CurOptionName.equals(OptionString) || CurOptionName.equals("OverwriteStyles"));
}
xStyleLoader.loadStylesFromURL(sTemplateUrl, StyleOptions);
}
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index 35773d7..5b45c82 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -568,10 +568,10 @@ void OOXMLDocumentImpl::resolveCustomXmlStream(Stream & rStream)
beans::StringPair aPair = aSeq[i];
// Need to resolve only customxml files from document relationships.
// Skipping other files.
- if (aPair.Second.compareTo(sCustomType) == 0 ||
- aPair.Second.compareTo(sCustomTypeStrict) == 0)
+ if (aPair.Second == sCustomType ||
+ aPair.Second == sCustomTypeStrict)
bFound = true;
- else if(aPair.First.compareTo(sTarget) == 0 && bFound)
+ else if(aPair.First == sTarget && bFound)
{
// Adding value to extern variable customTarget. It will be used in ooxmlstreamimpl
// to ensure customxml target is visited in lcl_getTarget.
@@ -644,26 +644,26 @@ void OOXMLDocumentImpl::resolveGlossaryStream(Stream & /*rStream*/)
OOXMLStream::StreamType_t nType(OOXMLStream::UNKNOWN);
bool bFound = true;
- if(gType.compareTo(sSettingsType) == 0 ||
- gType.compareTo(sSettingsTypeStrict) == 0)
+ if(gType == sSettingsType ||
+ gType == sSettingsTypeStrict)
{
nType = OOXMLStream::SETTINGS;
contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml";
}
- else if(gType.compareTo(sStylesType) == 0 ||
- gType.compareTo(sStylesTypeStrict) == 0)
+ else if(gType == sStylesType ||
+ gType == sStylesTypeStrict)
{
nType = OOXMLStream::STYLES;
contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";
}
- else if(gType.compareTo(sWebSettings) == 0 ||
- gType.compareTo(sWebSettingsStrict) == 0)
+ else if(gType == sWebSettings ||
+ gType == sWebSettingsStrict)
{
nType = OOXMLStream::WEBSETTINGS;
contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml";
}
- else if(gType.compareTo(sFonttableType) == 0 ||
- gType.compareTo(sFonttableTypeStrict) == 0)
+ else if(gType == sFonttableType ||
+ gType == sFonttableTypeStrict)
{
nType = OOXMLStream::FONTTABLE;
contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml";
@@ -735,24 +735,24 @@ void OOXMLDocumentImpl::resolveEmbeddingsStream(OOXMLStream::Pointer_t pStream)
for (sal_Int32 i = 0; i < aSeq.getLength(); i++)
{
beans::StringPair aPair = aSeq[i];
- if (aPair.Second.compareTo(sChartType) == 0 ||
- aPair.Second.compareTo(sChartTypeStrict) == 0)
+ if (aPair.Second == sChartType ||
+ aPair.Second == sChartTypeStrict)
{
bFound = true;
}
- else if(aPair.Second.compareTo(sFootersType) == 0 ||
- aPair.Second.compareTo(sFootersTypeStrict) == 0)
+ else if(aPair.Second == sFootersType ||
+ aPair.Second == sFootersTypeStrict)
{
bHeaderFooterFound = true;
streamType = OOXMLStream::FOOTER;
}
- else if(aPair.Second.compareTo(sHeaderType) == 0 ||
- aPair.Second.compareTo(sHeaderTypeStrict) == 0)
+ else if(aPair.Second == sHeaderType ||
+ aPair.Second == sHeaderTypeStrict)
{
bHeaderFooterFound = true;
streamType = OOXMLStream::HEADER;
}
- else if(aPair.First.compareTo(sTarget) == 0 && ( bFound || bHeaderFooterFound ))
+ else if(aPair.First == sTarget && ( bFound || bHeaderFooterFound ))
{
// Adding value to extern variable customTarget. It will be used in ooxmlstreamimpl
// to ensure chart.xml target is visited in lcl_getTarget.
@@ -823,10 +823,10 @@ void OOXMLDocumentImpl::resolveActiveXStream(Stream & rStream)
beans::StringPair aPair = aSeq[i];
// Need to resolve only ActiveX files from document relationships.
// Skipping other files.
- if (aPair.Second.compareTo(sCustomType) == 0 ||
- aPair.Second.compareTo(sCustomTypeStrict) == 0)
+ if (aPair.Second == sCustomType ||
+ aPair.Second == sCustomTypeStrict)
bFound = true;
- else if(aPair.First.compareTo(sTarget) == 0 && bFound)
+ else if(aPair.First == sTarget && bFound)
{
// Adding value to extern variable customTarget. It will be used in ooxmlstreamimpl
// to ensure ActiveX.xml target is visited in lcl_getTarget.
diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
index 759762a..f107924 100644
--- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
@@ -287,21 +287,21 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess>
{
const beans::StringPair &rPair = rSeq[i];
- if (rPair.First.compareTo(sType) == 0 &&
- ( rPair.Second.compareTo(sStreamType) == 0 ||
- rPair.Second.compareTo(sStreamTypeStrict) == 0))
+ if (rPair.First == sType &&
+ ( rPair.Second == sStreamType ||
+ rPair.Second == sStreamTypeStrict ))
bFound = true;
- else if(rPair.First.compareTo(sType) == 0 &&
- ((rPair.Second.compareTo(sOleObjectType) == 0 ||
- rPair.Second.compareTo(sOleObjectTypeStrict) == 0) &&
+ else if(rPair.First == sType &&
+ ((rPair.Second == sOleObjectType ||
+ rPair.Second == sOleObjectTypeStrict) &&
nStreamType == EMBEDDINGS))
{
bFound = true;
}
- else if (rPair.First.compareTo(sId) == 0 &&
- rPair.Second.compareTo(rId) == 0)
+ else if (rPair.First == sId &&
+ rPair.Second == rId)
bFound = true;
- else if (rPair.First.compareTo(sTarget) == 0)
+ else if (rPair.First == sTarget)
{
// checking item[n].xml or activex[n].xml is not visited already.
if(customTarget != rPair.Second && (sStreamType == sCustomType || sStreamType == sActiveXType || sStreamType == sChartType || sStreamType == sFooterType || sStreamType == sHeaderType))
@@ -313,8 +313,8 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess>
sMyTarget = rPair.Second;
}
}
- else if (rPair.First.compareTo(sTargetMode) == 0 &&
- rPair.Second.compareTo(sExternal) == 0)
+ else if (rPair.First == sTargetMode &&
+ rPair.Second == sExternal)
bExternalTarget = true;
}
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index b45fd3e..a4c7c1d 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -759,7 +759,7 @@ int RTFDocumentImpl::resolvePict(bool bInline)
// provided by picw and pich.
OString aURLBS(OUStringToOString(aGraphicUrl, RTL_TEXTENCODING_UTF8));
const char aURLBegin[] = "vnd.sun.star.GraphicObject:";
- if (aURLBS.compareTo(aURLBegin, RTL_CONSTASCII_LENGTH(aURLBegin)) == 0)
+ if (aURLBS.startsWith(aURLBegin))
{
Graphic aGraphic = GraphicObject(aURLBS.copy(RTL_CONSTASCII_LENGTH(aURLBegin))).GetTransformedGraphic();
Size aSize(aGraphic.GetPrefSize());
diff --git a/xmerge/source/bridge/java/XMergeBridge.java b/xmerge/source/bridge/java/XMergeBridge.java
index ad76fcd..2f4897d 100644
--- a/xmerge/source/bridge/java/XMergeBridge.java
+++ b/xmerge/source/bridge/java/XMergeBridge.java
@@ -157,10 +157,10 @@ public class XMergeBridge {
{
try{
- if (pValue[i].Name.compareTo("InputStream")==0){
+ if (pValue[i].Name.equals("InputStream")){
xis=(com.sun.star.io.XInputStream)AnyConverter.toObject(new Type(com.sun.star.io.XInputStream.class), pValue[i].Value);
}
- if (pValue[i].Name.compareTo("FileName")==0){
+ if (pValue[i].Name.equals("FileName")){
sFileName=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
}
@@ -234,15 +234,15 @@ public class XMergeBridge {
try{
- if (pValue[i].Name.compareTo("OutputStream")==0){
+ if (pValue[i].Name.equals("OutputStream")){
xos=(com.sun.star.io.XOutputStream)AnyConverter.toObject(new Type(com.sun.star.io.XOutputStream.class), pValue[i].Value);
}
- if (pValue[i].Name.compareTo("FileName")==0){
+ if (pValue[i].Name.equals("FileName")){
sFileName=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
}
- if (pValue[i].Name.compareTo("URL")==0){
+ if (pValue[i].Name.equals("URL")){
sURL=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
}
}
commit adc20c3937f3119d39af5a0c8e4a439d8127fe63
Author: Noel Grandin <noel at peralex.com>
Date: Wed Jun 4 08:54:40 2014 +0200
compareToAscii -> equalsAscii
convert places using compareToAscii that should be using equalsAscii
Change-Id: I97b4da7f6e867c3967b2f65b70d6886f83b4a4e5
diff --git a/extensions/source/dbpilots/unoautopilot.inl b/extensions/source/dbpilots/unoautopilot.inl
index c79254b..4796e23 100644
--- a/extensions/source/dbpilots/unoautopilot.inl
+++ b/extensions/source/dbpilots/unoautopilot.inl
@@ -107,7 +107,7 @@ void OUnoAutoPilot<TYPE, SERVICEINFO>::implInitialize(const com::sun::star::uno:
{
::com::sun::star::beans::PropertyValue aArgument;
if (_rValue >>= aArgument)
- if (0 == aArgument.Name.compareToAscii("ObjectModel"))
+ if (aArgument.Name.equals("ObjectModel"))
{
aArgument.Value >>= m_xObjectModel;
return;
diff --git a/include/connectivity/sqlnode.hxx b/include/connectivity/sqlnode.hxx
index 31ceb29..8b3f772 100644
--- a/include/connectivity/sqlnode.hxx
+++ b/include/connectivity/sqlnode.hxx
@@ -462,7 +462,7 @@ namespace connectivity
#define SQL_ISTOKEN(pParseNode, token) ((pParseNode)->isToken() && (pParseNode)->getTokenID() == SQL_TOKEN_##token)
#define SQL_ISTOKENOR2(pParseNode, tok0, tok1) ((pParseNode)->isToken() && ( (pParseNode)->getTokenID() == SQL_TOKEN_##tok0 || (pParseNode)->getTokenID() == SQL_TOKEN_##tok1 ))
#define SQL_ISTOKENOR3(pParseNode, tok0, tok1, tok2) ((pParseNode)->isToken() && ( (pParseNode)->getTokenID() == SQL_TOKEN_##tok0 || (pParseNode)->getTokenID() == SQL_TOKEN_##tok1 || (pParseNode)->getTokenID() == SQL_TOKEN_##tok2 ))
- #define SQL_ISPUNCTUATION(pParseNode, aString) ((pParseNode)->getNodeType() == SQL_NODE_PUNCTUATION && !(pParseNode)->getTokenValue().compareToAscii(aString))
+ #define SQL_ISPUNCTUATION(pParseNode, aString) ((pParseNode)->getNodeType() == SQL_NODE_PUNCTUATION && (pParseNode)->getTokenValue().equalsAscii(aString))
}
#endif // INCLUDED_CONNECTIVITY_SQLNODE_HXX
diff --git a/include/vbahelper/vbaaccesshelper.hxx b/include/vbahelper/vbaaccesshelper.hxx
index 833cd92..362c2b2 100644
--- a/include/vbahelper/vbaaccesshelper.hxx
+++ b/include/vbahelper/vbaaccesshelper.hxx
@@ -57,7 +57,7 @@ namespace ooo
const SfxMedium *pMedium = rDocShell.GetMedium();
const SfxFilter *pFilt = pMedium ? pMedium->GetFilter() : NULL;
if ( pFilt && pFilt->IsAlienFormat() )
- bRes = ( pFilt->GetMimeType().compareToAscii( pMimeType ) == 0 );
+ bRes = pFilt->GetMimeType().equalsAscii( pMimeType );
return bRes;
}
VBAHELPER_DLLPRIVATE inline bool isAlienExcelDoc( SfxObjectShell& rDocShell ) { return isAlienDoc( rDocShell, "application/vnd.ms-excel" ); }
diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
index 9294525..73f2be9 100644
--- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
+++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
@@ -557,7 +557,7 @@ void * SAL_CALL MacSpellChecker_getFactory( const sal_Char * pImplName,
XMultiServiceFactory * pServiceManager, void * )
{
void * pRet = 0;
- if ( !MacSpellChecker::getImplementationName_Static().compareToAscii( pImplName ) )
+ if ( MacSpellChecker::getImplementationName_Static().equalsAscii( pImplName ) )
{
Reference< XSingleServiceFactory > xFactory =
cppu::createOneInstanceFactory(
diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx
index 969f680..e72d806 100644
--- a/sc/source/ui/unoobj/eventuno.cxx
+++ b/sc/source/ui/unoobj/eventuno.cxx
@@ -96,7 +96,7 @@ void SAL_CALL ScSheetEventsObj::replaceByName( const OUString& aName, const uno:
if ( rProp.Value >>= aEventType )
{
// only "Script" is supported
- if ( aEventType.compareToAscii( SC_UNO_SCRIPT ) != 0 )
+ if ( ! aEventType.equalsAscii( SC_UNO_SCRIPT ) )
throw lang::IllegalArgumentException();
}
}
diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx
index 8d24705..6349b7b 100644
--- a/scaddins/source/analysis/analysis.cxx
+++ b/scaddins/source/analysis/analysis.cxx
@@ -1153,7 +1153,7 @@ OUString SAL_CALL AnalysisAddIn::getComplex( double fR, double fI, const uno::An
{
const OUString* pSuff = ( const OUString* ) rSuff.getValue();
bi = pSuff->equalsAscii( "i" ) || pSuff->isEmpty();
- if( !bi && pSuff->compareToAscii( "j" ) != 0 )
+ if( !bi && !pSuff->equalsAscii( "j" ) )
throw lang::IllegalArgumentException();
}
break;
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index 79c6ffb..b5760b6 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -203,7 +203,7 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
// Sometimes we get a propertyval with name = "Referer"
// this is not an argument to be passed to script, so
// ignore.
- if ( lArgs[ index ].Name.compareToAscii("Referer") != 0 ||
+ if ( !lArgs[ index ].Name.equalsAscii("Referer") ||
lArgs[ index ].Name.isEmpty() )
{
inArgs.realloc( ++argCount );
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index c2876a7..53454bc 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -771,7 +771,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
const OUString& rVal = *(OUString*)aTmp.getValue();
if( rVal.isEmpty() )
bEmptyValue = true;
- else if( rVal.compareToAscii( OOO_STRING_SVTOOLS_HTML_on ) != 0 )
+ else if( !rVal.equalsAscii( OOO_STRING_SVTOOLS_HTML_on ) )
sValue = rVal;
}
break;
diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx
index a7a6060..d847271 100644
--- a/ucb/source/ucp/file/filrset.cxx
+++ b/ucb/source/ucp/file/filrset.cxx
@@ -708,8 +708,7 @@ XResultSet_impl::getMetaData(
{
for ( sal_Int32 n = 0; n < m_sProperty.getLength(); ++n )
{
- if ( m_sProperty.getConstArray()[ n ].Name.compareToAscii( "Title" )
- == 0 )
+ if ( m_sProperty.getConstArray()[ n ].Name.equalsAscii( "Title" ) )
{
// @@@ #82177# - Determine correct value!
bool bCaseSensitiveChildren = false;
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx
index 8beeec9..6bf08cc 100644
--- a/unotools/source/ucbhelper/ucblockbytes.cxx
+++ b/unotools/source/ucbhelper/ucblockbytes.cxx
@@ -871,8 +871,8 @@ static bool UCBOpenContentSync(
return _UCBOpenContentSync(
xLockBytes,xContent,rArg,xSink,xInteract,xProgress,xHandler);
- if ( (aScheme.compareToAscii( "http" ) != 0) ||
- (aScheme.compareToAscii( "https" ) != 0) )
+ if ( !aScheme.equalsAscii( "http" ) ||
+ !aScheme.equalsAscii( "https" ) )
xLockBytes->SetStreamValid_Impl();
Reference< XPropertiesChangeListener > xListener;
@@ -1108,7 +1108,7 @@ static bool _UCBOpenContentSync(
// http protocol must be handled in a special way: during the opening process the input stream may change
// only the last inputstream after notifying the document headers is valid
- if ( aScheme.compareToAscii("http") != 0 )
+ if ( !aScheme.equalsAscii("http") )
xLockBytes->SetStreamValid_Impl();
Reference< XPropertiesChangeListener > xListener = new UcbPropertiesChangeListener_Impl( xLockBytes );
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 73bf69e..31f96c5 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -419,7 +419,7 @@ const std::vector< OUString >& Databases::getModuleList( const OUString& Languag
( str[idx + 1] == 'c' || str[idx + 1] == 'C' ) &&
( str[idx + 2] == 'f' || str[idx + 2] == 'F' ) &&
( str[idx + 3] == 'g' || str[idx + 3] == 'G' ) &&
- ( fileName = fileName.copy(0,idx).toAsciiLowerCase() ).compareToAscii( "picture" ) != 0 ) {
+ !( fileName = fileName.copy(0,idx).toAsciiLowerCase() ).equalsAscii( "picture" ) ) {
if(! m_bShowBasic && fileName.equalsAscii("sbasic") )
continue;
m_avModules.push_back( fileName );
diff --git a/xmlhelp/source/cxxhelp/provider/provider.cxx b/xmlhelp/source/cxxhelp/provider/provider.cxx
index 88937f5..2d4cb92 100644
--- a/xmlhelp/source/cxxhelp/provider/provider.cxx
+++ b/xmlhelp/source/cxxhelp/provider/provider.cxx
@@ -246,7 +246,7 @@ ContentProvider::elementReplaced(const container::ContainerEvent& Event)
OUString accessor;
Event.Accessor >>= accessor;
- if(accessor.compareToAscii("HelpStyleSheet"))
+ if(!accessor.equalsAscii("HelpStyleSheet"))
return;
OUString replacedElement,element;
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index 1e0a670..174aef4 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -158,7 +158,7 @@ OUString URLParameter::get_title()
{
if( isFile() )
return get_the_title();
- else if( m_aModule.compareToAscii("") != 0 )
+ else if( !m_aModule.equalsAscii("") )
{
StaticModuleInformation* inf =
m_pDatabases->getStaticInformationForModule( get_module(),
diff --git a/xmlhelp/source/treeview/tvfactory.cxx b/xmlhelp/source/treeview/tvfactory.cxx
index d0bd2e9..110fbfb 100644
--- a/xmlhelp/source/treeview/tvfactory.cxx
+++ b/xmlhelp/source/treeview/tvfactory.cxx
@@ -108,7 +108,7 @@ TVFactory::createInstanceWithArguments(
if( ! ( Arguments[i] >>= pV ) )
continue;
- if( pV.Name.compareToAscii( "nodepath" ) )
+ if( !pV.Name.equalsAscii( "nodepath" ) )
continue;
if( ! ( pV.Value >>= hierview ) )
More information about the Libreoffice-commits
mailing list