diff options
author | Szabolcs Dezsi <dezsiszabi@hotmail.com> | 2012-04-06 19:49:53 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-04-06 20:03:42 +0200 |
commit | d6bc02f8c4cd0f50f0a2631ac7634dab408efc1f (patch) | |
tree | b5a12df1fcae025715633469b75ab4c9b6f6d279 /stoc/source | |
parent | I suspect the logic is supposed to be the other way around. (diff) | |
download | core-d6bc02f8c4cd0f50f0a2631ac7634dab408efc1f.tar.gz core-d6bc02f8c4cd0f50f0a2631ac7634dab408efc1f.zip |
Replaced equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(...)) with == operator
Diffstat (limited to 'stoc/source')
-rw-r--r-- | stoc/source/inspect/introspection.cxx | 4 | ||||
-rw-r--r-- | stoc/source/invocation_adapterfactory/iafactory.cxx | 4 | ||||
-rw-r--r-- | stoc/source/javavm/javavm.cxx | 25 | ||||
-rw-r--r-- | stoc/source/registry_tdprovider/tdservice.cxx | 3 | ||||
-rw-r--r-- | stoc/source/security/access_controller.cxx | 3 | ||||
-rw-r--r-- | stoc/source/security/file_policy.cxx | 18 | ||||
-rw-r--r-- | stoc/source/typeconv/convert.cxx | 6 |
7 files changed, 24 insertions, 39 deletions
diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index 48fa447bdef7..fe987071202e 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -2356,7 +2356,7 @@ rtl::Reference< IntrospectionAccessStatic_Impl > ImplIntrospection::implInspect( } else { - if( !aMethName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("queryInterface")) ) + if( aMethName != "queryInterface" ) { rMethodConcept_i |= MethodConcept::DANGEROUS; continue; @@ -2471,7 +2471,7 @@ rtl::Reference< IntrospectionAccessStatic_Impl > ImplIntrospection::implInspect( OUString aMethName2 = rxMethod_k->getName(); OUString aStartStr2 = aMethName2.copy( 0, 3 ); // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! - if( !( aStartStr2.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("set")) ) ) + if( aStartStr2 != "set" ) continue; // Ist es denn der gleiche Name? diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx index d49a8e7e90ea..337bdb1023c9 100644 --- a/stoc/source/invocation_adapterfactory/iafactory.cxx +++ b/stoc/source/invocation_adapterfactory/iafactory.cxx @@ -352,9 +352,7 @@ static void handleInvokExc( uno_Any * pDest, uno_Any * pSource ) OUString const & name = *reinterpret_cast< OUString const * >( &pSource->pType->pTypeName ); - if (name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( - "com.sun.star.reflection.InvocationTargetException") )) + if ( name == "com.sun.star.reflection.InvocationTargetException" ) { // unwrap invocation target exception uno_Any * target_exc = diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index c73d2fae4cd4..a1242463a8b8 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -643,9 +643,7 @@ JavaVirtualMachine::initialize(css::uno::Sequence< css::uno::Any > const & "bad call to initialize")), static_cast< cppu::OWeakObject * >(this)); css::beans::NamedValue val; - if (rArguments.getLength() == 1 && (rArguments[0] >>= val) - && val.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "UnoVirtualMachine"))) + if (rArguments.getLength() == 1 && (rArguments[0] >>= val) && val.Name == "UnoVirtualMachine" ) { OSL_ENSURE( sizeof (sal_Int64) >= sizeof (jvmaccess::UnoVirtualMachine *), @@ -1136,15 +1134,13 @@ void SAL_CALL JavaVirtualMachine::elementReplaced( setINetSettingsInVM(value != 0); return; } - else if (aAccessor.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( - "ooInetHTTPProxyName"))) + else if ( aAccessor == "ooInetHTTPProxyName" ) { aPropertyName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "http.proxyHost")); rEvent.Element >>= aPropertyValue; } - else if (aAccessor.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( - "ooInetHTTPProxyPort"))) + else if ( aAccessor == "ooInetHTTPProxyPort" ) { aPropertyName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("http.proxyPort")); @@ -1152,15 +1148,13 @@ void SAL_CALL JavaVirtualMachine::elementReplaced( rEvent.Element >>= n; aPropertyValue = rtl::OUString::valueOf(n); } - else if (aAccessor.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( - "ooInetHTTPSProxyName"))) + else if ( aAccessor == "ooInetHTTPSProxyName" ) { aPropertyName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "https.proxyHost")); rEvent.Element >>= aPropertyValue; } - else if (aAccessor.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( - "ooInetHTTPSProxyPort"))) + else if ( aAccessor == "ooInetHTTPSProxyPort" ) { aPropertyName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("https.proxyPort")); @@ -1168,15 +1162,13 @@ void SAL_CALL JavaVirtualMachine::elementReplaced( rEvent.Element >>= n; aPropertyValue = rtl::OUString::valueOf(n); } - else if (aAccessor.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( - "ooInetFTPProxyName"))) + else if ( aAccessor == "ooInetFTPProxyName" ) { aPropertyName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ftp.proxyHost")); rEvent.Element >>= aPropertyValue; } - else if (aAccessor.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( - "ooInetFTPProxyPort"))) + else if ( aAccessor == "ooInetFTPProxyPort" ) { aPropertyName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ftp.proxyPort")); @@ -1184,8 +1176,7 @@ void SAL_CALL JavaVirtualMachine::elementReplaced( rEvent.Element >>= n; aPropertyValue = rtl::OUString::valueOf(n); } - else if (aAccessor.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( - "ooInetNoProxy"))) + else if ( aAccessor == "ooInetNoProxy" ) { aPropertyName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "http.nonProxyHosts")); diff --git a/stoc/source/registry_tdprovider/tdservice.cxx b/stoc/source/registry_tdprovider/tdservice.cxx index ed2a254de75f..5b39d9ffe00a 100644 --- a/stoc/source/registry_tdprovider/tdservice.cxx +++ b/stoc/source/registry_tdprovider/tdservice.cxx @@ -349,8 +349,7 @@ ServiceTypeDescriptionImpl::getConstructors() throw (RuntimeException) { for (sal_uInt16 i = 0; i < ctorCount; ++i) { rtl::OUString name(reader.getMethodName(i)); if (reader.getMethodFlags(i) != RT_MODE_TWOWAY - || (!reader.getMethodReturnTypeName(i).equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("void"))) + || (reader.getMethodReturnTypeName(i) != "void") || (name.isEmpty() && (ctorCount != 1 || reader.getMethodParameterCount(i) != 0 || reader.getMethodExceptionCount(i) != 0))) diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx index 00dc8edde9af..15e58ab8475f 100644 --- a/stoc/source/security/access_controller.cxx +++ b/stoc/source/security/access_controller.cxx @@ -364,8 +364,7 @@ static inline Reference< security::XAccessControlContext > getDynamicRestriction // avoid ref-counting OUString const & typeName = *reinterpret_cast< OUString const * >( &acc.pType->pTypeName ); - if (typeName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("com.sun.star.security.XAccessControlContext") )) + if ( typeName == "com.sun.star.security.XAccessControlContext" ) { return Reference< security::XAccessControlContext >( *reinterpret_cast< security::XAccessControlContext ** const >( acc.pData ) ); diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx index 1a48ce1d921c..ce4e3ac58e0a 100644 --- a/stoc/source/security/file_policy.cxx +++ b/stoc/source/security/file_policy.cxx @@ -467,46 +467,46 @@ void FilePolicy::refresh() OUString token( reader.getToken() ); while (!token.isEmpty()) { - if (!token.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_grant))) + if ( token != s_grant ) reader.error( OUSTR("expected >grant< token!") ); OUString userId; token = reader.assureToken(); - if (token.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_user))) // next token is user-id + if ( token == s_user ) // next token is user-id { userId = reader.assureQuotedToken(); token = reader.assureToken(); } - if (!token.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_openBrace))) + if ( token != s_openBrace ) reader.error( OUSTR("expected opening brace >{<!") ); token = reader.assureToken(); // permissions list - while (!token.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_closingBrace))) + while ( token != s_closingBrace ) { - if (!token.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_permission))) + if ( token != s_permission ) reader.error( OUSTR("expected >permission< or closing brace >}<!") ); token = reader.assureToken(); // permission type Any perm; - if (token.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_filePermission))) // FilePermission + if ( token == s_filePermission ) // FilePermission { OUString url( reader.assureQuotedToken() ); reader.assureToken( ',' ); OUString actions( reader.assureQuotedToken() ); perm <<= io::FilePermission( url, actions ); } - else if (token.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_socketPermission))) // SocketPermission + else if ( token == s_socketPermission ) // SocketPermission { OUString host( reader.assureQuotedToken() ); reader.assureToken( ',' ); OUString actions( reader.assureQuotedToken() ); perm <<= connection::SocketPermission( host, actions ); } - else if (token.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_runtimePermission))) // RuntimePermission + else if ( token == s_runtimePermission ) // RuntimePermission { OUString name( reader.assureQuotedToken() ); perm <<= security::RuntimePermission( name ); } - else if (token.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_allPermission))) // AllPermission + else if ( token == s_allPermission ) // AllPermission { perm <<= security::AllPermission(); } diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx index d98cf3e33150..6f8c0887774f 100644 --- a/stoc/source/typeconv/convert.cxx +++ b/stoc/source/typeconv/convert.cxx @@ -775,14 +775,12 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina case TypeClass_STRING: { const OUString & aStr = *(const OUString *)rVal.getValue(); - if (aStr.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("0") ) || - aStr.equalsIgnoreAsciiCase( OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) )) + if ( aStr == "0" || aStr.equalsIgnoreAsciiCase( OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) )) { sal_Bool bFalse = sal_False; aRet.setValue( &bFalse, getCppuBooleanType() ); } - else if (aStr.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("1") ) || - aStr.equalsIgnoreAsciiCase( OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) )) + else if ( aStr == "1" || aStr.equalsIgnoreAsciiCase( OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) )) { sal_Bool bTrue = sal_True; aRet.setValue( &bTrue, getCppuBooleanType() ); |