summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-01-21 15:53:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-01-21 16:01:07 +0000
commit523ad9696c9135a29393a0c4d147ab206b6de4f5 (patch)
treefe30ff35cc11890a2345d75495c455f792a4bf56 /stoc
parent7713dfc9b50b88cf2548d49e65b099a6a81e9d65 (diff)
Fix bogus mass-conversion equalsAsciiL -> startsWith
3af99e4d59d89c343965a928681a30f36b1007d2 "convert equalsAsciiL calls to startsWith calls" should rather have converted to oprator ==. (cherry picked from commit a3f32769fc4bb23c64168b412dd10ec769a3854d) Conflicts: sc/source/ui/unoobj/nameuno.cxx sc/source/ui/unoobj/styleuno.cxx sfx2/source/appl/sfxhelp.cxx stoc/source/security/permissions.cxx sw/source/core/unocore/unocrsrhelper.cxx (None of those bogus startsWith calls seem problematic enough to warrant backporting also to libreoffice-4-2-0.) Change-Id: Id4a8836c5d6d570e54661c40be7214632e202b21 Reviewed-on: https://gerrit.libreoffice.org/7578 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
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.cxx58
3 files changed, 31 insertions, 31 deletions
diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx
index ee218a8e5eb8..f4b8b9567ae0 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.startsWith(s_acRestriction))
+ if (name == s_acRestriction)
{
return m_restriction;
}
diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx
index 448db7ea9f75..16420038e5e1 100644
--- a/stoc/source/security/permissions.cxx
+++ b/stoc/source/security/permissions.cxx
@@ -318,7 +318,7 @@ FilePermission::FilePermission(
: Permission( FILE, next )
, m_actions( makeMask( perm.Actions, s_actions ) )
, m_url( perm.URL )
- , m_allFiles( sal_False != perm.URL.startsWith("<<ALL FILES>>") )
+ , m_allFiles( perm.URL == "<<ALL FILES>>" )
{
if (! m_allFiles)
{
diff --git a/stoc/test/testiadapter.cxx b/stoc/test/testiadapter.cxx
index e13b486f7e12..1f850cb3917c 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.startsWith( "raiseException" ) ||
- rName.startsWith( "getValues" ) ||
- rName.startsWith( "setValues2" ) ||
- rName.startsWith( "setValues" ) ||
- rName.startsWith( "acquire" ) ||
- rName.startsWith( "release" ) ||
- rName.startsWith( "queryInterface" ));
+ return (rName == "raiseException" ||
+ rName == "getValues" ||
+ rName == "setValues2" ||
+ rName == "setValues" ||
+ rName == "acquire" ||
+ rName == "release" ||
+ rName == "queryInterface" );
}
//__________________________________________________________________________________________________
sal_Bool XLB_Invocation::hasProperty( const OUString & rName )
throw(::com::sun::star::uno::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" ) );
+ return (rName == "Bool" ||
+ rName == "Byte" ||
+ rName == "Char" ||
+ rName == "Short" ||
+ rName == "UShort" ||
+ rName == "Long" ||
+ rName == "ULong" ||
+ rName == "Hyper" ||
+ rName == "UHyper" ||
+ rName == "Float" ||
+ rName == "Double" ||
+ rName == "Enum" ||
+ rName == "String" ||
+ rName == "Interface" ||
+ rName == "Any" ||
+ rName == "Sequence" ||
+ rName == "Struct" ||
+ rName == "RuntimeException" );
}
//##################################################################################################
@@ -895,7 +895,7 @@ sal_Bool raiseException( const Reference<XLanguageBindingTest > & xLBT )
catch (const IllegalArgumentException &aExc)
{
OSL_ENSURE( aExc.ArgumentPosition == 5 &&
- aExc.Message.startsWith("dum dum dum ich tanz im kreis herum..."),
+ aExc.Message == "dum dum dum ich tanz im kreis herum...",
"### unexpected exception content!" );
Reference<XLanguageBindingTest > xLBT2(
@@ -910,7 +910,7 @@ sal_Bool raiseException( const Reference<XLanguageBindingTest > & xLBT )
}
catch (const RuntimeException & rExc)
{
- OSL_ENSURE( rExc.Message.startsWith("dum dum dum ich tanz im kreis herum..."),
+ OSL_ENSURE( rExc.Message == "dum dum dum ich tanz im kreis herum...",
"### unexpected exception content!" );
Reference<XLanguageBindingTest > xLBT2(
@@ -925,9 +925,9 @@ sal_Bool raiseException( const Reference<XLanguageBindingTest > & xLBT )
}
catch (const Exception & aExc)
{
- OSL_ENSURE( aExc.Message.startsWith("dum dum dum ich tanz im kreis herum..."),
+ OSL_ENSURE( aExc.Message == "dum dum dum ich tanz im kreis herum...",
"### unexpected exception content!" );
- return aExc.Message.startsWith("dum dum dum ich tanz im kreis herum...");
+ return aExc.Message == "dum dum dum ich tanz im kreis herum...";
}
return sal_False;
}