From fcd1637d5101b9142e6808edfb77b01122857901 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 5 Nov 2013 14:39:55 +0200 Subject: 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 --- .../Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'odk') diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx index a9d78f988362..c9bd218046ba 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx +++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx @@ -115,13 +115,13 @@ Reference< XDispatch > SAL_CALL Addon::queryDispatch( const URL& aURL, const ::r throw( RuntimeException ) { Reference < XDispatch > xRet; - if ( aURL.Protocol.compareToAscii("org.openoffice.Office.addon.example:") == 0 ) + if ( aURL.Protocol.equalsAscii("org.openoffice.Office.addon.example:") ) { - if ( aURL.Path.compareToAscii( "Function1" ) == 0 ) + if ( aURL.Path.equalsAscii( "Function1" ) ) xRet = this; - else if ( aURL.Path.compareToAscii( "Function2" ) == 0 ) + else if ( aURL.Path.equalsAscii( "Function2" ) ) xRet = this; - else if ( aURL.Path.compareToAscii( "Help" ) == 0 ) + else if ( aURL.Path.equalsAscii( "Help" ) ) xRet = this; } @@ -134,21 +134,21 @@ Reference< XDispatch > SAL_CALL Addon::queryDispatch( const URL& aURL, const ::r */ void SAL_CALL Addon::dispatch( const URL& aURL, const Sequence < PropertyValue >& lArgs ) throw (RuntimeException) { - if ( aURL.Protocol.compareToAscii("org.openoffice.Office.addon.example:") == 0 ) + if ( aURL.Protocol.equalsAscii("org.openoffice.Office.addon.example:") ) { - if ( aURL.Path.compareToAscii( "Function1" ) == 0 ) + if ( aURL.Path.equalsAscii( "Function1" ) ) { ShowMessageBox( mxToolkit, mxFrame, OUString( "SDK Add-On example" ), OUString( "Function 1 activated" ) ); } - else if ( aURL.Path.compareToAscii( "Function2" ) == 0 ) + else if ( aURL.Path.equalsAscii( "Function2" ) ) { ShowMessageBox( mxToolkit, mxFrame, OUString( "SDK Add-On example" ), OUString( "Function 2 activated" ) ); } - else if ( aURL.Path.compareToAscii( "Help" ) == 0 ) + else if ( aURL.Path.equalsAscii( "Help" ) ) { // Show info box ShowMessageBox( mxToolkit, mxFrame, -- cgit