loplugin:ostr in configmgr

Change-Id: If1caaee8e54b5861e1435e900b3ae7bd90ecae5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167237
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit is contained in:
Noel Grandin
2024-05-06 18:30:35 +02:00
parent ae4f76363d
commit b667543a2a
18 changed files with 193 additions and 194 deletions

View File

@@ -138,10 +138,10 @@ void RecursiveTest::test()
{ {
properties_.set( properties_.set(
test_.createUpdateAccess( test_.createUpdateAccess(
"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/" u"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/"
".uno:WebHtml"), ".uno:WebHtml"_ustr),
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
properties_->addPropertyChangeListener("Label", this); properties_->addPropertyChangeListener(u"Label"_ustr, this);
step(); step();
CPPUNIT_ASSERT_EQUAL(0, count_); CPPUNIT_ASSERT_EQUAL(0, count_);
css::uno::Reference< css::lang::XComponent >( css::uno::Reference< css::lang::XComponent >(
@@ -169,7 +169,7 @@ void RecursiveTest::propertyChange(css::beans::PropertyChangeEvent const & evt)
css::uno::Reference<css::uno::XInterface>( css::uno::Reference<css::uno::XInterface>(
properties_, css::uno::UNO_QUERY_THROW), properties_, css::uno::UNO_QUERY_THROW),
evt.Source); evt.Source);
CPPUNIT_ASSERT_EQUAL( OUString("Label"), evt.PropertyName ); CPPUNIT_ASSERT_EQUAL( u"Label"_ustr, evt.PropertyName );
if (count_ > 0) { if (count_ > 0) {
--count_; --count_;
step(); step();
@@ -192,10 +192,10 @@ SimpleRecursiveTest::SimpleRecursiveTest(
void SimpleRecursiveTest::step() const void SimpleRecursiveTest::step() const
{ {
test_.setKey( test_.setKey(
"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/" u"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/"
".uno:WebHtml", ".uno:WebHtml"_ustr,
"Label", u"Label"_ustr,
css::uno::Any(OUString("step"))); css::uno::Any(u"step"_ustr));
} }
void Test::setUp() void Test::setUp()
@@ -210,12 +210,12 @@ void Test::testKeyFetch()
OUString s; OUString s;
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
getKey( getKey(
"/org.openoffice.System", u"/org.openoffice.System"_ustr,
"L10N/Locale") >>= u"L10N/Locale"_ustr) >>=
s); s);
} }
{ {
auto const v = getKey("/org.openoffice.System", "L10N/['Locale']"); auto const v = getKey(u"/org.openoffice.System"_ustr, u"L10N/['Locale']"_ustr);
CPPUNIT_ASSERT_EQUAL(cppu::UnoType<OUString>::get(), v.getValueType()); CPPUNIT_ASSERT_EQUAL(cppu::UnoType<OUString>::get(), v.getValueType());
} }
} }
@@ -223,31 +223,31 @@ void Test::testKeyFetch()
void Test::testKeySet() void Test::testKeySet()
{ {
setKey( setKey(
"/org.openoffice.System/L10N", u"/org.openoffice.System/L10N"_ustr,
"Locale", u"Locale"_ustr,
css::uno::Any(OUString("com.sun.star.configuration.backend.LocaleBackend UILocale"))); css::uno::Any(u"com.sun.star.configuration.backend.LocaleBackend UILocale"_ustr));
OUString s; OUString s;
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
getKey( getKey(
"/org.openoffice.System/L10N", u"/org.openoffice.System/L10N"_ustr,
"Locale") >>= u"Locale"_ustr) >>=
s); s);
CPPUNIT_ASSERT_EQUAL( OUString("com.sun.star.configuration.backend.LocaleBackend UILocale"), s ); CPPUNIT_ASSERT_EQUAL( u"com.sun.star.configuration.backend.LocaleBackend UILocale"_ustr, s );
} }
void Test::testKeyReset() void Test::testKeyReset()
{ {
if (resetKey( if (resetKey(
"/org.openoffice.System/L10N", u"/org.openoffice.System/L10N"_ustr,
"Locale")) u"Locale"_ustr))
{ {
OUString s; OUString s;
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
getKey( getKey(
"/org.openoffice.System/L10N", u"/org.openoffice.System/L10N"_ustr,
"Locale") >>= u"Locale"_ustr) >>=
s); s);
CPPUNIT_ASSERT_EQUAL( OUString("com.sun.star.configuration.backend.LocaleBackend Locale"), s ); CPPUNIT_ASSERT_EQUAL( u"com.sun.star.configuration.backend.LocaleBackend Locale"_ustr, s );
} }
} }
@@ -256,21 +256,21 @@ void Test::testSetSetMemberName()
OUString s; OUString s;
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
getKey( getKey(
"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/" u"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/"
".uno:FontworkShapeType", ".uno:FontworkShapeType"_ustr,
"Label") >>= u"Label"_ustr) >>=
s); s);
CPPUNIT_ASSERT_EQUAL( OUString("Fontwork Shape"), s ); CPPUNIT_ASSERT_EQUAL( u"Fontwork Shape"_ustr, s );
css::uno::Reference< css::container::XNameAccess > access( css::uno::Reference< css::container::XNameAccess > access(
createUpdateAccess( createUpdateAccess(
"/org.openoffice.Office.UI.GenericCommands/UserInterface/" u"/org.openoffice.Office.UI.GenericCommands/UserInterface/"
"Commands"), "Commands"_ustr),
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
css::uno::Reference< css::container::XNamed > member; css::uno::Reference< css::container::XNamed > member;
access->getByName(".uno:FontworkGalleryFloater") >>= member; access->getByName(u".uno:FontworkGalleryFloater"_ustr) >>= member;
CPPUNIT_ASSERT(member.is()); CPPUNIT_ASSERT(member.is());
member->setName(".uno:FontworkShapeType"); member->setName(u".uno:FontworkShapeType"_ustr);
css::uno::Reference< css::util::XChangesBatch >( css::uno::Reference< css::util::XChangesBatch >(
access, css::uno::UNO_QUERY_THROW)->commitChanges(); access, css::uno::UNO_QUERY_THROW)->commitChanges();
css::uno::Reference< css::lang::XComponent >( css::uno::Reference< css::lang::XComponent >(
@@ -278,38 +278,38 @@ void Test::testSetSetMemberName()
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
getKey( getKey(
"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/" u"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/"
".uno:FontworkShapeType", ".uno:FontworkShapeType"_ustr,
"Label") >>= u"Label"_ustr) >>=
s); s);
CPPUNIT_ASSERT_EQUAL( OUString("Insert Fontwork"), s ); CPPUNIT_ASSERT_EQUAL( u"Insert Fontwork"_ustr, s );
} }
void Test::testInsertSetMember() { void Test::testInsertSetMember() {
css::uno::Reference<css::container::XNameContainer> access( css::uno::Reference<css::container::XNameContainer> access(
createUpdateAccess( createUpdateAccess(
"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands"), u"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands"_ustr),
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
css::uno::Reference<css::uno::XInterface> member; css::uno::Reference<css::uno::XInterface> member;
member.set( member.set(
css::uno::Reference<css::lang::XSingleServiceFactory>( css::uno::Reference<css::lang::XSingleServiceFactory>(
access, css::uno::UNO_QUERY_THROW)->createInstance()); access, css::uno::UNO_QUERY_THROW)->createInstance());
CPPUNIT_ASSERT(member.is()); CPPUNIT_ASSERT(member.is());
access->insertByName("A", css::uno::Any(member)); access->insertByName(u"A"_ustr, css::uno::Any(member));
member.set( member.set(
css::uno::Reference<css::lang::XSingleServiceFactory>( css::uno::Reference<css::lang::XSingleServiceFactory>(
access, css::uno::UNO_QUERY_THROW)->createInstance()); access, css::uno::UNO_QUERY_THROW)->createInstance());
CPPUNIT_ASSERT(member.is()); CPPUNIT_ASSERT(member.is());
try { try {
access->insertByName("", css::uno::Any(member)); access->insertByName(u""_ustr, css::uno::Any(member));
CPPUNIT_FAIL("expected IllegalArgumentException"); CPPUNIT_FAIL("expected IllegalArgumentException");
} catch (css::lang::IllegalArgumentException &) {} } catch (css::lang::IllegalArgumentException &) {}
try { try {
access->insertByName("\x01", css::uno::Any(member)); access->insertByName(u"\x01"_ustr, css::uno::Any(member));
CPPUNIT_FAIL("expected IllegalArgumentException"); CPPUNIT_FAIL("expected IllegalArgumentException");
} catch (css::lang::IllegalArgumentException &) {} } catch (css::lang::IllegalArgumentException &) {}
try { try {
access->insertByName("a/b", css::uno::Any(member)); access->insertByName(u"a/b"_ustr, css::uno::Any(member));
} catch (css::lang::IllegalArgumentException &) { } catch (css::lang::IllegalArgumentException &) {
CPPUNIT_FAIL("unexpected IllegalArgumentException"); CPPUNIT_FAIL("unexpected IllegalArgumentException");
} }
@@ -321,15 +321,15 @@ void Test::testInsertSetMember() {
void Test::testLocalizedProperty() { void Test::testLocalizedProperty() {
auto const access = css::configuration::ReadOnlyAccess::create( auto const access = css::configuration::ReadOnlyAccess::create(
comphelper::getProcessComponentContext(), "*"); comphelper::getProcessComponentContext(), u"*"_ustr);
{ {
// See <https://bugs.documentfoundation.org/show_bug.cgi?id=33638> "Pagination extension // See <https://bugs.documentfoundation.org/show_bug.cgi?id=33638> "Pagination extension
// not localized in LibreOffice", which wants to retrieve the non-canonical xml:lang="pt-PT" // not localized in LibreOffice", which wants to retrieve the non-canonical xml:lang="pt-PT"
// value for the passed-in "pt" locale: // value for the passed-in "pt" locale:
OUString v; OUString v;
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
access->getByHierarchicalName("/org.libreoffice.unittest/localized/*pt") >>= v); access->getByHierarchicalName(u"/org.libreoffice.unittest/localized/*pt"_ustr) >>= v);
CPPUNIT_ASSERT_EQUAL(OUString("pt-PT"), v); CPPUNIT_ASSERT_EQUAL(u"pt-PT"_ustr, v);
} }
{ {
// See <https://gerrit.libreoffice.org/c/core/+/147089> "configmgr: fix no longer found // See <https://gerrit.libreoffice.org/c/core/+/147089> "configmgr: fix no longer found
@@ -337,30 +337,30 @@ void Test::testLocalizedProperty() {
// "es-419" locale: // "es-419" locale:
OUString v; OUString v;
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
access->getByHierarchicalName("/org.libreoffice.unittest/localized/*es-419") >>= v); access->getByHierarchicalName(u"/org.libreoffice.unittest/localized/*es-419"_ustr) >>= v);
CPPUNIT_ASSERT_EQUAL(OUString("es"), v); CPPUNIT_ASSERT_EQUAL(u"es"_ustr, v);
} }
{ {
// See <https://git.libreoffice.org/core/+/dfc28be2487c13be36a90efd778b8d8f179c589d%5E%21> // See <https://git.libreoffice.org/core/+/dfc28be2487c13be36a90efd778b8d8f179c589d%5E%21>
// "configmgr: Use a proper LanguageTag-based locale fallback mechanism": // "configmgr: Use a proper LanguageTag-based locale fallback mechanism":
OUString v; OUString v;
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
access->getByHierarchicalName("/org.libreoffice.unittest/localized/*zh-Hant-TW") >>= v); access->getByHierarchicalName(u"/org.libreoffice.unittest/localized/*zh-Hant-TW"_ustr) >>= v);
CPPUNIT_ASSERT_EQUAL(OUString("zh-TW"), v); CPPUNIT_ASSERT_EQUAL(u"zh-TW"_ustr, v);
} }
{ {
// Make sure a degenerate passed-in "-" locale is handled gracefully: // Make sure a degenerate passed-in "-" locale is handled gracefully:
OUString v; OUString v;
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
access->getByHierarchicalName("/org.libreoffice.unittest/localized/*-") >>= v); access->getByHierarchicalName(u"/org.libreoffice.unittest/localized/*-"_ustr) >>= v);
CPPUNIT_ASSERT_EQUAL(OUString("en-US"), v); CPPUNIT_ASSERT_EQUAL(u"en-US"_ustr, v);
} }
{ {
// Make sure a degenerate passed-in "-" locale is handled gracefully: // Make sure a degenerate passed-in "-" locale is handled gracefully:
OUString v; OUString v;
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
access->getByHierarchicalName("/org.libreoffice.unittest/noDefaultLang/*-") >>= v); access->getByHierarchicalName(u"/org.libreoffice.unittest/noDefaultLang/*-"_ustr) >>= v);
CPPUNIT_ASSERT_EQUAL(OUString("en-US"), v); CPPUNIT_ASSERT_EQUAL(u"en-US"_ustr, v);
} }
} }
@@ -368,8 +368,8 @@ void Test::testReadCommands()
{ {
css::uno::Reference< css::container::XNameAccess > access( css::uno::Reference< css::container::XNameAccess > access(
createViewAccess( createViewAccess(
"/org.openoffice.Office.UI.GenericCommands/UserInterface/" u"/org.openoffice.Office.UI.GenericCommands/UserInterface/"
"Commands"), "Commands"_ustr),
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
const css::uno::Sequence< OUString > names(access->getElementNames()); const css::uno::Sequence< OUString > names(access->getElementNames());
@@ -381,9 +381,9 @@ void Test::testReadCommands()
css::uno::Reference< css::container::XNameAccess > child; css::uno::Reference< css::container::XNameAccess > child;
if (access->getByName(childName) >>= child) { if (access->getByName(childName) >>= child) {
CPPUNIT_ASSERT(child.is()); CPPUNIT_ASSERT(child.is());
child->getByName("Label"); child->getByName(u"Label"_ustr);
child->getByName("ContextLabel"); child->getByName(u"ContextLabel"_ustr);
child->getByName("Properties"); child->getByName(u"Properties"_ustr);
} }
} }
} }
@@ -395,7 +395,7 @@ void Test::testReadCommands()
void Test::testListener() void Test::testListener()
{ {
OUString aRandomPath = "/org.openoffice.Office.Math/View"; OUString aRandomPath = u"/org.openoffice.Office.Math/View"_ustr;
// test with no props. // test with no props.
{ {
@@ -409,7 +409,7 @@ void Test::testListener()
rtl::Reference xListener( rtl::Reference xListener(
new comphelper::ConfigurationListener(aRandomPath)); new comphelper::ConfigurationListener(aRandomPath));
comphelper::ConfigurationListenerProperty<bool> aSetting(xListener, "AutoRedraw"); comphelper::ConfigurationListenerProperty<bool> aSetting(xListener, u"AutoRedraw"_ustr);
CPPUNIT_ASSERT_MESSAGE("check AutoRedraw defaults to true", aSetting.get()); CPPUNIT_ASSERT_MESSAGE("check AutoRedraw defaults to true", aSetting.get());
// set to false // set to false
@@ -497,10 +497,10 @@ css::uno::Reference< css::uno::XInterface > Test::createViewAccess(
{ {
css::uno::Any arg( css::uno::Any arg(
css::beans::NamedValue( css::beans::NamedValue(
"nodepath", u"nodepath"_ustr,
css::uno::Any(path))); css::uno::Any(path)));
return provider_->createInstanceWithArguments( return provider_->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationAccess", u"com.sun.star.configuration.ConfigurationAccess"_ustr,
css::uno::Sequence< css::uno::Any >(&arg, 1)); css::uno::Sequence< css::uno::Any >(&arg, 1));
} }
@@ -509,10 +509,10 @@ css::uno::Reference< css::uno::XInterface > Test::createUpdateAccess(
{ {
css::uno::Any arg( css::uno::Any arg(
css::beans::NamedValue( css::beans::NamedValue(
"nodepath", u"nodepath"_ustr,
css::uno::Any(path))); css::uno::Any(path)));
return provider_->createInstanceWithArguments( return provider_->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationUpdateAccess", u"com.sun.star.configuration.ConfigurationUpdateAccess"_ustr,
css::uno::Sequence< css::uno::Any >(&arg, 1)); css::uno::Sequence< css::uno::Any >(&arg, 1));
} }

View File

@@ -239,7 +239,7 @@ OUString Access::getImplementationName()
assert(thisIs(IS_ANY)); assert(thisIs(IS_ANY));
osl::MutexGuard g(*lock_); osl::MutexGuard g(*lock_);
checkLocalizedPropertyAccess(); checkLocalizedPropertyAccess();
return "org.openoffice-configmgr::Access"; return u"org.openoffice-configmgr::Access"_ustr;
} }
sal_Bool Access::supportsService(OUString const & ServiceName) sal_Bool Access::supportsService(OUString const & ServiceName)
@@ -285,7 +285,7 @@ void Access::dispose() {
checkLocalizedPropertyAccess(); checkLocalizedPropertyAccess();
if (getParentAccess().is()) { if (getParentAccess().is()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"configmgr dispose inappropriate Access", u"configmgr dispose inappropriate Access"_ustr,
getXWeak()); getXWeak());
} }
if (disposed_) { if (disposed_) {
@@ -307,7 +307,7 @@ void Access::addEventListener(
checkLocalizedPropertyAccess(); checkLocalizedPropertyAccess();
if (!xListener.is()) { if (!xListener.is()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"null listener", getXWeak()); u"null listener"_ustr, getXWeak());
} }
if (!disposed_) { if (!disposed_) {
disposeListeners_.insert(xListener); disposeListeners_.insert(xListener);
@@ -351,7 +351,7 @@ css::uno::Type Access::getElementType() {
default: default:
assert(false); assert(false);
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"this cannot happen", getXWeak()); u"this cannot happen"_ustr, getXWeak());
} }
} }
@@ -535,8 +535,8 @@ void Access::replaceByHierarchicalName(
break; break;
case Node::KIND_SET: case Node::KIND_SET:
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
("configmgr::Access::replaceByHierarchicalName does not" (u"configmgr::Access::replaceByHierarchicalName does not"
" currently support set members"), " currently support set members"_ustr),
getXWeak(), 0); getXWeak(), 0);
case Node::KIND_ROOT: case Node::KIND_ROOT:
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
@@ -561,7 +561,7 @@ void Access::addContainerListener(
checkLocalizedPropertyAccess(); checkLocalizedPropertyAccess();
if (!xListener.is()) { if (!xListener.is()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"null listener", getXWeak()); u"null listener"_ustr, getXWeak());
} }
if (!disposed_) { if (!disposed_) {
containerListeners_.insert(xListener); containerListeners_.insert(xListener);
@@ -654,7 +654,7 @@ OUString Access::composeHierarchicalName(
checkLocalizedPropertyAccess(); checkLocalizedPropertyAccess();
if (aRelativeName.isEmpty() || aRelativeName[0] == '/') { if (aRelativeName.isEmpty() || aRelativeName[0] == '/') {
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
"configmgr composeHierarchicalName inappropriate relative name", u"configmgr composeHierarchicalName inappropriate relative name"_ustr,
getXWeak(), -1); getXWeak(), -1);
} }
OUStringBuffer path(getRelativePathRepresentation()); OUStringBuffer path(getRelativePathRepresentation());
@@ -729,7 +729,7 @@ void Access::setName(OUString const & aName)
// renaming a property could only work for an extension property, // renaming a property could only work for an extension property,
// but a localized property is never an extension property // but a localized property is never an extension property
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"configmgr setName inappropriate node", u"configmgr setName inappropriate node"_ustr,
getXWeak()); getXWeak());
default: default:
assert(false); // this cannot happen assert(false); // this cannot happen
@@ -763,7 +763,7 @@ void Access::setPropertyValue(
osl::MutexGuard g(*lock_); osl::MutexGuard g(*lock_);
if (!getRootAccess()->isUpdate()) { if (!getRootAccess()->isUpdate()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"configmgr setPropertyValue on non-update access", u"configmgr setPropertyValue on non-update access"_ustr,
getXWeak()); getXWeak());
} }
Modifications localMods; Modifications localMods;
@@ -798,7 +798,7 @@ void Access::addPropertyChangeListener(
osl::MutexGuard g(*lock_); osl::MutexGuard g(*lock_);
if (!xListener.is()) { if (!xListener.is()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"null listener", getXWeak()); u"null listener"_ustr, getXWeak());
} }
checkKnownProperty(aPropertyName); checkKnownProperty(aPropertyName);
if (!disposed_) { if (!disposed_) {
@@ -843,7 +843,7 @@ void Access::addVetoableChangeListener(
osl::MutexGuard g(*lock_); osl::MutexGuard g(*lock_);
if (!aListener.is()) { if (!aListener.is()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"null listener", getXWeak()); u"null listener"_ustr, getXWeak());
} }
checkKnownProperty(PropertyName); checkKnownProperty(PropertyName);
if (!disposed_) { if (!disposed_) {
@@ -889,20 +889,20 @@ void Access::setPropertyValues(
osl::MutexGuard g(*lock_); osl::MutexGuard g(*lock_);
if (!getRootAccess()->isUpdate()) { if (!getRootAccess()->isUpdate()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"configmgr setPropertyValues on non-update access", u"configmgr setPropertyValues on non-update access"_ustr,
getXWeak()); getXWeak());
} }
if (aPropertyNames.getLength() != aValues.getLength()) { if (aPropertyNames.getLength() != aValues.getLength()) {
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
("configmgr setPropertyValues: aPropertyNames/aValues of" (u"configmgr setPropertyValues: aPropertyNames/aValues of"
" different length"), " different length"_ustr),
getXWeak(), -1); getXWeak(), -1);
} }
Modifications localMods; Modifications localMods;
for (sal_Int32 i = 0; i < aPropertyNames.getLength(); ++i) { for (sal_Int32 i = 0; i < aPropertyNames.getLength(); ++i) {
if (!setChildProperty(aPropertyNames[i], aValues[i], &localMods)) { if (!setChildProperty(aPropertyNames[i], aValues[i], &localMods)) {
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
"configmgr setPropertyValues inappropriate property name", u"configmgr setPropertyValues inappropriate property name"_ustr,
getXWeak(), -1); getXWeak(), -1);
} }
} }
@@ -922,7 +922,7 @@ css::uno::Sequence< css::uno::Any > Access::getPropertyValues(
{ {
if (!getByNameFast(aPropertyNames[i], aValsRange[i])) if (!getByNameFast(aPropertyNames[i], aValsRange[i]))
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"configmgr getPropertyValues inappropriate property name", u"configmgr getPropertyValues inappropriate property name"_ustr,
getXWeak()); getXWeak());
} }
@@ -939,7 +939,7 @@ void Access::addPropertiesChangeListener(
osl::MutexGuard g(*lock_); osl::MutexGuard g(*lock_);
if (!xListener.is()) { if (!xListener.is()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"null listener", getXWeak()); u"null listener"_ustr, getXWeak());
} }
if (!disposed_) { if (!disposed_) {
propertiesChangeListeners_.insert(xListener); propertiesChangeListeners_.insert(xListener);
@@ -998,7 +998,7 @@ void Access::setHierarchicalPropertyValue(
osl::MutexGuard g(*lock_); osl::MutexGuard g(*lock_);
if (!getRootAccess()->isUpdate()) { if (!getRootAccess()->isUpdate()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"configmgr setHierarchicalPropertyName on non-update access", u"configmgr setHierarchicalPropertyName on non-update access"_ustr,
getXWeak()); getXWeak());
} }
rtl::Reference< ChildAccess > child( rtl::Reference< ChildAccess > child(
@@ -1040,13 +1040,13 @@ void Access::setHierarchicalPropertyValues(
osl::MutexGuard g(*lock_); osl::MutexGuard g(*lock_);
if (!getRootAccess()->isUpdate()) { if (!getRootAccess()->isUpdate()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"configmgr setPropertyValues on non-update access", u"configmgr setPropertyValues on non-update access"_ustr,
getXWeak()); getXWeak());
} }
if (aHierarchicalPropertyNames.getLength() != Values.getLength()) { if (aHierarchicalPropertyNames.getLength() != Values.getLength()) {
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
("configmgr setHierarchicalPropertyValues:" (u"configmgr setHierarchicalPropertyValues:"
" aHierarchicalPropertyNames/Values of different length"), " aHierarchicalPropertyNames/Values of different length"_ustr),
getXWeak(), -1); getXWeak(), -1);
} }
Modifications localMods; Modifications localMods;
@@ -1055,8 +1055,8 @@ void Access::setHierarchicalPropertyValues(
getSubChild(aHierarchicalPropertyNames[i])); getSubChild(aHierarchicalPropertyNames[i]));
if (!child.is()) { if (!child.is()) {
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
("configmgr setHierarchicalPropertyValues inappropriate" (u"configmgr setHierarchicalPropertyValues inappropriate"
" property name"), " property name"_ustr),
getXWeak(), -1); getXWeak(), -1);
} }
child->checkFinalized(); child->checkFinalized();
@@ -1080,8 +1080,8 @@ css::uno::Sequence< css::uno::Any > Access::getHierarchicalPropertyValues(
getSubChild(aHierarchicalPropertyNames[i])); getSubChild(aHierarchicalPropertyNames[i]));
if (!child.is()) { if (!child.is()) {
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
("configmgr getHierarchicalPropertyValues inappropriate" (u"configmgr getHierarchicalPropertyValues inappropriate"
" hierarchical property name"), " hierarchical property name"_ustr),
getXWeak(), -1); getXWeak(), -1);
} }
aValsRange[i] = child->asValue(); aValsRange[i] = child->asValue();
@@ -1268,8 +1268,8 @@ css::uno::Reference< css::uno::XInterface > Access::createInstanceWithArguments(
assert(thisIs(IS_SET|IS_UPDATE)); assert(thisIs(IS_SET|IS_UPDATE));
if (aArguments.hasElements()) { if (aArguments.hasElements()) {
throw css::uno::Exception( throw css::uno::Exception(
("configuration SimpleSetUpdate createInstanceWithArguments" (u"configuration SimpleSetUpdate createInstanceWithArguments"
" must not specify any arguments"), " must not specify any arguments"_ustr),
getXWeak()); getXWeak());
} }
return createInstance(); return createInstance();
@@ -1421,7 +1421,7 @@ void Access::checkLocalizedPropertyAccess() {
!Components::allLocales(getRootAccess()->getLocale())) !Components::allLocales(getRootAccess()->getLocale()))
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"configmgr Access to specialized LocalizedPropertyNode", u"configmgr Access to specialized LocalizedPropertyNode"_ustr,
getXWeak()); getXWeak());
} }
} }
@@ -1509,15 +1509,15 @@ rtl::Reference< ChildAccess > Access::getChild(OUString const & name) {
} }
// Defaults are the "en-US" locale, the "en" locale, the empty string locale, the first child (if // Defaults are the "en-US" locale, the "en" locale, the empty string locale, the first child (if
// any, and if the property is non-nillable), or a null ChildAccess, in that order: // any, and if the property is non-nillable), or a null ChildAccess, in that order:
rtl::Reference< ChildAccess > child(getChild("en-US")); rtl::Reference< ChildAccess > child(getChild(u"en-US"_ustr));
if (child.is()) { if (child.is()) {
return child; return child;
} }
child = getChild("en"); child = getChild(u"en"_ustr);
if (child.is()) { if (child.is()) {
return child; return child;
} }
child = getChild(""); child = getChild(u""_ustr);
if (child.is()) { if (child.is()) {
return child; return child;
} }
@@ -1608,7 +1608,7 @@ void Access::checkValue(css::uno::Any const & value, Type type, bool nillable) {
} }
if (!ok) { if (!ok) {
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
"configmgr inappropriate property value", u"configmgr inappropriate property value"_ustr,
getXWeak(), -1); getXWeak(), -1);
} }
} }
@@ -1744,7 +1744,7 @@ void Access::initBroadcasterAndChanges(
css::uno::Any())); css::uno::Any()));
} }
} }
j = propertyChangeListeners_.find(""); j = propertyChangeListeners_.find(u""_ustr);
if (j != propertyChangeListeners_.end()) { if (j != propertyChangeListeners_.end()) {
for (auto const& propertyChangeListenerElement : j->second) for (auto const& propertyChangeListenerElement : j->second)
{ {
@@ -1822,7 +1822,7 @@ void Access::initBroadcasterAndChanges(
css::uno::Any())); css::uno::Any()));
} }
} }
j = propertyChangeListeners_.find(""); j = propertyChangeListeners_.find(u""_ustr);
if (j != propertyChangeListeners_.end()) { if (j != propertyChangeListeners_.end()) {
for (auto const& propertyChangeListenerElement : j->second) for (auto const& propertyChangeListenerElement : j->second)
{ {
@@ -1941,7 +1941,7 @@ void Access::initBroadcasterAndChanges(
css::uno::Any())); css::uno::Any()));
} }
} }
j = propertyChangeListeners_.find(""); j = propertyChangeListeners_.find(u""_ustr);
if (j != propertyChangeListeners_.end()) { if (j != propertyChangeListeners_.end()) {
for (auto const& propertyChangeListenerElement : j->second) for (auto const& propertyChangeListenerElement : j->second)
{ {
@@ -2224,7 +2224,7 @@ css::beans::Property Access::asProperty() {
void Access::checkFinalized() { void Access::checkFinalized() {
if (isFinalized()) { if (isFinalized()) {
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
"configmgr modification of finalized item", u"configmgr modification of finalized item"_ustr,
getXWeak(), -1); getXWeak(), -1);
} }
} }
@@ -2267,7 +2267,7 @@ rtl::Reference< ChildAccess > Access::getFreeSetMember(
freeAcc->getRootAccess() != getRootAccess())) freeAcc->getRootAccess() != getRootAccess()))
{ {
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
"configmgr inappropriate set element", u"configmgr inappropriate set element"_ustr,
getXWeak(), 1); getXWeak(), 1);
} }
assert(dynamic_cast< SetNode * >(getNode().get()) != nullptr); assert(dynamic_cast< SetNode * >(getNode().get()) != nullptr);
@@ -2275,7 +2275,7 @@ rtl::Reference< ChildAccess > Access::getFreeSetMember(
freeAcc->getNode()->getTemplateName())) freeAcc->getNode()->getTemplateName()))
{ {
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
"configmgr inappropriate set element", u"configmgr inappropriate set element"_ustr,
getXWeak(), 1); getXWeak(), 1);
} }
return freeAcc; return freeAcc;

