summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-19 15:58:58 +0200
committerNoel Grandin <noel@peralex.com>2013-11-20 10:07:31 +0200
commit3af99e4d59d89c343965a928681a30f36b1007d2 (patch)
tree2389765131bdb92817e98bc922ffecbf0184d69b /stoc
parentd665e058246631c8a838c3a731bdd0c56be27903 (diff)
convert equalsAsciiL calls to startsWith calls
Convert code like: aStr.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ActiveConnection" ) ) to aStr.startsWith( "ActiveConnection" ) which compiles down to the same machine code. Change-Id: Id4b0c5e0f9afe716a468d3afc70374699848dc33
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/security/access_controller.cxx2
-rw-r--r--stoc/source/security/permissions.cxx2
-rw-r--r--stoc/test/testiadapter.cxx61
3 files changed, 31 insertions, 34 deletions
diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx
index ce78ed875b90..5f59ed156526 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -295,7 +295,7 @@ void acc_CurrentContext::release()
Any acc_CurrentContext::getValueByName( OUString const & name )
throw (RuntimeException)
{
- if (name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_acRestriction)))
+ if (name.startsWith(s_acRestriction))
{
return m_restriction;
}
diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx
index 4cf385e9361a..34bb834ef339 100644
--- a/stoc/source/security/permissions.cxx
+++ b/stoc/source/security/permissions.cxx
@@ -319,7 +319,7 @@ FilePermission::FilePermission(
: Permission( FILE, next )
, m_actions( makeMask( perm.Actions, s_actions ) )
, m_url( perm.URL )
- , m_allFiles( sal_False != perm.URL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("<<ALL FILES>>")) )
+ , m_allFiles( sal_False != perm.URL.startsWith("<<ALL FILES>>") )
{
if (! m_allFiles)
{
diff --git a/stoc/test/testiadapter.cxx b/stoc/test/testiadapter.cxx
index b9875d850cfe..e13b486f7e12 100644
--- a/stoc/test/testiadapter.cxx
+++ b/stoc/test/testiadapter.cxx
@@ -633,36 +633,36 @@ Any XLB_Invocation::getValue( const OUString & rName )
sal_Bool XLB_Invocation::hasMethod( const OUString & rName )
throw(::com::sun::star::uno::RuntimeException)
{
- return (rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("raiseException") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("getValues") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("setValues2") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("setValues") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("acquire") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("release") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("queryInterface") ));
+ return (rName.startsWith( "raiseException" ) ||
+ rName.startsWith( "getValues" ) ||
+ rName.startsWith( "setValues2" ) ||
+ rName.startsWith( "setValues" ) ||
+ rName.startsWith( "acquire" ) ||
+ rName.startsWith( "release" ) ||
+ rName.startsWith( "queryInterface" ));
}
//__________________________________________________________________________________________________
sal_Bool XLB_Invocation::hasProperty( const OUString & rName )
throw(::com::sun::star::uno::RuntimeException)
{
- return (rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Bool") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Byte") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Char") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Short") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("UShort") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Long") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ULong") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Hyper") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("UHyper") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Float") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Double") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Enum") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("String") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Interface") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Any") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Sequence") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Struct") ) ||
- rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("RuntimeException") ) );
+ return (rName.startsWith( "Bool" ) ||
+ rName.startsWith( "Byte" ) ||
+ rName.startsWith( "Char" ) ||
+ rName.startsWith( "Short" ) ||
+ rName.startsWith( "UShort" ) ||
+ rName.startsWith( "Long" ) ||
+ rName.startsWith( "ULong" ) ||
+ rName.startsWith( "Hyper" ) ||
+ rName.startsWith( "UHyper" ) ||
+ rName.startsWith( "Float" ) ||
+ rName.startsWith( "Double" ) ||
+ rName.startsWith( "Enum" ) ||
+ rName.startsWith( "String" ) ||
+ rName.startsWith( "Interface" ) ||
+ rName.startsWith( "Any" ) ||
+ rName.startsWith( "Sequence" ) ||
+ rName.startsWith( "Struct" ) ||
+ rName.startsWith( "RuntimeException" ) );
}
//##################################################################################################
@@ -895,7 +895,7 @@ sal_Bool raiseException( const Reference<XLanguageBindingTest > & xLBT )
catch (const IllegalArgumentException &aExc)
{
OSL_ENSURE( aExc.ArgumentPosition == 5 &&
- aExc.Message.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dum dum dum ich tanz im kreis herum...")),
+ aExc.Message.startsWith("dum dum dum ich tanz im kreis herum..."),
"### unexpected exception content!" );
Reference<XLanguageBindingTest > xLBT2(
@@ -910,8 +910,7 @@ sal_Bool raiseException( const Reference<XLanguageBindingTest > & xLBT )
}
catch (const RuntimeException & rExc)
{
- OSL_ENSURE(
- rExc.Message.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dum dum dum ich tanz im kreis herum...")),
+ OSL_ENSURE( rExc.Message.startsWith("dum dum dum ich tanz im kreis herum..."),
"### unexpected exception content!" );
Reference<XLanguageBindingTest > xLBT2(
@@ -926,11 +925,9 @@ sal_Bool raiseException( const Reference<XLanguageBindingTest > & xLBT )
}
catch (const Exception & aExc)
{
- OSL_ENSURE(
- aExc.Message.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dum dum dum ich tanz im kreis herum...")),
+ OSL_ENSURE( aExc.Message.startsWith("dum dum dum ich tanz im kreis herum..."),
"### unexpected exception content!" );
- return (
- aExc.Message.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dum dum dum ich tanz im kreis herum...")));
+ return aExc.Message.startsWith("dum dum dum ich tanz im kreis herum...");
}
return sal_False;
}