From 042033f1e6da22616cb76c8d950c20c9efecbad5 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 28 Dec 2020 17:56:40 +0100 Subject: loplugin:stringviewparam: operator + Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- unoidl/source/unoidl-check.cxx | 13 +++++++------ unoidl/source/unoidl-read.cxx | 7 ++++--- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'unoidl') diff --git a/unoidl/source/unoidl-check.cxx b/unoidl/source/unoidl-check.cxx index 6066994f1049..a3cade0b0334 100644 --- a/unoidl/source/unoidl-check.cxx +++ b/unoidl/source/unoidl-check.cxx @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -159,7 +160,7 @@ private: }; void checkMap( - rtl::Reference const & providerB, OUString const & prefix, + rtl::Reference const & providerB, std::u16string_view prefix, rtl::Reference const & cursor, bool ignoreUnpublished) { assert(providerB.is()); @@ -173,7 +174,7 @@ void checkMap( OUString name(prefix + id); if (entA->getSort() == unoidl::Entity::SORT_MODULE) { checkMap( - providerB, name + ".", + providerB, OUString(name + "."), (static_cast(entA.get()) ->createCursor()), ignoreUnpublished); @@ -898,7 +899,7 @@ bool valid(OUString const & identifier) { } void checkIds( - rtl::Reference const & providerA, OUString const & prefix, + rtl::Reference const & providerA, std::u16string_view prefix, rtl::Reference const & cursor) { assert(cursor.is()); @@ -919,7 +920,7 @@ void checkIds( switch (entB->getSort()) { case unoidl::Entity::SORT_MODULE: checkIds( - providerA, name + ".", + providerA, OUString(name + "."), (static_cast(entB.get()) ->createCursor())); break; @@ -1148,8 +1149,8 @@ SAL_IMPLEMENT_MAIN() { if (side == 0 || !(prov[0].is() && prov[1].is())) { badUsage(); } - checkMap(prov[1], "", prov[0]->createRootCursor(), ignoreUnpublished); - checkIds(prov[0], "", prov[1]->createRootCursor()); + checkMap(prov[1], u"", prov[0]->createRootCursor(), ignoreUnpublished); + checkIds(prov[0], u"", prov[1]->createRootCursor()); return EXIT_SUCCESS; } catch (unoidl::FileFormatException & e1) { std::cerr diff --git a/unoidl/source/unoidl-read.cxx b/unoidl/source/unoidl-read.cxx index 2b733c0f6f31..443cade3ea07 100644 --- a/unoidl/source/unoidl-read.cxx +++ b/unoidl/source/unoidl-read.cxx @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -214,7 +215,7 @@ void insertTypeDependency( void scanMap( rtl::Reference const & manager, rtl::Reference const & cursor, bool published, - OUString const & prefix, std::map & entities) + std::u16string_view prefix, std::map & entities) { assert(cursor.is()); for (;;) { @@ -228,7 +229,7 @@ void scanMap( scanMap( manager, static_cast(ent.get())->createCursor(), - published, name + ".", entities); + published, OUString(name + "."), entities); } else { std::map::iterator i( entities.insert( @@ -1040,7 +1041,7 @@ SAL_IMPLEMENT_MAIN() { } } std::map ents; - scanMap(mgr, prov->createRootCursor(), published, "", ents); + scanMap(mgr, prov->createRootCursor(), published, u"", ents); std::vector sorted(sort(ents)); std::vector mods; for (const auto & i: sorted) { -- cgit