View File

@@ -150,7 +150,7 @@ void ChildAccess::setParent(css::uno::Reference< css::uno::XInterface > const &)
osl::MutexGuard g(*lock_); osl::MutexGuard g(*lock_);
checkLocalizedPropertyAccess(); checkLocalizedPropertyAccess();
throw css::lang::NoSupportException( throw css::lang::NoSupportException(
"setParent", getXWeak()); u"setParent"_ustr, getXWeak());
} }
void ChildAccess::bind( void ChildAccess::bind(
@@ -312,8 +312,8 @@ void ChildAccess::addSupportedServiceNames(
assert(services != nullptr); assert(services != nullptr);
services->push_back( services->push_back(
getParentNode()->kind() == Node::KIND_GROUP getParentNode()->kind() == Node::KIND_GROUP
? OUString("com.sun.star.configuration.GroupElement") ? u"com.sun.star.configuration.GroupElement"_ustr
: OUString("com.sun.star.configuration.SetElement")); : u"com.sun.star.configuration.SetElement"_ustr);
} }
css::uno::Any ChildAccess::queryInterface(css::uno::Type const & aType) css::uno::Any ChildAccess::queryInterface(css::uno::Type const & aType)

View File

@@ -466,7 +466,7 @@ Components::Components(
{ {
assert(context.is()); assert(context.is());
lock_ = lock(); lock_ = lock();
OUString conf(expand("${CONFIGURATION_LAYERS}")); OUString conf(expand(u"${CONFIGURATION_LAYERS}"_ustr));
int layer = 0; int layer = 0;
for (sal_Int32 i = 0;;) { for (sal_Int32 i = 0;;) {
while (i != conf.getLength() && conf[i] == ' ') { while (i != conf.getLength() && conf[i] == ' ') {
@@ -477,8 +477,8 @@ Components::Components(
} }
if (modificationTarget_ != ModificationTarget::None) { if (modificationTarget_ != ModificationTarget::None) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"CONFIGURATION_LAYERS: modification target layer followed by" u"CONFIGURATION_LAYERS: modification target layer followed by"
" further layers"); " further layers"_ustr);
} }
sal_Int32 c = i; sal_Int32 c = i;
for (;; ++c) { for (;; ++c) {
@@ -507,7 +507,7 @@ Components::Components(
} else if (type == "sharedext") { } else if (type == "sharedext") {
if (sharedExtensionLayer_ != -1) { if (sharedExtensionLayer_ != -1) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"CONFIGURATION_LAYERS: multiple \"sharedext\" layers"); u"CONFIGURATION_LAYERS: multiple \"sharedext\" layers"_ustr);
} }
sharedExtensionLayer_ = layer; sharedExtensionLayer_ = layer;
parseXcsXcuIniLayer(layer, url, true); parseXcsXcuIniLayer(layer, url, true);
@@ -515,7 +515,7 @@ Components::Components(
} else if (type == "userext") { } else if (type == "userext") {
if (userExtensionLayer_ != -1) { if (userExtensionLayer_ != -1) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"CONFIGURATION_LAYERS: multiple \"userext\" layers"); u"CONFIGURATION_LAYERS: multiple \"userext\" layers"_ustr);
} }
userExtensionLayer_ = layer; userExtensionLayer_ = layer;
parseXcsXcuIniLayer(layer, url, true); parseXcsXcuIniLayer(layer, url, true);
@@ -570,7 +570,7 @@ Components::Components(
} }
if (url.isEmpty()) { if (url.isEmpty()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"CONFIGURATION_LAYERS: empty \"user\" URL"); u"CONFIGURATION_LAYERS: empty \"user\" URL"_ustr);
} }
bool ignore = false; bool ignore = false;
#if ENABLE_DCONF #if ENABLE_DCONF
@@ -819,8 +819,8 @@ void Components::parseXcdFiles(int layer, OUString const & url) {
void Components::parseXcsXcuLayer(int layer, OUString const & url) { void Components::parseXcsXcuLayer(int layer, OUString const & url) {
parseXcdFiles(layer, url); parseXcdFiles(layer, url);
parseFiles(layer, ".xcs", &parseXcsFile, url + "/schema", false); parseFiles(layer, u".xcs"_ustr, &parseXcsFile, url + "/schema", false);
parseFiles(layer + 1, ".xcu", &parseXcuFile, url + "/data", false); parseFiles(layer + 1, u".xcu"_ustr, &parseXcuFile, url + "/data", false);
} }
void Components::parseXcsXcuIniLayer( void Components::parseXcsXcuIniLayer(
@@ -860,7 +860,7 @@ void Components::parseXcsXcuIniLayer(
void Components::parseResLayer(int layer, std::u16string_view url) { void Components::parseResLayer(int layer, std::u16string_view url) {
OUString resUrl(OUString::Concat(url) + "/res"); OUString resUrl(OUString::Concat(url) + "/res");
parseXcdFiles(layer, resUrl); parseXcdFiles(layer, resUrl);
parseFiles(layer, ".xcu", &parseXcuFile, resUrl, false); parseFiles(layer, u".xcu"_ustr, &parseXcuFile, resUrl, false);
} }
void Components::parseModificationLayer(int layer, OUString const & url) { void Components::parseModificationLayer(int layer, OUString const & url) {
@@ -873,10 +873,10 @@ void Components::parseModificationLayer(int layer, OUString const & url) {
// longer relevant, probably OOo 4; also see hack for xsi namespace in // longer relevant, probably OOo 4; also see hack for xsi namespace in
// xmlreader::XmlReader::registerNamespaceIri): // xmlreader::XmlReader::registerNamespaceIri):
parseFiles( parseFiles(
layer, ".xcu", &parseXcuFile, layer, u".xcu"_ustr, &parseXcuFile,
expand( expand(
"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap")
":UserInstallation}/user/registry/data"), ":UserInstallation}/user/registry/data"_ustr),
false); false);
} }
} }
@@ -885,7 +885,7 @@ int Components::getExtensionLayer(bool shared) const {
int layer = shared ? sharedExtensionLayer_ : userExtensionLayer_; int layer = shared ? sharedExtensionLayer_ : userExtensionLayer_;
if (layer == -1) { if (layer == -1) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"insert extension xcs/xcu file into undefined layer"); u"insert extension xcs/xcu file into undefined layer"_ustr);
} }
return layer; return layer;
} }

