summaryrefslogtreecommitdiff
path: root/odk
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-05 14:39:55 +0200
committerNoel Grandin <noel@peralex.com>2013-11-11 12:58:13 +0200
commitfcd1637d5101b9142e6808edfb77b01122857901 (patch)
tree5fd09f97de80cf2a9481bd55a798015db35f1d0c /odk
parentef90021abe3735fba57145598fd7c3d359d2718e (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 'odk')
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx16
1 files changed, 8 insertions, 8 deletions
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,