diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-03-19 09:22:44 +0100 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2013-03-19 09:00:26 +0000 |
commit | 8b27d78b4afaa9c47ca0fda144c8060f2f14046b (patch) | |
tree | 2dbddceebf0f96492adc5652697e8efce8a8ba06 /cppuhelper/source | |
parent | WaE: Potentially uninitialized local variable (diff) | |
download | core-8b27d78b4afaa9c47ca0fda144c8060f2f14046b.tar.gz core-8b27d78b4afaa9c47ca0fda144c8060f2f14046b.zip |
automated removal of RTL_CONSTASCII_USTRINGPARAM for quoted OUStrings
Done with a perl regex:
s/OUString\s*\(\s*RTL_CONSTASCII_USTRINGPARAM\s*\((\s*"[^")]*?"\s*)\)\s*\)/OUString\($1\)/gms
Change-Id: Idf28320817cdcbea6d0f7ec06a9bf51bd2c3b3ec
Reviewed-on: https://gerrit.libreoffice.org/2832
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
Diffstat (limited to 'cppuhelper/source')
-rw-r--r-- | cppuhelper/source/component.cxx | 4 | ||||
-rw-r--r-- | cppuhelper/source/factory.cxx | 16 | ||||
-rw-r--r-- | cppuhelper/source/implbase.cxx | 8 | ||||
-rw-r--r-- | cppuhelper/source/propertysetmixin.cxx | 66 | ||||
-rw-r--r-- | cppuhelper/source/shlib.cxx | 2 | ||||
-rw-r--r-- | cppuhelper/source/unourl.cxx | 35 |
6 files changed, 56 insertions, 75 deletions
diff --git a/cppuhelper/source/component.cxx b/cppuhelper/source/component.cxx index 4ae70ad679ab..c178e986fcc7 100644 --- a/cppuhelper/source/component.cxx +++ b/cppuhelper/source/component.cxx @@ -197,8 +197,8 @@ void OComponentHelper::dispose() catch (Exception & exc) { throw RuntimeException( - OUString( RTL_CONSTASCII_USTRINGPARAM( - "unexpected UNO exception caught: ") ) + + OUString( + "unexpected UNO exception caught: ") + exc.Message, Reference< XInterface >() ); } } diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx index ba2aeaf2233d..dc5cf91a0fee 100644 --- a/cppuhelper/source/factory.cxx +++ b/cppuhelper/source/factory.cxx @@ -228,7 +228,7 @@ Reference< XInterface > OSingleFactoryHelper::createInstanceWithArgumentsAndCont xComp->dispose(); throw lang::IllegalArgumentException( - OUString( RTL_CONSTASCII_USTRINGPARAM("cannot pass arguments to component => no XInitialization implemented!") ), + OUString("cannot pass arguments to component => no XInitialization implemented!"), Reference< XInterface >(), 0 ); } } @@ -818,7 +818,7 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory() OUString aLocation; Reference<XRegistryKey > xActivatorKey = xImplementationKey->openKey( - OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/ACTIVATOR") ) ); + OUString("/UNO/ACTIVATOR") ); if( xActivatorKey.is() && xActivatorKey->getValueType() == RegistryValueType_ASCII ) { aActivatorUrl = xActivatorKey->getAsciiValue(); @@ -828,7 +828,7 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory() aActivatorName = tmpActivator.getToken(0, ':', nIndex ); Reference<XRegistryKey > xLocationKey = xImplementationKey->openKey( - OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/LOCATION") ) ); + OUString("/UNO/LOCATION") ); if( xLocationKey.is() && xLocationKey->getValueType() == RegistryValueType_ASCII ) aLocation = xLocationKey->getAsciiValue(); } @@ -837,7 +837,7 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory() // old style"url" // the location of the program code of the implementation Reference<XRegistryKey > xLocationKey = xImplementationKey->openKey( - OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/URL") ) ); + OUString("/UNO/URL") ); // is the key of the right type ? if( xLocationKey.is() && xLocationKey->getValueType() == RegistryValueType_ASCII ) { @@ -846,14 +846,14 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory() // search protocol delimiter sal_Int32 nPos = aLocation.indexOf( - OUString( RTL_CONSTASCII_USTRINGPARAM("://") ) ); + OUString("://") ); if( nPos != -1 ) { aActivatorName = aLocation.copy( 0, nPos ); if( aActivatorName.compareToAscii( "java" ) == 0 ) - aActivatorName = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.Java") ); + aActivatorName = OUString("com.sun.star.loader.Java"); else if( aActivatorName.compareToAscii( "module" ) == 0 ) - aActivatorName = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary") ); + aActivatorName = OUString("com.sun.star.loader.SharedLibrary"); aLocation = aLocation.copy( nPos + 3 ); } } @@ -884,7 +884,7 @@ Sequence< OUString > ORegistryFactoryHelper::getSupportedServiceNames(void) try { Reference<XRegistryKey > xKey = xImplementationKey->openKey( - OUString( RTL_CONSTASCII_USTRINGPARAM("UNO/SERVICES") ) ); + OUString("UNO/SERVICES") ); if (xKey.is()) { diff --git a/cppuhelper/source/implbase.cxx b/cppuhelper/source/implbase.cxx index f983e881e911..4816c4a63832 100644 --- a/cppuhelper/source/implbase.cxx +++ b/cppuhelper/source/implbase.cxx @@ -287,8 +287,8 @@ void WeakComponentImplHelperBase::dispose() catch (Exception & exc) { throw RuntimeException( - OUString( RTL_CONSTASCII_USTRINGPARAM( - "unexpected UNO exception caught: ") ) + + OUString( + "unexpected UNO exception caught: ") + exc.Message, Reference< XInterface >() ); } } @@ -423,8 +423,8 @@ void WeakAggComponentImplHelperBase::dispose() catch (Exception & exc) { throw RuntimeException( - OUString( RTL_CONSTASCII_USTRINGPARAM( - "unexpected UNO exception caught: ") ) + + OUString( + "unexpected UNO exception caught: ") + exc.Message, Reference< XInterface >() ); } } diff --git a/cppuhelper/source/propertysetmixin.cxx b/cppuhelper/source/propertysetmixin.cxx index d45409d4d021..12a3752a44e4 100644 --- a/cppuhelper/source/propertysetmixin.cxx +++ b/cppuhelper/source/propertysetmixin.cxx @@ -266,8 +266,7 @@ void Data::initProperties( if (args.getLength() != 1) { throw css::uno::RuntimeException( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "inconsistent UNO type registry")), + "inconsistent UNO type registry"), css::uno::Reference< css::uno::XInterface >()); } t = args[0]; @@ -277,8 +276,7 @@ void Data::initProperties( if (handles > SAL_MAX_INT32) { throw css::uno::RuntimeException( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "interface type has too many attributes")), + "interface type has too many attributes"), css::uno::Reference< css::uno::XInterface >()); } rtl::OUString name(members[i]->getMemberName()); @@ -297,8 +295,7 @@ void Data::initProperties( { throw css::uno::RuntimeException( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "inconsistent UNO type registry")), + "inconsistent UNO type registry"), css::uno::Reference< css::uno::XInterface >()); } handleNames->push_back(name); @@ -517,7 +514,7 @@ rtl::OUString PropertySetMixinImpl::Impl::translateHandle( { if (handle < 0 || handle >= handleMap.getLength()) { throw css::beans::UnknownPropertyException( - (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad handle ")) + (rtl::OUString("bad handle ") + rtl::OUString::valueOf(handle)), object); } @@ -589,8 +586,7 @@ void PropertySetMixinImpl::Impl::setProperty( //TODO Clarify whether PropertyVetoException is the correct exception // to throw when trying to set a read-only property: throw css::beans::PropertyVetoException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("cannot set read-only property ")) + (rtl::OUString("cannot set read-only property ") + name), object); } catch (css::lang::WrappedTargetRuntimeException & e) { @@ -643,8 +639,7 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty( } catch (css::lang::IllegalArgumentException & e) { throw css::uno::RuntimeException( (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "unexpected com.sun.star.lang.IllegalArgumentException: ")) + "unexpected com.sun.star.lang.IllegalArgumentException: ") + e.Message), object); } catch (css::lang::WrappedTargetRuntimeException & e) { @@ -689,8 +684,7 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty( try { if (!(css::uno::Reference< css::reflection::XIdlField2 >( ambiguous->getField( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("IsAmbiguous"))), + rtl::OUString("IsAmbiguous")), css::uno::UNO_QUERY_THROW)->get(value) >>= isAmbiguous)) { @@ -704,7 +698,7 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty( } value = css::uno::Reference< css::reflection::XIdlField2 >( ambiguous->getField( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value"))), + rtl::OUString("Value")), css::uno::UNO_QUERY_THROW)->get(value); } catch (css::lang::IllegalArgumentException & e) { throw css::uno::RuntimeException( @@ -727,8 +721,7 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty( if (!(css::uno::Reference< css::reflection::XIdlField2 >( defaulted->getField( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("IsDefaulted"))), + rtl::OUString("IsDefaulted")), css::uno::UNO_QUERY_THROW)->get(value) >>= isDefaulted)) { @@ -742,7 +735,7 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty( } value = css::uno::Reference< css::reflection::XIdlField2 >( defaulted->getField( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value"))), + rtl::OUString("Value")), css::uno::UNO_QUERY_THROW)->get(value); } catch (css::lang::IllegalArgumentException & e) { throw css::uno::RuntimeException( @@ -765,8 +758,7 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty( bool present = false; if (!(css::uno::Reference< css::reflection::XIdlField2 >( optional->getField( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("IsPresent"))), + rtl::OUString("IsPresent")), css::uno::UNO_QUERY_THROW)->get(value) >>= present)) { @@ -783,7 +775,7 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty( } value = css::uno::Reference< css::reflection::XIdlField2 >( optional->getField( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value"))), + rtl::OUString("Value")), css::uno::UNO_QUERY_THROW)->get(value); } catch (css::lang::IllegalArgumentException & e) { throw css::uno::RuntimeException( @@ -798,8 +790,7 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty( } else { throw css::uno::RuntimeException( (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "unexpected type of attribute ")) + "unexpected type of attribute ") + name), object); } @@ -826,8 +817,7 @@ PropertySetMixinImpl::Impl::getReflection(rtl::OUString const & typeName) const refl.ifc = css::uno::Reference< css::reflection::XIdlReflection >( factory->createInstanceWithContext( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.reflection.CoreReflection")), + "com.sun.star.reflection.CoreReflection"), m_context), css::uno::UNO_QUERY_THROW); } catch (css::uno::RuntimeException &) { @@ -865,8 +855,7 @@ css::uno::Any PropertySetMixinImpl::Impl::wrapValue( try { css::uno::Reference< css::reflection::XIdlField2 > field( type->getField( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("Value"))), + rtl::OUString("Value")), css::uno::UNO_QUERY_THROW); field->set( strct, @@ -875,8 +864,7 @@ css::uno::Any PropertySetMixinImpl::Impl::wrapValue( wrapDefaulted, isDefaulted, wrapOptional)); css::uno::Reference< css::reflection::XIdlField2 >( type->getField( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("IsAmbiguous"))), + rtl::OUString("IsAmbiguous")), css::uno::UNO_QUERY_THROW)->set( strct, css::uno::makeAny(isAmbiguous)); } catch (css::lang::IllegalArgumentException & e) { @@ -906,8 +894,7 @@ css::uno::Any PropertySetMixinImpl::Impl::wrapValue( try { css::uno::Reference< css::reflection::XIdlField2 > field( type->getField( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("Value"))), + rtl::OUString("Value")), css::uno::UNO_QUERY_THROW); field->set( strct, @@ -916,8 +903,7 @@ css::uno::Any PropertySetMixinImpl::Impl::wrapValue( false, false, wrapOptional)); css::uno::Reference< css::reflection::XIdlField2 >( type->getField( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("IsDefaulted"))), + rtl::OUString("IsDefaulted")), css::uno::UNO_QUERY_THROW)->set( strct, css::uno::makeAny(isDefaulted)); } catch (css::lang::IllegalArgumentException & e) { @@ -948,15 +934,13 @@ css::uno::Any PropertySetMixinImpl::Impl::wrapValue( try { css::uno::Reference< css::reflection::XIdlField2 >( type->getField( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("IsPresent"))), + rtl::OUString("IsPresent")), css::uno::UNO_QUERY_THROW)->set( strct, css::uno::makeAny(present)); if (present) { css::uno::Reference< css::reflection::XIdlField2 > field( type->getField( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("Value"))), + rtl::OUString("Value")), css::uno::UNO_QUERY_THROW); field->set( strct, @@ -986,8 +970,7 @@ css::uno::Any PropertySetMixinImpl::Impl::wrapValue( if (wrapAmbiguous || wrapDefaulted || wrapOptional) { throw css::uno::RuntimeException( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "unexpected type of attribute")), + "unexpected type of attribute"), object); } return value; @@ -1027,7 +1010,7 @@ void PropertySetMixinImpl::prepareSet( osl::MutexGuard g(m_impl->mutex); if (m_impl->disposed) { throw css::lang::DisposedException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("disposed")), + rtl::OUString("disposed"), static_cast< css::beans::XPropertySet * >(this)); } if ((it->second.property.Attributes @@ -1393,10 +1376,9 @@ void PropertySetMixinImpl::setPropertyValues( props[i].Handle))) { throw css::beans::UnknownPropertyException( - (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name ")) + (rtl::OUString("name ") + props[i].Name - + rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM(" does not match handle ")) + + rtl::OUString(" does not match handle ") + rtl::OUString::valueOf(props[i].Handle)), static_cast< css::beans::XPropertySet * >(this)); } diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx index d2ed0cf8a524..180a05484b66 100644 --- a/cppuhelper/source/shlib.cxx +++ b/cppuhelper/source/shlib.cxx @@ -296,7 +296,7 @@ static void getLibEnv(oslModule lib, const OString aStr( aEnv.getToken( 0, ';', nIndex ) ); if ( aStr.equals(implName) ) { - *pSourceEnv_name += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":log")); + *pSourceEnv_name += ::rtl::OUString(":log"); break; } } while( nIndex != -1 ); diff --git a/cppuhelper/source/unourl.cxx b/cppuhelper/source/unourl.cxx index 15e1d11df210..7179256f3a3a 100644 --- a/cppuhelper/source/unourl.cxx +++ b/cppuhelper/source/unourl.cxx @@ -78,8 +78,8 @@ inline UnoUrlDescriptor::Impl::Impl(rtl::OUString const & rDescriptor) case STATE_NAME0: if (bEnd || !isAlphanum(c)) throw rtl::MalformedUriException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "UNO URL contains bad descriptor name"))); + rtl::OUString( + "UNO URL contains bad descriptor name")); nStart = i; eState = STATE_NAME; break; @@ -93,15 +93,15 @@ inline UnoUrlDescriptor::Impl::Impl(rtl::OUString const & rDescriptor) } else if (!isAlphanum(c)) throw rtl::MalformedUriException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "UNO URL contains bad descriptor name"))); + rtl::OUString( + "UNO URL contains bad descriptor name")); break; case STATE_KEY0: if (bEnd || !isAlphanum(c)) throw rtl::MalformedUriException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "UNO URL contains bad parameter key"))); + rtl::OUString( + "UNO URL contains bad parameter key")); nStart = i; eState = STATE_KEY; break; @@ -115,8 +115,8 @@ inline UnoUrlDescriptor::Impl::Impl(rtl::OUString const & rDescriptor) } else if (bEnd || !isAlphanum(c)) throw rtl::MalformedUriException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "UNO URL contains bad parameter key"))); + rtl::OUString( + "UNO URL contains bad parameter key")); break; case STATE_VALUE: @@ -131,8 +131,7 @@ inline UnoUrlDescriptor::Impl::Impl(rtl::OUString const & rDescriptor) RTL_TEXTENCODING_UTF8))).second) throw rtl::MalformedUriException( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "UNO URL contains duplicated parameter"))); + "UNO URL contains duplicated parameter")); eState = STATE_KEY0; } break; @@ -223,8 +222,8 @@ inline UnoUrl::Impl * UnoUrl::Impl::create(rtl::OUString const & rUrl) sal_Int32 j = rUrl.indexOf(';', i); if (j < 0) throw rtl::MalformedUriException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "UNO URL has too few semicolons"))); + rtl::OUString( + "UNO URL has too few semicolons")); SAL_WNODEPRECATED_DECLARATIONS_PUSH std::auto_ptr< UnoUrlDescriptor::Impl > xConnection(new UnoUrlDescriptor::Impl(rUrl.copy(i, j - i))); @@ -233,8 +232,8 @@ inline UnoUrl::Impl * UnoUrl::Impl::create(rtl::OUString const & rUrl) j = rUrl.indexOf(0x3B, i); // ';' if (j < 0) throw rtl::MalformedUriException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "UNO URL has too few semicolons"))); + rtl::OUString( + "UNO URL has too few semicolons")); SAL_WNODEPRECATED_DECLARATIONS_PUSH std::auto_ptr< UnoUrlDescriptor::Impl > xProtocol(new UnoUrlDescriptor::Impl(rUrl.copy(i, j - i))); @@ -242,8 +241,8 @@ inline UnoUrl::Impl * UnoUrl::Impl::create(rtl::OUString const & rUrl) i = j + 1; if (i == rUrl.getLength()) throw rtl::MalformedUriException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "UNO URL contains empty ObjectName"))); + rtl::OUString( + "UNO URL contains empty ObjectName")); for (j = i; j < rUrl.getLength(); ++j) { sal_Unicode c = rUrl.getStr()[j]; @@ -255,8 +254,8 @@ inline UnoUrl::Impl * UnoUrl::Impl::create(rtl::OUString const & rUrl) && c != 0x3F && c != 0x40 && c != 0x5F // '?', '@', '_' && c != 0x7E) // '~' throw rtl::MalformedUriException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "UNO URL contains invalid ObjectName"))); + rtl::OUString( + "UNO URL contains invalid ObjectName")); } return new Impl(xConnection, xProtocol, rUrl.copy(i)); } |