View File

@@ -67,8 +67,8 @@ constexpr OUString updateAccessServiceName =
void badNodePath() { void badNodePath() {
throw css::uno::Exception( throw css::uno::Exception(
("com.sun.star.configuration.ConfigurationProvider expects a single," (u"com.sun.star.configuration.ConfigurationProvider expects a single,"
" non-empty, string nodepath argument"), " non-empty, string nodepath argument"_ustr),
nullptr); nullptr);
} }
@@ -112,7 +112,7 @@ private:
{ {
return default_ return default_
? default_provider::getImplementationName() ? default_provider::getImplementationName()
: "com.sun.star.comp.configuration.ConfigurationProvider"; : u"com.sun.star.comp.configuration.ConfigurationProvider"_ustr;
} }
virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override
@@ -123,7 +123,7 @@ private:
{ {
return default_ return default_
? default_provider::getSupportedServiceNames() ? default_provider::getSupportedServiceNames()
: css::uno::Sequence<OUString> { "com.sun.star.configuration.ConfigurationProvider" }; : css::uno::Sequence<OUString> { u"com.sun.star.configuration.ConfigurationProvider"_ustr };
} }
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
@@ -201,8 +201,8 @@ Service::createInstanceWithArguments(
break; break;
} else { } else {
throw css::uno::Exception( throw css::uno::Exception(
("com.sun.star.configuration.ConfigurationProvider expects" (u"com.sun.star.configuration.ConfigurationProvider expects"
" NamedValue or PropertyValue arguments"), " NamedValue or PropertyValue arguments"_ustr),
nullptr); nullptr);
} }
// For backwards compatibility, allow "nodepath" and "Locale" in any // For backwards compatibility, allow "nodepath" and "Locale" in any
@@ -218,8 +218,8 @@ Service::createInstanceWithArguments(
locale.isEmpty()) locale.isEmpty())
{ {
throw css::uno::Exception( throw css::uno::Exception(
("com.sun.star.configuration.ConfigurationProvider expects" (u"com.sun.star.configuration.ConfigurationProvider expects"
" at most one, non-empty, string Locale argument"), " at most one, non-empty, string Locale argument"_ustr),
nullptr); nullptr);
} }
} }
@@ -368,8 +368,8 @@ com_sun_star_comp_configuration_ConfigurationProvider_get_implementation(
value = v2.Value; value = v2.Value;
} else { } else {
throw css::uno::Exception( throw css::uno::Exception(
("com.sun.star.configuration.ConfigurationProvider factory" (u"com.sun.star.configuration.ConfigurationProvider factory"
" expects NamedValue or PropertyValue arguments"), " expects NamedValue or PropertyValue arguments"_ustr),
nullptr); nullptr);
} }
// For backwards compatibility, allow "Locale" and (ignored) // For backwards compatibility, allow "Locale" and (ignored)
@@ -379,9 +379,9 @@ com_sun_star_comp_configuration_ConfigurationProvider_get_implementation(
locale.isEmpty()) locale.isEmpty())
{ {
throw css::uno::Exception( throw css::uno::Exception(
("com.sun.star.configuration.ConfigurationProvider" (u"com.sun.star.configuration.ConfigurationProvider"
" factory expects at most one, non-empty, string" " factory expects at most one, non-empty, string"
" Locale argument"), " Locale argument"_ustr),
nullptr); nullptr);
} }
} else if (!name.equalsIgnoreAsciiCase("enableasync")) { } else if (!name.equalsIgnoreAsciiCase("enableasync")) {

View File

@@ -78,14 +78,14 @@ private:
virtual ~Service() override {} virtual ~Service() override {}
virtual OUString SAL_CALL getImplementationName() override virtual OUString SAL_CALL getImplementationName() override
{ return "com.sun.star.comp.configuration.ConfigurationRegistry"; } { return u"com.sun.star.comp.configuration.ConfigurationRegistry"_ustr; }
virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override
{ return cppu::supportsService(this, ServiceName); } { return cppu::supportsService(this, ServiceName); }
virtual css::uno::Sequence< OUString > SAL_CALL virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedServiceNames() override getSupportedServiceNames() override
{ return { "com.sun.star.configuration.ConfigurationRegistry" }; } { return { u"com.sun.star.configuration.ConfigurationRegistry"_ustr }; }
virtual OUString SAL_CALL getURL() override; virtual OUString SAL_CALL getURL() override;
@@ -221,7 +221,7 @@ Service::Service(
try { try {
provider_.set( provider_.set(
context->getServiceManager()->createInstanceWithContext( context->getServiceManager()->createInstanceWithContext(
"com.sun.star.configuration.DefaultProvider", context), u"com.sun.star.configuration.DefaultProvider"_ustr, context),
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
} catch (css::uno::RuntimeException &) { } catch (css::uno::RuntimeException &) {
throw; throw;
@@ -248,13 +248,12 @@ void Service::open(OUString const & rURL, sal_Bool bReadOnly, sal_Bool)
doClose(); doClose();
} }
css::uno::Sequence< css::uno::Any > args{ css::uno::Any( css::uno::Sequence< css::uno::Any > args{ css::uno::Any(
css::beans::NamedValue("nodepath", css::uno::Any(rURL))) }; css::beans::NamedValue(u"nodepath"_ustr, css::uno::Any(rURL))) };
try { try {
access_ = provider_->createInstanceWithArguments( access_ = provider_->createInstanceWithArguments(
(bReadOnly (bReadOnly
? OUString("com.sun.star.configuration.ConfigurationAccess") ? u"com.sun.star.configuration.ConfigurationAccess"_ustr
: OUString( : u"com.sun.star.configuration.ConfigurationUpdateAccess"_ustr),
"com.sun.star.configuration.ConfigurationUpdateAccess")),
args); args);
} catch (css::uno::RuntimeException &) { } catch (css::uno::RuntimeException &) {
throw; throw;
@@ -284,7 +283,7 @@ void Service::close()
void Service::destroy() void Service::destroy()
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
@@ -304,14 +303,14 @@ sal_Bool Service::isReadOnly() {
void Service::mergeKey(OUString const &, OUString const &) void Service::mergeKey(OUString const &, OUString const &)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
void Service::flush() void Service::flush()
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
@@ -319,7 +318,7 @@ void Service::addFlushListener(
css::uno::Reference< css::util::XFlushListener > const &) css::uno::Reference< css::util::XFlushListener > const &)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
@@ -327,14 +326,14 @@ void Service::removeFlushListener(
css::uno::Reference< css::util::XFlushListener > const &) css::uno::Reference< css::util::XFlushListener > const &)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
void Service::checkValid() { void Service::checkValid() {
if (!access_.is()) { if (!access_.is()) {
throw css::registry::InvalidRegistryException( throw css::registry::InvalidRegistryException(
"com.sun.star.configuration.ConfigurationRegistry: not valid", u"com.sun.star.configuration.ConfigurationRegistry: not valid"_ustr,
getXWeak()); getXWeak());
} }
} }
@@ -342,7 +341,7 @@ void Service::checkValid() {
void Service::checkValid_RuntimeException() { void Service::checkValid_RuntimeException() {
if (!access_.is()) { if (!access_.is()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not valid", u"com.sun.star.configuration.ConfigurationRegistry: not valid"_ustr,
getXWeak()); getXWeak());
} }
} }
@@ -359,7 +358,7 @@ OUString RegistryKey::getKeyName() {
return named->getName(); return named->getName();
} }
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
@@ -417,14 +416,14 @@ sal_Int32 RegistryKey::getLongValue()
return v; return v;
} }
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
"com.sun.star.configuration.ConfigurationRegistry", u"com.sun.star.configuration.ConfigurationRegistry"_ustr,
getXWeak()); getXWeak());
} }
void RegistryKey::setLongValue(sal_Int32) void RegistryKey::setLongValue(sal_Int32)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
@@ -437,14 +436,14 @@ css::uno::Sequence< sal_Int32 > RegistryKey::getLongListValue()
return v; return v;
} }
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
"com.sun.star.configuration.ConfigurationRegistry", u"com.sun.star.configuration.ConfigurationRegistry"_ustr,
getXWeak()); getXWeak());
} }
void RegistryKey::setLongListValue(css::uno::Sequence< sal_Int32 > const &) void RegistryKey::setLongListValue(css::uno::Sequence< sal_Int32 > const &)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
@@ -457,14 +456,14 @@ OUString RegistryKey::getAsciiValue()
return v; return v;
} }
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
"com.sun.star.configuration.ConfigurationRegistry", u"com.sun.star.configuration.ConfigurationRegistry"_ustr,
getXWeak()); getXWeak());
} }
void RegistryKey::setAsciiValue(OUString const &) void RegistryKey::setAsciiValue(OUString const &)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
@@ -477,14 +476,14 @@ css::uno::Sequence< OUString > RegistryKey::getAsciiListValue()
return v; return v;
} }
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
"com.sun.star.configuration.ConfigurationRegistry", u"com.sun.star.configuration.ConfigurationRegistry"_ustr,
getXWeak()); getXWeak());
} }
void RegistryKey::setAsciiListValue(css::uno::Sequence< OUString > const &) void RegistryKey::setAsciiListValue(css::uno::Sequence< OUString > const &)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
@@ -497,14 +496,14 @@ OUString RegistryKey::getStringValue()
return v; return v;
} }
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
"com.sun.star.configuration.ConfigurationRegistry", u"com.sun.star.configuration.ConfigurationRegistry"_ustr,
getXWeak()); getXWeak());
} }
void RegistryKey::setStringValue(OUString const &) void RegistryKey::setStringValue(OUString const &)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
@@ -517,7 +516,7 @@ css::uno::Sequence< OUString > RegistryKey::getStringListValue()
return v; return v;
} }
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
"com.sun.star.configuration.ConfigurationRegistry", u"com.sun.star.configuration.ConfigurationRegistry"_ustr,
getXWeak()); getXWeak());
} }
@@ -525,7 +524,7 @@ void RegistryKey::setStringListValue(
css::uno::Sequence< OUString > const &) css::uno::Sequence< OUString > const &)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
@@ -538,14 +537,14 @@ css::uno::Sequence< sal_Int8 > RegistryKey::getBinaryValue()
return v; return v;
} }
throw css::registry::InvalidValueException( throw css::registry::InvalidValueException(
"com.sun.star.configuration.ConfigurationRegistry", u"com.sun.star.configuration.ConfigurationRegistry"_ustr,
getXWeak()); getXWeak());
} }
void RegistryKey::setBinaryValue(css::uno::Sequence< sal_Int8 > const &) void RegistryKey::setBinaryValue(css::uno::Sequence< sal_Int8 > const &)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
@@ -568,7 +567,7 @@ css::uno::Reference< css::registry::XRegistryKey > RegistryKey::createKey(
OUString const &) OUString const &)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
@@ -581,7 +580,7 @@ void RegistryKey::closeKey()
void RegistryKey::deleteKey(OUString const &) void RegistryKey::deleteKey(OUString const &)
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
@@ -589,14 +588,14 @@ css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > >
RegistryKey::openKeys() RegistryKey::openKeys()
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }
css::uno::Sequence< OUString > RegistryKey::getKeyNames() css::uno::Sequence< OUString > RegistryKey::getKeyNames()
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"com.sun.star.configuration.ConfigurationRegistry: not implemented", u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr,
getXWeak()); getXWeak());
} }

