diff options
author | Noel Grandin <noel@peralex.com> | 2013-11-05 14:39:55 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-11 12:58:13 +0200 |
commit | fcd1637d5101b9142e6808edfb77b01122857901 (patch) | |
tree | 5fd09f97de80cf2a9481bd55a798015db35f1d0c /sfx2 | |
parent | ef90021abe3735fba57145598fd7c3d359d2718e (diff) |
convert OUString compareToAscii == 0 to equalsAscii
Convert code like
aStr.compareToAscii("XXX") == 0
to
aStr.equalsAscii("XXX")
which is both easier to read and faster.
Change-Id: I448abf58f2fa0e7715dba53f8e8825ca0587c83f
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/unoctitm.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/printhelper.cxx | 26 |
3 files changed, 17 insertions, 17 deletions
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 2576b14f8cfd..496e6b961d56 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -283,7 +283,7 @@ SfxStatusDispatcher::SfxStatusDispatcher() void SAL_CALL SfxStatusDispatcher::addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL) throw ( ::com::sun::star::uno::RuntimeException ) { aListeners.addInterface( aURL.Complete, aListener ); - if ( aURL.Complete.compareToAscii(".uno:LifeTime")==0 ) + if ( aURL.Complete.equalsAscii(".uno:LifeTime") ) { ::com::sun::star::frame::FeatureStateEvent aEvent; aEvent.FeatureURL = aURL; diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 654a7e3e8f17..0d8e17e34d53 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -2450,9 +2450,9 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList, if ( rUITitle.isEmpty() ) { // reserved FS names that should not be used - if ( rTitle.compareToAscii( "wizard" ) == 0 ) + if ( rTitle.equalsAscii( "wizard" ) ) return; - else if ( rTitle.compareToAscii( "internal" ) == 0 ) + else if ( rTitle.equalsAscii( "internal" ) ) return; aTitle = getLongName( rTitle ); @@ -2515,7 +2515,7 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList, OUString aType; OUString aHierURL; - if ( aChildTitle.compareToAscii( "sfx.tlx" ) == 0 || aChildTitle == "groupuinames.xml" ) + if ( aChildTitle.equalsAscii( "sfx.tlx" ) || aChildTitle == "groupuinames.xml" ) continue; sal_Bool bDocHasTitle = sal_False; diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 7be793d69802..40663d663fcb 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -334,7 +334,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > const beans::PropertyValue &rProp = rPrinter.getConstArray()[n]; // Name-Property? - if ( rProp.Name.compareToAscii( "Name" ) == 0 ) + if ( rProp.Name.equalsAscii( "Name" ) ) { OUString aPrinterName; if ( ! ( rProp.Value >>= aPrinterName ) ) @@ -359,7 +359,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > const beans::PropertyValue &rProp = rPrinter.getConstArray()[i]; // PaperOrientation-Property? - if ( rProp.Name.compareToAscii( "PaperOrientation" ) == 0 ) + if ( rProp.Name.equalsAscii( "PaperOrientation" ) ) { view::PaperOrientation eOrient; if ( ( rProp.Value >>= eOrient ) == sal_False ) @@ -377,7 +377,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > } // PaperFormat-Property? - else if ( rProp.Name.compareToAscii( "PaperFormat" ) == 0 ) + else if ( rProp.Name.equalsAscii( "PaperFormat" ) ) { if ( ( rProp.Value >>= nPaperFormat ) == sal_False ) { @@ -394,7 +394,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > } // PaperSize-Property? - else if ( rProp.Name.compareToAscii( "PaperSize" ) == 0 ) + else if ( rProp.Name.equalsAscii( "PaperSize" ) ) { awt::Size aTempSize ; if ( ( rProp.Value >>= aTempSize ) == sal_False ) @@ -408,7 +408,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > } // PrinterTray-Property - else if ( rProp.Name.compareToAscii( "PrinterPaperTray" ) == 0 ) + else if ( rProp.Name.equalsAscii( "PrinterPaperTray" ) ) { OUString aTmp; if ( ( rProp.Value >>= aTmp ) == sal_False ) @@ -617,7 +617,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& const beans::PropertyValue &rProp = rOptions.getConstArray()[n]; // FileName-Property? - if ( rProp.Name.compareToAscii( "FileName" ) == 0 ) + if ( rProp.Name.equalsAscii( "FileName" ) ) { // unpack th URL and check for a valid and well known protocol OUString sTemp; @@ -692,7 +692,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& } // CopyCount-Property - else if ( rProp.Name.compareToAscii( "CopyCount" ) == 0 ) + else if ( rProp.Name.equalsAscii( "CopyCount" ) ) { sal_Int32 nCopies = 0; if ( ( rProp.Value >>= nCopies ) == sal_False ) @@ -704,8 +704,8 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& // Collate-Property // Sort-Property (deprecated) - else if ( rProp.Name.compareToAscii( "Collate" ) == 0 || - ( rProp.Name.compareToAscii( "Sort" ) == 0 ) ) + else if ( rProp.Name.equalsAscii( "Collate" ) || + rProp.Name.equalsAscii( "Sort" ) ) { sal_Bool bTemp = sal_Bool(); if ( rProp.Value >>= bTemp ) @@ -718,7 +718,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& } // Pages-Property - else if ( rProp.Name.compareToAscii( "Pages" ) == 0 ) + else if ( rProp.Name.equalsAscii( "Pages" ) ) { OUString sTemp; if( rProp.Value >>= sTemp ) @@ -731,7 +731,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& } // MonitorVisible - else if ( rProp.Name.compareToAscii( "MonitorVisible" ) == 0 ) + else if ( rProp.Name.equalsAscii( "MonitorVisible" ) ) { if( !(rProp.Value >>= bMonitor) ) throw ::com::sun::star::lang::IllegalArgumentException(); @@ -740,7 +740,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& } // Wait - else if ( rProp.Name.compareToAscii( "Wait" ) == 0 ) + else if ( rProp.Name.equalsAscii( "Wait" ) ) { if ( !(rProp.Value >>= bWaitUntilEnd) ) throw ::com::sun::star::lang::IllegalArgumentException(); @@ -748,7 +748,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& aCheckedArgs[nProps++].Value <<= bWaitUntilEnd; } - else if ( rProp.Name.compareToAscii( "DuplexMode" ) == 0 ) + else if ( rProp.Name.equalsAscii( "DuplexMode" ) ) { if ( !(rProp.Value >>= nDuplexMode ) ) throw ::com::sun::star::lang::IllegalArgumentException(); |