diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-13 16:13:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-13 20:35:21 +0200 |
commit | 902e81b1b0c62993270846962d44aea6774e9687 (patch) | |
tree | c38240f60ed72d457eb4ac77dd89064f6f8f5a8f /configmgr | |
parent | ab612633003c75dfb30664db8cc8924c086a91ee (diff) |
use more string_view in configmgr
Change-Id: Ia8aab5ea1a03d1512a1da806d505ce06f6977828
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132971
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/source/components.cxx | 14 | ||||
-rw-r--r-- | configmgr/source/components.hxx | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index cf1375956571..57f9e30e185b 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -405,15 +405,15 @@ void Components::insertModificationXcuFile( } css::beans::Optional< css::uno::Any > Components::getExternalValue( - OUString const & descriptor) + std::u16string_view descriptor) { - sal_Int32 i = descriptor.indexOf(' '); - if (i <= 0) { + size_t i = descriptor.find(' '); + if (i == 0 || i == std::u16string_view::npos) { throw css::uno::RuntimeException( - "bad external value descriptor " + descriptor); + OUString::Concat("bad external value descriptor ") + descriptor); } //TODO: Do not make calls with mutex locked: - OUString name(descriptor.copy(0, i)); + OUString name(descriptor.substr(0, i)); ExternalServices::iterator j(externalServices_.find(name)); if (j == externalServices_.end()) { css::uno::Reference< css::uno::XInterface > service; @@ -439,11 +439,11 @@ css::beans::Optional< css::uno::Any > Components::getExternalValue( css::beans::Optional< css::uno::Any > value; if (j->second.is()) { try { - if (!(j->second->getPropertyValue(descriptor.copy(i + 1)) >>= + if (!(j->second->getPropertyValue(OUString(descriptor.substr(i + 1))) >>= value)) { throw css::uno::RuntimeException( - "cannot obtain external value through " + descriptor); + OUString::Concat("cannot obtain external value through ") + descriptor); } } catch (css::beans::UnknownPropertyException & e) { throw css::uno::RuntimeException( diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx index 08f14a8b7bf9..5d7b6b5967ee 100644 --- a/configmgr/source/components.hxx +++ b/configmgr/source/components.hxx @@ -96,7 +96,7 @@ public: Modifications * modifications); css::beans::Optional< css::uno::Any > - getExternalValue(OUString const & descriptor); + getExternalValue(std::u16string_view descriptor); private: Components(const Components&) = delete; |