View File

@@ -42,11 +42,11 @@ com_sun_star_comp_configuration_DefaultProvider_get_implementation(
namespace configmgr::default_provider namespace configmgr::default_provider
{ {
OUString getImplementationName() { return "com.sun.star.comp.configuration.DefaultProvider"; } OUString getImplementationName() { return u"com.sun.star.comp.configuration.DefaultProvider"_ustr; }
css::uno::Sequence<OUString> getSupportedServiceNames() css::uno::Sequence<OUString> getSupportedServiceNames()
{ {
return { "com.sun.star.configuration.DefaultProvider" }; return { u"com.sun.star.configuration.DefaultProvider"_ustr };
} }
} }

View File

@@ -42,7 +42,7 @@ rtl::Reference< Node > LocalizedValueNode::clone(bool) const {
} }
OUString LocalizedValueNode::getTemplateName() const { OUString LocalizedValueNode::getTemplateName() const {
return "*"; return u"*"_ustr;
} }

View File

@@ -33,7 +33,7 @@ namespace configmgr {
NodeMap & Node::getMembers() { NodeMap & Node::getMembers() {
assert(false); assert(false);
throw css::uno::RuntimeException("this cannot happen"); throw css::uno::RuntimeException(u"this cannot happen"_ustr);
} }
OUString Node::getTemplateName() const { OUString Node::getTemplateName() const {

View File

@@ -53,14 +53,14 @@ private:
virtual ~Service() override {} virtual ~Service() override {}
virtual OUString SAL_CALL getImplementationName() override virtual OUString SAL_CALL getImplementationName() override
{ return "com.sun.star.comp.configuration.ReadOnlyAccess"; } { return u"com.sun.star.comp.configuration.ReadOnlyAccess"_ustr; }
virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override
{ return cppu::supportsService(this, ServiceName); } { return cppu::supportsService(this, ServiceName); }
virtual css::uno::Sequence< OUString > SAL_CALL virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedServiceNames() override getSupportedServiceNames() override
{ return { "com.sun.star.configuration.ReadOnlyAccess" }; } { return { u"com.sun.star.configuration.ReadOnlyAccess"_ustr }; }
virtual void SAL_CALL initialize( virtual void SAL_CALL initialize(
css::uno::Sequence< css::uno::Any > const & aArguments) override; css::uno::Sequence< css::uno::Any > const & aArguments) override;
@@ -85,17 +85,17 @@ void Service::initialize(css::uno::Sequence< css::uno::Any > const & aArguments)
OUString locale; OUString locale;
if (aArguments.getLength() != 1 || !(aArguments[0] >>= locale)) { if (aArguments.getLength() != 1 || !(aArguments[0] >>= locale)) {
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
"not exactly one string argument", u"not exactly one string argument"_ustr,
getXWeak(), -1); getXWeak(), -1);
} }
std::unique_lock g1(mutex_); std::unique_lock g1(mutex_);
if (root_.is()) { if (root_.is()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"already initialized", getXWeak()); u"already initialized"_ustr, getXWeak());
} }
osl::MutexGuard g2(*lock()); osl::MutexGuard g2(*lock());
Components & components = Components::getSingleton(context_); Components & components = Components::getSingleton(context_);
root_ = new RootAccess(components, "/", locale, false); root_ = new RootAccess(components, u"/"_ustr, locale, false);
components.addRootAccess(root_); components.addRootAccess(root_);
} }
@@ -103,7 +103,7 @@ rtl::Reference< RootAccess > Service::getRoot() {
std::unique_lock g(mutex_); std::unique_lock g(mutex_);
if (!root_.is()) { if (!root_.is()) {
throw css::lang::NotInitializedException( throw css::lang::NotInitializedException(
"not initialized", getXWeak()); u"not initialized"_ustr, getXWeak());
} }
return root_; return root_;
} }

