From b667543a2a63b3933630032b5470db8bc3eefaf9 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 6 May 2024 18:30:35 +0200 Subject: [PATCH] loplugin:ostr in configmgr Change-Id: If1caaee8e54b5861e1435e900b3ae7bd90ecae5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167237 Reviewed-by: Noel Grandin Tested-by: Jenkins --- configmgr/qa/unit/test.cxx | 122 ++++++++++----------- configmgr/source/access.cxx | 78 ++++++------- configmgr/source/childaccess.cxx | 6 +- configmgr/source/components.cxx | 26 ++--- configmgr/source/configurationprovider.cxx | 24 ++-- configmgr/source/configurationregistry.cxx | 65 ++++++----- configmgr/source/defaultprovider.cxx | 4 +- configmgr/source/localizedvaluenode.cxx | 2 +- configmgr/source/node.cxx | 2 +- configmgr/source/readonlyaccess.cxx | 12 +- configmgr/source/readwriteaccess.cxx | 12 +- configmgr/source/rootaccess.cxx | 8 +- configmgr/source/type.cxx | 4 +- configmgr/source/update.cxx | 4 +- configmgr/source/valueparser.cxx | 8 +- configmgr/source/writemodfile.cxx | 2 +- configmgr/source/xcsparser.cxx | 6 +- configmgr/source/xmldata.cxx | 2 +- 18 files changed, 193 insertions(+), 194 deletions(-) diff --git a/configmgr/qa/unit/test.cxx b/configmgr/qa/unit/test.cxx index d6213692405d..4e3c28329e53 100644 --- a/configmgr/qa/unit/test.cxx +++ b/configmgr/qa/unit/test.cxx @@ -138,10 +138,10 @@ void RecursiveTest::test() { properties_.set( test_.createUpdateAccess( - "/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/" - ".uno:WebHtml"), + u"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/" + ".uno:WebHtml"_ustr), css::uno::UNO_QUERY_THROW); - properties_->addPropertyChangeListener("Label", this); + properties_->addPropertyChangeListener(u"Label"_ustr, this); step(); CPPUNIT_ASSERT_EQUAL(0, count_); css::uno::Reference< css::lang::XComponent >( @@ -169,7 +169,7 @@ void RecursiveTest::propertyChange(css::beans::PropertyChangeEvent const & evt) css::uno::Reference( properties_, css::uno::UNO_QUERY_THROW), evt.Source); - CPPUNIT_ASSERT_EQUAL( OUString("Label"), evt.PropertyName ); + CPPUNIT_ASSERT_EQUAL( u"Label"_ustr, evt.PropertyName ); if (count_ > 0) { --count_; step(); @@ -192,10 +192,10 @@ SimpleRecursiveTest::SimpleRecursiveTest( void SimpleRecursiveTest::step() const { test_.setKey( - "/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/" - ".uno:WebHtml", - "Label", - css::uno::Any(OUString("step"))); + u"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/" + ".uno:WebHtml"_ustr, + u"Label"_ustr, + css::uno::Any(u"step"_ustr)); } void Test::setUp() @@ -210,12 +210,12 @@ void Test::testKeyFetch() OUString s; CPPUNIT_ASSERT( getKey( - "/org.openoffice.System", - "L10N/Locale") >>= + u"/org.openoffice.System"_ustr, + u"L10N/Locale"_ustr) >>= 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::get(), v.getValueType()); } } @@ -223,31 +223,31 @@ void Test::testKeyFetch() void Test::testKeySet() { setKey( - "/org.openoffice.System/L10N", - "Locale", - css::uno::Any(OUString("com.sun.star.configuration.backend.LocaleBackend UILocale"))); + u"/org.openoffice.System/L10N"_ustr, + u"Locale"_ustr, + css::uno::Any(u"com.sun.star.configuration.backend.LocaleBackend UILocale"_ustr)); OUString s; CPPUNIT_ASSERT( getKey( - "/org.openoffice.System/L10N", - "Locale") >>= + u"/org.openoffice.System/L10N"_ustr, + u"Locale"_ustr) >>= 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() { if (resetKey( - "/org.openoffice.System/L10N", - "Locale")) + u"/org.openoffice.System/L10N"_ustr, + u"Locale"_ustr)) { OUString s; CPPUNIT_ASSERT( getKey( - "/org.openoffice.System/L10N", - "Locale") >>= + u"/org.openoffice.System/L10N"_ustr, + u"Locale"_ustr) >>= 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; CPPUNIT_ASSERT( getKey( - "/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/" - ".uno:FontworkShapeType", - "Label") >>= + u"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/" + ".uno:FontworkShapeType"_ustr, + u"Label"_ustr) >>= s); - CPPUNIT_ASSERT_EQUAL( OUString("Fontwork Shape"), s ); + CPPUNIT_ASSERT_EQUAL( u"Fontwork Shape"_ustr, s ); css::uno::Reference< css::container::XNameAccess > access( createUpdateAccess( - "/org.openoffice.Office.UI.GenericCommands/UserInterface/" - "Commands"), + u"/org.openoffice.Office.UI.GenericCommands/UserInterface/" + "Commands"_ustr), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::container::XNamed > member; - access->getByName(".uno:FontworkGalleryFloater") >>= member; + access->getByName(u".uno:FontworkGalleryFloater"_ustr) >>= member; CPPUNIT_ASSERT(member.is()); - member->setName(".uno:FontworkShapeType"); + member->setName(u".uno:FontworkShapeType"_ustr); css::uno::Reference< css::util::XChangesBatch >( access, css::uno::UNO_QUERY_THROW)->commitChanges(); css::uno::Reference< css::lang::XComponent >( @@ -278,38 +278,38 @@ void Test::testSetSetMemberName() CPPUNIT_ASSERT( getKey( - "/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/" - ".uno:FontworkShapeType", - "Label") >>= + u"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/" + ".uno:FontworkShapeType"_ustr, + u"Label"_ustr) >>= s); - CPPUNIT_ASSERT_EQUAL( OUString("Insert Fontwork"), s ); + CPPUNIT_ASSERT_EQUAL( u"Insert Fontwork"_ustr, s ); } void Test::testInsertSetMember() { css::uno::Reference access( createUpdateAccess( - "/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands"), + u"/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands"_ustr), css::uno::UNO_QUERY_THROW); css::uno::Reference member; member.set( css::uno::Reference( access, css::uno::UNO_QUERY_THROW)->createInstance()); CPPUNIT_ASSERT(member.is()); - access->insertByName("A", css::uno::Any(member)); + access->insertByName(u"A"_ustr, css::uno::Any(member)); member.set( css::uno::Reference( access, css::uno::UNO_QUERY_THROW)->createInstance()); CPPUNIT_ASSERT(member.is()); try { - access->insertByName("", css::uno::Any(member)); + access->insertByName(u""_ustr, css::uno::Any(member)); CPPUNIT_FAIL("expected IllegalArgumentException"); } catch (css::lang::IllegalArgumentException &) {} try { - access->insertByName("\x01", css::uno::Any(member)); + access->insertByName(u"\x01"_ustr, css::uno::Any(member)); CPPUNIT_FAIL("expected IllegalArgumentException"); } catch (css::lang::IllegalArgumentException &) {} try { - access->insertByName("a/b", css::uno::Any(member)); + access->insertByName(u"a/b"_ustr, css::uno::Any(member)); } catch (css::lang::IllegalArgumentException &) { CPPUNIT_FAIL("unexpected IllegalArgumentException"); } @@ -321,15 +321,15 @@ void Test::testInsertSetMember() { void Test::testLocalizedProperty() { auto const access = css::configuration::ReadOnlyAccess::create( - comphelper::getProcessComponentContext(), "*"); + comphelper::getProcessComponentContext(), u"*"_ustr); { // See "Pagination extension // not localized in LibreOffice", which wants to retrieve the non-canonical xml:lang="pt-PT" // value for the passed-in "pt" locale: OUString v; CPPUNIT_ASSERT( - access->getByHierarchicalName("/org.libreoffice.unittest/localized/*pt") >>= v); - CPPUNIT_ASSERT_EQUAL(OUString("pt-PT"), v); + access->getByHierarchicalName(u"/org.libreoffice.unittest/localized/*pt"_ustr) >>= v); + CPPUNIT_ASSERT_EQUAL(u"pt-PT"_ustr, v); } { // See "configmgr: fix no longer found @@ -337,30 +337,30 @@ void Test::testLocalizedProperty() { // "es-419" locale: OUString v; CPPUNIT_ASSERT( - access->getByHierarchicalName("/org.libreoffice.unittest/localized/*es-419") >>= v); - CPPUNIT_ASSERT_EQUAL(OUString("es"), v); + access->getByHierarchicalName(u"/org.libreoffice.unittest/localized/*es-419"_ustr) >>= v); + CPPUNIT_ASSERT_EQUAL(u"es"_ustr, v); } { // See // "configmgr: Use a proper LanguageTag-based locale fallback mechanism": OUString v; CPPUNIT_ASSERT( - access->getByHierarchicalName("/org.libreoffice.unittest/localized/*zh-Hant-TW") >>= v); - CPPUNIT_ASSERT_EQUAL(OUString("zh-TW"), v); + access->getByHierarchicalName(u"/org.libreoffice.unittest/localized/*zh-Hant-TW"_ustr) >>= v); + CPPUNIT_ASSERT_EQUAL(u"zh-TW"_ustr, v); } { // Make sure a degenerate passed-in "-" locale is handled gracefully: OUString v; CPPUNIT_ASSERT( - access->getByHierarchicalName("/org.libreoffice.unittest/localized/*-") >>= v); - CPPUNIT_ASSERT_EQUAL(OUString("en-US"), v); + access->getByHierarchicalName(u"/org.libreoffice.unittest/localized/*-"_ustr) >>= v); + CPPUNIT_ASSERT_EQUAL(u"en-US"_ustr, v); } { // Make sure a degenerate passed-in "-" locale is handled gracefully: OUString v; CPPUNIT_ASSERT( - access->getByHierarchicalName("/org.libreoffice.unittest/noDefaultLang/*-") >>= v); - CPPUNIT_ASSERT_EQUAL(OUString("en-US"), v); + access->getByHierarchicalName(u"/org.libreoffice.unittest/noDefaultLang/*-"_ustr) >>= v); + CPPUNIT_ASSERT_EQUAL(u"en-US"_ustr, v); } } @@ -368,8 +368,8 @@ void Test::testReadCommands() { css::uno::Reference< css::container::XNameAccess > access( createViewAccess( - "/org.openoffice.Office.UI.GenericCommands/UserInterface/" - "Commands"), + u"/org.openoffice.Office.UI.GenericCommands/UserInterface/" + "Commands"_ustr), css::uno::UNO_QUERY_THROW); const css::uno::Sequence< OUString > names(access->getElementNames()); @@ -381,9 +381,9 @@ void Test::testReadCommands() css::uno::Reference< css::container::XNameAccess > child; if (access->getByName(childName) >>= child) { CPPUNIT_ASSERT(child.is()); - child->getByName("Label"); - child->getByName("ContextLabel"); - child->getByName("Properties"); + child->getByName(u"Label"_ustr); + child->getByName(u"ContextLabel"_ustr); + child->getByName(u"Properties"_ustr); } } } @@ -395,7 +395,7 @@ void Test::testReadCommands() void Test::testListener() { - OUString aRandomPath = "/org.openoffice.Office.Math/View"; + OUString aRandomPath = u"/org.openoffice.Office.Math/View"_ustr; // test with no props. { @@ -409,7 +409,7 @@ void Test::testListener() rtl::Reference xListener( new comphelper::ConfigurationListener(aRandomPath)); - comphelper::ConfigurationListenerProperty aSetting(xListener, "AutoRedraw"); + comphelper::ConfigurationListenerProperty aSetting(xListener, u"AutoRedraw"_ustr); CPPUNIT_ASSERT_MESSAGE("check AutoRedraw defaults to true", aSetting.get()); // set to false @@ -497,10 +497,10 @@ css::uno::Reference< css::uno::XInterface > Test::createViewAccess( { css::uno::Any arg( css::beans::NamedValue( - "nodepath", + u"nodepath"_ustr, css::uno::Any(path))); return provider_->createInstanceWithArguments( - "com.sun.star.configuration.ConfigurationAccess", + u"com.sun.star.configuration.ConfigurationAccess"_ustr, 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::beans::NamedValue( - "nodepath", + u"nodepath"_ustr, css::uno::Any(path))); return provider_->createInstanceWithArguments( - "com.sun.star.configuration.ConfigurationUpdateAccess", + u"com.sun.star.configuration.ConfigurationUpdateAccess"_ustr, css::uno::Sequence< css::uno::Any >(&arg, 1)); } diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx index b8d174b4b086..0a8d42beb21f 100644 --- a/configmgr/source/access.cxx +++ b/configmgr/source/access.cxx @@ -239,7 +239,7 @@ OUString Access::getImplementationName() assert(thisIs(IS_ANY)); osl::MutexGuard g(*lock_); checkLocalizedPropertyAccess(); - return "org.openoffice-configmgr::Access"; + return u"org.openoffice-configmgr::Access"_ustr; } sal_Bool Access::supportsService(OUString const & ServiceName) @@ -285,7 +285,7 @@ void Access::dispose() { checkLocalizedPropertyAccess(); if (getParentAccess().is()) { throw css::uno::RuntimeException( - "configmgr dispose inappropriate Access", + u"configmgr dispose inappropriate Access"_ustr, getXWeak()); } if (disposed_) { @@ -307,7 +307,7 @@ void Access::addEventListener( checkLocalizedPropertyAccess(); if (!xListener.is()) { throw css::uno::RuntimeException( - "null listener", getXWeak()); + u"null listener"_ustr, getXWeak()); } if (!disposed_) { disposeListeners_.insert(xListener); @@ -351,7 +351,7 @@ css::uno::Type Access::getElementType() { default: assert(false); throw css::uno::RuntimeException( - "this cannot happen", getXWeak()); + u"this cannot happen"_ustr, getXWeak()); } } @@ -535,8 +535,8 @@ void Access::replaceByHierarchicalName( break; case Node::KIND_SET: throw css::lang::IllegalArgumentException( - ("configmgr::Access::replaceByHierarchicalName does not" - " currently support set members"), + (u"configmgr::Access::replaceByHierarchicalName does not" + " currently support set members"_ustr), getXWeak(), 0); case Node::KIND_ROOT: throw css::lang::IllegalArgumentException( @@ -561,7 +561,7 @@ void Access::addContainerListener( checkLocalizedPropertyAccess(); if (!xListener.is()) { throw css::uno::RuntimeException( - "null listener", getXWeak()); + u"null listener"_ustr, getXWeak()); } if (!disposed_) { containerListeners_.insert(xListener); @@ -654,7 +654,7 @@ OUString Access::composeHierarchicalName( checkLocalizedPropertyAccess(); if (aRelativeName.isEmpty() || aRelativeName[0] == '/') { throw css::lang::IllegalArgumentException( - "configmgr composeHierarchicalName inappropriate relative name", + u"configmgr composeHierarchicalName inappropriate relative name"_ustr, getXWeak(), -1); } OUStringBuffer path(getRelativePathRepresentation()); @@ -729,7 +729,7 @@ void Access::setName(OUString const & aName) // renaming a property could only work for an extension property, // but a localized property is never an extension property throw css::uno::RuntimeException( - "configmgr setName inappropriate node", + u"configmgr setName inappropriate node"_ustr, getXWeak()); default: assert(false); // this cannot happen @@ -763,7 +763,7 @@ void Access::setPropertyValue( osl::MutexGuard g(*lock_); if (!getRootAccess()->isUpdate()) { throw css::uno::RuntimeException( - "configmgr setPropertyValue on non-update access", + u"configmgr setPropertyValue on non-update access"_ustr, getXWeak()); } Modifications localMods; @@ -798,7 +798,7 @@ void Access::addPropertyChangeListener( osl::MutexGuard g(*lock_); if (!xListener.is()) { throw css::uno::RuntimeException( - "null listener", getXWeak()); + u"null listener"_ustr, getXWeak()); } checkKnownProperty(aPropertyName); if (!disposed_) { @@ -843,7 +843,7 @@ void Access::addVetoableChangeListener( osl::MutexGuard g(*lock_); if (!aListener.is()) { throw css::uno::RuntimeException( - "null listener", getXWeak()); + u"null listener"_ustr, getXWeak()); } checkKnownProperty(PropertyName); if (!disposed_) { @@ -889,20 +889,20 @@ void Access::setPropertyValues( osl::MutexGuard g(*lock_); if (!getRootAccess()->isUpdate()) { throw css::uno::RuntimeException( - "configmgr setPropertyValues on non-update access", + u"configmgr setPropertyValues on non-update access"_ustr, getXWeak()); } if (aPropertyNames.getLength() != aValues.getLength()) { throw css::lang::IllegalArgumentException( - ("configmgr setPropertyValues: aPropertyNames/aValues of" - " different length"), + (u"configmgr setPropertyValues: aPropertyNames/aValues of" + " different length"_ustr), getXWeak(), -1); } Modifications localMods; for (sal_Int32 i = 0; i < aPropertyNames.getLength(); ++i) { if (!setChildProperty(aPropertyNames[i], aValues[i], &localMods)) { throw css::lang::IllegalArgumentException( - "configmgr setPropertyValues inappropriate property name", + u"configmgr setPropertyValues inappropriate property name"_ustr, getXWeak(), -1); } } @@ -922,7 +922,7 @@ css::uno::Sequence< css::uno::Any > Access::getPropertyValues( { if (!getByNameFast(aPropertyNames[i], aValsRange[i])) throw css::uno::RuntimeException( - "configmgr getPropertyValues inappropriate property name", + u"configmgr getPropertyValues inappropriate property name"_ustr, getXWeak()); } @@ -939,7 +939,7 @@ void Access::addPropertiesChangeListener( osl::MutexGuard g(*lock_); if (!xListener.is()) { throw css::uno::RuntimeException( - "null listener", getXWeak()); + u"null listener"_ustr, getXWeak()); } if (!disposed_) { propertiesChangeListeners_.insert(xListener); @@ -998,7 +998,7 @@ void Access::setHierarchicalPropertyValue( osl::MutexGuard g(*lock_); if (!getRootAccess()->isUpdate()) { throw css::uno::RuntimeException( - "configmgr setHierarchicalPropertyName on non-update access", + u"configmgr setHierarchicalPropertyName on non-update access"_ustr, getXWeak()); } rtl::Reference< ChildAccess > child( @@ -1040,13 +1040,13 @@ void Access::setHierarchicalPropertyValues( osl::MutexGuard g(*lock_); if (!getRootAccess()->isUpdate()) { throw css::uno::RuntimeException( - "configmgr setPropertyValues on non-update access", + u"configmgr setPropertyValues on non-update access"_ustr, getXWeak()); } if (aHierarchicalPropertyNames.getLength() != Values.getLength()) { throw css::lang::IllegalArgumentException( - ("configmgr setHierarchicalPropertyValues:" - " aHierarchicalPropertyNames/Values of different length"), + (u"configmgr setHierarchicalPropertyValues:" + " aHierarchicalPropertyNames/Values of different length"_ustr), getXWeak(), -1); } Modifications localMods; @@ -1055,8 +1055,8 @@ void Access::setHierarchicalPropertyValues( getSubChild(aHierarchicalPropertyNames[i])); if (!child.is()) { throw css::lang::IllegalArgumentException( - ("configmgr setHierarchicalPropertyValues inappropriate" - " property name"), + (u"configmgr setHierarchicalPropertyValues inappropriate" + " property name"_ustr), getXWeak(), -1); } child->checkFinalized(); @@ -1080,8 +1080,8 @@ css::uno::Sequence< css::uno::Any > Access::getHierarchicalPropertyValues( getSubChild(aHierarchicalPropertyNames[i])); if (!child.is()) { throw css::lang::IllegalArgumentException( - ("configmgr getHierarchicalPropertyValues inappropriate" - " hierarchical property name"), + (u"configmgr getHierarchicalPropertyValues inappropriate" + " hierarchical property name"_ustr), getXWeak(), -1); } aValsRange[i] = child->asValue(); @@ -1268,8 +1268,8 @@ css::uno::Reference< css::uno::XInterface > Access::createInstanceWithArguments( assert(thisIs(IS_SET|IS_UPDATE)); if (aArguments.hasElements()) { throw css::uno::Exception( - ("configuration SimpleSetUpdate createInstanceWithArguments" - " must not specify any arguments"), + (u"configuration SimpleSetUpdate createInstanceWithArguments" + " must not specify any arguments"_ustr), getXWeak()); } return createInstance(); @@ -1421,7 +1421,7 @@ void Access::checkLocalizedPropertyAccess() { !Components::allLocales(getRootAccess()->getLocale())) { throw css::uno::RuntimeException( - "configmgr Access to specialized LocalizedPropertyNode", + u"configmgr Access to specialized LocalizedPropertyNode"_ustr, 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 // 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()) { return child; } - child = getChild("en"); + child = getChild(u"en"_ustr); if (child.is()) { return child; } - child = getChild(""); + child = getChild(u""_ustr); if (child.is()) { return child; } @@ -1608,7 +1608,7 @@ void Access::checkValue(css::uno::Any const & value, Type type, bool nillable) { } if (!ok) { throw css::lang::IllegalArgumentException( - "configmgr inappropriate property value", + u"configmgr inappropriate property value"_ustr, getXWeak(), -1); } } @@ -1744,7 +1744,7 @@ void Access::initBroadcasterAndChanges( css::uno::Any())); } } - j = propertyChangeListeners_.find(""); + j = propertyChangeListeners_.find(u""_ustr); if (j != propertyChangeListeners_.end()) { for (auto const& propertyChangeListenerElement : j->second) { @@ -1822,7 +1822,7 @@ void Access::initBroadcasterAndChanges( css::uno::Any())); } } - j = propertyChangeListeners_.find(""); + j = propertyChangeListeners_.find(u""_ustr); if (j != propertyChangeListeners_.end()) { for (auto const& propertyChangeListenerElement : j->second) { @@ -1941,7 +1941,7 @@ void Access::initBroadcasterAndChanges( css::uno::Any())); } } - j = propertyChangeListeners_.find(""); + j = propertyChangeListeners_.find(u""_ustr); if (j != propertyChangeListeners_.end()) { for (auto const& propertyChangeListenerElement : j->second) { @@ -2224,7 +2224,7 @@ css::beans::Property Access::asProperty() { void Access::checkFinalized() { if (isFinalized()) { throw css::lang::IllegalArgumentException( - "configmgr modification of finalized item", + u"configmgr modification of finalized item"_ustr, getXWeak(), -1); } } @@ -2267,7 +2267,7 @@ rtl::Reference< ChildAccess > Access::getFreeSetMember( freeAcc->getRootAccess() != getRootAccess())) { throw css::lang::IllegalArgumentException( - "configmgr inappropriate set element", + u"configmgr inappropriate set element"_ustr, getXWeak(), 1); } assert(dynamic_cast< SetNode * >(getNode().get()) != nullptr); @@ -2275,7 +2275,7 @@ rtl::Reference< ChildAccess > Access::getFreeSetMember( freeAcc->getNode()->getTemplateName())) { throw css::lang::IllegalArgumentException( - "configmgr inappropriate set element", + u"configmgr inappropriate set element"_ustr, getXWeak(), 1); } return freeAcc; diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx index abf3795f1d55..adbc2159fa6e 100644 --- a/configmgr/source/childaccess.cxx +++ b/configmgr/source/childaccess.cxx @@ -150,7 +150,7 @@ void ChildAccess::setParent(css::uno::Reference< css::uno::XInterface > const &) osl::MutexGuard g(*lock_); checkLocalizedPropertyAccess(); throw css::lang::NoSupportException( - "setParent", getXWeak()); + u"setParent"_ustr, getXWeak()); } void ChildAccess::bind( @@ -312,8 +312,8 @@ void ChildAccess::addSupportedServiceNames( assert(services != nullptr); services->push_back( getParentNode()->kind() == Node::KIND_GROUP - ? OUString("com.sun.star.configuration.GroupElement") - : OUString("com.sun.star.configuration.SetElement")); + ? u"com.sun.star.configuration.GroupElement"_ustr + : u"com.sun.star.configuration.SetElement"_ustr); } css::uno::Any ChildAccess::queryInterface(css::uno::Type const & aType) diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 3c35a258c12c..7c6f6f2d79fc 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -466,7 +466,7 @@ Components::Components( { assert(context.is()); lock_ = lock(); - OUString conf(expand("${CONFIGURATION_LAYERS}")); + OUString conf(expand(u"${CONFIGURATION_LAYERS}"_ustr)); int layer = 0; for (sal_Int32 i = 0;;) { while (i != conf.getLength() && conf[i] == ' ') { @@ -477,8 +477,8 @@ Components::Components( } if (modificationTarget_ != ModificationTarget::None) { throw css::uno::RuntimeException( - "CONFIGURATION_LAYERS: modification target layer followed by" - " further layers"); + u"CONFIGURATION_LAYERS: modification target layer followed by" + " further layers"_ustr); } sal_Int32 c = i; for (;; ++c) { @@ -507,7 +507,7 @@ Components::Components( } else if (type == "sharedext") { if (sharedExtensionLayer_ != -1) { throw css::uno::RuntimeException( - "CONFIGURATION_LAYERS: multiple \"sharedext\" layers"); + u"CONFIGURATION_LAYERS: multiple \"sharedext\" layers"_ustr); } sharedExtensionLayer_ = layer; parseXcsXcuIniLayer(layer, url, true); @@ -515,7 +515,7 @@ Components::Components( } else if (type == "userext") { if (userExtensionLayer_ != -1) { throw css::uno::RuntimeException( - "CONFIGURATION_LAYERS: multiple \"userext\" layers"); + u"CONFIGURATION_LAYERS: multiple \"userext\" layers"_ustr); } userExtensionLayer_ = layer; parseXcsXcuIniLayer(layer, url, true); @@ -570,7 +570,7 @@ Components::Components( } if (url.isEmpty()) { throw css::uno::RuntimeException( - "CONFIGURATION_LAYERS: empty \"user\" URL"); + u"CONFIGURATION_LAYERS: empty \"user\" URL"_ustr); } bool ignore = false; #if ENABLE_DCONF @@ -819,8 +819,8 @@ void Components::parseXcdFiles(int layer, OUString const & url) { void Components::parseXcsXcuLayer(int layer, OUString const & url) { parseXcdFiles(layer, url); - parseFiles(layer, ".xcs", &parseXcsFile, url + "/schema", false); - parseFiles(layer + 1, ".xcu", &parseXcuFile, url + "/data", false); + parseFiles(layer, u".xcs"_ustr, &parseXcsFile, url + "/schema", false); + parseFiles(layer + 1, u".xcu"_ustr, &parseXcuFile, url + "/data", false); } void Components::parseXcsXcuIniLayer( @@ -860,7 +860,7 @@ void Components::parseXcsXcuIniLayer( void Components::parseResLayer(int layer, std::u16string_view url) { OUString resUrl(OUString::Concat(url) + "/res"); 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) { @@ -873,10 +873,10 @@ void Components::parseModificationLayer(int layer, OUString const & url) { // longer relevant, probably OOo 4; also see hack for xsi namespace in // xmlreader::XmlReader::registerNamespaceIri): parseFiles( - layer, ".xcu", &parseXcuFile, + layer, u".xcu"_ustr, &parseXcuFile, expand( - "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") - ":UserInstallation}/user/registry/data"), + u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") + ":UserInstallation}/user/registry/data"_ustr), false); } } @@ -885,7 +885,7 @@ int Components::getExtensionLayer(bool shared) const { int layer = shared ? sharedExtensionLayer_ : userExtensionLayer_; if (layer == -1) { throw css::uno::RuntimeException( - "insert extension xcs/xcu file into undefined layer"); + u"insert extension xcs/xcu file into undefined layer"_ustr); } return layer; } diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx index 9789e0721bd6..02c3c78d4303 100644 --- a/configmgr/source/configurationprovider.cxx +++ b/configmgr/source/configurationprovider.cxx @@ -67,8 +67,8 @@ constexpr OUString updateAccessServiceName = void badNodePath() { throw css::uno::Exception( - ("com.sun.star.configuration.ConfigurationProvider expects a single," - " non-empty, string nodepath argument"), + (u"com.sun.star.configuration.ConfigurationProvider expects a single," + " non-empty, string nodepath argument"_ustr), nullptr); } @@ -112,7 +112,7 @@ private: { return default_ ? 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 @@ -123,7 +123,7 @@ private: { return default_ ? default_provider::getSupportedServiceNames() - : css::uno::Sequence { "com.sun.star.configuration.ConfigurationProvider" }; + : css::uno::Sequence { u"com.sun.star.configuration.ConfigurationProvider"_ustr }; } virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( @@ -201,8 +201,8 @@ Service::createInstanceWithArguments( break; } else { throw css::uno::Exception( - ("com.sun.star.configuration.ConfigurationProvider expects" - " NamedValue or PropertyValue arguments"), + (u"com.sun.star.configuration.ConfigurationProvider expects" + " NamedValue or PropertyValue arguments"_ustr), nullptr); } // For backwards compatibility, allow "nodepath" and "Locale" in any @@ -218,8 +218,8 @@ Service::createInstanceWithArguments( locale.isEmpty()) { throw css::uno::Exception( - ("com.sun.star.configuration.ConfigurationProvider expects" - " at most one, non-empty, string Locale argument"), + (u"com.sun.star.configuration.ConfigurationProvider expects" + " at most one, non-empty, string Locale argument"_ustr), nullptr); } } @@ -368,8 +368,8 @@ com_sun_star_comp_configuration_ConfigurationProvider_get_implementation( value = v2.Value; } else { throw css::uno::Exception( - ("com.sun.star.configuration.ConfigurationProvider factory" - " expects NamedValue or PropertyValue arguments"), + (u"com.sun.star.configuration.ConfigurationProvider factory" + " expects NamedValue or PropertyValue arguments"_ustr), nullptr); } // For backwards compatibility, allow "Locale" and (ignored) @@ -379,9 +379,9 @@ com_sun_star_comp_configuration_ConfigurationProvider_get_implementation( locale.isEmpty()) { throw css::uno::Exception( - ("com.sun.star.configuration.ConfigurationProvider" + (u"com.sun.star.configuration.ConfigurationProvider" " factory expects at most one, non-empty, string" - " Locale argument"), + " Locale argument"_ustr), nullptr); } } else if (!name.equalsIgnoreAsciiCase("enableasync")) { diff --git a/configmgr/source/configurationregistry.cxx b/configmgr/source/configurationregistry.cxx index 4900b9f97d52..c5dcf0cf58ed 100644 --- a/configmgr/source/configurationregistry.cxx +++ b/configmgr/source/configurationregistry.cxx @@ -78,14 +78,14 @@ private: virtual ~Service() 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 { return cppu::supportsService(this, ServiceName); } virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override - { return { "com.sun.star.configuration.ConfigurationRegistry" }; } + { return { u"com.sun.star.configuration.ConfigurationRegistry"_ustr }; } virtual OUString SAL_CALL getURL() override; @@ -221,7 +221,7 @@ Service::Service( try { provider_.set( context->getServiceManager()->createInstanceWithContext( - "com.sun.star.configuration.DefaultProvider", context), + u"com.sun.star.configuration.DefaultProvider"_ustr, context), css::uno::UNO_QUERY_THROW); } catch (css::uno::RuntimeException &) { throw; @@ -248,13 +248,12 @@ void Service::open(OUString const & rURL, sal_Bool bReadOnly, sal_Bool) doClose(); } 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 { access_ = provider_->createInstanceWithArguments( (bReadOnly - ? OUString("com.sun.star.configuration.ConfigurationAccess") - : OUString( - "com.sun.star.configuration.ConfigurationUpdateAccess")), + ? u"com.sun.star.configuration.ConfigurationAccess"_ustr + : u"com.sun.star.configuration.ConfigurationUpdateAccess"_ustr), args); } catch (css::uno::RuntimeException &) { throw; @@ -284,7 +283,7 @@ void Service::close() void Service::destroy() { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } @@ -304,14 +303,14 @@ sal_Bool Service::isReadOnly() { void Service::mergeKey(OUString const &, OUString const &) { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } void Service::flush() { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } @@ -319,7 +318,7 @@ void Service::addFlushListener( css::uno::Reference< css::util::XFlushListener > const &) { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } @@ -327,14 +326,14 @@ void Service::removeFlushListener( css::uno::Reference< css::util::XFlushListener > const &) { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } void Service::checkValid() { if (!access_.is()) { throw css::registry::InvalidRegistryException( - "com.sun.star.configuration.ConfigurationRegistry: not valid", + u"com.sun.star.configuration.ConfigurationRegistry: not valid"_ustr, getXWeak()); } } @@ -342,7 +341,7 @@ void Service::checkValid() { void Service::checkValid_RuntimeException() { if (!access_.is()) { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not valid", + u"com.sun.star.configuration.ConfigurationRegistry: not valid"_ustr, getXWeak()); } } @@ -359,7 +358,7 @@ OUString RegistryKey::getKeyName() { return named->getName(); } throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } @@ -417,14 +416,14 @@ sal_Int32 RegistryKey::getLongValue() return v; } throw css::registry::InvalidValueException( - "com.sun.star.configuration.ConfigurationRegistry", + u"com.sun.star.configuration.ConfigurationRegistry"_ustr, getXWeak()); } void RegistryKey::setLongValue(sal_Int32) { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } @@ -437,14 +436,14 @@ css::uno::Sequence< sal_Int32 > RegistryKey::getLongListValue() return v; } throw css::registry::InvalidValueException( - "com.sun.star.configuration.ConfigurationRegistry", + u"com.sun.star.configuration.ConfigurationRegistry"_ustr, getXWeak()); } void RegistryKey::setLongListValue(css::uno::Sequence< sal_Int32 > const &) { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } @@ -457,14 +456,14 @@ OUString RegistryKey::getAsciiValue() return v; } throw css::registry::InvalidValueException( - "com.sun.star.configuration.ConfigurationRegistry", + u"com.sun.star.configuration.ConfigurationRegistry"_ustr, getXWeak()); } void RegistryKey::setAsciiValue(OUString const &) { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } @@ -477,14 +476,14 @@ css::uno::Sequence< OUString > RegistryKey::getAsciiListValue() return v; } throw css::registry::InvalidValueException( - "com.sun.star.configuration.ConfigurationRegistry", + u"com.sun.star.configuration.ConfigurationRegistry"_ustr, getXWeak()); } void RegistryKey::setAsciiListValue(css::uno::Sequence< OUString > const &) { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } @@ -497,14 +496,14 @@ OUString RegistryKey::getStringValue() return v; } throw css::registry::InvalidValueException( - "com.sun.star.configuration.ConfigurationRegistry", + u"com.sun.star.configuration.ConfigurationRegistry"_ustr, getXWeak()); } void RegistryKey::setStringValue(OUString const &) { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } @@ -517,7 +516,7 @@ css::uno::Sequence< OUString > RegistryKey::getStringListValue() return v; } throw css::registry::InvalidValueException( - "com.sun.star.configuration.ConfigurationRegistry", + u"com.sun.star.configuration.ConfigurationRegistry"_ustr, getXWeak()); } @@ -525,7 +524,7 @@ void RegistryKey::setStringListValue( css::uno::Sequence< OUString > const &) { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } @@ -538,14 +537,14 @@ css::uno::Sequence< sal_Int8 > RegistryKey::getBinaryValue() return v; } throw css::registry::InvalidValueException( - "com.sun.star.configuration.ConfigurationRegistry", + u"com.sun.star.configuration.ConfigurationRegistry"_ustr, getXWeak()); } void RegistryKey::setBinaryValue(css::uno::Sequence< sal_Int8 > const &) { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } @@ -568,7 +567,7 @@ css::uno::Reference< css::registry::XRegistryKey > RegistryKey::createKey( OUString const &) { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } @@ -581,7 +580,7 @@ void RegistryKey::closeKey() void RegistryKey::deleteKey(OUString const &) { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } @@ -589,14 +588,14 @@ css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > > RegistryKey::openKeys() { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } css::uno::Sequence< OUString > RegistryKey::getKeyNames() { throw css::uno::RuntimeException( - "com.sun.star.configuration.ConfigurationRegistry: not implemented", + u"com.sun.star.configuration.ConfigurationRegistry: not implemented"_ustr, getXWeak()); } diff --git a/configmgr/source/defaultprovider.cxx b/configmgr/source/defaultprovider.cxx index 7161659e0fa6..9e1088ed1723 100644 --- a/configmgr/source/defaultprovider.cxx +++ b/configmgr/source/defaultprovider.cxx @@ -42,11 +42,11 @@ com_sun_star_comp_configuration_DefaultProvider_get_implementation( 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 getSupportedServiceNames() { - return { "com.sun.star.configuration.DefaultProvider" }; + return { u"com.sun.star.configuration.DefaultProvider"_ustr }; } } diff --git a/configmgr/source/localizedvaluenode.cxx b/configmgr/source/localizedvaluenode.cxx index 407040a560c0..031e4ea88ed7 100644 --- a/configmgr/source/localizedvaluenode.cxx +++ b/configmgr/source/localizedvaluenode.cxx @@ -42,7 +42,7 @@ rtl::Reference< Node > LocalizedValueNode::clone(bool) const { } OUString LocalizedValueNode::getTemplateName() const { - return "*"; + return u"*"_ustr; } diff --git a/configmgr/source/node.cxx b/configmgr/source/node.cxx index 2c8c697b5338..fdb166f146b8 100644 --- a/configmgr/source/node.cxx +++ b/configmgr/source/node.cxx @@ -33,7 +33,7 @@ namespace configmgr { NodeMap & Node::getMembers() { assert(false); - throw css::uno::RuntimeException("this cannot happen"); + throw css::uno::RuntimeException(u"this cannot happen"_ustr); } OUString Node::getTemplateName() const { diff --git a/configmgr/source/readonlyaccess.cxx b/configmgr/source/readonlyaccess.cxx index c070e47f71ce..8e4f7ab2f9f4 100644 --- a/configmgr/source/readonlyaccess.cxx +++ b/configmgr/source/readonlyaccess.cxx @@ -53,14 +53,14 @@ private: virtual ~Service() 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 { return cppu::supportsService(this, ServiceName); } virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override - { return { "com.sun.star.configuration.ReadOnlyAccess" }; } + { return { u"com.sun.star.configuration.ReadOnlyAccess"_ustr }; } virtual void SAL_CALL initialize( 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; if (aArguments.getLength() != 1 || !(aArguments[0] >>= locale)) { throw css::lang::IllegalArgumentException( - "not exactly one string argument", + u"not exactly one string argument"_ustr, getXWeak(), -1); } std::unique_lock g1(mutex_); if (root_.is()) { throw css::uno::RuntimeException( - "already initialized", getXWeak()); + u"already initialized"_ustr, getXWeak()); } osl::MutexGuard g2(*lock()); Components & components = Components::getSingleton(context_); - root_ = new RootAccess(components, "/", locale, false); + root_ = new RootAccess(components, u"/"_ustr, locale, false); components.addRootAccess(root_); } @@ -103,7 +103,7 @@ rtl::Reference< RootAccess > Service::getRoot() { std::unique_lock g(mutex_); if (!root_.is()) { throw css::lang::NotInitializedException( - "not initialized", getXWeak()); + u"not initialized"_ustr, getXWeak()); } return root_; } diff --git a/configmgr/source/readwriteaccess.cxx b/configmgr/source/readwriteaccess.cxx index 18148b377c1d..2be385bc1309 100644 --- a/configmgr/source/readwriteaccess.cxx +++ b/configmgr/source/readwriteaccess.cxx @@ -53,14 +53,14 @@ private: virtual ~Service() 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 { return cppu::supportsService(this, ServiceName); } virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override - { return { "com.sun.star.configuration.ReadWriteAccess" }; } + { return { u"com.sun.star.configuration.ReadWriteAccess"_ustr }; } virtual void SAL_CALL initialize( 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; if (aArguments.getLength() != 1 || !(aArguments[0] >>= locale)) { throw css::lang::IllegalArgumentException( - "not exactly one string argument", + u"not exactly one string argument"_ustr, getXWeak(), -1); } std::unique_lock g1(mutex_); if (root_.is()) { throw css::uno::RuntimeException( - "already initialized", getXWeak()); + u"already initialized"_ustr, getXWeak()); } osl::MutexGuard g2(*lock()); Components & components = Components::getSingleton(context_); - root_ = new RootAccess(components, "/", locale, true); + root_ = new RootAccess(components, u"/"_ustr, locale, true); components.addRootAccess(root_); } @@ -125,7 +125,7 @@ rtl::Reference< RootAccess > Service::getRoot() { std::unique_lock g(mutex_); if (!root_.is()) { throw css::lang::NotInitializedException( - "not initialized", getXWeak()); + u"not initialized"_ustr, getXWeak()); } return root_; } diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx index 122401f6b068..d7c2466b650e 100644 --- a/configmgr/source/rootaccess.cxx +++ b/configmgr/source/rootaccess.cxx @@ -118,7 +118,7 @@ void RootAccess::addChangesListener( checkLocalizedPropertyAccess(); if (!aListener.is()) { throw css::uno::RuntimeException( - "null listener", getXWeak()); + u"null listener"_ustr, getXWeak()); } if (!isDisposed()) { changesListeners_.insert(aListener); @@ -257,9 +257,9 @@ void RootAccess::addSupportedServiceNames( std::vector * services) { assert(services != nullptr); - services->push_back("com.sun.star.configuration.AccessRootElement"); + services->push_back(u"com.sun.star.configuration.AccessRootElement"_ustr); 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)); osl::MutexGuard g(*lock_); checkLocalizedPropertyAccess(); - return "configmgr.RootAccess"; + return u"configmgr.RootAccess"_ustr; } } diff --git a/configmgr/source/type.cxx b/configmgr/source/type.cxx index b8fab28ac2c8..329762313f30 100644 --- a/configmgr/source/type.cxx +++ b/configmgr/source/type.cxx @@ -55,7 +55,7 @@ Type elementType(Type type) { return TYPE_HEXBINARY; default: 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(); default: assert(false); - throw css::uno::RuntimeException("this cannot happen"); + throw css::uno::RuntimeException(u"this cannot happen"_ustr); } } diff --git a/configmgr/source/update.cxx b/configmgr/source/update.cxx index 5851a6af05a3..1df4cbdd7aa5 100644 --- a/configmgr/source/update.cxx +++ b/configmgr/source/update.cxx @@ -82,7 +82,7 @@ private: css::uno::Sequence< OUString > const & excludedPaths) 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 { @@ -90,7 +90,7 @@ private: } css::uno::Sequence SAL_CALL getSupportedServiceNames() override { - return {"com.sun.star.configuration.Update_Service"}; + return {u"com.sun.star.configuration.Update_Service"_ustr}; } std::shared_ptr lock_; diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx index 83ddd245dc06..04d2059c1de9 100644 --- a/configmgr/source/valueparser.cxx +++ b/configmgr/source/valueparser.cxx @@ -184,7 +184,7 @@ template< typename T > css::uno::Any parseSingleValue( { T val; if (!parseValue(text, &val)) { - throw css::uno::RuntimeException("invalid value"); + throw css::uno::RuntimeException(u"invalid value"_ustr); } return css::uno::Any(val); } @@ -207,7 +207,7 @@ template< typename T > css::uno::Any parseListValue( if (!parseValue( 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); if (i < 0) { @@ -225,7 +225,7 @@ css::uno::Any parseValue( { switch (type) { 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: return parseSingleValue< sal_Bool >(text); case TYPE_SHORT: @@ -257,7 +257,7 @@ css::uno::Any parseValue( separator, text); default: assert(false); - throw css::uno::RuntimeException("this cannot happen"); + throw css::uno::RuntimeException(u"this cannot happen"_ustr); } } diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx index 3e7e281eb6aa..51a738d8d31c 100644 --- a/configmgr/source/writemodfile.cxx +++ b/configmgr/source/writemodfile.cxx @@ -67,7 +67,7 @@ OString convertToUtf8(std::u16string_view text) { RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) { throw css::uno::RuntimeException( - "cannot convert to UTF-8"); + u"cannot convert to UTF-8"_ustr); } return s; } diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx index 35f61fa1959e..053b9007dc17 100644 --- a/configmgr/source/xcsparser.cxx +++ b/configmgr/source/xcsparser.cxx @@ -176,7 +176,7 @@ bool XcsParser::startElement( assert(elements_.empty()); elements_.push( Element( - new GroupNode(valueParser_.getLayer(), false, ""), + new GroupNode(valueParser_.getLayer(), false, u""_ustr), componentName_)); return true; } @@ -342,7 +342,7 @@ void XcsParser::endElement(xmlreader::XmlReader const & reader) { default: assert(false); throw css::uno::RuntimeException( - "this cannot happen"); + u"this cannot happen"_ustr); } } else { if (!elements_.top().node->getMembers().insert( @@ -652,7 +652,7 @@ void XcsParser::handleSetItem(xmlreader::XmlReader & reader, SetNode * set) { } set->getAdditionalTemplateNames().push_back( xmldata::parseTemplateReference(component, hasNodeType, nodeType, nullptr)); - elements_.push(Element(rtl::Reference< Node >(), "")); + elements_.push(Element(rtl::Reference< Node >(), u""_ustr)); } } diff --git a/configmgr/source/xmldata.cxx b/configmgr/source/xmldata.cxx index ecb4dacab41f..0f20706e0928 100644 --- a/configmgr/source/xmldata.cxx +++ b/configmgr/source/xmldata.cxx @@ -123,7 +123,7 @@ OUString parseTemplateReference( return *defaultTemplateName; } throw css::uno::RuntimeException( - "missing node-type attribute"); + u"missing node-type attribute"_ustr); } return Data::fullTemplateName(component, nodeType); }