diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-13 15:16:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-13 20:11:48 +0200 |
commit | df4b0ba2f631e2a99d72011e58ac5e81fbc1dec5 (patch) | |
tree | e5bcefcb888f5db573789262319e9ac2647e8204 /stoc/source | |
parent | a9cf09844ee35610cbf102895014a7f03f8de100 (diff) |
loplugin:ostr in stoc
Change-Id: I638b1e12781264770ce742d3303693e3b7fa82c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167597
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'stoc/source')
28 files changed, 324 insertions, 324 deletions
diff --git a/stoc/source/corereflection/crarray.cxx b/stoc/source/corereflection/crarray.cxx index 67be31e1ac93..f3de3041c260 100644 --- a/stoc/source/corereflection/crarray.cxx +++ b/stoc/source/corereflection/crarray.cxx @@ -45,7 +45,7 @@ void ArrayIdlClassImpl::realloc( Any & rArray, sal_Int32 nLen ) if (nLen < 0) { throw IllegalArgumentException( - "negative length given!", + u"negative length given!"_ustr, getXWeak(), 1 ); } @@ -134,7 +134,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 nIndex, const Any & rNewVal { TYPELIB_DANGER_RELEASE( pElemTypeDescr ); throw IllegalArgumentException( - "sequence element is not assignable by given value!", + u"sequence element is not assignable by given value!"_ustr, getXWeak(), 2 ); } TYPELIB_DANGER_RELEASE( pElemTypeDescr ); diff --git a/stoc/source/corereflection/crcomp.cxx b/stoc/source/corereflection/crcomp.cxx index b1143e158b09..d47151c7ea92 100644 --- a/stoc/source/corereflection/crcomp.cxx +++ b/stoc/source/corereflection/crcomp.cxx @@ -160,7 +160,7 @@ void IdlCompFieldImpl::set( const Any & rObj, const Any & rValue ) if (!coerce_assign( const_cast<char *>(static_cast<char const *>(rObj.getValue()) + _nOffset), getTypeDescr(), rValue, getReflection() )) { throw IllegalArgumentException( - "cannot assign value to destination", + u"cannot assign value to destination"_ustr, getXWeak(), 1 ); } return; @@ -193,7 +193,7 @@ void IdlCompFieldImpl::set( Any & rObj, const Any & rValue ) if (!coerce_assign( const_cast<char *>(static_cast<char const *>(rObj.getValue()) + _nOffset), getTypeDescr(), rValue, getReflection() )) { throw IllegalArgumentException( - "cannot assign to destination", + u"cannot assign to destination"_ustr, getXWeak(), 1 ); } return; diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx index 1f4562181abb..f9ca56720fed 100644 --- a/stoc/source/corereflection/crefl.cxx +++ b/stoc/source/corereflection/crefl.cxx @@ -45,7 +45,7 @@ IdlReflectionServiceImpl::IdlReflectionServiceImpl( : WeakComponentImplHelper( _aComponentMutex ) { xContext->getValueByName( - "/singletons/com.sun.star.reflection.theTypeDescriptionManager" ) >>= _xTDMgr; + u"/singletons/com.sun.star.reflection.theTypeDescriptionManager"_ustr ) >>= _xTDMgr; OSL_ENSURE( _xTDMgr.is(), "### cannot get singleton \"TypeDescriptionManager\" from context!" ); } @@ -70,7 +70,7 @@ void IdlReflectionServiceImpl::disposing() OUString IdlReflectionServiceImpl::getImplementationName() { - return "com.sun.star.comp.stoc.CoreReflection"; + return u"com.sun.star.comp.stoc.CoreReflection"_ustr; } sal_Bool IdlReflectionServiceImpl::supportsService( const OUString & rServiceName ) @@ -80,7 +80,7 @@ sal_Bool IdlReflectionServiceImpl::supportsService( const OUString & rServiceNam Sequence< OUString > IdlReflectionServiceImpl::getSupportedServiceNames() { - Sequence< OUString > seqNames { "com.sun.star.reflection.CoreReflection" }; + Sequence< OUString > seqNames { u"com.sun.star.reflection.CoreReflection"_ustr }; return seqNames; } @@ -260,7 +260,7 @@ Reference< XIdlClass > IdlReflectionServiceImpl::forType( typelib_TypeDescriptio return xRet; } throw RuntimeException( - "IdlReflectionServiceImpl::forType() failed!", + u"IdlReflectionServiceImpl::forType() failed!"_ustr, getXWeak() ); } @@ -272,12 +272,12 @@ const Mapping & IdlReflectionServiceImpl::getCpp2Uno() MutexGuard aGuard( getMutexAccess() ); if (! _aCpp2Uno.is()) { - _aCpp2Uno = Mapping( CPPU_CURRENT_LANGUAGE_BINDING_NAME, UNO_LB_UNO ); + _aCpp2Uno = Mapping( CPPU_CURRENT_LANGUAGE_BINDING_NAME, u"" UNO_LB_UNO ""_ustr ); OSL_ENSURE( _aCpp2Uno.is(), "### cannot get c++ to uno mapping!" ); if (! _aCpp2Uno.is()) { throw RuntimeException( - "cannot get c++ to uno mapping!", + u"cannot get c++ to uno mapping!"_ustr, getXWeak() ); } } @@ -292,12 +292,12 @@ const Mapping & IdlReflectionServiceImpl::getUno2Cpp() MutexGuard aGuard( getMutexAccess() ); if (! _aUno2Cpp.is()) { - _aUno2Cpp = Mapping( UNO_LB_UNO, CPPU_CURRENT_LANGUAGE_BINDING_NAME ); + _aUno2Cpp = Mapping( u"" UNO_LB_UNO ""_ustr, CPPU_CURRENT_LANGUAGE_BINDING_NAME ); OSL_ENSURE( _aUno2Cpp.is(), "### cannot get uno to c++ mapping!" ); if (! _aUno2Cpp.is()) { throw RuntimeException( - "cannot get uno to c++ mapping!", + u"cannot get uno to c++ mapping!"_ustr, getXWeak() ); } } @@ -313,7 +313,7 @@ uno_Interface * IdlReflectionServiceImpl::mapToUno( return static_cast<uno_Interface *>(getCpp2Uno().mapInterface( xObj.get(), pTo )); throw RuntimeException( - "illegal object given!", + u"illegal object given!"_ustr, getXWeak() ); } diff --git a/stoc/source/corereflection/crenum.cxx b/stoc/source/corereflection/crenum.cxx index 2cb07c9b5ec8..13484e0eb324 100644 --- a/stoc/source/corereflection/crenum.cxx +++ b/stoc/source/corereflection/crenum.cxx @@ -91,14 +91,14 @@ Any IdlEnumFieldImpl::get( const Any & ) void IdlEnumFieldImpl::set( const Any &, const Any & ) { throw IllegalAccessException( - "cannot set enum field, it is constant", + u"cannot set enum field, it is constant"_ustr, getXWeak() ); } void IdlEnumFieldImpl::set( Any &, const Any & ) { throw IllegalAccessException( - "cannot set enum field, it is constant", + u"cannot set enum field, it is constant"_ustr, getXWeak() ); } diff --git a/stoc/source/corereflection/criface.cxx b/stoc/source/corereflection/criface.cxx index 130ff546e278..7b35020fb67f 100644 --- a/stoc/source/corereflection/criface.cxx +++ b/stoc/source/corereflection/criface.cxx @@ -150,7 +150,7 @@ Any IdlAttributeFieldImpl::get( const Any & rObj ) return aRet; } throw IllegalArgumentException( - "illegal object given!", + u"illegal object given!"_ustr, getXWeak(), 0 ); } @@ -159,7 +159,7 @@ void IdlAttributeFieldImpl::set( Any & rObj, const Any & rValue ) if (getAttributeTypeDescr()->bReadOnly) { throw IllegalAccessException( - "cannot set readonly attribute!", + u"cannot set readonly attribute!"_ustr, getXWeak() ); } @@ -232,11 +232,11 @@ void IdlAttributeFieldImpl::set( Any & rObj, const Any & rValue ) (*pUnoI->release)( pUnoI ); throw IllegalArgumentException( - "illegal value given!", + u"illegal value given!"_ustr, *o3tl::doAccess<Reference<XInterface>>(rObj), 1 ); } throw IllegalArgumentException( - "illegal destination object given!", + u"illegal destination object given!"_ustr, getXWeak(), 0 ); } @@ -261,8 +261,8 @@ void IdlAttributeFieldImpl::checkException( cppu::UnoType<RuntimeException>::get())) { throw WrappedTargetRuntimeException( - "non-RuntimeException occurred when accessing an" - " interface type attribute", + u"non-RuntimeException occurred when accessing an" + " interface type attribute"_ustr, context, e); } cppu::throwException(e); @@ -609,7 +609,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > & uno_type_copyAndConvertData(&aRet, pUnoExc, cppu::UnoType<Any>::get().getTypeLibType(), getReflection()->getUno2Cpp().get() ); uno_any_destruct( pUnoExc, nullptr ); - throw InvocationTargetException("exception occurred during invocation!", + throw InvocationTargetException(u"exception occurred during invocation!"_ustr, *o3tl::doAccess<Reference<XInterface>>(rObj), aRet); } else @@ -640,7 +640,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > & return aRet; } throw IllegalArgumentException( - "illegal destination object given!", + u"illegal destination object given!"_ustr, getXWeak(), 0 ); } diff --git a/stoc/source/corereflection/dump.cxx b/stoc/source/corereflection/dump.cxx index 0905393db9bc..445e05b83e79 100644 --- a/stoc/source/corereflection/dump.cxx +++ b/stoc/source/corereflection/dump.cxx @@ -105,7 +105,7 @@ public: explicit Dump(css::uno::Reference<css::uno::XComponentContext> const& context) : WeakComponentImplHelper(m_aMutex) , manager_(context->getValueByName( - "/singletons/com.sun.star.reflection.theTypeDescriptionManager"), + u"/singletons/com.sun.star.reflection.theTypeDescriptionManager"_ustr), css::uno::UNO_QUERY_THROW) { } @@ -121,7 +121,7 @@ public: switch (value.getValueTypeClass()) { case css::uno::TypeClass_VOID: - return "void"; + return u"void"_ustr; case css::uno::TypeClass_BOOLEAN: return OUString::boolean(value.get<bool>()); case css::uno::TypeClass_BYTE: @@ -218,7 +218,7 @@ public: case css::uno::TypeClass_INTERFACE: { auto const p = *static_cast<void* const*>(value.getValue()); - return p == nullptr ? OUString("null") + return p == nullptr ? u"null"_ustr : OUString("0x" + hex(reinterpret_cast<sal_uIntPtr>(p), SAL_TYPES_SIZEOFPOINTER * 2)); @@ -241,7 +241,7 @@ public: osl::MutexGuard g(m_aMutex); if (rBHelper.bDisposed) { - throw css::lang::DisposedException("css.reflection.Dumper"); + throw css::lang::DisposedException(u"css.reflection.Dumper"_ustr); } manager = manager_; } diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx index d531b455d7d5..3082bed5d44e 100644 --- a/stoc/source/defaultregistry/defaultregistry.cxx +++ b/stoc/source/defaultregistry/defaultregistry.cxx @@ -1009,7 +1009,7 @@ Any RegistryEnumueration::nextElement( ) } else { - throw NoSuchElementException( "NestedRegistry: no nextElement() !" ); + throw NoSuchElementException( u"NestedRegistry: no nextElement() !"_ustr ); } return a; } @@ -1035,7 +1035,7 @@ sal_Bool SAL_CALL NestedRegistryImpl::hasElements( ) OUString SAL_CALL NestedRegistryImpl::getImplementationName( ) { - return "com.sun.star.comp.stoc.NestedRegistry"; + return u"com.sun.star.comp.stoc.NestedRegistry"_ustr; } sal_Bool SAL_CALL NestedRegistryImpl::supportsService( const OUString& ServiceName ) @@ -1045,7 +1045,7 @@ sal_Bool SAL_CALL NestedRegistryImpl::supportsService( const OUString& ServiceNa Sequence<OUString> SAL_CALL NestedRegistryImpl::getSupportedServiceNames( ) { - Sequence< OUString > seqNames { "com.sun.star.registry.NestedRegistry" }; + Sequence< OUString > seqNames { u"com.sun.star.registry.NestedRegistry"_ustr }; return seqNames; } @@ -1084,7 +1084,7 @@ OUString SAL_CALL NestedRegistryImpl::getURL() void SAL_CALL NestedRegistryImpl::open( const OUString&, sal_Bool, sal_Bool ) { throw InvalidRegistryException( - "the 'open' method is not specified for a nested registry" ); + u"the 'open' method is not specified for a nested registry"_ustr ); } @@ -1122,7 +1122,7 @@ void SAL_CALL NestedRegistryImpl::close( ) void SAL_CALL NestedRegistryImpl::destroy( ) { throw InvalidRegistryException( - "the 'destroy' method is not specified for a nested registry" ); + u"the 'destroy' method is not specified for a nested registry"_ustr ); } @@ -1170,7 +1170,7 @@ sal_Bool SAL_CALL NestedRegistryImpl::isReadOnly( ) void SAL_CALL NestedRegistryImpl::mergeKey( const OUString&, const OUString& ) { - throw css::uno::RuntimeException("css.registry.NestedRegistry::mergeKey: not implemented"); + throw css::uno::RuntimeException(u"css.registry.NestedRegistry::mergeKey: not implemented"_ustr); } } // namespace diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index 98df49d93338..6f2a8cb4ee93 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -660,7 +660,7 @@ void delete_all_singleton_entries( { Reference<registry::XRegistryKey> const& xSingleton = singletons[nPos]; Reference< registry::XRegistryKey > xRegisteredImplNames( - xSingleton->openKey( "REGISTERED_BY" ) ); + xSingleton->openKey( u"REGISTERED_BY"_ustr ) ); if (xRegisteredImplNames.is() && xRegisteredImplNames->isValid()) { Sequence< OUString > registered_implnames; @@ -694,7 +694,7 @@ void delete_all_singleton_entries( { // remove whole entry xRegisteredImplNames->closeKey(); - xSingleton->deleteKey( "REGISTERED_BY" ); + xSingleton->deleteKey( u"REGISTERED_BY"_ustr ); // registry key cannot provide its relative name, only absolute :( OUString abs( xSingleton->getKeyName() ); xSingletons_section->deleteKey( abs.copy( abs.lastIndexOf( '/' ) +1 ) ); @@ -793,7 +793,7 @@ void insert_singletons( // throw( registry::InvalidRegistryException, registry::CannotRegisterImplementationException, RuntimeException ) { // singletons - Reference< registry::XRegistryKey > xKey( xImplKey->openKey( "UNO/SINGLETONS" ) ); + Reference< registry::XRegistryKey > xKey( xImplKey->openKey( u"UNO/SINGLETONS"_ustr ) ); if (!(xKey.is() && xKey->isValid())) return; @@ -819,7 +819,7 @@ void insert_singletons( { Reference< container::XHierarchicalNameAccess > xTDMgr; OUString the_tdmgr = - "/singletons/com.sun.star.reflection.theTypeDescriptionManager"; + u"/singletons/com.sun.star.reflection.theTypeDescriptionManager"_ustr; xContext->getValueByName( the_tdmgr ) >>= xTDMgr; if (! xTDMgr.is()) { @@ -866,11 +866,11 @@ void insert_singletons( } Reference< registry::XRegistryKey > xRegisteredImplNames( - xKey2->openKey( "REGISTERED_BY" ) ); + xKey2->openKey( u"REGISTERED_BY"_ustr ) ); if (!xRegisteredImplNames.is() || !xRegisteredImplNames->isValid()) { // create - xRegisteredImplNames = xKey2->createKey( "REGISTERED_BY" ); + xRegisteredImplNames = xKey2->createKey( u"REGISTERED_BY"_ustr ); } Sequence< OUString > implnames; @@ -908,7 +908,7 @@ void prepareRegistry( if (!subKeys.hasElements()) { throw InvalidRegistryException( - "prepareRegistry(): source registry is empty" ); + u"prepareRegistry(): source registry is empty"_ustr ); } for (const Reference < XRegistryKey >& xImplKey : subKeys) @@ -1116,7 +1116,7 @@ ImplementationRegistration::ImplementationRegistration( const Reference < XCompo // XServiceInfo OUString ImplementationRegistration::getImplementationName() { - return "com.sun.star.comp.stoc.ImplementationRegistration"; + return u"com.sun.star.comp.stoc.ImplementationRegistration"_ustr; } // XServiceInfo @@ -1128,7 +1128,7 @@ sal_Bool ImplementationRegistration::supportsService(const OUString& ServiceName // XServiceInfo Sequence< OUString > ImplementationRegistration::getSupportedServiceNames() { - return { "com.sun.star.registry.ImplementationRegistration" }; + return { u"com.sun.star.registry.ImplementationRegistration"_ustr }; } Reference< XSimpleRegistry > ImplementationRegistration::getRegistryFromServiceManager() const @@ -1259,8 +1259,8 @@ void ImplementationRegistration::prepareRegister( if( !m_xSMgr.is() ) { throw CannotRegisterImplementationException( - "ImplementationRegistration::registerImplementation() " - "no componentcontext available to instantiate loader" ); + u"ImplementationRegistration::registerImplementation() " + "no componentcontext available to instantiate loader"_ustr ); } try @@ -1479,7 +1479,7 @@ void ImplementationRegistration::doRevoke( } } - xKey = xRootKey->openKey( "/SINGLETONS" ); + xKey = xRootKey->openKey( u"/SINGLETONS"_ustr ); if (xKey.is() && xKey->isValid()) { delete_all_singleton_entries( xKey, aNames ); @@ -1523,7 +1523,7 @@ void ImplementationRegistration::doRegister( if ( !bSuccess ) { throw CannotRegisterImplementationException( - "ImplementationRegistration::doRegistration() component registration signaled failure" ); + u"ImplementationRegistration::doRegistration() component registration signaled failure"_ustr ); } prepareRegistry(xDest, xSourceKey, implementationLoaderUrl, registeredLocationUrl, xCtx); diff --git a/stoc/source/implementationregistration/mergekeys.cxx b/stoc/source/implementationregistration/mergekeys.cxx index fe979540d839..426caa2be9d6 100644 --- a/stoc/source/implementationregistration/mergekeys.cxx +++ b/stoc/source/implementationregistration/mergekeys.cxx @@ -59,11 +59,11 @@ static void mergeKeys( { if (!xSource.is() || !xSource->isValid()) { throw registry::InvalidRegistryException( - "source key is null or invalid!" ); + u"source key is null or invalid!"_ustr ); } if (!xDest.is() || !xDest->isValid()) { throw registry::InvalidRegistryException( - "destination key is null or invalid!" ); + u"destination key is null or invalid!"_ustr ); } // write value @@ -151,12 +151,12 @@ void mergeKeys( { if (!xDest.is() || !xDest->isValid()) { throw registry::InvalidRegistryException( - "destination key is null or invalid!" ); + u"destination key is null or invalid!"_ustr ); } if (xDest->isReadOnly()) { throw registry::InvalidRegistryException( - "destination registry is read-only! cannot merge!" ); + u"destination registry is read-only! cannot merge!"_ustr ); } t_links links; diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index 20ac8ccd41c7..5491001a070a 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -1535,7 +1535,7 @@ private: } virtual OUString SAL_CALL getImplementationName() override - { return "com.sun.star.comp.stoc.Introspection"; } + { return u"com.sun.star.comp.stoc.Introspection"_ustr; } virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override { return cppu::supportsService(this, ServiceName); } @@ -1543,7 +1543,7 @@ private: virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override { - Sequence<OUString> s { "com.sun.star.beans.Introspection" }; + Sequence<OUString> s { u"com.sun.star.beans.Introspection"_ustr }; return s; } diff --git a/stoc/source/invocation/invocation.cxx b/stoc/source/invocation/invocation.cxx index 44aa91f6cb9e..228332a3a572 100644 --- a/stoc/source/invocation/invocation.cxx +++ b/stoc/source/invocation/invocation.cxx @@ -529,7 +529,7 @@ void Invocation_Impl::setValue( const OUString& PropertyName, const Any& Value ) _xPropertySet->setPropertyValue( PropertyName, xTypeConverter->convertTo( Value, aProp.Type ) ); else - throw RuntimeException( "no type converter service!" ); + throw RuntimeException( u"no type converter service!"_ustr ); } // NameContainer else if( _xNameContainer.is() ) @@ -544,7 +544,7 @@ void Invocation_Impl::setValue( const OUString& PropertyName, const Any& Value ) else if( xTypeConverter.is() ) aConv = xTypeConverter->convertTo( Value, _xNameContainer->getElementType() ); else - throw RuntimeException( "no type converter service!" ); + throw RuntimeException( u"no type converter service!"_ustr ); // Replace if present, otherwise insert if (_xNameContainer->hasByName( PropertyName )) @@ -553,7 +553,7 @@ void Invocation_Impl::setValue( const OUString& PropertyName, const Any& Value ) _xNameContainer->insertByName( PropertyName, aConv ); } else - throw UnknownPropertyException( "no introspection nor name container!" ); + throw UnknownPropertyException( u"no introspection nor name container!"_ustr ); } catch (UnknownPropertyException &) { @@ -638,7 +638,7 @@ Any Invocation_Impl::invoke( const OUString& FunctionName, const Sequence<Any>& } else { - throw CannotConvertException("invocation type mismatch!", *this, {}, 0, 0); + throw CannotConvertException(u"invocation type mismatch!"_ustr, *this, {}, 0, 0); } } @@ -671,7 +671,7 @@ Any Invocation_Impl::invoke( const OUString& FunctionName, const Sequence<Any>& return aRet; } - throw RuntimeException("invocation lacking of introspection access!", *this); + throw RuntimeException(u"invocation lacking of introspection access!"_ustr, *this); } namespace { @@ -1019,7 +1019,7 @@ InvocationService::InvocationService( const Reference<XComponentContext> & xCtx , xCoreReflection( css::reflection::theCoreReflection::get(mxCtx) ) { xTypeConverter.set( - mxSMgr->createInstanceWithContext( "com.sun.star.script.Converter", xCtx ), + mxSMgr->createInstanceWithContext( u"com.sun.star.script.Converter"_ustr, xCtx ), UNO_QUERY ); xIntrospection = theIntrospection::get(xCtx); } @@ -1027,7 +1027,7 @@ InvocationService::InvocationService( const Reference<XComponentContext> & xCtx // XServiceInfo OUString InvocationService::getImplementationName() { - return "com.sun.star.comp.stoc.Invocation"; + return u"com.sun.star.comp.stoc.Invocation"_ustr; } // XServiceInfo @@ -1039,7 +1039,7 @@ sal_Bool InvocationService::supportsService(const OUString& ServiceName) // XServiceInfo Sequence< OUString > InvocationService::getSupportedServiceNames() { - return { "com.sun.star.script.Invocation" }; + return { u"com.sun.star.script.Invocation"_ustr }; } diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx index b5b62db089a8..cfce2f0681bc 100644 --- a/stoc/source/invocation_adapterfactory/iafactory.cxx +++ b/stoc/source/invocation_adapterfactory/iafactory.cxx @@ -282,8 +282,8 @@ bool AdapterImpl::coerce_assign( // set runtime exception constructRuntimeException( pOutExc, - "type coercion failed: " - "conversion succeeded, but assignment failed?!" ); + u"type coercion failed: " + "conversion succeeded, but assignment failed?!"_ustr ); } return succ; } @@ -333,7 +333,7 @@ static void handleInvokExc( uno_Any * pDest, uno_Any * pSource ) else { constructRuntimeException( - pDest, "no exception has been thrown via invocation?!" ); + pDest, u"no exception has been thrown via invocation?!"_ustr ); } } } @@ -526,7 +526,7 @@ void AdapterImpl::invoke( // set runtime exception constructRuntimeException( *ppException, - "out params lengths differ after invocation call!" ); + u"out params lengths differ after invocation call!"_ustr ); } // cleanup invok out params ::uno_destructData( &pOutIndices, m_pFactory->m_pShortSeqTD, nullptr ); @@ -645,7 +645,7 @@ AdapterImpl::AdapterImpl( &m_vInterfaces[ n ].m_pTypeDescr->aBase ); } throw RuntimeException( - "cannot retrieve all interface type infos!" ); + u"cannot retrieve all interface type infos!"_ustr ); } } @@ -655,7 +655,7 @@ AdapterImpl::AdapterImpl( OSL_ASSERT( nullptr != m_pReceiver ); if (! m_pReceiver) { - throw RuntimeException( "cannot map receiver!" ); + throw RuntimeException( u"cannot map receiver!"_ustr ); } m_pFactory->acquire(); @@ -663,8 +663,8 @@ AdapterImpl::AdapterImpl( FactoryImpl::FactoryImpl( Reference< XComponentContext > const & xContext ) - : m_aUno2Cpp(Mapping( UNO_LB_UNO, CPPU_CURRENT_LANGUAGE_BINDING_NAME )), - m_aCpp2Uno(Mapping( CPPU_CURRENT_LANGUAGE_BINDING_NAME, UNO_LB_UNO)), + : m_aUno2Cpp(Mapping( u"" UNO_LB_UNO ""_ustr, CPPU_CURRENT_LANGUAGE_BINDING_NAME )), + m_aCpp2Uno(Mapping( CPPU_CURRENT_LANGUAGE_BINDING_NAME, u"" UNO_LB_UNO ""_ustr)), m_pInvokMethodTD( nullptr ), m_pSetValueTD( nullptr ), m_pGetValueTD( nullptr ), @@ -679,7 +679,7 @@ FactoryImpl::FactoryImpl( Reference< XComponentContext > const & xContext ) // type converter Reference< script::XTypeConverter > xConverter( xContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.script.Converter", + u"com.sun.star.script.Converter"_ustr, xContext ), UNO_QUERY_THROW ); m_pConverter = static_cast<uno_Interface *>(m_aCpp2Uno.mapInterface( @@ -721,7 +721,7 @@ FactoryImpl::FactoryImpl( Reference< XComponentContext > const & xContext ) !m_pConvertToTD || !m_pAnySeqTD || !m_pShortSeqTD) { - throw RuntimeException( "missing type descriptions!" ); + throw RuntimeException( u"missing type descriptions!"_ustr ); } } @@ -836,7 +836,7 @@ Reference< XInterface > FactoryImpl::createAdapter( OSL_ASSERT( xRet.is() ); if (! xRet.is()) { - throw RuntimeException( "mapping UNO to C++ failed!" ); + throw RuntimeException( u"mapping UNO to C++ failed!"_ustr ); } } return xRet; @@ -853,7 +853,7 @@ Reference< XInterface > FactoryImpl::createAdapter( OUString FactoryImpl::getImplementationName() { - return "com.sun.star.comp.stoc.InvocationAdapterFactory"; + return u"com.sun.star.comp.stoc.InvocationAdapterFactory"_ustr; } sal_Bool FactoryImpl::supportsService( const OUString & rServiceName ) @@ -863,7 +863,7 @@ sal_Bool FactoryImpl::supportsService( const OUString & rServiceName ) Sequence< OUString > FactoryImpl::getSupportedServiceNames() { - return { "com.sun.star.script.InvocationAdapterFactory" }; + return { u"com.sun.star.script.InvocationAdapterFactory"_ustr }; } } diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx index b0cd09e2f21f..ff64ca45a330 100644 --- a/stoc/source/javaloader/javaloader.cxx +++ b/stoc/source/javaloader/javaloader.cxx @@ -93,7 +93,7 @@ OUString generateRandomPipeId() sal_uInt8 bytes[ 32 ]; if (rtl_random_getBytes( nullptr, bytes, SAL_N_ELEMENTS(bytes) ) != rtl_Random_E_None) { - throw RuntimeException( "random pool error!?", nullptr ); + throw RuntimeException( u"random pool error!?"_ustr, nullptr ); } OUStringBuffer buf; for (unsigned char byte : bytes) { @@ -141,16 +141,16 @@ oslProcess raiseProcess( case osl_Process_E_None: break; case osl_Process_E_NotFound: - throw RuntimeException( "image not found!", nullptr ); + throw RuntimeException( u"image not found!"_ustr, nullptr ); case osl_Process_E_TimedOut: - throw RuntimeException( "timeout occurred!", nullptr ); + throw RuntimeException( u"timeout occurred!"_ustr, nullptr ); case osl_Process_E_NoPermission: - throw RuntimeException( "permission denied!", nullptr ); + throw RuntimeException( u"permission denied!"_ustr, nullptr ); case osl_Process_E_Unknown: - throw RuntimeException( "unknown error!", nullptr ); + throw RuntimeException( u"unknown error!"_ustr, nullptr ); case osl_Process_E_InvalidError: default: - throw RuntimeException( "unmapped error!", nullptr ); + throw RuntimeException( u"unmapped error!"_ustr, nullptr ); } return hProcess; @@ -162,7 +162,7 @@ Reference<XComponentContext> raise_uno_process( { OSL_ASSERT( xContext.is() ); - OUString const url(css::util::theMacroExpander::get(xContext)->expandMacros("$URE_BIN_DIR/uno")); + OUString const url(css::util::theMacroExpander::get(xContext)->expandMacros(u"$URE_BIN_DIR/uno"_ustr)); const OUString connectStr = "uno:pipe,name=" + generateRandomPipeId() + ";urp;uno.ComponentContext"; @@ -174,11 +174,11 @@ Reference<XComponentContext> raise_uno_process( #if OSL_DEBUG_LEVEL == 0 "--quiet", #endif - "--singleaccept", - "-u", + u"--singleaccept"_ustr, + u"-u"_ustr, connectStr, // don't inherit from unorc: - "-env:INIFILENAME=" }; + u"-env:INIFILENAME="_ustr }; //now add the bootstrap variables which were supplied on the command line std::vector<OUString> bootvars = getCmdBootstrapVariables(); @@ -306,15 +306,15 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL if (!m_xRemoteComponentContext.is()) { Reference<css::container::XHierarchicalNameAccess> const xConf( m_xComponentContext->getServiceManager()->createInstanceWithArgumentsAndContext( - "com.sun.star.configuration.ReadOnlyAccess", - { Any(OUString("*")) }, // locale isn't relevant here + u"com.sun.star.configuration.ReadOnlyAccess"_ustr, + { Any(u"*"_ustr) }, // locale isn't relevant here m_xComponentContext), UNO_QUERY); // configmgr is not part of URE, so may not exist! if (xConf.is()) { Any const value(xConf->getByHierarchicalName( - "org.openoffice.Office.Java/VirtualMachine/RunUnoComponentsOutOfProcess")); + u"org.openoffice.Office.Java/VirtualMachine/RunUnoComponentsOutOfProcess"_ustr)); bool b; if ((value >>= b) && b) { SAL_INFO("stoc.java", "JavaComponentLoader: starting uno process"); @@ -327,7 +327,7 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL // create JVM service in remote uno.bin process Reference<XImplementationLoader> const xLoader( m_xRemoteComponentContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.loader.Java2", m_xRemoteComponentContext), + u"com.sun.star.loader.Java2"_ustr, m_xRemoteComponentContext), UNO_QUERY_THROW); assert(xLoader.is()); m_javaLoader = xLoader; @@ -345,8 +345,8 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL // get a java vm, where we can create a loader css::uno::Reference<XJavaVM> javaVM_xJavaVM( m_xComponentContext->getValueByName( - ("/singletons/" - "com.sun.star.java.theJavaVirtualMachine")), + (u"/singletons/" + "com.sun.star.java.theJavaVirtualMachine"_ustr)), UNO_QUERY_THROW); // Use the special protocol of XJavaVM.getJavaVM: If the passed in @@ -391,54 +391,54 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL jclass jcClassLoader = pJNIEnv->FindClass("java/lang/ClassLoader"); if(pJNIEnv->ExceptionOccurred()) throw RuntimeException( - "javaloader error - could not find class java/lang/ClassLoader"); + u"javaloader error - could not find class java/lang/ClassLoader"_ustr); jmethodID jmLoadClass = pJNIEnv->GetMethodID( jcClassLoader, "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;"); if(pJNIEnv->ExceptionOccurred()) throw RuntimeException( - "javaloader error - could not find method java/lang/ClassLoader.loadClass"); + u"javaloader error - could not find method java/lang/ClassLoader.loadClass"_ustr); jvalue arg; arg.l = pJNIEnv->NewStringUTF( "com.sun.star.comp.loader.JavaLoader"); if(pJNIEnv->ExceptionOccurred()) throw RuntimeException( - "javaloader error - could not create string"); + u"javaloader error - could not create string"_ustr); jclass jcJavaLoader = static_cast< jclass >( pJNIEnv->CallObjectMethodA( static_cast< jobject >(xVirtualMachine->getClassLoader()), jmLoadClass, &arg)); if(pJNIEnv->ExceptionOccurred()) throw RuntimeException( - "javaloader error - could not find class com/sun/star/comp/loader/JavaLoader"); + u"javaloader error - could not find class com/sun/star/comp/loader/JavaLoader"_ustr); jmethodID jmJavaLoader_init = pJNIEnv->GetMethodID(jcJavaLoader, "<init>", "()V"); if(pJNIEnv->ExceptionOccurred()) throw RuntimeException( - "javaloader error - instantiation of com.sun.star.comp.loader.JavaLoader failed"); + u"javaloader error - instantiation of com.sun.star.comp.loader.JavaLoader failed"_ustr); jobject joJavaLoader = pJNIEnv->NewObject(jcJavaLoader, jmJavaLoader_init); if(pJNIEnv->ExceptionOccurred()) throw RuntimeException( - "javaloader error - instantiation of com.sun.star.comp.loader.JavaLoader failed"); + u"javaloader error - instantiation of com.sun.star.comp.loader.JavaLoader failed"_ustr); // map the java JavaLoader to this environment - OUString sJava("java"); + OUString sJava(u"java"_ustr); uno_getEnvironment(&pJava_environment, sJava.pData, xVirtualMachine.get()); if(!pJava_environment) throw RuntimeException( - "javaloader error - no Java environment available"); + u"javaloader error - no Java environment available"_ustr); // why is there no convenient constructor? OUString sCppu_current_lb_name(CPPU_CURRENT_LANGUAGE_BINDING_NAME); uno_getEnvironment(&pUno_environment, sCppu_current_lb_name.pData, nullptr); if(!pUno_environment) throw RuntimeException( - "javaloader error - no C++ environment available"); + u"javaloader error - no C++ environment available"_ustr); Mapping java_curr(pJava_environment, pUno_environment); if(!java_curr.is()) throw RuntimeException( - "javaloader error - no mapping from java to C++ "); + u"javaloader error - no mapping from java to C++ "_ustr); // release java environment pJava_environment->release(pJava_environment); @@ -452,13 +452,13 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL getDescription(reinterpret_cast<typelib_TypeDescription **>(&pType_XImplementationLoader)); if(!pType_XImplementationLoader) throw RuntimeException( - "javaloader error - no type information for XImplementationLoader"); + u"javaloader error - no type information for XImplementationLoader"_ustr); m_javaLoader.set(static_cast<XImplementationLoader *>(java_curr.mapInterface(joJavaLoader, pType_XImplementationLoader))); pJNIEnv->DeleteLocalRef( joJavaLoader ); if(!m_javaLoader.is()) throw RuntimeException( - "javaloader error - mapping of java XImplementationLoader to c++ failed"); + u"javaloader error - mapping of java XImplementationLoader to c++ failed"_ustr); typelib_typedescription_release(reinterpret_cast<typelib_TypeDescription *>(pType_XImplementationLoader)); pType_XImplementationLoader = nullptr; @@ -467,7 +467,7 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL { css::uno::Any anyEx = cppu::getCaughtException(); throw css::lang::WrappedTargetRuntimeException( - "jvmaccess::VirtualMachine::AttachGuard::CreationException", + u"jvmaccess::VirtualMachine::AttachGuard::CreationException"_ustr, getXWeak(), anyEx ); } @@ -505,7 +505,7 @@ JavaComponentLoader::JavaComponentLoader(css::uno::Reference<XComponentContext> // XServiceInfo OUString SAL_CALL JavaComponentLoader::getImplementationName() { - return "com.sun.star.comp.stoc.JavaComponentLoader"; + return u"com.sun.star.comp.stoc.JavaComponentLoader"_ustr; } sal_Bool SAL_CALL JavaComponentLoader::supportsService(const OUString & ServiceName) @@ -515,7 +515,7 @@ sal_Bool SAL_CALL JavaComponentLoader::supportsService(const OUString & ServiceN Sequence<OUString> SAL_CALL JavaComponentLoader::getSupportedServiceNames() { - return { "com.sun.star.loader.Java", "com.sun.star.loader.Java2" }; + return { u"com.sun.star.loader.Java"_ustr, u"com.sun.star.loader.Java2"_ustr }; } @@ -527,7 +527,7 @@ sal_Bool SAL_CALL JavaComponentLoader::writeRegistryInfo( OUString remoteArg(blabla); const css::uno::Reference<XImplementationLoader> & loader = getJavaLoader(remoteArg); if (!loader.is()) - throw CannotRegisterImplementationException("Could not create Java implementation loader"); + throw CannotRegisterImplementationException(u"Could not create Java implementation loader"_ustr); return loader->writeRegistryInfo(xKey, remoteArg, rLibName); } @@ -545,7 +545,7 @@ css::uno::Reference<XInterface> SAL_CALL JavaComponentLoader::activate( const css::uno::Reference<XImplementationLoader> & loader = getJavaLoader(remoteArg); if (!loader.is()) - throw CannotActivateFactoryException("Could not create Java implementation loader"); + throw CannotActivateFactoryException(u"Could not create Java implementation loader"_ustr); return loader->activate(rImplName, remoteArg, rLibName, xKey); } diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index a1fedd1d2df8..b2c03c9fc0a1 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -134,7 +134,7 @@ static void destroyAttachGuards(void * pData) bool askForRetry(css::uno::Any const & rException) { - if (comphelper::IsContextFlagActive("DontEnableJava")) + if (comphelper::IsContextFlagActive(u"DontEnableJava"_ustr)) return false; css::uno::Reference< css::uno::XCurrentContext > xContext( @@ -142,7 +142,7 @@ bool askForRetry(css::uno::Any const & rException) if (xContext.is()) { css::uno::Reference< css::task::XInteractionHandler > xHandler; - xContext->getValueByName("java-vm.interaction-handler") + xContext->getValueByName(u"java-vm.interaction-handler"_ustr) >>= xHandler; if (xHandler.is()) { @@ -163,25 +163,25 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm, const css::uno::Reference<css::uno::XComponentContext> &xCtx ) { css::uno::Reference<css::uno::XInterface> xConfRegistry = xSMgr->createInstanceWithContext( - "com.sun.star.configuration.ConfigurationRegistry", + u"com.sun.star.configuration.ConfigurationRegistry"_ustr, xCtx ); - if(!xConfRegistry.is()) throw css::uno::RuntimeException("javavm.cxx: couldn't get ConfigurationRegistry", nullptr); + if(!xConfRegistry.is()) throw css::uno::RuntimeException(u"javavm.cxx: couldn't get ConfigurationRegistry"_ustr, nullptr); css::uno::Reference<css::registry::XSimpleRegistry> xConfRegistry_simple(xConfRegistry, css::uno::UNO_QUERY_THROW); - xConfRegistry_simple->open("org.openoffice.Inet", true, false); + xConfRegistry_simple->open(u"org.openoffice.Inet"_ustr, true, false); css::uno::Reference<css::registry::XRegistryKey> xRegistryRootKey = xConfRegistry_simple->getRootKey(); // if ooInetProxyType is not 0 then read the settings - css::uno::Reference<css::registry::XRegistryKey> proxyEnable= xRegistryRootKey->openKey("Settings/ooInetProxyType"); + css::uno::Reference<css::registry::XRegistryKey> proxyEnable= xRegistryRootKey->openKey(u"Settings/ooInetProxyType"_ustr); if( proxyEnable.is() && 0 != proxyEnable->getLongValue()) { // read http proxy name - css::uno::Reference<css::registry::XRegistryKey> httpProxy_name = xRegistryRootKey->openKey("Settings/ooInetHTTPProxyName"); + css::uno::Reference<css::registry::XRegistryKey> httpProxy_name = xRegistryRootKey->openKey(u"Settings/ooInetHTTPProxyName"_ustr); if(httpProxy_name.is() && !httpProxy_name->getStringValue().isEmpty()) { OUString httpHost = "http.proxyHost=" + httpProxy_name->getStringValue(); // read http proxy port - css::uno::Reference<css::registry::XRegistryKey> httpProxy_port = xRegistryRootKey->openKey("Settings/ooInetHTTPProxyPort"); + css::uno::Reference<css::registry::XRegistryKey> httpProxy_port = xRegistryRootKey->openKey(u"Settings/ooInetHTTPProxyPort"_ustr); if(httpProxy_port.is() && httpProxy_port->getLongValue()) { OUString httpPort = "http.proxyPort=" + OUString::number(httpProxy_port->getLongValue()); @@ -191,12 +191,12 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm, } // read https proxy name - css::uno::Reference<css::registry::XRegistryKey> httpsProxy_name = xRegistryRootKey->openKey("Settings/ooInetHTTPSProxyName"); + css::uno::Reference<css::registry::XRegistryKey> httpsProxy_name = xRegistryRootKey->openKey(u"Settings/ooInetHTTPSProxyName"_ustr); if(httpsProxy_name.is() && !httpsProxy_name->getStringValue().isEmpty()) { OUString httpsHost = "https.proxyHost=" + httpsProxy_name->getStringValue(); // read https proxy port - css::uno::Reference<css::registry::XRegistryKey> httpsProxy_port = xRegistryRootKey->openKey("Settings/ooInetHTTPSProxyPort"); + css::uno::Reference<css::registry::XRegistryKey> httpsProxy_port = xRegistryRootKey->openKey(u"Settings/ooInetHTTPSProxyPort"_ustr); if(httpsProxy_port.is() && httpsProxy_port->getLongValue()) { OUString httpsPort = "https.proxyPort=" + OUString::number(httpsProxy_port->getLongValue()); @@ -206,7 +206,7 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm, } // read nonProxyHosts - css::uno::Reference<css::registry::XRegistryKey> nonProxies_name = xRegistryRootKey->openKey("Settings/ooInetNoProxy"); + css::uno::Reference<css::registry::XRegistryKey> nonProxies_name = xRegistryRootKey->openKey(u"Settings/ooInetNoProxy"_ustr); if(nonProxies_name.is() && !nonProxies_name->getStringValue().isEmpty()) { OUString value = nonProxies_name->getStringValue(); // replace the separator ";" by "|" @@ -227,14 +227,14 @@ void getDefaultLocaleFromConfig( const css::uno::Reference<css::uno::XComponentContext> &xCtx ) { css::uno::Reference<css::uno::XInterface> xConfRegistry = - xSMgr->createInstanceWithContext( "com.sun.star.configuration.ConfigurationRegistry", xCtx ); + xSMgr->createInstanceWithContext( u"com.sun.star.configuration.ConfigurationRegistry"_ustr, xCtx ); if(!xConfRegistry.is()) throw css::uno::RuntimeException( - "javavm.cxx: couldn't get ConfigurationRegistry", nullptr); + u"javavm.cxx: couldn't get ConfigurationRegistry"_ustr, nullptr); css::uno::Reference<css::registry::XSimpleRegistry> xConfRegistry_simple( xConfRegistry, css::uno::UNO_QUERY_THROW); - xConfRegistry_simple->open("org.openoffice.Setup", true, false); + xConfRegistry_simple->open(u"org.openoffice.Setup"_ustr, true, false); css::uno::Reference<css::registry::XRegistryKey> xRegistryRootKey = xConfRegistry_simple->getRootKey(); // Since 1.7 Java knows DISPLAY and FORMAT locales, which match our UI and @@ -244,7 +244,7 @@ void getDefaultLocaleFromConfig( // https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html // Read UI language/locale. - css::uno::Reference<css::registry::XRegistryKey> xUILocale = xRegistryRootKey->openKey("L10N/ooLocale"); + css::uno::Reference<css::registry::XRegistryKey> xUILocale = xRegistryRootKey->openKey(u"L10N/ooLocale"_ustr); if(xUILocale.is() && !xUILocale->getStringValue().isEmpty()) { LanguageTag aLanguageTag( xUILocale->getStringValue()); OUString language; @@ -289,7 +289,7 @@ void getDefaultLocaleFromConfig( } // Read system locale. - css::uno::Reference<css::registry::XRegistryKey> xLocale = xRegistryRootKey->openKey("L10N/ooSetupSystemLocale"); + css::uno::Reference<css::registry::XRegistryKey> xLocale = xRegistryRootKey->openKey(u"L10N/ooSetupSystemLocale"_ustr); if(xLocale.is() && !xLocale->getStringValue().isEmpty()) { LanguageTag aLanguageTag( xLocale->getStringValue()); OUString language; @@ -328,23 +328,23 @@ void getJavaPropsFromSafetySettings( { css::uno::Reference<css::uno::XInterface> xConfRegistry = xSMgr->createInstanceWithContext( - "com.sun.star.configuration.ConfigurationRegistry", + u"com.sun.star.configuration.ConfigurationRegistry"_ustr, xCtx); if(!xConfRegistry.is()) throw css::uno::RuntimeException( - "javavm.cxx: couldn't get ConfigurationRegistry", nullptr); + u"javavm.cxx: couldn't get ConfigurationRegistry"_ustr, nullptr); css::uno::Reference<css::registry::XSimpleRegistry> xConfRegistry_simple( xConfRegistry, css::uno::UNO_QUERY_THROW); xConfRegistry_simple->open( - "org.openoffice.Office.Java", + u"org.openoffice.Office.Java"_ustr, true, false); css::uno::Reference<css::registry::XRegistryKey> xRegistryRootKey = xConfRegistry_simple->getRootKey(); if (xRegistryRootKey.is()) { - css::uno::Reference<css::registry::XRegistryKey> key_NetAccess= xRegistryRootKey->openKey("VirtualMachine/NetAccess"); + css::uno::Reference<css::registry::XRegistryKey> key_NetAccess= xRegistryRootKey->openKey(u"VirtualMachine/NetAccess"_ustr); if (key_NetAccess.is()) { sal_Int32 val= key_NetAccess->getLongValue(); @@ -362,11 +362,11 @@ void getJavaPropsFromSafetySettings( pjvm->pushProp(sProperty); } css::uno::Reference<css::registry::XRegistryKey> key_CheckSecurity= xRegistryRootKey->openKey( - "VirtualMachine/Security"); + u"VirtualMachine/Security"_ustr); if( key_CheckSecurity.is()) { bool val = static_cast<bool>(key_CheckSecurity->getLongValue()); - OUString sProperty("stardiv.security.disableSecurity="); + OUString sProperty(u"stardiv.security.disableSecurity="_ustr); if( val) sProperty += "false"; else @@ -399,7 +399,7 @@ void setTimeZone(stoc_javavm::JVM * pjvm) noexcept { #endif if (!strcmp(TIMEZONE, p)) - pjvm->pushProp("user.timezone=ECT"); + pjvm->pushProp(u"user.timezone=ECT"_ustr); } /// @throws css::uno::Exception @@ -438,7 +438,7 @@ void initVMConfiguration( // java-side force look and feel to something that doesn't // crash when we are using gtk3 if (getenv("STOC_FORCE_SYSTEM_LAF")) - pjvm->pushProp("swing.systemlaf=javax.swing.plaf.metal.MetalLookAndFeel"); + pjvm->pushProp(u"swing.systemlaf=javax.swing.plaf.metal.MetalLookAndFeel"_ustr); setTimeZone(pjvm); } @@ -487,10 +487,10 @@ JavaVirtualMachine::initialize(css::uno::Sequence< css::uno::Any > const & osl::MutexGuard aGuard(m_aMutex); if (m_bDisposed) throw css::lang::DisposedException( - "", getXWeak()); + u""_ustr, getXWeak()); if (m_xUnoVirtualMachine.is()) throw css::uno::RuntimeException( - "bad call to initialize", + u"bad call to initialize"_ustr, getXWeak()); css::beans::NamedValue val; if (rArguments.getLength() == 1 && (rArguments[0] >>= val) && val.Name == "UnoVirtualMachine" ) @@ -519,19 +519,19 @@ JavaVirtualMachine::initialize(css::uno::Sequence< css::uno::Any > const & } catch (jvmaccess::UnoVirtualMachine::CreationException &) { css::uno::Any anyEx = cppu::getCaughtException(); throw css::lang::WrappedTargetRuntimeException( - "jvmaccess::UnoVirtualMachine::CreationException", + u"jvmaccess::UnoVirtualMachine::CreationException"_ustr, getXWeak(), anyEx ); } } } if (!m_xUnoVirtualMachine.is()) { throw css::lang::IllegalArgumentException( - "sequence of exactly one any containing either (a) a" + u"sequence of exactly one any containing either (a) a" " com.sun.star.beans.NamedValue with Name" " \"UnoVirtualMachine\" and Value a hyper representing a" " non-null pointer to a jvmaccess:UnoVirtualMachine, or (b)" " a hyper representing a non-null pointer to a" - " jvmaccess::VirtualMachine required", + " jvmaccess::VirtualMachine required"_ustr, getXWeak(), 0); } m_xVirtualMachine = m_xUnoVirtualMachine->getVirtualMachine(); @@ -539,7 +539,7 @@ JavaVirtualMachine::initialize(css::uno::Sequence< css::uno::Any > const & OUString SAL_CALL JavaVirtualMachine::getImplementationName() { - return "com.sun.star.comp.stoc.JavaVirtualMachine"; + return u"com.sun.star.comp.stoc.JavaVirtualMachine"_ustr; } sal_Bool SAL_CALL @@ -551,7 +551,7 @@ JavaVirtualMachine::supportsService(OUString const & rServiceName) css::uno::Sequence< OUString > SAL_CALL JavaVirtualMachine::getSupportedServiceNames() { - return { "com.sun.star.java.JavaVirtualMachine" }; + return { u"com.sun.star.java.JavaVirtualMachine"_ustr }; } css::uno::Any SAL_CALL @@ -560,7 +560,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) osl::MutexGuard aGuard(m_aMutex); if (m_bDisposed) throw css::lang::DisposedException( - "", getXWeak()); + u""_ustr, getXWeak()); css::uno::Sequence< sal_Int8 > aId(16); rtl_getGlobalProcessId(reinterpret_cast< sal_uInt8 * >(aId.getArray())); enum ReturnType { @@ -624,8 +624,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) //%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. //Please install a JRE and restart %PRODUCTNAME. css::java::JavaNotFoundException exc( - "JavaVirtualMachine::getJavaVM failed because" - " No suitable JRE found!", + u"JavaVirtualMachine::getJavaVM failed because" + " No suitable JRE found!"_ustr, getXWeak()); askForRetry(css::uno::Any(exc)); return css::uno::Any(); @@ -645,8 +645,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) // - Options - %PRODUCTNAME - Java, select the Java runtime environment // you want to have used by %PRODUCTNAME. css::java::InvalidJavaSettingsException exc( - "JavaVirtualMachine::getJavaVM failed because" - " Java settings have changed!", + u"JavaVirtualMachine::getJavaVM failed because" + " Java settings have changed!"_ustr, getXWeak()); askForRetry(css::uno::Any(exc)); return css::uno::Any(); @@ -658,7 +658,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) //this task. However, use of a JRE has been disabled. Do you want to //enable the use of a JRE now? css::java::JavaDisabledException exc( - "JavaVirtualMachine::getJavaVM failed because Java is disabled!", + u"JavaVirtualMachine::getJavaVM failed because Java is disabled!"_ustr, getXWeak()); if( ! askForRetry(css::uno::Any(exc))) return css::uno::Any(); @@ -695,7 +695,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) //is defective. Please select another version or install a new JRE //and select it under Tools - Options - %PRODUCTNAME - Java. css::java::JavaVMCreationFailureException exc( - "JavaVirtualMachine::getJavaVM failed because Java is defective!", + u"JavaVirtualMachine::getJavaVM failed because Java is defective!"_ustr, getXWeak(), 0); askForRetry(css::uno::Any(exc)); return css::uno::Any(); @@ -712,8 +712,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) //For the selected Java runtime environment to work properly, //%PRODUCTNAME must be restarted. Please restart %PRODUCTNAME now. css::java::RestartRequiredException exc( - "JavaVirtualMachine::getJavaVM failed because " - "Office must be restarted before Java can be used!", + u"JavaVirtualMachine::getJavaVM failed because " + "Office must be restarted before Java can be used!"_ustr, getXWeak()); askForRetry(css::uno::Any(exc)); return css::uno::Any(); @@ -722,8 +722,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) //RuntimeException: error is somewhere in the java framework. //An unexpected error occurred throw css::uno::RuntimeException( - "[JavaVirtualMachine]:An unexpected error occurred" - " while starting Java!", nullptr); + u"[JavaVirtualMachine]:An unexpected error occurred" + " while starting Java!"_ustr, nullptr); } if (bStarted) @@ -751,7 +751,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) } catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &) { css::uno::Any anyEx = cppu::getCaughtException(); throw css::lang::WrappedTargetRuntimeException( - "jvmaccess::VirtualMachine::AttachGuard::CreationException occurred", + u"jvmaccess::VirtualMachine::AttachGuard::CreationException occurred"_ustr, getXWeak(), anyEx ); } } @@ -759,8 +759,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) default: // RETURN_JAVAVM if (m_pJavaVm == nullptr) { throw css::uno::RuntimeException( - "JavaVirtualMachine service was initialized in a way" - " that the requested JavaVM pointer is not available", + u"JavaVirtualMachine service was initialized in a way" + " that the requested JavaVM pointer is not available"_ustr, getXWeak()); } return css::uno::Any(reinterpret_cast< sal_IntPtr >(m_pJavaVm)); @@ -821,10 +821,10 @@ void SAL_CALL JavaVirtualMachine::registerThread() osl::MutexGuard aGuard(m_aMutex); if (m_bDisposed) throw css::lang::DisposedException( - "", getXWeak()); + u""_ustr, getXWeak()); if (!m_xUnoVirtualMachine.is()) throw css::uno::RuntimeException( - "JavaVirtualMachine::registerThread: null VirtualMachine", + u"JavaVirtualMachine::registerThread: null VirtualMachine"_ustr, getXWeak()); GuardStack * pStack = static_cast< GuardStack * >(m_aAttachGuards.getData()); @@ -843,8 +843,8 @@ void SAL_CALL JavaVirtualMachine::registerThread() { css::uno::Any anyEx = cppu::getCaughtException(); throw css::lang::WrappedTargetRuntimeException( - "JavaVirtualMachine::registerThread: jvmaccess::" - "VirtualMachine::AttachGuard::CreationException", + u"JavaVirtualMachine::registerThread: jvmaccess::" + "VirtualMachine::AttachGuard::CreationException"_ustr, getXWeak(), anyEx ); } } @@ -854,16 +854,16 @@ void SAL_CALL JavaVirtualMachine::revokeThread() osl::MutexGuard aGuard(m_aMutex); if (m_bDisposed) throw css::lang::DisposedException( - "", getXWeak()); + u""_ustr, getXWeak()); if (!m_xUnoVirtualMachine.is()) throw css::uno::RuntimeException( - "JavaVirtualMachine::revokeThread: null VirtualMachine", + u"JavaVirtualMachine::revokeThread: null VirtualMachine"_ustr, getXWeak()); GuardStack * pStack = static_cast< GuardStack * >(m_aAttachGuards.getData()); if (pStack == nullptr || pStack->empty()) throw css::uno::RuntimeException( - "JavaVirtualMachine::revokeThread: no matching registerThread", + u"JavaVirtualMachine::revokeThread: no matching registerThread"_ustr, getXWeak()); delete pStack->top(); pStack->pop(); @@ -1000,12 +1000,12 @@ void SAL_CALL JavaVirtualMachine::elementReplaced( // call java.lang.System.setProperty // String setProperty( String key, String value) jclass jcSystem= pJNIEnv->FindClass("java/lang/System"); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:FindClass java/lang/System", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:FindClass java/lang/System"_ustr, nullptr); jmethodID jmSetProps= pJNIEnv->GetStaticMethodID( jcSystem, "setProperty","(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:GetStaticMethodID java.lang.System.setProperty", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:GetStaticMethodID java.lang.System.setProperty"_ustr, nullptr); jstring jsPropName= pJNIEnv->NewString( reinterpret_cast<jchar const *>(aPropertyName.getStr()), aPropertyName.getLength()); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:NewString", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:NewString"_ustr, nullptr); // remove the property if it does not have a value ( user left the dialog field empty) // or if the port is set to 0 @@ -1016,23 +1016,23 @@ void SAL_CALL JavaVirtualMachine::elementReplaced( { // call java.lang.System.getProperties jmethodID jmGetProps= pJNIEnv->GetStaticMethodID( jcSystem, "getProperties","()Ljava/util/Properties;"); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:GetStaticMethodID java.lang.System.getProperties", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:GetStaticMethodID java.lang.System.getProperties"_ustr, nullptr); jobject joProperties= pJNIEnv->CallStaticObjectMethod( jcSystem, jmGetProps); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:CallStaticObjectMethod java.lang.System.getProperties", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:CallStaticObjectMethod java.lang.System.getProperties"_ustr, nullptr); // call java.util.Properties.remove jclass jcProperties= pJNIEnv->FindClass("java/util/Properties"); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:FindClass java/util/Properties", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:FindClass java/util/Properties"_ustr, nullptr); jmethodID jmRemove= pJNIEnv->GetMethodID( jcProperties, "remove", "(Ljava/lang/Object;)Ljava/lang/Object;"); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:GetMethodID java.util.Properties.remove", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:GetMethodID java.util.Properties.remove"_ustr, nullptr); pJNIEnv->CallObjectMethod( joProperties, jmRemove, jsPropName); } else { // Change the Value of the property jstring jsPropValue= pJNIEnv->NewString( reinterpret_cast<jchar const *>(aPropertyValue.getStr()), aPropertyValue.getLength()); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:NewString", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:NewString"_ustr, nullptr); pJNIEnv->CallStaticObjectMethod( jcSystem, jmSetProps, jsPropName, jsPropValue); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:CallStaticObjectMethod java.lang.System.setProperty", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:CallStaticObjectMethod java.lang.System.setProperty"_ustr, nullptr); } // If the settings for Security and NetAccess changed then we have to notify the SandboxSecurity @@ -1041,7 +1041,7 @@ void SAL_CALL JavaVirtualMachine::elementReplaced( if (bSecurityChanged) { jmethodID jmGetSecur= pJNIEnv->GetStaticMethodID( jcSystem,"getSecurityManager","()Ljava/lang/SecurityManager;"); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:GetStaticMethodID java.lang.System.getSecurityManager", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:GetStaticMethodID java.lang.System.getSecurityManager"_ustr, nullptr); jobject joSecur= pJNIEnv->CallStaticObjectMethod( jcSystem, jmGetSecur); if (joSecur != nullptr) { @@ -1055,9 +1055,9 @@ void SAL_CALL JavaVirtualMachine::elementReplaced( // The SecurityManagers class Name must be com.sun.star.lib.sandbox.SandboxSecurity jclass jcSec= pJNIEnv->GetObjectClass( joSecur); jclass jcClass= pJNIEnv->FindClass("java/lang/Class"); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:FindClass java.lang.Class", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:FindClass java.lang.Class"_ustr, nullptr); jmethodID jmName= pJNIEnv->GetMethodID( jcClass,"getName","()Ljava/lang/String;"); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:GetMethodID java.lang.Class.getName", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:GetMethodID java.lang.Class.getName"_ustr, nullptr); jstring jsClass= static_cast<jstring>(pJNIEnv->CallObjectMethod( jcSec, jmName)); const jchar* jcharName= pJNIEnv->GetStringChars( jsClass, nullptr); OUString sName(reinterpret_cast<sal_Unicode const *>(jcharName)); @@ -1069,9 +1069,9 @@ void SAL_CALL JavaVirtualMachine::elementReplaced( { // call SandboxSecurity.reset jmethodID jmReset= pJNIEnv->GetMethodID( jcSec,"reset","()V"); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:GetMethodID com.sun.star.lib.sandbox.SandboxSecurity.reset", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:GetMethodID com.sun.star.lib.sandbox.SandboxSecurity.reset"_ustr, nullptr); pJNIEnv->CallVoidMethod( joSecur, jmReset); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:CallVoidMethod com.sun.star.lib.sandbox.SandboxSecurity.reset", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:CallVoidMethod com.sun.star.lib.sandbox.SandboxSecurity.reset"_ustr, nullptr); } } } @@ -1080,7 +1080,7 @@ void SAL_CALL JavaVirtualMachine::elementReplaced( { css::uno::Any anyEx = cppu::getCaughtException(); throw css::lang::WrappedTargetRuntimeException( - "jvmaccess::VirtualMachine::AttachGuard::CreationException", + u"jvmaccess::VirtualMachine::AttachGuard::CreationException"_ustr, getXWeak(), anyEx ); } } @@ -1139,7 +1139,7 @@ void JavaVirtualMachine::registerConfigChangesListener() { css::uno::Reference< css::lang::XMultiServiceFactory > xConfigProvider( m_xContext->getValueByName( - "/singletons/com.sun.star.configuration.theDefaultProvider"), + u"/singletons/com.sun.star.configuration.theDefaultProvider"_ustr), css::uno::UNO_QUERY); if (xConfigProvider.is()) @@ -1148,12 +1148,12 @@ void JavaVirtualMachine::registerConfigChangesListener() // arguments for ConfigurationAccess css::uno::Sequence<css::uno::Any> aArguments(comphelper::InitAnyPropertySequence( { - {"nodepath", css::uno::Any(OUString("org.openoffice.Inet/Settings"))}, + {"nodepath", css::uno::Any(u"org.openoffice.Inet/Settings"_ustr)}, {"depth", css::uno::Any(sal_Int32(-1))} })); m_xInetConfiguration.set( xConfigProvider->createInstanceWithArguments( - "com.sun.star.configuration.ConfigurationAccess", + u"com.sun.star.configuration.ConfigurationAccess"_ustr, aArguments), css::uno::UNO_QUERY); @@ -1163,12 +1163,12 @@ void JavaVirtualMachine::registerConfigChangesListener() // now register as listener to changes in org.openoffice.Java/VirtualMachine css::uno::Sequence<css::uno::Any> aArguments2(comphelper::InitAnyPropertySequence( { - {"nodepath", css::uno::Any(OUString("org.openoffice.Office.Java/VirtualMachine"))}, + {"nodepath", css::uno::Any(u"org.openoffice.Office.Java/VirtualMachine"_ustr)}, {"depth", css::uno::Any(sal_Int32(-1))} // depth: -1 means unlimited })); m_xJavaConfiguration.set( xConfigProvider->createInstanceWithArguments( - "com.sun.star.configuration.ConfigurationAccess", + u"com.sun.star.configuration.ConfigurationAccess"_ustr, aArguments2), css::uno::UNO_QUERY); @@ -1195,32 +1195,32 @@ void JavaVirtualMachine::setINetSettingsInVM(bool set_reset) JNIEnv * pJNIEnv = aAttachGuard.getEnvironment(); // The Java Properties - OUString sHttpProxyHost("http.proxyHost"); - OUString sHttpProxyPort("http.proxyPort"); - OUString sHttpNonProxyHosts("http.nonProxyHosts"); + OUString sHttpProxyHost(u"http.proxyHost"_ustr); + OUString sHttpProxyPort(u"http.proxyPort"_ustr); + OUString sHttpNonProxyHosts(u"http.nonProxyHosts"_ustr); // create Java Properties as JNI strings jstring jsHttpProxyHost= pJNIEnv->NewString( reinterpret_cast<jchar const *>(sHttpProxyHost.getStr()), sHttpProxyHost.getLength()); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:NewString", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:NewString"_ustr, nullptr); jstring jsHttpProxyPort= pJNIEnv->NewString( reinterpret_cast<jchar const *>(sHttpProxyPort.getStr()), sHttpProxyPort.getLength()); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:NewString", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:NewString"_ustr, nullptr); jstring jsHttpNonProxyHosts= pJNIEnv->NewString( reinterpret_cast<jchar const *>(sHttpNonProxyHosts.getStr()), sHttpNonProxyHosts.getLength()); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:NewString", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:NewString"_ustr, nullptr); // prepare java.lang.System.setProperty jclass jcSystem= pJNIEnv->FindClass("java/lang/System"); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:FindClass java/lang/System", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:FindClass java/lang/System"_ustr, nullptr); jmethodID jmSetProps= pJNIEnv->GetStaticMethodID( jcSystem, "setProperty","(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:GetStaticMethodID java.lang.System.setProperty", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:GetStaticMethodID java.lang.System.setProperty"_ustr, nullptr); // call java.lang.System.getProperties jmethodID jmGetProps= pJNIEnv->GetStaticMethodID( jcSystem, "getProperties","()Ljava/util/Properties;"); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:GetStaticMethodID java.lang.System.getProperties", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:GetStaticMethodID java.lang.System.getProperties"_ustr, nullptr); jobject joProperties= pJNIEnv->CallStaticObjectMethod( jcSystem, jmGetProps); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:CallStaticObjectMethod java.lang.System.getProperties", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:CallStaticObjectMethod java.lang.System.getProperties"_ustr, nullptr); // prepare java.util.Properties.remove jclass jcProperties= pJNIEnv->FindClass("java/util/Properties"); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:FindClass java/util/Properties", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:FindClass java/util/Properties"_ustr, nullptr); if (set_reset) { @@ -1238,23 +1238,23 @@ void JavaVirtualMachine::setINetSettingsInVM(bool set_reset) if (propName == sHttpProxyHost) { jstring jsVal= pJNIEnv->NewString( reinterpret_cast<jchar const *>(propValue.getStr()), propValue.getLength()); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:NewString", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:NewString"_ustr, nullptr); pJNIEnv->CallStaticObjectMethod( jcSystem, jmSetProps, jsHttpProxyHost, jsVal); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:CallStaticObjectMethod java.lang.System.setProperty", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:CallStaticObjectMethod java.lang.System.setProperty"_ustr, nullptr); } else if( propName == sHttpProxyPort) { jstring jsVal= pJNIEnv->NewString( reinterpret_cast<jchar const *>(propValue.getStr()), propValue.getLength()); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:NewString", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:NewString"_ustr, nullptr); pJNIEnv->CallStaticObjectMethod( jcSystem, jmSetProps, jsHttpProxyPort, jsVal); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:CallStaticObjectMethod java.lang.System.setProperty", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:CallStaticObjectMethod java.lang.System.setProperty"_ustr, nullptr); } else if( propName == sHttpNonProxyHosts) { jstring jsVal= pJNIEnv->NewString( reinterpret_cast<jchar const *>(propValue.getStr()), propValue.getLength()); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:NewString", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:NewString"_ustr, nullptr); pJNIEnv->CallStaticObjectMethod( jcSystem, jmSetProps, jsHttpNonProxyHosts, jsVal); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:CallStaticObjectMethod java.lang.System.setProperty", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:CallStaticObjectMethod java.lang.System.setProperty"_ustr, nullptr); } } } @@ -1262,7 +1262,7 @@ void JavaVirtualMachine::setINetSettingsInVM(bool set_reset) { // call java.util.Properties.remove jmethodID jmRemove= pJNIEnv->GetMethodID( jcProperties, "remove", "(Ljava/lang/Object;)Ljava/lang/Object;"); - if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException("JNI:GetMethodID java.util.Property.remove", nullptr); + if(pJNIEnv->ExceptionOccurred()) throw css::uno::RuntimeException(u"JNI:GetMethodID java.util.Property.remove"_ustr, nullptr); pJNIEnv->CallObjectMethod( joProperties, jmRemove, jsHttpProxyHost); pJNIEnv->CallObjectMethod( joProperties, jmRemove, jsHttpProxyPort); pJNIEnv->CallObjectMethod( joProperties, jmRemove, jsHttpNonProxyHosts); @@ -1283,16 +1283,16 @@ void JavaVirtualMachine::setUpUnoVirtualMachine(JNIEnv * environment) { css::uno::Reference< css::util::XMacroExpander > exp = css::util::theMacroExpander::get(m_xContext); OUString baseUrl; try { - baseUrl = exp->expandMacros("$URE_INTERNAL_JAVA_DIR/"); + baseUrl = exp->expandMacros(u"$URE_INTERNAL_JAVA_DIR/"_ustr); } catch (css::lang::IllegalArgumentException &) { css::uno::Any anyEx = cppu::getCaughtException(); throw css::lang::WrappedTargetRuntimeException( - "css::lang::IllegalArgumentException", + u"css::lang::IllegalArgumentException"_ustr, getXWeak(), anyEx ); } OUString classPath; try { - classPath = exp->expandMacros("$URE_INTERNAL_JAVA_CLASSPATH"); + classPath = exp->expandMacros(u"$URE_INTERNAL_JAVA_CLASSPATH"_ustr); } catch (css::lang::IllegalArgumentException &) {} jclass class_URLClassLoader = environment->FindClass( "java/net/URLClassLoader"); @@ -1388,7 +1388,7 @@ void JavaVirtualMachine::setUpUnoVirtualMachine(JNIEnv * environment) { } catch (jvmaccess::UnoVirtualMachine::CreationException &) { css::uno::Any anyEx = cppu::getCaughtException(); throw css::lang::WrappedTargetRuntimeException( - "jvmaccess::UnoVirtualMachine::CreationException", + u"jvmaccess::UnoVirtualMachine::CreationException"_ustr, getXWeak(), anyEx ); } } @@ -1400,7 +1400,7 @@ void JavaVirtualMachine::handleJniException(JNIEnv * environment) { environment->ExceptionClear(); #endif throw css::uno::RuntimeException( - "JNI exception occurred", + u"JNI exception occurred"_ustr, getXWeak()); } diff --git a/stoc/source/loader/dllcomponentloader.cxx b/stoc/source/loader/dllcomponentloader.cxx index b32e833214c6..83082d2f2c8c 100644 --- a/stoc/source/loader/dllcomponentloader.cxx +++ b/stoc/source/loader/dllcomponentloader.cxx @@ -75,7 +75,7 @@ DllComponentLoader::DllComponentLoader( const Reference<XComponentContext> & xCt OUString SAL_CALL DllComponentLoader::getImplementationName( ) { - return "com.sun.star.comp.stoc.DLLComponentLoader"; + return u"com.sun.star.comp.stoc.DLLComponentLoader"_ustr; } sal_Bool SAL_CALL DllComponentLoader::supportsService( const OUString& ServiceName ) @@ -85,7 +85,7 @@ sal_Bool SAL_CALL DllComponentLoader::supportsService( const OUString& ServiceNa Sequence<OUString> SAL_CALL DllComponentLoader::getSupportedServiceNames( ) { - return { "com.sun.star.loader.SharedLibrary" }; + return { u"com.sun.star.loader.SharedLibrary"_ustr }; } diff --git a/stoc/source/namingservice/namingservice.cxx b/stoc/source/namingservice/namingservice.cxx index 0013f7455ad1..5040b1f88b55 100644 --- a/stoc/source/namingservice/namingservice.cxx +++ b/stoc/source/namingservice/namingservice.cxx @@ -69,7 +69,7 @@ NamingService_Impl::NamingService_Impl() {} // XServiceInfo OUString NamingService_Impl::getImplementationName() { - return "com.sun.star.comp.stoc.NamingService"; + return u"com.sun.star.comp.stoc.NamingService"_ustr; } // XServiceInfo @@ -81,7 +81,7 @@ sal_Bool NamingService_Impl::supportsService( const OUString & rServiceName ) // XServiceInfo Sequence< OUString > NamingService_Impl::getSupportedServiceNames() { - return { "com.sun.star.uno.NamingService" }; + return { u"com.sun.star.uno.NamingService"_ustr }; } // XServiceInfo diff --git a/stoc/source/proxy_factory/proxyfac.cxx b/stoc/source/proxy_factory/proxyfac.cxx index a22bcc3fcafe..2a0ac98fe297 100644 --- a/stoc/source/proxy_factory/proxyfac.cxx +++ b/stoc/source/proxy_factory/proxyfac.cxx @@ -351,7 +351,7 @@ Any ProxyRoot::queryAggregation( Type const & rType ) FactoryImpl::FactoryImpl() { - OUString uno = UNO_LB_UNO; + OUString uno = u"" UNO_LB_UNO ""_ustr; OUString cpp = CPPU_CURRENT_LANGUAGE_BINDING_NAME; uno_getEnvironment( @@ -385,7 +385,7 @@ Reference< XAggregation > FactoryImpl::createProxy( OUString FactoryImpl::getImplementationName() { - return "com.sun.star.comp.reflection.ProxyFactory"; + return u"com.sun.star.comp.reflection.ProxyFactory"_ustr; } sal_Bool FactoryImpl::supportsService( const OUString & rServiceName ) @@ -395,7 +395,7 @@ sal_Bool FactoryImpl::supportsService( const OUString & rServiceName ) Sequence< OUString > FactoryImpl::getSupportedServiceNames() { - return { "com.sun.star.reflection.ProxyFactory" }; + return { u"com.sun.star.reflection.ProxyFactory"_ustr }; } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx index 63f5ca10137b..e6ab2b45bd54 100644 --- a/stoc/source/security/access_controller.cxx +++ b/stoc/source/security/access_controller.cxx @@ -413,14 +413,14 @@ void AccessController::initialize( if (Mode::SingleUser != m_mode) // only if in single-user mode { throw RuntimeException( - "invalid call: ac must be in \"single-user\" mode!", getXWeak() ); + u"invalid call: ac must be in \"single-user\" mode!"_ustr, getXWeak() ); } OUString userId; arguments[ 0 ] >>= userId; if ( userId.isEmpty() ) { throw RuntimeException( - "expected a user-id as first argument!", getXWeak() ); + u"expected a user-id as first argument!"_ustr, getXWeak() ); } // assured that no sync is necessary: no check happens at this forking time m_singleUserId = userId; @@ -435,11 +435,11 @@ Reference< security::XPolicy > const & AccessController::getPolicy() { Reference< security::XPolicy > xPolicy; m_xComponentContext->getValueByName( - "/singletons/com.sun.star.security.thePolicy" ) >>= xPolicy; + u"/singletons/com.sun.star.security.thePolicy"_ustr ) >>= xPolicy; if (!xPolicy.is()) { throw SecurityException( - "cannot get policy singleton!", getXWeak() ); + u"cannot get policy singleton!"_ustr, getXWeak() ); } MutexGuard guard( m_aMutex ); @@ -576,7 +576,7 @@ PermissionCollection AccessController::getEffectivePermissions( if ( userId.isEmpty() ) { throw SecurityException( - "cannot determine current user in multi-user ac!", getXWeak() ); + u"cannot determine current user in multi-user ac!"_ustr, getXWeak() ); } // lookup policy for user @@ -721,7 +721,7 @@ void AccessController::checkPermission( if (rBHelper.bDisposed) { throw lang::DisposedException( - "checkPermission() call on disposed AccessController!", getXWeak() ); + u"checkPermission() call on disposed AccessController!"_ustr, getXWeak() ); } if (Mode::Off == m_mode) @@ -750,7 +750,7 @@ Any AccessController::doRestricted( if (rBHelper.bDisposed) { throw lang::DisposedException( - "doRestricted() call on disposed AccessController!", getXWeak() ); + u"doRestricted() call on disposed AccessController!"_ustr, getXWeak() ); } if (Mode::Off == m_mode) // optimize this way, because no dynamic check will be performed @@ -782,7 +782,7 @@ Any AccessController::doPrivileged( if (rBHelper.bDisposed) { throw lang::DisposedException( - "doPrivileged() call on disposed AccessController!", getXWeak() ); + u"doPrivileged() call on disposed AccessController!"_ustr, getXWeak() ); } if (Mode::Off == m_mode) // no dynamic check will be performed @@ -816,7 +816,7 @@ Reference< security::XAccessControlContext > AccessController::getContext() if (rBHelper.bDisposed) { throw lang::DisposedException( - "getContext() call on disposed AccessController!", getXWeak() ); + u"getContext() call on disposed AccessController!"_ustr, getXWeak() ); } if (Mode::Off == m_mode) // optimize this way, because no dynamic check will be performed @@ -836,7 +836,7 @@ Reference< security::XAccessControlContext > AccessController::getContext() OUString AccessController::getImplementationName() { - return "com.sun.star.security.comp.stoc.AccessController"; + return u"com.sun.star.security.comp.stoc.AccessController"_ustr; } sal_Bool AccessController::supportsService( OUString const & serviceName ) diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx index 63d0c6156e50..b25d24854949 100644 --- a/stoc/source/security/file_policy.cxx +++ b/stoc/source/security/file_policy.cxx @@ -335,7 +335,7 @@ PolicyReader::PolicyReader( OUString fileName, AccessControl & ac ) , m_pos( 1 ) // force readline , m_back( '\0' ) { - ac.checkFilePermission( m_fileName, "read" ); + ac.checkFilePermission( m_fileName, u"read"_ustr ); if (osl_File_E_None != ::osl_openFile( m_fileName.pData, &m_file, osl_File_OpenFlag_Read )) { throw RuntimeException( "cannot open file \"" + m_fileName + "\"!" ); @@ -373,7 +373,7 @@ void FilePolicy::refresh() if ( fileName.isEmpty() ) { throw RuntimeException( - "name of policy file unknown!", + u"name of policy file unknown!"_ustr, getXWeak() ); } @@ -478,7 +478,7 @@ sal_Bool FilePolicy::supportsService( OUString const & serviceName ) Sequence< OUString > FilePolicy::getSupportedServiceNames() { - return { "com.sun.star.security.Policy" }; + return { u"com.sun.star.security.Policy"_ustr }; } } // namespace diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx index 033d608e90b0..77da8459987b 100644 --- a/stoc/source/security/permissions.cxx +++ b/stoc/source/security/permissions.cxx @@ -444,7 +444,7 @@ bool AllPermission::implies( Permission const & ) const OUString AllPermission::toString() const { - return "com.sun.star.security.AllPermission"; + return u"com.sun.star.security.AllPermission"_ustr; } diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx index a17b9c1d9f43..b43b8c1fb1f4 100644 --- a/stoc/source/servicemanager/servicemanager.cxx +++ b/stoc/source/servicemanager/servicemanager.cxx @@ -155,7 +155,7 @@ Any ServiceEnumeration_Impl::nextElement() { std::scoped_lock aGuard( aMutex ); if( nIt == aFactories.getLength() ) - throw NoSuchElementException("no more elements"); + throw NoSuchElementException(u"no more elements"_ustr); return Any( &aFactories[nIt++], cppu::UnoType<XInterface>::get()); } @@ -232,7 +232,7 @@ Any ImplementationEnumeration_Impl::nextElement() { std::scoped_lock aGuard( aMutex ); if( aIt == aImplementationMap.end() ) - throw NoSuchElementException("no more elements"); + throw NoSuchElementException(u"no more elements"_ustr); Any ret( &(*aIt), cppu::UnoType<XInterface>::get()); ++aIt; @@ -411,7 +411,7 @@ void OServiceManager::check_undisposed() const if (is_disposed()) { throw lang::DisposedException( - "service manager instance has already been disposed!", + u"service manager instance has already been disposed!"_ustr, const_cast<OServiceManager *>(this)->getXWeak() ); } } @@ -431,7 +431,7 @@ class OServiceManagerWrapper : public cppu::BaseMutex, public t_OServiceManagerW if (! m_root.is()) { throw lang::DisposedException( - "service manager instance has already been disposed!" ); + u"service manager instance has already been disposed!"_ustr ); } return m_root; } @@ -520,7 +520,7 @@ void SAL_CALL OServiceManagerWrapper::setPropertyValue( if (!(aValue >>= xContext)) { throw IllegalArgumentException( - "no XComponentContext given!", + u"no XComponentContext given!"_ustr, getXWeak(), 1 ); } @@ -568,7 +568,7 @@ OServiceManagerWrapper::OServiceManagerWrapper( if (! m_root.is()) { throw RuntimeException( - "no service manager to wrap" ); + u"no service manager to wrap"_ustr ); } } @@ -638,7 +638,7 @@ Reference<XPropertySetInfo > OServiceManager::getPropertySetInfo() if (! m_xPropertyInfo.is()) { Sequence< beans::Property > seq{ beans::Property( - "DefaultContext", -1, cppu::UnoType<decltype(m_xContext)>::get(), 0 ) }; + u"DefaultContext"_ustr, -1, cppu::UnoType<decltype(m_xContext)>::get(), 0 ) }; Reference< beans::XPropertySetInfo > xInfo( new PropertySetInfo_Impl( seq ) ); MutexGuard aGuard( m_aMutex ); @@ -665,7 +665,7 @@ void OServiceManager::setPropertyValue( if (!(aValue >>= xContext)) { throw IllegalArgumentException( - "no XComponentContext given!", + u"no XComponentContext given!"_ustr, getXWeak(), 1 ); } @@ -695,28 +695,28 @@ void OServiceManager::addPropertyChangeListener( const OUString&, const Reference<XPropertyChangeListener >&) { check_undisposed(); - throw UnknownPropertyException("unsupported"); + throw UnknownPropertyException(u"unsupported"_ustr); } void OServiceManager::removePropertyChangeListener( const OUString&, const Reference<XPropertyChangeListener >&) { check_undisposed(); - throw UnknownPropertyException("unsupported"); + throw UnknownPropertyException(u"unsupported"_ustr); } void OServiceManager::addVetoableChangeListener( const OUString&, const Reference<XVetoableChangeListener >&) { check_undisposed(); - throw UnknownPropertyException("unsupported"); + throw UnknownPropertyException(u"unsupported"_ustr); } void OServiceManager::removeVetoableChangeListener( const OUString&, const Reference<XVetoableChangeListener >&) { check_undisposed(); - throw UnknownPropertyException("unsupported"); + throw UnknownPropertyException(u"unsupported"_ustr); } // OServiceManager @@ -760,7 +760,7 @@ Reference< XInterface > OServiceManager::createInstanceWithContext( if (xProps.is()) { Reference< XComponentContext > xDefContext; - xProps->getPropertyValue( "DefaultContext" ) >>= xDefContext; + xProps->getPropertyValue( u"DefaultContext"_ustr ) >>= xDefContext; OSL_ENSURE( xContext == xDefContext, "### default context of service manager singleton differs from context holding it!" ); @@ -812,7 +812,7 @@ Reference< XInterface > OServiceManager::createInstanceWithArgumentsAndContext( if (xProps.is()) { Reference< XComponentContext > xDefContext; - xProps->getPropertyValue( "DefaultContext" ) >>= xDefContext; + xProps->getPropertyValue( u"DefaultContext"_ustr ) >>= xDefContext; OSL_ENSURE( xContext == xDefContext, "### default context of service manager singleton differs from context holding it!" ); @@ -888,7 +888,7 @@ void OServiceManager::initialize( Sequence< Any > const & ) // XServiceInfo OUString OServiceManager::getImplementationName() { - return "com.sun.star.comp.stoc.OServiceManager"; + return u"com.sun.star.comp.stoc.OServiceManager"_ustr; } // XServiceInfo @@ -900,7 +900,7 @@ sal_Bool OServiceManager::supportsService(const OUString& ServiceName) // XServiceInfo Sequence< OUString > OServiceManager::getSupportedServiceNames() { - return { "com.sun.star.lang.MultiServiceFactory", "com.sun.star.lang.ServiceManager" }; + return { u"com.sun.star.lang.MultiServiceFactory"_ustr, u"com.sun.star.lang.ServiceManager"_ustr }; } @@ -1014,7 +1014,7 @@ void OServiceManager::insert( const Any & Element ) HashSet_Ref::iterator aIt = m_ImplementationMap.find( xEle ); if( aIt != m_ImplementationMap.end() ) { - throw ElementExistException( "element already exists!" ); + throw ElementExistException( u"element already exists!"_ustr ); } // put into the implementation hashmap @@ -1090,7 +1090,7 @@ void OServiceManager::remove( const Any & Element ) if( aIt == m_ImplementationMap.end() ) { throw NoSuchElementException( - "element not found", + u"element not found"_ustr, getXWeak() ); } //First remove all factories which have been loaded by ORegistryServiceManager. @@ -1144,7 +1144,7 @@ public: // XServiceInfo OUString SAL_CALL getImplementationName() override - { return "com.sun.star.comp.stoc.ORegistryServiceManager"; } + { return u"com.sun.star.comp.stoc.ORegistryServiceManager"_ustr; } Sequence< OUString > SAL_CALL getSupportedServiceNames() override; @@ -1228,7 +1228,7 @@ Reference<XRegistryKey > ORegistryServiceManager::getRootKey() m_xRegistry.set( createInstanceWithContext( - "com.sun.star.registry.DefaultRegistry", + u"com.sun.star.registry.DefaultRegistry"_ustr, m_xContext ), UNO_QUERY ); } @@ -1316,7 +1316,7 @@ void ORegistryServiceManager::fillAllNamesFromRegistry( HashSet_OWString & rSet try { - Reference<XRegistryKey > xServicesKey = xRootKey->openKey( "SERVICES" ); + Reference<XRegistryKey > xServicesKey = xRootKey->openKey( u"SERVICES"_ustr ); // root + /Services + / if( xServicesKey.is() ) { @@ -1366,7 +1366,7 @@ Sequence< OUString > ORegistryServiceManager::getAvailableServiceNames() // XServiceInfo Sequence< OUString > ORegistryServiceManager::getSupportedServiceNames() { - return { "com.sun.star.lang.MultiServiceFactory", "com.sun.star.lang.RegistryServiceManager" }; + return { u"com.sun.star.lang.MultiServiceFactory"_ustr, u"com.sun.star.lang.RegistryServiceManager"_ustr }; } @@ -1417,8 +1417,8 @@ Reference<XPropertySetInfo > ORegistryServiceManager::getPropertySetInfo() if (! m_xPropertyInfo.is()) { Sequence< beans::Property > seq{ - beans::Property("DefaultContext", -1, cppu::UnoType<decltype(m_xContext)>::get(), 0), - beans::Property("Registry", -1, cppu::UnoType<decltype(m_xRegistry)>::get(), + beans::Property(u"DefaultContext"_ustr, -1, cppu::UnoType<decltype(m_xContext)>::get(), 0), + beans::Property(u"Registry"_ustr, -1, cppu::UnoType<decltype(m_xRegistry)>::get(), beans::PropertyAttribute::READONLY) }; Reference< beans::XPropertySetInfo > xInfo( new PropertySetInfo_Impl( seq ) ); diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx index f793aa56dbe5..4f5e063fd969 100644 --- a/stoc/source/simpleregistry/simpleregistry.cxx +++ b/stoc/source/simpleregistry/simpleregistry.cxx @@ -89,7 +89,7 @@ private: OUString const & aKeyName, OUString const & aUrl) override; virtual OUString SAL_CALL getImplementationName() override - { return "com.sun.star.comp.stoc.SimpleRegistry"; } + { return u"com.sun.star.comp.stoc.SimpleRegistry"_ustr; } virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override { return cppu::supportsService(this, ServiceName); } @@ -97,7 +97,7 @@ private: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override { - css::uno::Sequence< OUString > names { "com.sun.star.registry.SimpleRegistry" }; + css::uno::Sequence< OUString > names { u"com.sun.star.registry.SimpleRegistry"_ustr }; return names; } @@ -261,8 +261,8 @@ sal_Int32 Key::getLongValue() break; case RegError::INVALID_VALUE: throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key getLongValue:" - " underlying RegistryKey::getValue() = RegError::INVALID_VALUE", + u"com.sun.star.registry.SimpleRegistry key getLongValue:" + " underlying RegistryKey::getValue() = RegError::INVALID_VALUE"_ustr, getXWeak()); default: throw css::registry::InvalidRegistryException( @@ -298,9 +298,9 @@ css::uno::Sequence< sal_Int32 > Key::getLongListValue() return css::uno::Sequence< sal_Int32 >(); case RegError::INVALID_VALUE: throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key getLongListValue:" + u"com.sun.star.registry.SimpleRegistry key getLongListValue:" " underlying RegistryKey::getLongListValue() =" - " RegError::INVALID_VALUE", + " RegError::INVALID_VALUE"_ustr, getXWeak()); default: throw css::registry::InvalidRegistryException( @@ -311,8 +311,8 @@ css::uno::Sequence< sal_Int32 > Key::getLongListValue() sal_uInt32 n = list.getLength(); if (n > SAL_MAX_INT32) { throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key getLongListValue:" - " underlying RegistryKey::getLongListValue() too large", + u"com.sun.star.registry.SimpleRegistry key getLongListValue:" + " underlying RegistryKey::getLongListValue() too large"_ustr, getXWeak()); } css::uno::Sequence< sal_Int32 > value(static_cast< sal_Int32 >(n)); @@ -357,15 +357,15 @@ OUString Key::getAsciiValue() // size contains terminating null (error in underlying registry.cxx): if (size == 0) { throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key getAsciiValue:" + u"com.sun.star.registry.SimpleRegistry key getAsciiValue:" " underlying RegistryKey size 0 cannot happen due to" - " design error", + " design error"_ustr, getXWeak()); } if (size > SAL_MAX_INT32) { throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key getAsciiValue:" - " underlying RegistryKey size too large", + u"com.sun.star.registry.SimpleRegistry key getAsciiValue:" + " underlying RegistryKey size too large"_ustr, getXWeak()); } std::vector< char > list(size); @@ -378,9 +378,9 @@ OUString Key::getAsciiValue() } if (list[size - 1] != '\0') { throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key getAsciiValue:" + u"com.sun.star.registry.SimpleRegistry key getAsciiValue:" " underlying RegistryKey value must be null-terminated due" - " to design error", + " to design error"_ustr, getXWeak()); } OUString value; @@ -392,8 +392,8 @@ OUString Key::getAsciiValue() RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR))) { throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key getAsciiValue:" - " underlying RegistryKey not UTF-8", + u"com.sun.star.registry.SimpleRegistry key getAsciiValue:" + " underlying RegistryKey not UTF-8"_ustr, getXWeak()); } return value; @@ -409,8 +409,8 @@ void Key::setAsciiValue(OUString const & value) RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) { throw css::uno::RuntimeException( - "com.sun.star.registry.SimpleRegistry key setAsciiValue:" - " value not UTF-16", + u"com.sun.star.registry.SimpleRegistry key setAsciiValue:" + " value not UTF-16"_ustr, getXWeak()); } RegError err = key_->setValue( @@ -437,9 +437,9 @@ css::uno::Sequence< OUString > Key::getAsciiListValue() return css::uno::Sequence< OUString >(); case RegError::INVALID_VALUE: throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key" + u"com.sun.star.registry.SimpleRegistry key" " getAsciiListValue: underlying" - " RegistryKey::getStringListValue() = RegError::INVALID_VALUE", + " RegistryKey::getStringListValue() = RegError::INVALID_VALUE"_ustr, getXWeak()); default: throw css::registry::InvalidRegistryException( @@ -451,9 +451,9 @@ css::uno::Sequence< OUString > Key::getAsciiListValue() sal_uInt32 n = list.getLength(); if (n > SAL_MAX_INT32) { throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key" + u"com.sun.star.registry.SimpleRegistry key" " getAsciiListValue: underlying" - " RegistryKey::getStringListValue() too large", + " RegistryKey::getStringListValue() too large"_ustr, getXWeak()); } css::uno::Sequence< OUString > value(static_cast< sal_Int32 >(n)); @@ -469,9 +469,9 @@ css::uno::Sequence< OUString > Key::getAsciiListValue() RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR))) { throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key" + u"com.sun.star.registry.SimpleRegistry key" " getAsciiListValue: underlying RegistryKey not" - " UTF-8", + " UTF-8"_ustr, getXWeak()); } } @@ -491,8 +491,8 @@ void Key::setAsciiListValue( RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) { throw css::uno::RuntimeException( - "com.sun.star.registry.SimpleRegistry key" - " setAsciiListValue: value not UTF-16", + u"com.sun.star.registry.SimpleRegistry key" + " setAsciiListValue: value not UTF-16"_ustr, getXWeak()); } list.push_back(utf8); @@ -535,15 +535,15 @@ OUString Key::getStringValue() // registry.cxx): if (size == 0 || (size & 1) == 1) { throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key getStringValue:" + u"com.sun.star.registry.SimpleRegistry key getStringValue:" " underlying RegistryKey size 0 or odd cannot happen due to" - " design error", + " design error"_ustr, getXWeak()); } if (size > SAL_MAX_INT32) { throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key getStringValue:" - " underlying RegistryKey size too large", + u"com.sun.star.registry.SimpleRegistry key getStringValue:" + " underlying RegistryKey size too large"_ustr, getXWeak()); } std::vector< sal_Unicode > list(size); @@ -556,9 +556,9 @@ OUString Key::getStringValue() } if (list[size/2 - 1] != 0) { throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key getStringValue:" + u"com.sun.star.registry.SimpleRegistry key getStringValue:" " underlying RegistryKey value must be null-terminated due" - " to design error", + " to design error"_ustr, getXWeak()); } return OUString(list.data(), static_cast< sal_Int32 >(size/2 - 1)); @@ -592,9 +592,9 @@ css::uno::Sequence< OUString > Key::getStringListValue() return css::uno::Sequence< OUString >(); case RegError::INVALID_VALUE: throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key" + u"com.sun.star.registry.SimpleRegistry key" " getStringListValue: underlying" - " RegistryKey::getUnicodeListValue() = RegError::INVALID_VALUE", + " RegistryKey::getUnicodeListValue() = RegError::INVALID_VALUE"_ustr, getXWeak()); default: throw css::registry::InvalidRegistryException( @@ -606,9 +606,9 @@ css::uno::Sequence< OUString > Key::getStringListValue() sal_uInt32 n = list.getLength(); if (n > SAL_MAX_INT32) { throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key" + u"com.sun.star.registry.SimpleRegistry key" " getStringListValue: underlying" - " RegistryKey::getUnicodeListValue() too large", + " RegistryKey::getUnicodeListValue() too large"_ustr, getXWeak()); } css::uno::Sequence< OUString > value(static_cast< sal_Int32 >(n)); @@ -658,8 +658,8 @@ css::uno::Sequence< sal_Int8 > Key::getBinaryValue() } if (size > SAL_MAX_INT32) { throw css::registry::InvalidValueException( - "com.sun.star.registry.SimpleRegistry key getBinaryValue:" - " underlying RegistryKey size too large", + u"com.sun.star.registry.SimpleRegistry key getBinaryValue:" + " underlying RegistryKey size too large"_ustr, getXWeak()); } css::uno::Sequence< sal_Int8 > value(static_cast< sal_Int32 >(size)); @@ -765,8 +765,8 @@ Key::openKeys() sal_uInt32 n = list.getLength(); if (n > SAL_MAX_INT32) { throw css::registry::InvalidRegistryException( - "com.sun.star.registry.SimpleRegistry key getKeyNames:" - " underlying RegistryKey::getKeyNames() too large", + u"com.sun.star.registry.SimpleRegistry key getKeyNames:" + " underlying RegistryKey::getKeyNames() too large"_ustr, getXWeak()); } css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > > @@ -793,8 +793,8 @@ css::uno::Sequence< OUString > Key::getKeyNames() sal_uInt32 n = list.getLength(); if (n > SAL_MAX_INT32) { throw css::registry::InvalidRegistryException( - "com.sun.star.registry.SimpleRegistry key getKeyNames:" - " underlying RegistryKey::getKeyNames() too large", + u"com.sun.star.registry.SimpleRegistry key getKeyNames:" + " underlying RegistryKey::getKeyNames() too large"_ustr, getXWeak()); } css::uno::Sequence< OUString > names(static_cast< sal_Int32 >(n)); @@ -809,21 +809,21 @@ sal_Bool Key::createLink( OUString const & /*aLinkName*/, OUString const & /*aLinkTarget*/) { throw css::registry::InvalidRegistryException( - "com.sun.star.registry.SimpleRegistry key createLink: links are no longer supported", + u"com.sun.star.registry.SimpleRegistry key createLink: links are no longer supported"_ustr, getXWeak()); } void Key::deleteLink(OUString const & /*rLinkName*/) { throw css::registry::InvalidRegistryException( - "com.sun.star.registry.SimpleRegistry key deleteLink: links are no longer supported", + u"com.sun.star.registry.SimpleRegistry key deleteLink: links are no longer supported"_ustr, getXWeak()); } OUString Key::getLinkTarget(OUString const & /*rLinkName*/) { throw css::registry::InvalidRegistryException( - "com.sun.star.registry.SimpleRegistry key getLinkTarget: links are no longer supported", + u"com.sun.star.registry.SimpleRegistry key getLinkTarget: links are no longer supported"_ustr, getXWeak()); } @@ -916,7 +916,7 @@ sal_Bool SimpleRegistry::isReadOnly() void SimpleRegistry::mergeKey( OUString const &, OUString const &) { - throw css::uno::RuntimeException("css.registry.SimpleRegistry::mergeKey: not implemented"); + throw css::uno::RuntimeException(u"css.registry.SimpleRegistry::mergeKey: not implemented"_ustr); } } diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx index a9b4e0d46e50..c38b8d45ab66 100644 --- a/stoc/source/typeconv/convert.cxx +++ b/stoc/source/typeconv/convert.cxx @@ -241,7 +241,7 @@ TypeConverter_Impl::TypeConverter_Impl() {} // XServiceInfo OUString TypeConverter_Impl::getImplementationName() { - return "com.sun.star.comp.stoc.TypeConverter"; + return u"com.sun.star.comp.stoc.TypeConverter"_ustr; } // XServiceInfo @@ -253,7 +253,7 @@ sal_Bool TypeConverter_Impl::supportsService(const OUString& ServiceName) // XServiceInfo Sequence< OUString > TypeConverter_Impl::getSupportedServiceNames() { - return { "com.sun.star.script.Converter" }; + return { u"com.sun.star.script.Converter"_ustr }; } @@ -309,7 +309,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, sal_Int64 min, sal_uInt6 return static_cast<sal_Int64>(n); } throw CannotConvertException( - "UNSIGNED HYPER out of range!", + u"UNSIGNED HYPER out of range!"_ustr, Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 ); } @@ -323,7 +323,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, sal_Int64 min, sal_uInt6 return nRet; } throw CannotConvertException( - "FLOAT out of range!", + u"FLOAT out of range!"_ustr, Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 ); } case TypeClass_DOUBLE: @@ -335,7 +335,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, sal_Int64 min, sal_uInt6 return nRet; } throw CannotConvertException( - "DOUBLE out of range!", + u"DOUBLE out of range!"_ustr, Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 ); } @@ -346,14 +346,14 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, sal_Int64 min, sal_uInt6 if (! getHyperValue( nVal, *o3tl::forceAccess<OUString>(rAny) )) { throw CannotConvertException( - "invalid STRING value!", + u"invalid STRING value!"_ustr, Reference<XInterface>(), aDestinationClass, FailReason::IS_NOT_NUMBER, 0 ); } nRet = nVal; if (nVal >= min && (nVal < 0 || o3tl::make_unsigned(nVal) <= max)) return nRet; throw CannotConvertException( - "STRING value out of range!", + u"STRING value out of range!"_ustr, Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 ); } @@ -366,7 +366,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, sal_Int64 min, sal_uInt6 if (nRet >= min && (nRet < 0 || o3tl::make_unsigned(nRet) <= max)) return nRet; throw CannotConvertException( - "VALUE is out of range!", + u"VALUE is out of range!"_ustr, Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 ); } @@ -431,7 +431,7 @@ double TypeConverter_Impl::toDouble( const Any& rAny, double min, double max ) if (! getNumericValue( fRet, *o3tl::forceAccess<OUString>(rAny) )) { throw CannotConvertException( - "invalid STRING value!", + u"invalid STRING value!"_ustr, Reference<XInterface>(), aDestinationClass, FailReason::IS_NOT_NUMBER, 0 ); } break; @@ -446,7 +446,7 @@ double TypeConverter_Impl::toDouble( const Any& rAny, double min, double max ) if (fRet >= min && fRet <= max) return fRet; throw CannotConvertException( - "VALUE is out of range!", + u"VALUE is out of range!"_ustr, Reference< XInterface >(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 ); } @@ -482,7 +482,7 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestTy if (!typelib_typedescription_isAssignableFrom( aDestTD.get(), aSourceTD.get() )) { throw CannotConvertException( - "value is not of same or derived type!", + u"value is not of same or derived type!"_ustr, Reference< XInterface >(), aDestinationClass, FailReason::SOURCE_IS_NO_DERIVED_TYPE, 0 ); } @@ -506,7 +506,7 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestTy if (!ifc || !ifc->is()) { throw CannotConvertException( - "value is not interface", + u"value is not interface"_ustr, Reference< XInterface >(), aDestinationClass, FailReason::NO_SUCH_INTERFACE, 0 ); } aRet = (*ifc)->queryInterface(aDestType ); @@ -621,7 +621,7 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestTy if (nPos < 0) { throw CannotConvertException( - "value cannot be converted to demanded ENUM!", + u"value cannot be converted to demanded ENUM!"_ustr, Reference< XInterface >(), aDestinationClass, FailReason::IS_NOT_ENUM, 0 ); } @@ -648,7 +648,7 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestTy return aRet; throw CannotConvertException( - "conversion not possible!", + u"conversion not possible!"_ustr, Reference< XInterface >(), aDestinationClass, FailReason::INVALID, 0 ); } @@ -676,7 +676,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina default: throw IllegalArgumentException( - "destination type is not simple!", + u"destination type is not simple!"_ustr, Reference< XInterface >(), sal_Int16(1) ); } @@ -799,7 +799,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina if (nPos < 0) { throw CannotConvertException( - "value is not ENUM!", + u"value is not ENUM!"_ustr, Reference< XInterface >(), aDestinationClass, FailReason::IS_NOT_ENUM, 0 ); } @@ -811,8 +811,8 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina case TypeClass_BOOLEAN: aRet <<= *o3tl::forceAccess<bool>(rVal) ? - OUString("true") : - OUString("false"); + u"true"_ustr : + u"false"_ustr; break; case TypeClass_CHAR: aRet <<= OUString(*o3tl::forceAccess<sal_Unicode>(rVal)); @@ -855,7 +855,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina return aRet; throw CannotConvertException( - "conversion not possible!", + u"conversion not possible!"_ustr, Reference< XInterface >(), aDestinationClass, FailReason::INVALID, 0 ); } diff --git a/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx b/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx index b9e2ca4e993b..9e6e8d5abe0c 100644 --- a/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx +++ b/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx @@ -68,7 +68,7 @@ private: OUString Translator::getImplementationName() { - return "com.sun.star.comp.uri.ExternalUriReferenceTranslator"; + return u"com.sun.star.comp.uri.ExternalUriReferenceTranslator"_ustr; } sal_Bool Translator::supportsService(OUString const & serviceName) @@ -78,7 +78,7 @@ sal_Bool Translator::supportsService(OUString const & serviceName) css::uno::Sequence< OUString > Translator::getSupportedServiceNames() { - css::uno::Sequence< OUString > s { "com.sun.star.uri.ExternalUriReferenceTranslator" }; + css::uno::Sequence< OUString > s { u"com.sun.star.uri.ExternalUriReferenceTranslator"_ustr }; return s; } diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx b/stoc/source/uriproc/UriReferenceFactory.cxx index c9bc16bad495..2320194d205f 100644 --- a/stoc/source/uriproc/UriReferenceFactory.cxx +++ b/stoc/source/uriproc/UriReferenceFactory.cxx @@ -327,7 +327,7 @@ private: OUString Factory::getImplementationName() { - return "com.sun.star.comp.uri.UriReferenceFactory"; + return u"com.sun.star.comp.uri.UriReferenceFactory"_ustr; } sal_Bool Factory::supportsService(OUString const & serviceName) @@ -337,7 +337,7 @@ sal_Bool Factory::supportsService(OUString const & serviceName) css::uno::Sequence< OUString > Factory::getSupportedServiceNames() { - css::uno::Sequence< OUString > s { "com.sun.star.uri.UriReferenceFactory" }; + css::uno::Sequence< OUString > s { u"com.sun.star.uri.UriReferenceFactory"_ustr }; return s; } diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx index dde6fcb0605f..7f582c99dc6b 100644 --- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx +++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx @@ -127,7 +127,7 @@ OUString UrlReference::expand( css::uno::Reference< css::util::XMacroExpander > const & expander) { if (!expander.is()) { - throw css::uno::RuntimeException("null expander passed to XVndSunStarExpandUrl.expand"); + throw css::uno::RuntimeException(u"null expander passed to XVndSunStarExpandUrl.expand"_ustr); } return expander->expandMacros( ::rtl::Uri::decode( @@ -163,7 +163,7 @@ private: OUString Parser::getImplementationName() { - return "com.sun.star.comp.uri.UriSchemeParser_vndDOTsunDOTstarDOTexpand"; + return u"com.sun.star.comp.uri.UriSchemeParser_vndDOTsunDOTstarDOTexpand"_ustr; } sal_Bool Parser::supportsService(OUString const & serviceName) @@ -173,7 +173,7 @@ sal_Bool Parser::supportsService(OUString const & serviceName) css::uno::Sequence< OUString > Parser::getSupportedServiceNames() { - return { "com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTexpand" }; + return { u"com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTexpand"_ustr }; } css::uno::Reference< css::uri::XUriReference > Parser::parse( diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx index 1f533516935b..03fab8b59e04 100644 --- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx +++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx @@ -349,7 +349,7 @@ private: OUString Parser::getImplementationName() { - return "com.sun.star.comp.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript"; + return u"com.sun.star.comp.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript"_ustr; } sal_Bool Parser::supportsService(OUString const & serviceName) @@ -359,7 +359,7 @@ sal_Bool Parser::supportsService(OUString const & serviceName) css::uno::Sequence< OUString > Parser::getSupportedServiceNames() { - return { "com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript" }; + return { u"com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript"_ustr }; } css::uno::Reference< css::uri::XUriReference > diff --git a/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx b/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx index 7520c460f16d..38b93f668d4d 100644 --- a/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx +++ b/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx @@ -70,7 +70,7 @@ private: OUString Factory::getImplementationName() { - return "com.sun.star.comp.uri.VndSunStarPkgUrlReferenceFactory"; + return u"com.sun.star.comp.uri.VndSunStarPkgUrlReferenceFactory"_ustr; } sal_Bool Factory::supportsService(OUString const & serviceName) @@ -80,7 +80,7 @@ sal_Bool Factory::supportsService(OUString const & serviceName) css::uno::Sequence< OUString > Factory::getSupportedServiceNames() { - css::uno::Sequence< OUString > s { "com.sun.star.uri.VndSunStarPkgUrlReferenceFactory" }; + css::uno::Sequence< OUString > s { u"com.sun.star.uri.VndSunStarPkgUrlReferenceFactory"_ustr }; return s; } @@ -90,8 +90,8 @@ Factory::createVndSunStarPkgUrlReference( { if (!authority.is()) { throw css::uno::RuntimeException( - "null authority passed to" - " XVndSunStarPkgUrlReferenceFactory.createVndSunStarPkgUrlReference"); + u"null authority passed to" + " XVndSunStarPkgUrlReferenceFactory.createVndSunStarPkgUrlReference"_ustr); } if (authority->isAbsolute() && !authority->hasFragment()) { OUString buf = |