View File

@@ -53,14 +53,14 @@ private:
virtual ~Service() override {} virtual ~Service() override {}
virtual OUString SAL_CALL getImplementationName() override virtual OUString SAL_CALL getImplementationName() override
{ return "com.sun.star.comp.configuration.ReadWriteAccess"; } { return u"com.sun.star.comp.configuration.ReadWriteAccess"_ustr; }
virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override
{ return cppu::supportsService(this, ServiceName); } { return cppu::supportsService(this, ServiceName); }
virtual css::uno::Sequence< OUString > SAL_CALL virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedServiceNames() override getSupportedServiceNames() override
{ return { "com.sun.star.configuration.ReadWriteAccess" }; } { return { u"com.sun.star.configuration.ReadWriteAccess"_ustr }; }
virtual void SAL_CALL initialize( virtual void SAL_CALL initialize(
css::uno::Sequence< css::uno::Any > const & aArguments) override; css::uno::Sequence< css::uno::Any > const & aArguments) override;
@@ -107,17 +107,17 @@ void Service::initialize(css::uno::Sequence< css::uno::Any > const & aArguments)
OUString locale; OUString locale;
if (aArguments.getLength() != 1 || !(aArguments[0] >>= locale)) { if (aArguments.getLength() != 1 || !(aArguments[0] >>= locale)) {
throw css::lang::IllegalArgumentException( throw css::lang::IllegalArgumentException(
"not exactly one string argument", u"not exactly one string argument"_ustr,
getXWeak(), -1); getXWeak(), -1);
} }
std::unique_lock g1(mutex_); std::unique_lock g1(mutex_);
if (root_.is()) { if (root_.is()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"already initialized", getXWeak()); u"already initialized"_ustr, getXWeak());
} }
osl::MutexGuard g2(*lock()); osl::MutexGuard g2(*lock());
Components & components = Components::getSingleton(context_); Components & components = Components::getSingleton(context_);
root_ = new RootAccess(components, "/", locale, true); root_ = new RootAccess(components, u"/"_ustr, locale, true);
components.addRootAccess(root_); components.addRootAccess(root_);
} }
@@ -125,7 +125,7 @@ rtl::Reference< RootAccess > Service::getRoot() {
std::unique_lock g(mutex_); std::unique_lock g(mutex_);
if (!root_.is()) { if (!root_.is()) {
throw css::lang::NotInitializedException( throw css::lang::NotInitializedException(
"not initialized", getXWeak()); u"not initialized"_ustr, getXWeak());
} }
return root_; return root_;
} }

