[Libreoffice-commits] core.git: comphelper/inc comphelper/source dbaccess/source desktop/source dtrans/source embeddedobj/source embeddedobj/test forms/source fpicker/source
Ashish Banerjee
ashish.banerjee10 at gmail.com
Fri Apr 5 01:57:47 PDT 2013
comphelper/inc/comphelper/property.hxx | 6 +++---
comphelper/source/misc/ihwrapnofilter.cxx | 2 +-
comphelper/source/misc/instancelocker.cxx | 2 +-
dbaccess/source/ui/dlg/CollectionView.cxx | 2 +-
desktop/source/deployment/manager/dp_informationprovider.cxx | 2 +-
dtrans/source/cnttype/mcnttfactory.cxx | 2 +-
dtrans/source/generic/clipboardmanager.cxx | 4 ++--
dtrans/source/generic/generic_clipboard.cxx | 2 +-
dtrans/source/win32/clipb/WinClipboard.cxx | 2 +-
dtrans/source/win32/ftransl/ftransl.cxx | 2 +-
embeddedobj/source/commonembedding/xfactory.cxx | 4 ++--
embeddedobj/source/general/xcreator.cxx | 2 +-
embeddedobj/source/msole/xdialogcreator.cxx | 2 +-
embeddedobj/source/msole/xolefactory.cxx | 2 +-
embeddedobj/test/MainThreadExecutor/xexecutor.cxx | 2 +-
embeddedobj/test/mtexecutor/bitmapcreator.cxx | 2 +-
embeddedobj/test/mtexecutor/mainthreadexecutor.cxx | 2 +-
forms/source/component/Edit.cxx | 2 +-
fpicker/source/aqua/SalAquaFilePicker.mm | 2 +-
fpicker/source/aqua/SalAquaFolderPicker.mm | 2 +-
fpicker/source/win32/filepicker/FilePicker.cxx | 2 +-
fpicker/source/win32/filepicker/VistaFilePicker.cxx | 2 +-
fpicker/source/win32/folderpicker/FolderPicker.cxx | 2 +-
23 files changed, 27 insertions(+), 27 deletions(-)
New commits:
commit e1f6dac6893e0ad9e1b1f03a3b882cf1e9a08d32
Author: Ashish Banerjee <ashish.banerjee10 at gmail.com>
Date: Wed Apr 3 20:11:54 2013 -0600
Replace `compareTo(...) == 0` with ==
Proposed patch for the following issue:
https://bugs.freedesktop.org/show_bug.cgi?id=62096
Change-Id: Ib83a9051ea12c53642f781e5427a6ca728049a7f
Reviewed-on: https://gerrit.libreoffice.org/3198
Reviewed-by: Thomas Arnhold <thomas at arnhold.org>
Reviewed-by: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Tested-by: Miklos Vajna <vmiklos at suse.cz>
diff --git a/comphelper/inc/comphelper/property.hxx b/comphelper/inc/comphelper/property.hxx
index d8e0d3b..29ff7b2 100644
--- a/comphelper/inc/comphelper/property.hxx
+++ b/comphelper/inc/comphelper/property.hxx
@@ -60,12 +60,12 @@ namespace comphelper
// ................................................................
inline bool operator()( const ::com::sun::star::beans::Property& lhs, const ::rtl::OUString& rhs ) const
{
- return lhs.Name.compareTo(rhs) == 0;
+ return lhs.Name == rhs ;
}
// ................................................................
inline bool operator()( const ::rtl::OUString& lhs, const ::com::sun::star::beans::Property& rhs ) const
{
- return lhs.compareTo(rhs.Name) == 0;
+ return lhs == rhs.Name ;
}
};
//--------------------------------------------------------------------------
@@ -74,7 +74,7 @@ namespace comphelper
{
bool operator() (const ::com::sun::star::beans::Property& x, const ::com::sun::star::beans::Property& y) const
{
- return x.Name.compareTo(y.Name) == 0;
+ return x.Name == y.Name ;
}
};
diff --git a/comphelper/source/misc/ihwrapnofilter.cxx b/comphelper/source/misc/ihwrapnofilter.cxx
index 150da2b..c6b6697 100644
--- a/comphelper/source/misc/ihwrapnofilter.cxx
+++ b/comphelper/source/misc/ihwrapnofilter.cxx
@@ -114,7 +114,7 @@ namespace comphelper
uno::Sequence< ::rtl::OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx
index 50ca694..a42852f 100644
--- a/comphelper/source/misc/instancelocker.cxx
+++ b/comphelper/source/misc/instancelocker.cxx
@@ -203,7 +203,7 @@ void SAL_CALL OInstanceLocker::initialize( const uno::Sequence< uno::Any >& aArg
uno::Sequence< ::rtl::OUString > aSeq = getSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx
index 40516da..202c54f 100644
--- a/dbaccess/source/ui/dlg/CollectionView.cxx
+++ b/dbaccess/source/ui/dlg/CollectionView.cxx
@@ -287,7 +287,7 @@ void OCollectionView::initCurrentPath()
const ::rtl::OUString sCID = m_xContent->getIdentifier()->getContentIdentifier();
const static ::rtl::OUString s_sFormsCID("private:forms");
const static ::rtl::OUString s_sReportsCID("private:reports");
- m_bCreateForm = s_sFormsCID.compareTo(sCID) == 0;
+ m_bCreateForm = s_sFormsCID == sCID ;
::rtl::OUString sPath("/");
if ( m_bCreateForm && sCID.getLength() != s_sFormsCID.getLength())
sPath = sCID.copy(s_sFormsCID.getLength());
diff --git a/desktop/source/deployment/manager/dp_informationprovider.cxx b/desktop/source/deployment/manager/dp_informationprovider.cxx
index 90c75ee..33fa074 100644
--- a/desktop/source/deployment/manager/dp_informationprovider.cxx
+++ b/desktop/source/deployment/manager/dp_informationprovider.cxx
@@ -121,7 +121,7 @@ rtl::OUString PackageInformationProvider::getPackageLocation(
try
{
const beans::Optional< rtl::OUString > aID = packages[ pos ]->getIdentifier();
- if ( aID.IsPresent && aID.Value.compareTo( _rExtensionId ) == 0 )
+ if ( aID.IsPresent && (aID.Value == _rExtensionId ) )
{
aLocationURL = packages[ pos ]->getURL();
break;
diff --git a/dtrans/source/cnttype/mcnttfactory.cxx b/dtrans/source/cnttype/mcnttfactory.cxx
index 86eb617..ec43fcd 100644
--- a/dtrans/source/cnttype/mcnttfactory.cxx
+++ b/dtrans/source/cnttype/mcnttfactory.cxx
@@ -87,7 +87,7 @@ sal_Bool SAL_CALL CMimeContentTypeFactory::supportsService( const OUString& Serv
Sequence < OUString > SupportedServicesNames = MimeContentTypeFactory_getSupportedServiceNames();
for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
- if (SupportedServicesNames[n].compareTo(ServiceName) == 0)
+ if ( SupportedServicesNames[n] == ServiceName )
return sal_True;
return sal_False;
diff --git a/dtrans/source/generic/clipboardmanager.cxx b/dtrans/source/generic/clipboardmanager.cxx
index be78cdf..7793826 100644
--- a/dtrans/source/generic/clipboardmanager.cxx
+++ b/dtrans/source/generic/clipboardmanager.cxx
@@ -62,7 +62,7 @@ sal_Bool SAL_CALL ClipboardManager::supportsService( const OUString& ServiceName
Sequence < OUString > SupportedServicesNames = ClipboardManager_getSupportedServiceNames();
for ( sal_Int32 n = 0, nmax = SupportedServicesNames.getLength(); n < nmax; n++ )
- if (SupportedServicesNames[n].compareTo(ServiceName) == 0)
+ if ( SupportedServicesNames[n] == ServiceName )
return sal_True;
return sal_False;
@@ -111,7 +111,7 @@ void SAL_CALL ClipboardManager::addClipboard( const Reference< XClipboard >& xCl
// the name "default" is reserved for internal use
OUString aName = xClipboard->getName();
- if (m_aDefaultName.compareTo(aName) == 0)
+ if ( m_aDefaultName == aName )
throw IllegalArgumentException(OUString("name reserved"),
static_cast < XClipboardManager * > (this), 1);
diff --git a/dtrans/source/generic/generic_clipboard.cxx b/dtrans/source/generic/generic_clipboard.cxx
index 4da2b1b..8862163 100644
--- a/dtrans/source/generic/generic_clipboard.cxx
+++ b/dtrans/source/generic/generic_clipboard.cxx
@@ -75,7 +75,7 @@ sal_Bool SAL_CALL GenericClipboard::supportsService( const OUString& ServiceName
Sequence < OUString > SupportedServicesNames = GenericClipboard_getSupportedServiceNames();
for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
- if (SupportedServicesNames[n].compareTo(ServiceName) == 0)
+ if ( SupportedServicesNames[n] == ServiceName )
return sal_True;
return sal_False;
diff --git a/dtrans/source/win32/clipb/WinClipboard.cxx b/dtrans/source/win32/clipb/WinClipboard.cxx
index 7bf9687..80ef257 100644
--- a/dtrans/source/win32/clipb/WinClipboard.cxx
+++ b/dtrans/source/win32/clipb/WinClipboard.cxx
@@ -288,7 +288,7 @@ sal_Bool SAL_CALL CWinClipboard::supportsService( const OUString& ServiceName )
Sequence < OUString > SupportedServicesNames = WinClipboard_getSupportedServiceNames();
for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
- if (SupportedServicesNames[n].compareTo(ServiceName) == 0)
+ if ( SupportedServicesNames[n] == ServiceName )
return sal_True;
return sal_False;
diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/dtrans/source/win32/ftransl/ftransl.cxx
index 53611cb..1f141f2 100644
--- a/dtrans/source/win32/ftransl/ftransl.cxx
+++ b/dtrans/source/win32/ftransl/ftransl.cxx
@@ -225,7 +225,7 @@ sal_Bool SAL_CALL CDataFormatTranslator::supportsService( const OUString& Servic
Sequence < OUString > SupportedServicesNames = DataFormatTranslator_getSupportedServiceNames();
for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
- if (SupportedServicesNames[n].compareTo(ServiceName) == 0)
+ if ( SupportedServicesNames[n] == ServiceName )
return sal_True;
return sal_False;
diff --git a/embeddedobj/source/commonembedding/xfactory.cxx b/embeddedobj/source/commonembedding/xfactory.cxx
index ba5af4a..404635e 100644
--- a/embeddedobj/source/commonembedding/xfactory.cxx
+++ b/embeddedobj/source/commonembedding/xfactory.cxx
@@ -462,7 +462,7 @@ sal_Bool SAL_CALL OOoEmbeddedObjectFactory::supportsService( const ::rtl::OUStri
uno::Sequence< ::rtl::OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
@@ -537,7 +537,7 @@ sal_Bool SAL_CALL OOoSpecialEmbeddedObjectFactory::supportsService( const ::rtl:
uno::Sequence< ::rtl::OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/embeddedobj/source/general/xcreator.cxx b/embeddedobj/source/general/xcreator.cxx
index 24f5bbd..c3ac025 100644
--- a/embeddedobj/source/general/xcreator.cxx
+++ b/embeddedobj/source/general/xcreator.cxx
@@ -453,7 +453,7 @@ sal_Bool SAL_CALL UNOEmbeddedObjectCreator::supportsService( const ::rtl::OUStri
uno::Sequence< ::rtl::OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/embeddedobj/source/msole/xdialogcreator.cxx b/embeddedobj/source/msole/xdialogcreator.cxx
index ea7947a..b4e5d50 100644
--- a/embeddedobj/source/msole/xdialogcreator.cxx
+++ b/embeddedobj/source/msole/xdialogcreator.cxx
@@ -346,7 +346,7 @@ sal_Bool SAL_CALL MSOLEDialogObjectCreator::supportsService( const ::rtl::OUStri
uno::Sequence< ::rtl::OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/embeddedobj/source/msole/xolefactory.cxx b/embeddedobj/source/msole/xolefactory.cxx
index 5580925..f5fdff4 100644
--- a/embeddedobj/source/msole/xolefactory.cxx
+++ b/embeddedobj/source/msole/xolefactory.cxx
@@ -317,7 +317,7 @@ sal_Bool SAL_CALL OleEmbeddedObjectFactory::supportsService( const ::rtl::OUStri
uno::Sequence< ::rtl::OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/embeddedobj/test/MainThreadExecutor/xexecutor.cxx b/embeddedobj/test/MainThreadExecutor/xexecutor.cxx
index f5cb25e..e35feb8 100644
--- a/embeddedobj/test/MainThreadExecutor/xexecutor.cxx
+++ b/embeddedobj/test/MainThreadExecutor/xexecutor.cxx
@@ -116,7 +116,7 @@ sal_Bool SAL_CALL UNOMainThreadExecutor::supportsService( const ::rtl::OUString&
uno::Sequence< ::rtl::OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/embeddedobj/test/mtexecutor/bitmapcreator.cxx b/embeddedobj/test/mtexecutor/bitmapcreator.cxx
index fdc86df..5937410 100644
--- a/embeddedobj/test/mtexecutor/bitmapcreator.cxx
+++ b/embeddedobj/test/mtexecutor/bitmapcreator.cxx
@@ -97,7 +97,7 @@ sal_Bool SAL_CALL VCLBitmapCreator::supportsService( const ::rtl::OUString& Serv
uno::Sequence< ::rtl::OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/embeddedobj/test/mtexecutor/mainthreadexecutor.cxx b/embeddedobj/test/mtexecutor/mainthreadexecutor.cxx
index 828abef..084efe6 100644
--- a/embeddedobj/test/mtexecutor/mainthreadexecutor.cxx
+++ b/embeddedobj/test/mtexecutor/mainthreadexecutor.cxx
@@ -98,7 +98,7 @@ sal_Bool SAL_CALL MainThreadExecutor::supportsService( const ::rtl::OUString& Se
uno::Sequence< ::rtl::OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+ if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx
index b6e43b5..81b816c 100644
--- a/forms/source/component/Edit.cxx
+++ b/forms/source/component/Edit.cxx
@@ -584,7 +584,7 @@ void OEditModel::read(const Reference<XObjectInputStream>& _rxInStream) throw (
{
Any aDefaultControl = m_xAggregateSet->getPropertyValue(PROPERTY_DEFAULTCONTROL);
if ( (aDefaultControl.getValueType().getTypeClass() == TypeClass_STRING)
- && (getString(aDefaultControl).compareTo(STARDIV_ONE_FORM_CONTROL_TEXTFIELD) == COMPARE_EQUAL)
+ && (getString(aDefaultControl) == STARDIV_ONE_FORM_CONTROL_TEXTFIELD )
)
{
m_xAggregateSet->setPropertyValue( PROPERTY_DEFAULTCONTROL, makeAny( (::rtl::OUString)STARDIV_ONE_FORM_CONTROL_EDIT ) );
diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm
index d1a399f..e64c422 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.mm
+++ b/fpicker/source/aqua/SalAquaFilePicker.mm
@@ -629,7 +629,7 @@ throw( uno::RuntimeException )
uno::Sequence <rtl::OUString> supportedServicesNames = FilePicker_getSupportedServiceNames();
for( sal_Int32 n = supportedServicesNames.getLength(); n--; ) {
- if( supportedServicesNames[n].compareTo( sServiceName ) == 0) {
+ if( supportedServicesNames[n] == sServiceName ) {
retVal = sal_True;
break;
}
diff --git a/fpicker/source/aqua/SalAquaFolderPicker.mm b/fpicker/source/aqua/SalAquaFolderPicker.mm
index 8d06b7f..766f460 100644
--- a/fpicker/source/aqua/SalAquaFolderPicker.mm
+++ b/fpicker/source/aqua/SalAquaFolderPicker.mm
@@ -226,7 +226,7 @@ sal_Bool SAL_CALL SalAquaFolderPicker::supportsService( const rtl::OUString& sSe
uno::Sequence <rtl::OUString> supportedServicesNames = FolderPicker_getSupportedServiceNames();
for( sal_Int32 n = supportedServicesNames.getLength(); n--; ) {
- if( supportedServicesNames[n].compareTo( sServiceName ) == 0) {
+ if( supportedServicesNames[n] == sServiceName ) {
retVal = sal_True;
break;
}
diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx
index de1f84a..e851409 100644
--- a/fpicker/source/win32/filepicker/FilePicker.cxx
+++ b/fpicker/source/win32/filepicker/FilePicker.cxx
@@ -723,7 +723,7 @@ sal_Bool SAL_CALL CFilePicker::supportsService(const rtl::OUString& ServiceName)
uno::Sequence <rtl::OUString> SupportedServicesNames = FilePicker_getSupportedServiceNames();
for (sal_Int32 n = SupportedServicesNames.getLength(); n--;)
- if (SupportedServicesNames[n].compareTo(ServiceName) == 0)
+ if (SupportedServicesNames[n] == ServiceName)
return sal_True;
return sal_False;
diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx
index 3cb4e3a..ce51655 100644
--- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx
@@ -619,7 +619,7 @@ sal_Bool SAL_CALL VistaFilePicker::supportsService(const ::rtl::OUString& sServi
css::uno::Sequence< ::rtl::OUString > lSupportedServicesNames = VistaFilePicker_getSupportedServiceNames();
for (sal_Int32 n = lSupportedServicesNames.getLength(); n--;)
- if (lSupportedServicesNames[n].compareTo(sServiceName) == 0)
+ if (lSupportedServicesNames[n] == sServiceName)
return sal_True;
return sal_False;
diff --git a/fpicker/source/win32/folderpicker/FolderPicker.cxx b/fpicker/source/win32/folderpicker/FolderPicker.cxx
index de5f714..2b889e3 100644
--- a/fpicker/source/win32/folderpicker/FolderPicker.cxx
+++ b/fpicker/source/win32/folderpicker/FolderPicker.cxx
@@ -160,7 +160,7 @@ sal_Bool SAL_CALL CFolderPicker::supportsService( const OUString& ServiceName )
Sequence < OUString > SupportedServicesNames = FolderPicker_getSupportedServiceNames();
for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
- if (SupportedServicesNames[n].compareTo(ServiceName) == 0)
+ if ( SupportedServicesNames[n] == ServiceName )
return sal_True;
return sal_False;
More information about the Libreoffice-commits
mailing list