From 8a01ee624318ac08800af89d988971114637a04e Mon Sep 17 00:00:00 2001 From: Szabolcs Dezsi Date: Fri, 6 Apr 2012 14:28:18 +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 )/' \{\} \; --- sfx2/source/appl/appserv.cxx | 2 +- sfx2/source/dialog/dockwin.cxx | 2 +- sfx2/source/dialog/recfloat.cxx | 2 +- sfx2/source/dialog/templdlg.cxx | 2 +- sfx2/source/doc/docfac.cxx | 2 +- sfx2/source/doc/doctemplates.cxx | 2 +- sfx2/source/doc/graphhelp.cxx | 8 ++++---- sfx2/source/doc/guisaveas.cxx | 16 ++++++++-------- sfx2/source/doc/objstor.cxx | 4 ++-- sfx2/source/toolbox/tbxitem.cxx | 2 +- sfx2/source/view/viewprn.cxx | 2 +- sfx2/source/view/viewsh.cxx | 18 +++++++++--------- sfx2/workben/custompanel/ctp_factory.cxx | 2 +- 13 files changed, 32 insertions(+), 32 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index c83bd0b328d8..d39bc406fb14 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -889,7 +889,7 @@ namespace { Reference < XFrame > xFrame( xContainer->getByIndex(i), UNO_QUERY_THROW ); ::rtl::OUString sModule = xCheck->identify( xFrame ); - if ( sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.frame.StartModule" ) ) ) + if ( sModule == "com.sun.star.frame.StartModule" ) return xFrame; } catch( const UnknownModuleException& ) diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index cfaa5ffd58bf..00da60db9a61 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -116,7 +116,7 @@ static bool lcl_getWindowState( const uno::Reference< container::XNameAccess >& { for ( sal_Int32 n = 0; n < aWindowState.getLength(); n++ ) { - if ( aWindowState[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "UIName" ) )) + if ( aWindowState[n].Name == "UIName" ) { aWindowState[n].Value >>= rWindowState.sTitle; } diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index 285d2b975634..010002b1840b 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -126,7 +126,7 @@ static rtl::OUString GetLabelFromCommandURL( const rtl::OUString& rCommandURL, c { 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 >>= aLabel; break; diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 7f3fa7ebea6c..edee5ab35204 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -2541,7 +2541,7 @@ IMPL_LINK_INLINE_END( SfxTemplateDialog_Impl, ToolBoxLSelect, ToolBox *, pBox ) { 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 >>= sRet; break; diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index b180461c73f6..80a0f4cc8526 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -252,7 +252,7 @@ void SfxObjectFactory::SetSystemTemplate( const String& rServiceName, const Stri uno::Sequence< beans::PropertyValue > aActuralFilterData; xFilterFactory->getByName( aActualFilter ) >>= aActuralFilterData; for ( sal_Int32 nInd = 0; nInd < aActuralFilterData.getLength(); nInd++ ) - if ( aActuralFilterData[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Type" ) ) ) + if ( aActuralFilterData[nInd].Name == "Type" ) aActuralFilterData[nInd].Value >>= aActualFilterTypeName; ::comphelper::SequenceAsHashMap aProps1( xTypeDetection->getByName( aActualFilterTypeName ) ); uno::Sequence< ::rtl::OUString > aAllExt = diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index c5807fd93952..ac66b5d96fd8 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -1902,7 +1902,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, uno::Sequence< beans::PropertyValue > aFilterData; xFilterFactory->getByName( aFilterName ) >>= aFilterData; for ( sal_Int32 nInd = 0; nInd < aFilterData.getLength(); nInd++ ) - if ( aFilterData[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Type" ) ) ) + if ( aFilterData[nInd].Name == "Type" ) aFilterData[nInd].Value >>= aTypeName; if ( aTypeName.isEmpty() ) diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx index 3b1376898c39..8e79f753da79 100644 --- a/sfx2/source/doc/graphhelp.cxx +++ b/sfx2/source/doc/graphhelp.cxx @@ -502,19 +502,19 @@ sal_uInt16 GraphicHelper::getThumbnailReplacementIDByFactoryName_Impl( const ::r { sal_uInt16 nResult = 0; - if ( aFactoryShortName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "scalc" ) ) ) + if ( aFactoryShortName == "scalc" ) { nResult = BMP_128X128_CALC_DOC; } - else if ( aFactoryShortName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdraw" ) ) ) + else if ( aFactoryShortName == "sdraw" ) { nResult = BMP_128X128_DRAW_DOC; } - else if ( aFactoryShortName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "simpress" ) ) ) + else if ( aFactoryShortName == "simpress" ) { nResult = BMP_128X128_IMPRESS_DOC; } - else if ( aFactoryShortName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "smath" ) ) ) + else if ( aFactoryShortName == "smath" ) { nResult = BMP_128X128_MATH_DOC; } diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 2a34c89545c6..8a9fac81949d 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -137,15 +137,15 @@ static sal_uInt16 getSlotIDFromMode( sal_Int8 nStoreMode ) static sal_uInt8 getStoreModeFromSlotName( const ::rtl::OUString& aSlotName ) { sal_uInt8 nResult = 0; - if ( aSlotName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ExportTo" ) ) ) + if ( aSlotName == "ExportTo" ) nResult = EXPORT_REQUESTED; - else if ( aSlotName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ExportToPDF" ) ) ) + else if ( aSlotName == "ExportToPDF" ) nResult = EXPORT_REQUESTED | PDFEXPORT_REQUESTED; - else if ( aSlotName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ExportDirectToPDF" ) ) ) + else if ( aSlotName == "ExportDirectToPDF" ) nResult = EXPORT_REQUESTED | PDFEXPORT_REQUESTED | PDFDIRECTEXPORT_REQUESTED; - else if ( aSlotName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Save" ) ) ) + else if ( aSlotName == "Save" ) nResult = SAVE_REQUESTED; - else if ( aSlotName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "SaveAs" ) ) ) + else if ( aSlotName == "SaveAs" ) nResult = SAVEAS_REQUESTED; else throw task::ErrorCodeIOException( ::rtl::OUString(), @@ -877,11 +877,11 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, pFileDlg = new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aDocServiceName, nDialog, nMust, nDont, rStandardDir, rBlackList ); } - if( aDocServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.DrawingDocument" ) ) ) + if ( aDocServiceName == "com.sun.star.drawing.DrawingDocument" ) eCtxt = sfx2::FileDialogHelper::SD_EXPORT; - else if( aDocServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) ) + else if ( aDocServiceName == "com.sun.star.presentation.PresentationDocument" ) eCtxt = sfx2::FileDialogHelper::SI_EXPORT; - else if( aDocServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.TextDocument" ) ) ) + else if ( aDocServiceName == "com.sun.star.text.TextDocument" ) eCtxt = sfx2::FileDialogHelper::SW_EXPORT; if ( eCtxt != sfx2::FileDialogHelper::UNKNOWN_CONTEXT ) diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index b65c75f27bf3..3276a0800430 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2816,9 +2816,9 @@ sal_Bool SfxObjectShell::IsInformationLost() ::rtl::OUString aPreusedFilterName; for ( sal_Int32 nInd = 0; nInd < aProps.getLength(); nInd++ ) { - if ( aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FilterName" ) ) ) + if ( aProps[nInd].Name == "FilterName" ) aProps[nInd].Value >>= aFilterName; - else if ( aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PreusedFilterName" ) ) ) + else if ( aProps[nInd].Name == "PreusedFilterName" ) aProps[nInd].Value >>= aPreusedFilterName; } diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 0fab12577fd6..1bdeddd138ef 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -1507,7 +1507,7 @@ SfxPopupWindow* SfxAppToolBoxControl_Impl::CreatePopupWindow() if ( !pMenu ) { ::framework::MenuConfiguration aConf( m_xServiceManager ); - if ( m_aCommandURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:AddDirect" ) )) + if ( m_aCommandURL == ".uno:AddDirect" ) pMenu = aConf.CreateBookmarkMenu( m_xFrame, BOOKMARK_NEWMENU ); else pMenu = aConf.CreateBookmarkMenu( m_xFrame, BOOKMARK_WIZARDMENU ); diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 97a5f06b81df..d6497d3dac79 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -152,7 +152,7 @@ SfxPrinterController::SfxPrinterController( const boost::shared_ptr& i_ int nProps = aRenderParms.getLength(); for( int i = 0; i < nProps; i++ ) { - if( aRenderParms[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ExtraPrintUIOptions" ) ) ) + if ( aRenderParms[i].Name == "ExtraPrintUIOptions" ) { Sequence< beans::PropertyValue > aUIProps; aRenderParms[i].Value >>= aUIProps; diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index dc7cdf636cca..b9615924160d 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -273,7 +273,7 @@ static ::rtl::OUString RetrieveLabelFromCommand( { 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; @@ -383,32 +383,32 @@ enum ETypeFamily { case E_MS_DOC: { - if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.TextDocument" ) )) + if ( sModule == "com.sun.star.text.TextDocument" ) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "writer_MS_Word_97" )); else - if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.sheet.SpreadsheetDocument" ) )) + if ( sModule == "com.sun.star.sheet.SpreadsheetDocument" ) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "calc_MS_Excel_97" )); else - if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.DrawingDocument" ) )) + if ( sModule == "com.sun.star.drawing.DrawingDocument" ) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "impress_MS_PowerPoint_97" )); else - if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) )) + if ( sModule == "com.sun.star.presentation.PresentationDocument" ) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "impress_MS_PowerPoint_97" )); } break; case E_OOO_DOC: { - if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.TextDocument" ) )) + if ( sModule == "com.sun.star.text.TextDocument" ) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "writer8" )); else - if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.sheet.SpreadsheetDocument" ) )) + if ( sModule == "com.sun.star.sheet.SpreadsheetDocument" ) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "calc8" )); else - if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.DrawingDocument" ) )) + if ( sModule == "com.sun.star.drawing.DrawingDocument" ) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "draw8" )); else - if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) )) + if ( sModule == "com.sun.star.presentation.PresentationDocument" ) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "impress8" )); } break; diff --git a/sfx2/workben/custompanel/ctp_factory.cxx b/sfx2/workben/custompanel/ctp_factory.cxx index 192f89bb1b64..35f08ca5693c 100644 --- a/sfx2/workben/custompanel/ctp_factory.cxx +++ b/sfx2/workben/custompanel/ctp_factory.cxx @@ -94,7 +94,7 @@ namespace sd { namespace colortoolpanel const PropertyValue* pArgEnd = i_rArgs.getConstArray() + i_rArgs.getLength(); for ( ; pArg != pArgEnd; ++pArg ) { - if ( pArg->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ParentWindow" ) ) ) + if ( pArg->Name == "ParentWindow" ) { xParentWindow.set( pArg->Value, UNO_QUERY ); break; -- cgit