View File

@@ -118,7 +118,7 @@ void RootAccess::addChangesListener(
checkLocalizedPropertyAccess(); checkLocalizedPropertyAccess();
if (!aListener.is()) { if (!aListener.is()) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"null listener", getXWeak()); u"null listener"_ustr, getXWeak());
} }
if (!isDisposed()) { if (!isDisposed()) {
changesListeners_.insert(aListener); changesListeners_.insert(aListener);
@@ -257,9 +257,9 @@ void RootAccess::addSupportedServiceNames(
std::vector<OUString> * services) std::vector<OUString> * services)
{ {
assert(services != nullptr); assert(services != nullptr);
services->push_back("com.sun.star.configuration.AccessRootElement"); services->push_back(u"com.sun.star.configuration.AccessRootElement"_ustr);
if (update_) { if (update_) {
services->push_back("com.sun.star.configuration.UpdateRootElement"); services->push_back(u"com.sun.star.configuration.UpdateRootElement"_ustr);
} }
} }
@@ -305,7 +305,7 @@ OUString RootAccess::getImplementationName()
assert(thisIs(IS_ANY)); assert(thisIs(IS_ANY));
osl::MutexGuard g(*lock_); osl::MutexGuard g(*lock_);
checkLocalizedPropertyAccess(); checkLocalizedPropertyAccess();
return "configmgr.RootAccess"; return u"configmgr.RootAccess"_ustr;
} }
} }

