summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-04-26 15:25:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-04-27 15:11:25 +0200
commit60728712f0f8bf72662da0b0e446ab416e9bf347 (patch)
treee950a7cb099f51bd048e7e2e2f65607282ff5052 /cppuhelper
parent87e0feafd3690a9b58890cc28f8ba0c521bfb557 (diff)
loplugin:ostr in cppu,cppuhelper
Change-Id: I15c00d7a87396d07be2d10a0311f308a93e8eec3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166751 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/qa/misc/test_misc.cxx4
-rw-r--r--cppuhelper/source/access_control.cxx6
-rw-r--r--cppuhelper/source/bootstrap.cxx34
-rw-r--r--cppuhelper/source/component_context.cxx8
-rw-r--r--cppuhelper/source/defaultbootstrap.cxx18
-rw-r--r--cppuhelper/source/exc_thrower.cxx20
-rw-r--r--cppuhelper/source/factory.cxx16
-rw-r--r--cppuhelper/source/paths.cxx4
-rw-r--r--cppuhelper/source/propertysetmixin.cxx54
-rw-r--r--cppuhelper/source/propshlp.cxx2
-rw-r--r--cppuhelper/source/servicemanager.cxx46
-rw-r--r--cppuhelper/source/shlib.cxx16
-rw-r--r--cppuhelper/source/tdmgr.cxx30
-rw-r--r--cppuhelper/source/typemanager.cxx20
-rw-r--r--cppuhelper/source/unourl.cxx20
15 files changed, 149 insertions, 149 deletions
diff --git a/cppuhelper/qa/misc/test_misc.cxx b/cppuhelper/qa/misc/test_misc.cxx
index 0e4fdf9efb42..d4e45ab0da66 100644
--- a/cppuhelper/qa/misc/test_misc.cxx
+++ b/cppuhelper/qa/misc/test_misc.cxx
@@ -32,7 +32,7 @@ void Test::testCatchThrow()
css::uno::Any aSavedException;
try
{
- throw css::uno::RuntimeException("RuntimeException");
+ throw css::uno::RuntimeException(u"RuntimeException"_ustr);
}
catch (const css::uno::RuntimeException&)
{
@@ -60,7 +60,7 @@ void Test::testgetCaughtException()
aSavedException; /// exception caught during unzipping is saved to be thrown during reading
try
{
- throw css::uno::RuntimeException("RuntimeException");
+ throw css::uno::RuntimeException(u"RuntimeException"_ustr);
}
catch (...)
{
diff --git a/cppuhelper/source/access_control.cxx b/cppuhelper/source/access_control.cxx
index 9b8b907df6b6..09001b7fda0e 100644
--- a/cppuhelper/source/access_control.cxx
+++ b/cppuhelper/source/access_control.cxx
@@ -38,7 +38,7 @@ AccessControl::AccessControl( Reference< XComponentContext > const & xContext )
{
if (! (xContext->getValueByName( ACCESS_CONTROLLER_SINGLETON ) >>= m_xController))
{
- throw SecurityException( "no access controller!" );
+ throw SecurityException( u"no access controller!"_ustr );
}
}
@@ -48,7 +48,7 @@ AccessControl::AccessControl(
{
if (! m_xController.is())
{
- throw SecurityException( "no access controller!" );
+ throw SecurityException( u"no access controller!"_ustr );
}
}
@@ -57,7 +57,7 @@ AccessControl::AccessControl( AccessControl const & ac )
{
if (! m_xController.is())
{
- throw SecurityException( "no access controller!" );
+ throw SecurityException( u"no access controller!"_ustr );
}
}
diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx
index bd975460f06c..a6387c1ff1aa 100644
--- a/cppuhelper/source/bootstrap.cxx
+++ b/cppuhelper/source/bootstrap.cxx
@@ -90,7 +90,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
auto* p1 = cppuhelper_detail_findSofficePath();
if (p1 == nullptr) {
throw BootstrapException(
- "no soffice installation found!");
+ u"no soffice installation found!"_ustr);
}
OUString p2;
#if defined(_WIN32)
@@ -106,7 +106,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
if (!bOk)
{
throw BootstrapException(
- "bad characters in soffice installation path!");
+ u"bad characters in soffice installation path!"_ustr);
}
#endif
OUString path;
@@ -114,16 +114,16 @@ Reference< XComponentContext > SAL_CALL bootstrap()
osl::FileBase::E_None)
{
throw BootstrapException(
- "cannot convert soffice installation path to URL!");
+ u"cannot convert soffice installation path to URL!"_ustr);
}
if (!path.isEmpty() && !path.endsWith("/")) {
path += "/";
}
OUString uri;
- if (!Bootstrap::get("URE_BOOTSTRAP", uri)) {
+ if (!Bootstrap::get(u"URE_BOOTSTRAP"_ustr, uri)) {
Bootstrap::set(
- "URE_BOOTSTRAP",
+ u"URE_BOOTSTRAP"_ustr,
Bootstrap::encode(
path +
#if defined MACOSX
@@ -136,16 +136,16 @@ Reference< XComponentContext > SAL_CALL bootstrap()
Reference< XComponentContext > xLocalContext(
defaultBootstrap_InitialComponentContext() );
if ( !xLocalContext.is() )
- throw BootstrapException( "no local component context!" );
+ throw BootstrapException( u"no local component context!"_ustr );
// create a random pipe name
rtlRandomPool hPool = rtl_random_createPool();
if ( hPool == nullptr )
- throw BootstrapException( "cannot create random pool!" );
+ throw BootstrapException( u"cannot create random pool!"_ustr );
sal_uInt8 bytes[ 16 ];
if ( rtl_random_getBytes( hPool, bytes, std::size( bytes ) )
!= rtl_Random_E_None )
- throw BootstrapException( "random pool error!" );
+ throw BootstrapException( u"random pool error!"_ustr );
rtl_random_destroyPool( hPool );
OUStringBuffer buf("uno");
for (unsigned char byte : bytes)
@@ -154,10 +154,10 @@ Reference< XComponentContext > SAL_CALL bootstrap()
// arguments
OUString args [] = {
- OUString("--nologo"),
- OUString("--nodefault"),
- OUString("--norestore"),
- OUString("--nolockcheck"),
+ u"--nologo"_ustr,
+ u"--nodefault"_ustr,
+ u"--norestore"_ustr,
+ u"--nolockcheck"_ustr,
OUString("--accept=pipe,name=" + sPipeName + ";urp;")
};
rtl_uString * ar_args [] = {
@@ -184,16 +184,16 @@ Reference< XComponentContext > SAL_CALL bootstrap()
osl_freeProcessHandle( hProcess );
break;
case osl_Process_E_NotFound:
- throw BootstrapException( "image not found!" );
+ throw BootstrapException( u"image not found!"_ustr );
case osl_Process_E_TimedOut:
- throw BootstrapException( "timeout occurred!" );
+ throw BootstrapException( u"timeout occurred!"_ustr );
case osl_Process_E_NoPermission:
- throw BootstrapException( "permission denied!" );
+ throw BootstrapException( u"permission denied!"_ustr );
case osl_Process_E_Unknown:
- throw BootstrapException( "unknown error!" );
+ throw BootstrapException( u"unknown error!"_ustr );
case osl_Process_E_InvalidError:
default:
- throw BootstrapException( "unmapped error!" );
+ throw BootstrapException( u"unmapped error!"_ustr );
}
// create a URL resolver
diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx
index 47dbd0b3773e..893e484be44d 100644
--- a/cppuhelper/source/component_context.cxx
+++ b/cppuhelper/source/component_context.cxx
@@ -380,7 +380,7 @@ Reference< lang::XMultiComponentFactory > ComponentContext::getServiceManager()
if ( !m_xSMgr.is() )
{
throw DeploymentException(
- "null component context service manager",
+ u"null component context service manager"_ustr,
static_cast<OWeakObject *>(this) );
}
return m_xSMgr;
@@ -446,7 +446,7 @@ void ComponentContext::disposing(std::unique_lock<std::mutex>& rGuard)
uno_Environment ** envs;
sal_Int32 envCount;
uno_getRegisteredEnvironments(
- &envs, &envCount, &rtl_allocateMemory, OUString("java").pData);
+ &envs, &envCount, &rtl_allocateMemory, u"java"_ustr.pData);
assert(envCount >= 0);
assert(envCount == 0 || envs != nullptr);
if (envs) {
@@ -502,7 +502,7 @@ ComponentContext::ComponentContext(
// create new smgr based on delegate's one
m_xSMgr.set(
xMgr->createInstanceWithContext(
- "com.sun.star.comp.stoc.OServiceManagerWrapper", xDelegate ),
+ u"com.sun.star.comp.stoc.OServiceManagerWrapper"_ustr, xDelegate ),
UNO_QUERY );
// patch DefaultContext property of new one
Reference< beans::XPropertySet > xProps( m_xSMgr, UNO_QUERY );
@@ -510,7 +510,7 @@ ComponentContext::ComponentContext(
if (xProps.is())
{
Reference< XComponentContext > xThis( this );
- xProps->setPropertyValue( "DefaultContext", Any( xThis ) );
+ xProps->setPropertyValue( u"DefaultContext"_ustr, Any( xThis ) );
}
}
catch (...)
diff --git a/cppuhelper/source/defaultbootstrap.cxx b/cppuhelper/source/defaultbootstrap.cxx
index 6e80c9697158..ca70a91d3f57 100644
--- a/cppuhelper/source/defaultbootstrap.cxx
+++ b/cppuhelper/source/defaultbootstrap.cxx
@@ -54,25 +54,25 @@ cppu::defaultBootstrap_InitialComponentContext(OUString const & iniUri)
}
rtl::Reference smgr(
new cppuhelper::ServiceManager);
- smgr->init(getBootstrapVariable(bs, "UNO_SERVICES"));
+ smgr->init(getBootstrapVariable(bs, u"UNO_SERVICES"_ustr));
rtl::Reference tmgr(new cppuhelper::TypeManager);
- tmgr->init(getBootstrapVariable(bs, "UNO_TYPES"));
+ tmgr->init(getBootstrapVariable(bs, u"UNO_TYPES"_ustr));
std::vector< cppu::ContextEntry_Init > context_values
{
cppu::ContextEntry_Init(
- "/singletons/com.sun.star.lang.theServiceManager",
+ u"/singletons/com.sun.star.lang.theServiceManager"_ustr,
css::uno::Any(
css::uno::Reference< css::uno::XInterface >(
static_cast< cppu::OWeakObject * >(smgr.get()))),
false),
cppu::ContextEntry_Init(
- "/singletons/com.sun.star.reflection.theTypeDescriptionManager",
+ u"/singletons/com.sun.star.reflection.theTypeDescriptionManager"_ustr,
css::uno::Any(
css::uno::Reference< css::uno::XInterface >(
static_cast< cppu::OWeakObject * >(tmgr.get()))),
false),
cppu::ContextEntry_Init( //TODO: from services.rdb?
- "/singletons/com.sun.star.util.theMacroExpander",
+ u"/singletons/com.sun.star.util.theMacroExpander"_ustr,
css::uno::Any(
cppuhelper::detail::create_bootstrap_macro_expander_factory()),
true)
@@ -80,13 +80,13 @@ cppu::defaultBootstrap_InitialComponentContext(OUString const & iniUri)
smgr->addSingletonContextEntries(&context_values);
context_values.push_back(
cppu::ContextEntry_Init(
- "/services/com.sun.star.security.AccessController/mode",
- css::uno::Any(OUString("off")), false));
+ u"/services/com.sun.star.security.AccessController/mode"_ustr,
+ css::uno::Any(u"off"_ustr), false));
context_values.push_back(
cppu::ContextEntry_Init(
- "/singletons/com.sun.star.security.theAccessController",
+ u"/singletons/com.sun.star.security.theAccessController"_ustr,
css::uno::Any(
- OUString("com.sun.star.security.AccessController")),
+ u"com.sun.star.security.AccessController"_ustr),
true));
css::uno::Reference< css::uno::XComponentContext > context(
createComponentContext(context_values.data(), context_values.size()));
diff --git a/cppuhelper/source/exc_thrower.cxx b/cppuhelper/source/exc_thrower.cxx
index 50d3133ffb2b..eec416775038 100644
--- a/cppuhelper/source/exc_thrower.cxx
+++ b/cppuhelper/source/exc_thrower.cxx
@@ -115,7 +115,7 @@ void ExceptionThrower_dispatch(
default:
{
OSL_ASSERT( false );
- RuntimeException exc( "not implemented!" );
+ RuntimeException exc( u"not implemented!"_ustr );
uno_type_any_construct(
*ppException, &exc, cppu::UnoType<decltype(exc)>::get().getTypeLibType(), nullptr );
break;
@@ -227,18 +227,18 @@ void SAL_CALL throwException( Any const & exc )
if (exc.getValueTypeClass() != TypeClass_EXCEPTION)
{
throw RuntimeException(
- "no UNO exception given "
- "(must be derived from com::sun::star::uno::Exception)!" );
+ u"no UNO exception given "
+ "(must be derived from com::sun::star::uno::Exception)!"_ustr );
}
#if RETHROW_FAKE_EXCEPTIONS
lo_mobile_throwException(exc);
#else
- Mapping uno2cpp(Environment(UNO_LB_UNO), Environment::getCurrent());
+ Mapping uno2cpp(Environment(u"" UNO_LB_UNO ""_ustr), Environment::getCurrent());
if (! uno2cpp.is())
{
throw RuntimeException(
- "cannot get binary UNO to C++ mapping!" );
+ u"cannot get binary UNO to C++ mapping!"_ustr );
}
Reference< XExceptionThrower > xThrower;
@@ -258,17 +258,17 @@ Any SAL_CALL getCaughtException()
#if defined(ANDROID) || defined(EMSCRIPTEN)
return Any();
#else
- Mapping cpp2uno(Environment::getCurrent(), Environment(UNO_LB_UNO));
+ Mapping cpp2uno(Environment::getCurrent(), Environment(u"" UNO_LB_UNO ""_ustr));
if (! cpp2uno.is())
{
throw RuntimeException(
- "cannot get C++ to binary UNO mapping!" );
+ u"cannot get C++ to binary UNO mapping!"_ustr );
}
- Mapping uno2cpp(Environment(UNO_LB_UNO), Environment::getCurrent());
+ Mapping uno2cpp(Environment(u"" UNO_LB_UNO ""_ustr), Environment::getCurrent());
if (! uno2cpp.is())
{
throw RuntimeException(
- "cannot get binary UNO to C++ mapping!" );
+ u"cannot get binary UNO to C++ mapping!"_ustr );
}
typelib_TypeDescription * pTD = nullptr;
@@ -296,7 +296,7 @@ Any SAL_CALL getCaughtException()
if (exc == nullptr)
{
- throw RuntimeException( "rethrowing C++ exception failed!" );
+ throw RuntimeException( u"rethrowing C++ exception failed!"_ustr );
}
Any ret;
diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index d039e43824a8..b4a9d06c4d9e 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -272,7 +272,7 @@ OFactoryComponentHelper::createInstanceWithArgumentsEveryTime(
xComp->dispose();
throw lang::IllegalArgumentException(
- "cannot pass arguments to component => no XInitialization implemented!",
+ u"cannot pass arguments to component => no XInitialization implemented!"_ustr,
Reference< XInterface >(), 0 );
}
}
@@ -459,7 +459,7 @@ IPropertyArrayHelper & ORegistryFactoryHelper::getInfoHelper()
if (m_property_array_helper == nullptr)
{
beans::Property prop(
- "ImplementationKey" /* name */,
+ u"ImplementationKey"_ustr /* name */,
0 /* handle */,
cppu::UnoType<decltype(xImplementationKey)>::get(),
beans::PropertyAttribute::READONLY |
@@ -483,7 +483,7 @@ void ORegistryFactoryHelper::setFastPropertyValue_NoBroadcast(
sal_Int32, Any const & )
{
throw beans::PropertyVetoException(
- "unexpected: only readonly properties!",
+ u"unexpected: only readonly properties!"_ustr,
static_cast< OWeakObject * >(this) );
}
@@ -499,7 +499,7 @@ void ORegistryFactoryHelper::getFastPropertyValue(
{
rValue.clear();
throw beans::UnknownPropertyException(
- "unknown property!", static_cast< OWeakObject * >(
+ u"unknown property!"_ustr, static_cast< OWeakObject * >(
const_cast< ORegistryFactoryHelper * >(this) ) );
}
}
@@ -599,7 +599,7 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory()
OUString aLocation;
Reference<XRegistryKey > xActivatorKey = xImplementationKey->openKey(
- "/UNO/ACTIVATOR" );
+ u"/UNO/ACTIVATOR"_ustr );
if( xActivatorKey.is() && xActivatorKey->getValueType() == RegistryValueType_ASCII )
{
aActivatorUrl = xActivatorKey->getAsciiValue();
@@ -607,7 +607,7 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory()
aActivatorName = o3tl::getToken(aActivatorUrl, 0, ':');
Reference<XRegistryKey > xLocationKey = xImplementationKey->openKey(
- "/UNO/LOCATION" );
+ u"/UNO/LOCATION"_ustr );
if( xLocationKey.is() && xLocationKey->getValueType() == RegistryValueType_ASCII )
aLocation = xLocationKey->getAsciiValue();
}
@@ -616,7 +616,7 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory()
// old style"url"
// the location of the program code of the implementation
Reference<XRegistryKey > xLocationKey = xImplementationKey->openKey(
- "/UNO/URL" );
+ u"/UNO/URL"_ustr );
// is the key of the right type ?
if( xLocationKey.is() && xLocationKey->getValueType() == RegistryValueType_ASCII )
{
@@ -659,7 +659,7 @@ Sequence< OUString > ORegistryFactoryHelper::getSupportedServiceNames()
// not yet loaded
try
{
- Reference<XRegistryKey > xKey = xImplementationKey->openKey( "UNO/SERVICES" );
+ Reference<XRegistryKey > xKey = xImplementationKey->openKey( u"UNO/SERVICES"_ustr );
if (xKey.is())
{
diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx
index cf8c748ee7e0..0a4ccf76e6ef 100644
--- a/cppuhelper/source/paths.cxx
+++ b/cppuhelper/source/paths.cxx
@@ -88,14 +88,14 @@ bool cppu::nextDirectoryItem(osl::Directory & directory, OUString * url) {
return false;
default:
throw css::uno::DeploymentException(
- "Cannot iterate directory");
+ u"Cannot iterate directory"_ustr);
}
osl::FileStatus stat(
osl_FileStatus_Mask_Type | osl_FileStatus_Mask_FileName |
osl_FileStatus_Mask_FileURL);
if (i.getFileStatus(stat) != osl::FileBase::E_None) {
throw css::uno::DeploymentException(
- "Cannot stat in directory");
+ u"Cannot stat in directory"_ustr);
}
if (stat.getFileType() != osl::FileStatus::Directory) { //TODO: symlinks
// Ignore backup and spurious junk files:
diff --git a/cppuhelper/source/propertysetmixin.cxx b/cppuhelper/source/propertysetmixin.cxx
index c3c1ad0a66c8..b2c23dc2b507 100644
--- a/cppuhelper/source/propertysetmixin.cxx
+++ b/cppuhelper/source/propertysetmixin.cxx
@@ -231,7 +231,7 @@ void Data::initProperties(
getTypeArguments());
if (args.getLength() != 1) {
throw css::uno::RuntimeException(
- "inconsistent UNO type registry");
+ u"inconsistent UNO type registry"_ustr);
}
t = args[0];
}
@@ -239,7 +239,7 @@ void Data::initProperties(
= handleNames->size();
if (handles > SAL_MAX_INT32) {
throw css::uno::RuntimeException(
- "interface type has too many attributes");
+ u"interface type has too many attributes"_ustr);
}
OUString name(m->getMemberName());
if (!properties.emplace(
@@ -255,7 +255,7 @@ void Data::initProperties(
second)
{
throw css::uno::RuntimeException(
- "inconsistent UNO type registry");
+ u"inconsistent UNO type registry"_ustr);
}
handleNames->push_back(name);
}
@@ -425,8 +425,8 @@ PropertySetMixinImpl::Impl::Impl(
ifc.set(
css::uno::Reference< css::container::XHierarchicalNameAccess >(
m_context->getValueByName(
- "/singletons/com.sun.star.reflection."
- "theTypeDescriptionManager"),
+ u"/singletons/com.sun.star.reflection."
+ "theTypeDescriptionManager"_ustr),
css::uno::UNO_QUERY_THROW)->getByHierarchicalName(
m_type.getTypeName()),
css::uno::UNO_QUERY_THROW);
@@ -607,17 +607,17 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty(
getReflection(value.getValueTypeName()));
try {
if (!(css::uno::Reference< css::reflection::XIdlField2 >(
- ambiguous->getField("IsAmbiguous"),
+ ambiguous->getField(u"IsAmbiguous"_ustr),
css::uno::UNO_QUERY_THROW)->get(value)
>>= isAmbiguous))
{
throw css::uno::RuntimeException(
- ("unexpected type of com.sun.star.beans.Ambiguous"
- " IsAmbiguous member"),
+ (u"unexpected type of com.sun.star.beans.Ambiguous"
+ " IsAmbiguous member"_ustr),
object);
}
value = css::uno::Reference< css::reflection::XIdlField2 >(
- ambiguous->getField("Value"), css::uno::UNO_QUERY_THROW)->
+ ambiguous->getField(u"Value"_ustr), css::uno::UNO_QUERY_THROW)->
get(value);
} catch (css::lang::IllegalArgumentException & e) {
css::uno::Any anyEx = cppu::getCaughtException();
@@ -636,17 +636,17 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty(
try {
if (!(css::uno::Reference< css::reflection::XIdlField2 >(
- defaulted->getField("IsDefaulted"),
+ defaulted->getField(u"IsDefaulted"_ustr),
css::uno::UNO_QUERY_THROW)->get(value)
>>= isDefaulted))
{
throw css::uno::RuntimeException(
- ("unexpected type of com.sun.star.beans.Defaulted"
- " IsDefaulted member"),
+ (u"unexpected type of com.sun.star.beans.Defaulted"
+ " IsDefaulted member"_ustr),
object);
}
value = css::uno::Reference< css::reflection::XIdlField2 >(
- defaulted->getField("Value"), css::uno::UNO_QUERY_THROW)->
+ defaulted->getField(u"Value"_ustr), css::uno::UNO_QUERY_THROW)->
get(value);
} catch (css::lang::IllegalArgumentException & e) {
css::uno::Any anyEx = cppu::getCaughtException();
@@ -665,13 +665,13 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty(
try {
bool present = false;
if (!(css::uno::Reference< css::reflection::XIdlField2 >(
- optional->getField("IsPresent"),
+ optional->getField(u"IsPresent"_ustr),
css::uno::UNO_QUERY_THROW)->get(value)
>>= present))
{
throw css::uno::RuntimeException(
- ("unexpected type of com.sun.star.beans.Optional"
- " IsPresent member"),
+ (u"unexpected type of com.sun.star.beans.Optional"
+ " IsPresent member"_ustr),
object);
}
if (!present) {
@@ -679,7 +679,7 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty(
break;
}
value = css::uno::Reference< css::reflection::XIdlField2 >(
- optional->getField("Value"), css::uno::UNO_QUERY_THROW)->
+ optional->getField(u"Value"_ustr), css::uno::UNO_QUERY_THROW)->
get(value);
} catch (css::lang::IllegalArgumentException & e) {
css::uno::Any anyEx = cppu::getCaughtException();
@@ -730,14 +730,14 @@ css::uno::Any PropertySetMixinImpl::Impl::wrapValue(
type->createObject(strct);
try {
css::uno::Reference< css::reflection::XIdlField2 > field(
- type->getField("Value"), css::uno::UNO_QUERY_THROW);
+ type->getField(u"Value"_ustr), css::uno::UNO_QUERY_THROW);
field->set(
strct,
wrapValue(
object, value, field->getType(), false, false,
wrapDefaulted, isDefaulted, wrapOptional));
css::uno::Reference< css::reflection::XIdlField2 >(
- type->getField("IsAmbiguous"), css::uno::UNO_QUERY_THROW)->set(
+ type->getField(u"IsAmbiguous"_ustr), css::uno::UNO_QUERY_THROW)->set(
strct, css::uno::Any(isAmbiguous));
} catch (css::lang::IllegalArgumentException & e) {
css::uno::Any anyEx = cppu::getCaughtException();
@@ -761,14 +761,14 @@ css::uno::Any PropertySetMixinImpl::Impl::wrapValue(
type->createObject(strct);
try {
css::uno::Reference< css::reflection::XIdlField2 > field(
- type->getField("Value"), css::uno::UNO_QUERY_THROW);
+ type->getField(u"Value"_ustr), css::uno::UNO_QUERY_THROW);
field->set(
strct,
wrapValue(
object, value, field->getType(), wrapAmbiguous, isAmbiguous,
false, false, wrapOptional));
css::uno::Reference< css::reflection::XIdlField2 >(
- type->getField("IsDefaulted"), css::uno::UNO_QUERY_THROW)->set(
+ type->getField(u"IsDefaulted"_ustr), css::uno::UNO_QUERY_THROW)->set(
strct, css::uno::Any(isDefaulted));
} catch (css::lang::IllegalArgumentException & e) {
css::uno::Any anyEx = cppu::getCaughtException();
@@ -793,11 +793,11 @@ css::uno::Any PropertySetMixinImpl::Impl::wrapValue(
bool present = value.hasValue();
try {
css::uno::Reference< css::reflection::XIdlField2 >(
- type->getField("IsPresent"), css::uno::UNO_QUERY_THROW)->set(
+ type->getField(u"IsPresent"_ustr), css::uno::UNO_QUERY_THROW)->set(
strct, css::uno::Any(present));
if (present) {
css::uno::Reference< css::reflection::XIdlField2 > field(
- type->getField("Value"), css::uno::UNO_QUERY_THROW);
+ type->getField(u"Value"_ustr), css::uno::UNO_QUERY_THROW);
field->set(
strct,
wrapValue(
@@ -821,7 +821,7 @@ css::uno::Any PropertySetMixinImpl::Impl::wrapValue(
}
if (wrapAmbiguous || wrapDefaulted || wrapOptional) {
throw css::uno::RuntimeException(
- "unexpected type of attribute", object);
+ u"unexpected type of attribute"_ustr, object);
}
return value;
}
@@ -859,7 +859,7 @@ void PropertySetMixinImpl::prepareSet(
std::scoped_lock g(m_impl->mutex);
if (m_impl->disposed) {
throw css::lang::DisposedException(
- "disposed", static_cast< css::beans::XPropertySet * >(this));
+ u"disposed"_ustr, static_cast< css::beans::XPropertySet * >(this));
}
if ((it->second.property.Attributes
& css::beans::PropertyAttribute::CONSTRAINED)
@@ -870,7 +870,7 @@ void PropertySetMixinImpl::prepareSet(
if (i != m_impl->vetoListeners.end()) {
specificVeto = i->second;
}
- i = m_impl->vetoListeners.find("");
+ i = m_impl->vetoListeners.find(u""_ustr);
if (i != m_impl->vetoListeners.end()) {
unspecificVeto = i->second;
}
@@ -885,7 +885,7 @@ void PropertySetMixinImpl::prepareSet(
if (i != m_impl->boundListeners.end()) {
boundListeners->m_impl->specificListeners = i->second;
}
- i = m_impl->boundListeners.find("");
+ i = m_impl->boundListeners.find(u""_ustr);
if (i != m_impl->boundListeners.end()) {
boundListeners->m_impl->unspecificListeners = i->second;
}
diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx
index 18ee9d1bb770..1dfca5e2a6ec 100644
--- a/cppuhelper/source/propshlp.cxx
+++ b/cppuhelper/source/propshlp.cxx
@@ -869,7 +869,7 @@ void OPropertySetHelper::setPropertyValues(
{
sal_Int32 nSeqLen = rPropertyNames.getLength();
if (nSeqLen != rValues.getLength())
- throw IllegalArgumentException("lengths do not match", static_cast<XPropertySet*>(this),
+ throw IllegalArgumentException(u"lengths do not match"_ustr, static_cast<XPropertySet*>(this),
-1);
std::unique_ptr<sal_Int32[]> pHandles(new sal_Int32[ nSeqLen ]);
// get the map table
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 9085e208ee25..790a776392c4 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -484,7 +484,7 @@ css::uno::Any ContentEnumeration::nextElement()
std::scoped_lock g(mutex_);
if (iterator_ == factories_.end()) {
throw css::container::NoSuchElementException(
- "Bootstrap service manager service enumerator has no more elements",
+ u"Bootstrap service manager service enumerator has no more elements"_ustr,
static_cast< cppu::OWeakObject * >(this));
}
return *iterator_++;
@@ -492,7 +492,7 @@ css::uno::Any ContentEnumeration::nextElement()
css::beans::Property getDefaultContextProperty() {
return css::beans::Property(
- "DefaultContext", -1,
+ u"DefaultContext"_ustr, -1,
cppu::UnoType< css::uno::XComponentContext >::get(),
css::beans::PropertyAttribute::READONLY);
}
@@ -941,7 +941,7 @@ void cppuhelper::ServiceManager::initialize(
|| arg != "preload")
{
throw css::lang::IllegalArgumentException(
- "invalid ServiceManager::initialize argument",
+ u"invalid ServiceManager::initialize argument"_ustr,
css::uno::Reference<css::uno::XInterface>(), 0);
}
preloadImplementations();
@@ -950,7 +950,7 @@ void cppuhelper::ServiceManager::initialize(
OUString cppuhelper::ServiceManager::getImplementationName()
{
return
- "com.sun.star.comp.cppuhelper.bootstrap.ServiceManager";
+ u"com.sun.star.comp.cppuhelper.bootstrap.ServiceManager"_ustr;
}
sal_Bool cppuhelper::ServiceManager::supportsService(
@@ -962,7 +962,7 @@ sal_Bool cppuhelper::ServiceManager::supportsService(
css::uno::Sequence< OUString >
cppuhelper::ServiceManager::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 };
}
css::uno::Reference< css::uno::XInterface >
@@ -992,7 +992,7 @@ cppuhelper::ServiceManager::getAvailableServiceNames()
}
if (data_.services.size() > o3tl::make_unsigned(SAL_MAX_INT32)) {
throw css::uno::RuntimeException(
- "getAvailableServiceNames: too many services",
+ u"getAvailableServiceNames: too many services"_ustr,
static_cast< cppu::OWeakObject * >(this));
}
return comphelper::mapKeysToSequence(data_.services);
@@ -1038,14 +1038,14 @@ css::uno::Reference< css::container::XEnumeration >
cppuhelper::ServiceManager::createEnumeration()
{
throw css::uno::RuntimeException(
- "ServiceManager createEnumeration: method not supported",
+ u"ServiceManager createEnumeration: method not supported"_ustr,
static_cast< cppu::OWeakObject * >(this));
}
sal_Bool cppuhelper::ServiceManager::has(css::uno::Any const &)
{
throw css::uno::RuntimeException(
- "ServiceManager has: method not supported",
+ u"ServiceManager has: method not supported"_ustr,
static_cast< cppu::OWeakObject * >(this));
}
@@ -1060,19 +1060,19 @@ void cppuhelper::ServiceManager::insert(css::uno::Any const & aElement)
OUString uri;
if (!(arg.Value >>= uri)) {
throw css::lang::IllegalArgumentException(
- "Bad uri argument",
+ u"Bad uri argument"_ustr,
static_cast< cppu::OWeakObject * >(this), 0);
}
uris.push_back(uri);
} else if (arg.Name == "component-context") {
if (alienContext.is()) {
throw css::lang::IllegalArgumentException(
- "Multiple component-context arguments",
+ u"Multiple component-context arguments"_ustr,
static_cast< cppu::OWeakObject * >(this), 0);
}
if (!(arg.Value >>= alienContext) || !alienContext.is()) {
throw css::lang::IllegalArgumentException(
- "Bad component-context argument",
+ u"Bad component-context argument"_ustr,
static_cast< cppu::OWeakObject * >(this), 0);
}
} else {
@@ -1091,7 +1091,7 @@ void cppuhelper::ServiceManager::insert(css::uno::Any const & aElement)
}
throw css::lang::IllegalArgumentException(
- "Bad insert element", static_cast< cppu::OWeakObject * >(this), 0);
+ u"Bad insert element"_ustr, static_cast< cppu::OWeakObject * >(this), 0);
}
void cppuhelper::ServiceManager::remove(css::uno::Any const & aElement)
@@ -1108,7 +1108,7 @@ void cppuhelper::ServiceManager::remove(css::uno::Any const & aElement)
OUString uri;
if (!(i.Value >>= uri)) {
throw css::lang::IllegalArgumentException(
- "Bad uri argument",
+ u"Bad uri argument"_ustr,
static_cast< cppu::OWeakObject * >(this), 0);
}
uris.push_back(uri);
@@ -1120,7 +1120,7 @@ void cppuhelper::ServiceManager::remove(css::uno::Any const & aElement)
if ((aElement >>= info) && info.is()) {
if (!removeLegacyFactory(info, true)) {
throw css::container::NoSuchElementException(
- "Remove non-inserted factory object",
+ u"Remove non-inserted factory object"_ustr,
static_cast< cppu::OWeakObject * >(this));
}
return;
@@ -1132,7 +1132,7 @@ void cppuhelper::ServiceManager::remove(css::uno::Any const & aElement)
return;
}
throw css::lang::IllegalArgumentException(
- "Bad remove element", static_cast< cppu::OWeakObject * >(this), 0);
+ u"Bad remove element"_ustr, static_cast< cppu::OWeakObject * >(this), 0);
}
css::uno::Reference< css::container::XEnumeration >
@@ -1415,7 +1415,7 @@ bool cppuhelper::ServiceManager::readLegacyRdbFile(OUString const & uri) {
static_cast< cppu::OWeakObject * >(this));
}
RegistryKeyArray impls;
- switch (rootKey.openSubKeys("IMPLEMENTATIONS", impls)) {
+ switch (rootKey.openSubKeys(u"IMPLEMENTATIONS"_ustr, impls)) {
case RegError::NO_ERROR:
break;
case RegError::KEY_NOT_EXISTS:
@@ -1432,8 +1432,8 @@ bool cppuhelper::ServiceManager::readLegacyRdbFile(OUString const & uri) {
implKey.getName().copy(RTL_CONSTASCII_LENGTH("/IMPLEMENTATIONS/")));
std::shared_ptr< Data::Implementation > impl =
std::make_shared<Data::Implementation>(
- name, readLegacyRdbString(uri, implKey, "UNO/ACTIVATOR"),
- readLegacyRdbString(uri, implKey, "UNO/LOCATION"), "", "", "", false,
+ name, readLegacyRdbString(uri, implKey, u"UNO/ACTIVATOR"_ustr),
+ readLegacyRdbString(uri, implKey, u"UNO/LOCATION"_ustr), "", "", "", false,
css::uno::Reference< css::uno::XComponentContext >(), uri);
if (!data_.namedImplementations.emplace(name, impl).second)
{
@@ -1441,13 +1441,13 @@ bool cppuhelper::ServiceManager::readLegacyRdbFile(OUString const & uri) {
uri + ": duplicate <implementation name=\"" + name + "\">");
}
readLegacyRdbStrings(
- uri, implKey, "UNO/SERVICES", &impl->services);
+ uri, implKey, u"UNO/SERVICES"_ustr, &impl->services);
for (const auto& rService : impl->services)
{
data_.services[rService].push_back(impl);
}
readLegacyRdbStrings(
- uri, implKey, "UNO/SINGLETONS", &impl->singletons);
+ uri, implKey, u"UNO/SINGLETONS"_ustr, &impl->singletons);
for (const auto& rSingleton : impl->singletons)
{
data_.singletons[rSingleton].push_back(impl);
@@ -1553,8 +1553,8 @@ void cppuhelper::ServiceManager::insertLegacyFactory(
f2.set(factoryInfo, css::uno::UNO_QUERY);
if (!f2.is()) {
throw css::lang::IllegalArgumentException(
- ("Bad XServiceInfo argument implements neither"
- " XSingleComponentFactory nor XSingleServiceFactory"),
+ (u"Bad XServiceInfo argument implements neither"
+ " XSingleComponentFactory nor XSingleServiceFactory"_ustr),
static_cast< cppu::OWeakObject * >(this), 0);
}
}
@@ -1599,7 +1599,7 @@ bool cppuhelper::ServiceManager::insertExtraData(Data const & extra) {
if (bDuplicate)
{
throw css::lang::IllegalArgumentException(
- "Insert duplicate factory object",
+ u"Insert duplicate factory object"_ustr,
static_cast< cppu::OWeakObject * >(this), 0);
}
//TODO: The below leaves data_ in an inconsistent state upon exceptions:
diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index b270c62c5cb4..b6885cbed770 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -126,7 +126,7 @@ css::uno::Reference<css::uno::XInterface> invokeComponentFactory(
{
if (!(source.is() && target.is())) {
throw css::loader::CannotActivateFactoryException(
- "cannot get environments",
+ u"cannot get environments"_ustr,
css::uno::Reference<css::uno::XInterface>());
}
OString impl(
@@ -141,7 +141,7 @@ css::uno::Reference<css::uno::XInterface> invokeComponentFactory(
css::uno::Mapping mapFrom(target, source);
if (!(mapTo.is() && mapFrom.is())) {
throw css::loader::CannotActivateFactoryException(
- "cannot get mappings",
+ u"cannot get mappings"_ustr,
css::uno::Reference<css::uno::XInterface>());
}
void * smgr = mapTo.mapInterface(
@@ -189,7 +189,7 @@ cppuhelper::WrapperConstructorFn mapConstructorFn(
{
if (!(source.is() && target.is())) {
throw css::loader::CannotActivateFactoryException(
- "cannot get environments",
+ u"cannot get environments"_ustr,
css::uno::Reference<css::uno::XInterface>());
}
if (source.get() == target.get()) {
@@ -202,7 +202,7 @@ cppuhelper::WrapperConstructorFn mapConstructorFn(
css::uno::Mapping mapFrom(target, source);
if (!(mapTo.is() && mapFrom.is())) {
throw css::loader::CannotActivateFactoryException(
- "cannot get mappings",
+ u"cannot get mappings"_ustr,
css::uno::Reference<css::uno::XInterface>());
}
return [mapFrom, mapTo, target, constructorFunction]
@@ -365,7 +365,7 @@ css::uno::Reference<css::uno::XInterface> cppu::loadSharedLibComponentFactory(
assert(!xKey.is()); (void) xKey;
css::uno::Reference<css::uno::XInterface> fac;
cppuhelper::detail::loadSharedLibComponentFactory(
- uri, "", "", rImplName, "", xMgr, nullptr, &fac);
+ uri, u""_ustr, u""_ustr, rImplName, u""_ustr, xMgr, nullptr, &fac);
return fac;
}
@@ -403,16 +403,16 @@ void cppu::writeSharedLibComponentInfo(
css::uno::Reference<css::uno::XInterface>());
}
css::uno::Environment curEnv(css::uno::Environment::getCurrent());
- css::uno::Environment env(getEnvironmentFromModule(mod, curEnv, u"", ""));
+ css::uno::Environment env(getEnvironmentFromModule(mod, curEnv, u"", u""_ustr));
if (!(curEnv.is() && env.is())) {
throw css::registry::CannotRegisterImplementationException(
- "cannot get environments",
+ u"cannot get environments"_ustr,
css::uno::Reference<css::uno::XInterface>());
}
css::uno::Mapping map(curEnv, env);
if (!map.is()) {
throw css::registry::CannotRegisterImplementationException(
- "cannot get mapping", css::uno::Reference<css::uno::XInterface>());
+ u"cannot get mapping"_ustr, css::uno::Reference<css::uno::XInterface>());
}
void * smgr = map.mapInterface(
xMgr.get(), cppu::UnoType<css::lang::XMultiServiceFactory>::get());
diff --git a/cppuhelper/source/tdmgr.cxx b/cppuhelper/source/tdmgr.cxx
index 1e5826e248c7..821e4871204a 100644
--- a/cppuhelper/source/tdmgr.cxx
+++ b/cppuhelper/source/tdmgr.cxx
@@ -431,91 +431,91 @@ static typelib_TypeDescription * createCTD(
// built in types
case TypeClass_VOID:
{
- OUString aTypeName("void");
+ OUString aTypeName(u"void"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_VOID, aTypeName.pData, nullptr, 0, nullptr );
break;
}
case TypeClass_CHAR:
{
- OUString aTypeName("char");
+ OUString aTypeName(u"char"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_CHAR, aTypeName.pData, nullptr, 0, nullptr );
break;
}
case TypeClass_BOOLEAN:
{
- OUString aTypeName("boolean");
+ OUString aTypeName(u"boolean"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_BOOLEAN, aTypeName.pData, nullptr, 0, nullptr );
break;
}
case TypeClass_BYTE:
{
- OUString aTypeName("byte");
+ OUString aTypeName(u"byte"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_BYTE, aTypeName.pData, nullptr, 0, nullptr );
break;
}
case TypeClass_SHORT:
{
- OUString aTypeName("short");
+ OUString aTypeName(u"short"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_SHORT, aTypeName.pData, nullptr, 0, nullptr );
break;
}
case TypeClass_UNSIGNED_SHORT:
{
- OUString aTypeName("unsigned short");
+ OUString aTypeName(u"unsigned short"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_UNSIGNED_SHORT, aTypeName.pData, nullptr, 0, nullptr );
break;
}
case TypeClass_LONG:
{
- OUString aTypeName("long");
+ OUString aTypeName(u"long"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_LONG, aTypeName.pData, nullptr, 0, nullptr );
break;
}
case TypeClass_UNSIGNED_LONG:
{
- OUString aTypeName("unsigned long");
+ OUString aTypeName(u"unsigned long"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_UNSIGNED_LONG, aTypeName.pData, nullptr, 0, nullptr );
break;
}
case TypeClass_HYPER:
{
- OUString aTypeName("hyper");
+ OUString aTypeName(u"hyper"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_HYPER, aTypeName.pData, nullptr, 0, nullptr );
break;
}
case TypeClass_UNSIGNED_HYPER:
{
- OUString aTypeName("unsigned hyper");
+ OUString aTypeName(u"unsigned hyper"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_UNSIGNED_HYPER, aTypeName.pData, nullptr, 0, nullptr );
break;
}
case TypeClass_FLOAT:
{
- OUString aTypeName("float");
+ OUString aTypeName(u"float"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_FLOAT, aTypeName.pData, nullptr, 0, nullptr );
break;
}
case TypeClass_DOUBLE:
{
- OUString aTypeName("double");
+ OUString aTypeName(u"double"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_DOUBLE, aTypeName.pData, nullptr, 0, nullptr );
break;
}
case TypeClass_STRING:
{
- OUString aTypeName("string");
+ OUString aTypeName(u"string"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_STRING, aTypeName.pData, nullptr, 0, nullptr );
break;
}
case TypeClass_TYPE:
{
- OUString aTypeName("type");
+ OUString aTypeName(u"type"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_TYPE, aTypeName.pData, nullptr, 0, nullptr );
break;
}
case TypeClass_ANY:
{
- OUString aTypeName("any");
+ OUString aTypeName(u"any"_ustr);
typelib_typedescription_new( &pRet, typelib_TypeClass_ANY, aTypeName.pData, nullptr, 0, nullptr );
break;
}
diff --git a/cppuhelper/source/typemanager.cxx b/cppuhelper/source/typemanager.cxx
index 29f7025cdf6a..2d48326e540b 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -1711,7 +1711,7 @@ Enumeration::nextTypeDescription()
std::scoped_lock g(mutex_);
if (positions_.empty()) {
throw css::container::NoSuchElementException(
- "exhausted XTypeDescriptionEnumeration",
+ u"exhausted XTypeDescriptionEnumeration"_ustr,
static_cast< cppu::OWeakObject * >(this));
}
name = current_;
@@ -1905,7 +1905,7 @@ cppuhelper::TypeManager::~TypeManager() noexcept {}
OUString cppuhelper::TypeManager::getImplementationName()
{
return
- "com.sun.star.comp.cppuhelper.bootstrap.TypeManager";
+ u"com.sun.star.comp.cppuhelper.bootstrap.TypeManager"_ustr;
}
sal_Bool cppuhelper::TypeManager::supportsService(
@@ -1917,7 +1917,7 @@ sal_Bool cppuhelper::TypeManager::supportsService(
css::uno::Sequence< OUString >
cppuhelper::TypeManager::getSupportedServiceNames()
{
- return { "com.sun.star.reflection.TypeDescriptionManager" }; //TODO
+ return { u"com.sun.star.reflection.TypeDescriptionManager"_ustr }; //TODO
}
css::uno::Any cppuhelper::TypeManager::getByHierarchicalName(
@@ -1945,7 +1945,7 @@ css::uno::Type cppuhelper::TypeManager::getElementType()
sal_Bool cppuhelper::TypeManager::hasElements()
{
throw css::uno::RuntimeException(
- "TypeManager hasElements: method not supported",
+ u"TypeManager hasElements: method not supported"_ustr,
static_cast< cppu::OWeakObject * >(this));
}
@@ -1953,14 +1953,14 @@ css::uno::Reference< css::container::XEnumeration >
cppuhelper::TypeManager::createEnumeration()
{
throw css::uno::RuntimeException(
- "TypeManager createEnumeration: method not supported",
+ u"TypeManager createEnumeration: method not supported"_ustr,
static_cast< cppu::OWeakObject * >(this));
}
sal_Bool cppuhelper::TypeManager::has(css::uno::Any const &)
{
throw css::uno::RuntimeException(
- "TypeManager has: method not supported",
+ u"TypeManager has: method not supported"_ustr,
static_cast< cppu::OWeakObject * >(this));
}
@@ -1969,8 +1969,8 @@ void cppuhelper::TypeManager::insert(css::uno::Any const & aElement)
OUString uri;
if (!(aElement >>= uri)) {
throw css::lang::IllegalArgumentException(
- ("css.uno.theTypeDescriptionManager.insert expects a string URI"
- " argument"),
+ (u"css.uno.theTypeDescriptionManager.insert expects a string URI"
+ " argument"_ustr),
static_cast< cppu::OWeakObject * >(this), 0);
}
//TODO: check for ElementExistException
@@ -1983,8 +1983,8 @@ void cppuhelper::TypeManager::remove(css::uno::Any const & aElement)
OUString uri;
if (!(aElement >>= uri)) {
throw css::lang::IllegalArgumentException(
- ("css.uno.theTypeDescriptionManager.remove expects a string URI"
- " argument"),
+ (u"css.uno.theTypeDescriptionManager.remove expects a string URI"
+ " argument"_ustr),
static_cast< cppu::OWeakObject * >(this), 0);
}
//TODO: remove requests are silently ignored for now
diff --git a/cppuhelper/source/unourl.cxx b/cppuhelper/source/unourl.cxx
index 9656dd078ba1..be01adb460de 100644
--- a/cppuhelper/source/unourl.cxx
+++ b/cppuhelper/source/unourl.cxx
@@ -68,7 +68,7 @@ inline UnoUrlDescriptor::Impl::Impl(OUString const & rDescriptor)
case STATE_NAME0:
if (bEnd || !rtl::isAsciiAlphanumeric(c))
throw rtl::MalformedUriException(
- "UNO URL contains bad descriptor name");
+ u"UNO URL contains bad descriptor name"_ustr);
nStart = i;
eState = STATE_NAME;
break;
@@ -82,13 +82,13 @@ inline UnoUrlDescriptor::Impl::Impl(OUString const & rDescriptor)
}
else if (!rtl::isAsciiAlphanumeric(c))
throw rtl::MalformedUriException(
- "UNO URL contains bad descriptor name");
+ u"UNO URL contains bad descriptor name"_ustr);
break;
case STATE_KEY0:
if (bEnd || !rtl::isAsciiAlphanumeric(c))
throw rtl::MalformedUriException(
- "UNO URL contains bad parameter key");
+ u"UNO URL contains bad parameter key"_ustr);
nStart = i;
eState = STATE_KEY;
break;
@@ -102,7 +102,7 @@ inline UnoUrlDescriptor::Impl::Impl(OUString const & rDescriptor)
}
else if (bEnd || !rtl::isAsciiAlphanumeric(c))
throw rtl::MalformedUriException(
- "UNO URL contains bad parameter key");
+ u"UNO URL contains bad parameter key"_ustr);
break;
case STATE_VALUE:
@@ -115,7 +115,7 @@ inline UnoUrlDescriptor::Impl::Impl(OUString const & rDescriptor)
rtl_UriDecodeWithCharset,
RTL_TEXTENCODING_UTF8)).second)
throw rtl::MalformedUriException(
- "UNO URL contains duplicated parameter");
+ u"UNO URL contains duplicated parameter"_ustr);
eState = STATE_KEY0;
}
break;
@@ -198,20 +198,20 @@ private:
inline UnoUrl::Impl * UnoUrl::Impl::create(OUString const & rUrl)
{
if (!rUrl.startsWithIgnoreAsciiCase("uno:"))
- throw rtl::MalformedUriException("UNO URL does not start with \"uno:\"");
+ throw rtl::MalformedUriException(u"UNO URL does not start with \"uno:\""_ustr);
sal_Int32 i = RTL_CONSTASCII_LENGTH("uno:");
sal_Int32 j = rUrl.indexOf(';', i);
if (j < 0)
- throw rtl::MalformedUriException("UNO URL has too few semicolons");
+ throw rtl::MalformedUriException(u"UNO URL has too few semicolons"_ustr);
OUString aConnection(rUrl.copy(i, j - i));
i = j + 1;
j = rUrl.indexOf(0x3B, i); // ';'
if (j < 0)
- throw rtl::MalformedUriException("UNO URL has too few semicolons");
+ throw rtl::MalformedUriException(u"UNO URL has too few semicolons"_ustr);
OUString aProtocol(rUrl.copy(i, j - i));
i = j + 1;
if (i == rUrl.getLength())
- throw rtl::MalformedUriException("UNO URL contains empty ObjectName");
+ throw rtl::MalformedUriException(u"UNO URL contains empty ObjectName"_ustr);
for (j = i; j < rUrl.getLength(); ++j)
{
sal_Unicode c = rUrl[j];
@@ -222,7 +222,7 @@ inline UnoUrl::Impl * UnoUrl::Impl::create(OUString const & rUrl)
&& c != 0x2F && c != 0x3A && c != 0x3D // '/', ':', '='
&& c != 0x3F && c != 0x40 && c != 0x5F // '?', '@', '_'
&& c != 0x7E) // '~'
- throw rtl::MalformedUriException("UNO URL contains invalid ObjectName");
+ throw rtl::MalformedUriException(u"UNO URL contains invalid ObjectName"_ustr);
}
return new Impl(aConnection, aProtocol, rUrl.copy(i));
}