From 743f22045c4ec08c46c259fc0ba240194a391457 Mon Sep 17 00:00:00 2001 From: Szabolcs Dezsi Date: Fri, 6 Apr 2012 15:05:52 +0200 Subject: Replaced equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(...)) with == operator Pattern used: find . -name "*.cxx" -exec sed -i 's/\( *\)\(else if\|if\) *( *\([^!()|&]*\)\.equalsAsciiL( *RTL_CONSTASCII_STRINGPARAM *( *\([^)]*\)) *) *)$/\1\2 ( \3 == \4 )/' \{\} \; --- svtools/source/filter/SvFilterOptionsDialog.cxx | 6 ++--- svtools/source/filter/exportdialog.cxx | 34 ++++++++++++------------- svtools/source/graphic/provider.cxx | 8 +++--- svtools/source/uno/contextmenuhelper.cxx | 2 +- svtools/source/uno/popupmenucontrollerbase.cxx | 4 +-- svtools/source/uno/statusbarcontroller.cxx | 10 ++++---- svtools/source/uno/toolboxcontroller.cxx | 8 +++--- svtools/source/uno/unogridcolumnfacade.cxx | 4 +-- 8 files changed, 38 insertions(+), 38 deletions(-) (limited to 'svtools') diff --git a/svtools/source/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter/SvFilterOptionsDialog.cxx index a2e7d8b1d4af..b762c2fcd030 100644 --- a/svtools/source/filter/SvFilterOptionsDialog.cxx +++ b/svtools/source/filter/SvFilterOptionsDialog.cxx @@ -142,7 +142,7 @@ uno::Sequence< beans::PropertyValue > SvFilterOptionsDialog::getPropertyValues() sal_Int32 i, nCount; for ( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ ) { - if ( maMediaDescriptor[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FilterData")) ) + if ( maMediaDescriptor[ i ].Name == "FilterData" ) break; } if ( i == nCount ) @@ -164,11 +164,11 @@ void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::Prope sal_Int32 i, nCount; for ( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ ) { - if ( maMediaDescriptor[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FilterData")) ) + if ( maMediaDescriptor[ i ].Name == "FilterData" ) { maMediaDescriptor[ i ].Value >>= maFilterDataSequence; } - else if ( maMediaDescriptor[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SelectionOnly")) ) + else if ( maMediaDescriptor[ i ].Name == "SelectionOnly" ) { maMediaDescriptor[ i ].Value >>= mbExportSelection; } diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx index ed197e9018c8..9fc8ecd0eb71 100644 --- a/svtools/source/filter/exportdialog.cxx +++ b/svtools/source/filter/exportdialog.cxx @@ -87,39 +87,39 @@ using namespace ::com::sun::star; static sal_Int16 GetFilterFormat(const rtl::OUString& rExt) { sal_Int16 nFormat = FORMAT_UNKNOWN; - if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("JPG"))) + if ( rExt == "JPG" ) nFormat = FORMAT_JPG; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PNG"))) + else if ( rExt == "PNG" ) nFormat = FORMAT_PNG; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("BMP"))) + else if ( rExt == "BMP" ) nFormat = FORMAT_BMP; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("GIF"))) + else if ( rExt == "GIF" ) nFormat = FORMAT_GIF; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PBM"))) + else if ( rExt == "PBM" ) nFormat = FORMAT_PBM; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PGM"))) + else if ( rExt == "PGM" ) nFormat = FORMAT_PGM; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PPM"))) + else if ( rExt == "PPM" ) nFormat = FORMAT_PPM; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PCT"))) + else if ( rExt == "PCT" ) nFormat = FORMAT_PCT; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("RAS"))) + else if ( rExt == "RAS" ) nFormat = FORMAT_RAS; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("TIF"))) + else if ( rExt == "TIF" ) nFormat = FORMAT_TIF; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("XPM"))) + else if ( rExt == "XPM" ) nFormat = FORMAT_XPM; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("WMF"))) + else if ( rExt == "WMF" ) nFormat = FORMAT_WMF; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EMF"))) + else if ( rExt == "EMF" ) nFormat = FORMAT_EMF; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EPS"))) + else if ( rExt == "EPS" ) nFormat = FORMAT_EPS; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MET"))) + else if ( rExt == "MET" ) nFormat = FORMAT_MET; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SVG"))) + else if ( rExt == "SVG" ) nFormat = FORMAT_SVG; - else if (rExt.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SVM"))) + else if ( rExt == "SVM" ) nFormat = FORMAT_SVM; return nFormat; } diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index d5bcf46d990b..bbc2bc7abee0 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -226,19 +226,19 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadStandardImage( co if( ( 0 == rResourceURL.getToken( 0, '/', nIndex ).compareToAscii( "private:standardimage" ) ) ) { rtl::OUString sImageName( rResourceURL.copy( nIndex ) ); - if ( sImageName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("info")) ) + if ( sImageName == "info" ) { xRet = InfoBox::GetStandardImage().GetXGraphic(); } - else if ( sImageName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("warning")) ) + else if ( sImageName == "warning" ) { xRet = WarningBox::GetStandardImage().GetXGraphic(); } - else if ( sImageName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("error")) ) + else if ( sImageName == "error" ) { xRet = ErrorBox::GetStandardImage().GetXGraphic(); } - else if ( sImageName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("query")) ) + else if ( sImageName == "query" ) { xRet = QueryBox::GetStandardImage().GetXGraphic(); } diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx index 48554a3420bd..22d361a17a1e 100644 --- a/svtools/source/uno/contextmenuhelper.cxx +++ b/svtools/source/uno/contextmenuhelper.cxx @@ -557,7 +557,7 @@ ContextMenuHelper::getLabelFromCommandURL( { for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ ) { - if ( aPropSeq[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Label")) ) + if ( aPropSeq[i].Name == "Label" ) { aPropSeq[i].Value >>= aStr; break; diff --git a/svtools/source/uno/popupmenucontrollerbase.cxx b/svtools/source/uno/popupmenucontrollerbase.cxx index d10de663f31d..69e942e65360 100644 --- a/svtools/source/uno/popupmenucontrollerbase.cxx +++ b/svtools/source/uno/popupmenucontrollerbase.cxx @@ -369,9 +369,9 @@ void SAL_CALL PopupMenuControllerBase::initialize( const Sequence< Any >& aArgum { if ( aArguments[i] >>= aPropValue ) { - if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Frame")) ) + if ( aPropValue.Name == "Frame" ) aPropValue.Value >>= xFrame; - else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("CommandURL")) ) + else if ( aPropValue.Name == "CommandURL" ) aPropValue.Value >>= aCommandURL; } } diff --git a/svtools/source/uno/statusbarcontroller.cxx b/svtools/source/uno/statusbarcontroller.cxx index ee6e6455d666..2cb1d9c55a78 100644 --- a/svtools/source/uno/statusbarcontroller.cxx +++ b/svtools/source/uno/statusbarcontroller.cxx @@ -160,15 +160,15 @@ throw ( Exception, RuntimeException ) { if ( aArguments[i] >>= aPropValue ) { - if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Frame")) ) + if ( aPropValue.Name == "Frame" ) aPropValue.Value >>= m_xFrame; - else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("CommandURL")) ) + else if ( aPropValue.Name == "CommandURL" ) aPropValue.Value >>= m_aCommandURL; - else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ServiceManager")) ) + else if ( aPropValue.Name == "ServiceManager" ) aPropValue.Value >>= m_xServiceManager; - else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ParentWindow")) ) + else if ( aPropValue.Name == "ParentWindow" ) aPropValue.Value >>= m_xParentWindow; - else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Identifier")) ) + else if ( aPropValue.Name == "Identifier" ) aPropValue.Value >>= m_nID; } } diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index b46f5eb0509e..ea31875b346d 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -225,13 +225,13 @@ throw ( Exception, RuntimeException ) { if ( aArguments[i] >>= aPropValue ) { - if ( aPropValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Frame") )) + if ( aPropValue.Name == "Frame" ) m_xFrame.set(aPropValue.Value,UNO_QUERY); - else if ( aPropValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("CommandURL") )) + else if ( aPropValue.Name == "CommandURL" ) aPropValue.Value >>= m_aCommandURL; - else if ( aPropValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ServiceManager") )) + else if ( aPropValue.Name == "ServiceManager" ) m_xServiceManager.set(aPropValue.Value,UNO_QUERY); - else if ( aPropValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ParentWindow") )) + else if ( aPropValue.Name == "ParentWindow" ) m_pImpl->m_xParentWindow.set(aPropValue.Value,UNO_QUERY); else if ( aPropValue.Name == "ModuleName" ) aPropValue.Value >>= m_pImpl->m_sModuleName; diff --git a/svtools/source/uno/unogridcolumnfacade.cxx b/svtools/source/uno/unogridcolumnfacade.cxx index 47f0fe198fac..711615053f6f 100644 --- a/svtools/source/uno/unogridcolumnfacade.cxx +++ b/svtools/source/uno/unogridcolumnfacade.cxx @@ -147,7 +147,7 @@ namespace svt { namespace table //------------------------------------------------------------------------------------------------------------------ void SAL_CALL ColumnChangeMultiplexer::columnChanged( const GridColumnEvent& i_event ) throw (RuntimeException) { - if ( i_event.AttributeName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DataColumnIndex")) ) + if ( i_event.AttributeName == "DataColumnIndex" ) { SolarMutexGuard aGuard; if ( m_pColumnImplementation != NULL ) @@ -157,7 +157,7 @@ namespace svt { namespace table ColumnAttributeGroup nChangedAttributes( COL_ATTRS_NONE ); - if ( i_event.AttributeName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HorizontalAlign")) ) + if ( i_event.AttributeName == "HorizontalAlign" ) nChangedAttributes |= COL_ATTRS_APPEARANCE; if ( i_event.AttributeName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ColumnWidth")) -- cgit