View File

@@ -55,7 +55,7 @@ Type elementType(Type type) {
return TYPE_HEXBINARY; return TYPE_HEXBINARY;
default: default:
assert(false); assert(false);
throw css::uno::RuntimeException("this cannot happen"); throw css::uno::RuntimeException(u"this cannot happen"_ustr);
} }
} }
@@ -94,7 +94,7 @@ css::uno::Type const & mapType(Type type) {
css::uno::Sequence< css::uno::Sequence< sal_Int8 > > >::get(); css::uno::Sequence< css::uno::Sequence< sal_Int8 > > >::get();
default: default:
assert(false); assert(false);
throw css::uno::RuntimeException("this cannot happen"); throw css::uno::RuntimeException(u"this cannot happen"_ustr);
} }
} }

View File

@@ -82,7 +82,7 @@ private:
css::uno::Sequence< OUString > const & excludedPaths) override; css::uno::Sequence< OUString > const & excludedPaths) override;
OUString SAL_CALL getImplementationName() override { OUString SAL_CALL getImplementationName() override {
return "com.sun.star.comp.configuration.Update"; return u"com.sun.star.comp.configuration.Update"_ustr;
} }
sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override { sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override {
@@ -90,7 +90,7 @@ private:
} }
css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override { css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override {
return {"com.sun.star.configuration.Update_Service"}; return {u"com.sun.star.configuration.Update_Service"_ustr};
} }
std::shared_ptr<osl::Mutex> lock_; std::shared_ptr<osl::Mutex> lock_;

