summaryrefslogtreecommitdiffstats
path: root/cppuhelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-13 14:04:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-13 16:11:49 +0200
commita5343a89f898468178f04c241de0b2c2a314a1b5 (patch)
tree3e8118f488b2bfaec4cf1a793d297e878166e66a /cppuhelper
parentuse more string_view in l10ntools (diff)
downloadcore-a5343a89f898468178f04c241de0b2c2a314a1b5.tar.gz
core-a5343a89f898468178f04c241de0b2c2a314a1b5.zip
use more string_view in cppu
Change-Id: Ifd2ee4827e0083ffaff9120fee239fb16553380e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132957 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/source/typemanager.cxx8
-rw-r--r--cppuhelper/source/typemanager.hxx2
2 files changed, 5 insertions, 5 deletions
diff --git a/cppuhelper/source/typemanager.cxx b/cppuhelper/source/typemanager.cxx
index 28ef85189f29..44105df033fa 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -2149,15 +2149,15 @@ css::uno::Any cppuhelper::TypeManager::getInstantiatedStruct(
}
css::uno::Any cppuhelper::TypeManager::getInterfaceMember(
- OUString const & name, sal_Int32 separator)
+ std::u16string_view name, sal_Int32 separator)
{
- assert(name.indexOf("::") == separator && separator != -1);
+ assert(static_cast<sal_Int32>(name.find(u"::")) == separator && separator != -1);
css::uno::Reference< css::reflection::XInterfaceTypeDescription2 > ifc(
- resolveTypedefs(find(name.copy(0, separator))), css::uno::UNO_QUERY);
+ resolveTypedefs(find(OUString(name.substr(0, separator)))), css::uno::UNO_QUERY);
if (!ifc.is()) {
return css::uno::Any();
}
- OUString member(name.copy(separator + std::strlen("::")));
+ std::u16string_view member = name.substr(separator + std::strlen("::"));
const css::uno::Sequence<
css::uno::Reference<
css::reflection::XInterfaceMemberTypeDescription > > mems(
diff --git a/cppuhelper/source/typemanager.hxx b/cppuhelper/source/typemanager.hxx
index 1ee264bf16ff..28c193191267 100644
--- a/cppuhelper/source/typemanager.hxx
+++ b/cppuhelper/source/typemanager.hxx
@@ -100,7 +100,7 @@ private:
OUString const & name, sal_Int32 separator);
css::uno::Any getInterfaceMember(
- OUString const & name, sal_Int32 separator);
+ std::u16string_view name, sal_Int32 separator);
css::uno::Any getNamed(
OUString const & name,