View File

@@ -184,7 +184,7 @@ template< typename T > css::uno::Any parseSingleValue(
{ {
T val; T val;
if (!parseValue(text, &val)) { if (!parseValue(text, &val)) {
throw css::uno::RuntimeException("invalid value"); throw css::uno::RuntimeException(u"invalid value"_ustr);
} }
return css::uno::Any(val); return css::uno::Any(val);
} }
@@ -207,7 +207,7 @@ template< typename T > css::uno::Any parseListValue(
if (!parseValue( if (!parseValue(
xmlreader::Span(t.begin, i == -1 ? t.length : i), &val)) xmlreader::Span(t.begin, i == -1 ? t.length : i), &val))
{ {
throw css::uno::RuntimeException("invalid value"); throw css::uno::RuntimeException(u"invalid value"_ustr);
} }
seq.push_back(val); seq.push_back(val);
if (i < 0) { if (i < 0) {
@@ -225,7 +225,7 @@ css::uno::Any parseValue(
{ {
switch (type) { switch (type) {
case TYPE_ANY: case TYPE_ANY:
throw css::uno::RuntimeException("invalid value of type any"); throw css::uno::RuntimeException(u"invalid value of type any"_ustr);
case TYPE_BOOLEAN: case TYPE_BOOLEAN:
return parseSingleValue< sal_Bool >(text); return parseSingleValue< sal_Bool >(text);
case TYPE_SHORT: case TYPE_SHORT:
@@ -257,7 +257,7 @@ css::uno::Any parseValue(
separator, text); separator, text);
default: default:
assert(false); assert(false);
throw css::uno::RuntimeException("this cannot happen"); throw css::uno::RuntimeException(u"this cannot happen"_ustr);
} }
} }

View File

@@ -67,7 +67,7 @@ OString convertToUtf8(std::u16string_view text) {
RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)))
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"cannot convert to UTF-8"); u"cannot convert to UTF-8"_ustr);
} }
return s; return s;
} }

View File

@@ -176,7 +176,7 @@ bool XcsParser::startElement(
assert(elements_.empty()); assert(elements_.empty());
elements_.push( elements_.push(
Element( Element(
new GroupNode(valueParser_.getLayer(), false, ""), new GroupNode(valueParser_.getLayer(), false, u""_ustr),
componentName_)); componentName_));
return true; return true;
} }
@@ -342,7 +342,7 @@ void XcsParser::endElement(xmlreader::XmlReader const & reader) {
default: default:
assert(false); assert(false);
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"this cannot happen"); u"this cannot happen"_ustr);
} }
} else { } else {
if (!elements_.top().node->getMembers().insert( if (!elements_.top().node->getMembers().insert(
@@ -652,7 +652,7 @@ void XcsParser::handleSetItem(xmlreader::XmlReader & reader, SetNode * set) {
} }
set->getAdditionalTemplateNames().push_back( set->getAdditionalTemplateNames().push_back(
xmldata::parseTemplateReference(component, hasNodeType, nodeType, nullptr)); xmldata::parseTemplateReference(component, hasNodeType, nodeType, nullptr));
elements_.push(Element(rtl::Reference< Node >(), "")); elements_.push(Element(rtl::Reference< Node >(), u""_ustr));
} }
} }

View File

@@ -123,7 +123,7 @@ OUString parseTemplateReference(
return *defaultTemplateName; return *defaultTemplateName;
} }
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"missing node-type attribute"); u"missing node-type attribute"_ustr);
} }
return Data::fullTemplateName(component, nodeType); return Data::fullTemplateName(component, nodeType);
} }