diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-28 17:56:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-29 16:42:33 +0100 |
commit | 042033f1e6da22616cb76c8d950c20c9efecbad5 (patch) | |
tree | 26b3f1f42d067506f44550b410f3fb9640616a5b /unoidl | |
parent | ccfd8e9d09f9ac0a0ea92d0f378391006faaf934 (diff) |
loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'unoidl')
-rw-r--r-- | unoidl/source/unoidl-check.cxx | 13 | ||||
-rw-r--r-- | unoidl/source/unoidl-read.cxx | 7 |
2 files changed, 11 insertions, 9 deletions
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 <cassert> #include <cstdlib> #include <iostream> +#include <string_view> #include <vector> #include <osl/file.hxx> @@ -159,7 +160,7 @@ private: }; void checkMap( - rtl::Reference<unoidl::Provider> const & providerB, OUString const & prefix, + rtl::Reference<unoidl::Provider> const & providerB, std::u16string_view prefix, rtl::Reference<unoidl::MapCursor> 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<unoidl::ModuleEntity *>(entA.get()) ->createCursor()), ignoreUnpublished); @@ -898,7 +899,7 @@ bool valid(OUString const & identifier) { } void checkIds( - rtl::Reference<unoidl::Provider> const & providerA, OUString const & prefix, + rtl::Reference<unoidl::Provider> const & providerA, std::u16string_view prefix, rtl::Reference<unoidl::MapCursor> 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<unoidl::ModuleEntity *>(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 <iostream> #include <map> #include <set> +#include <string_view> #include <utility> #include <vector> @@ -214,7 +215,7 @@ void insertTypeDependency( void scanMap( rtl::Reference<unoidl::Manager> const & manager, rtl::Reference<unoidl::MapCursor> const & cursor, bool published, - OUString const & prefix, std::map<OUString, Entity> & entities) + std::u16string_view prefix, std::map<OUString, Entity> & entities) { assert(cursor.is()); for (;;) { @@ -228,7 +229,7 @@ void scanMap( scanMap( manager, static_cast<unoidl::ModuleEntity *>(ent.get())->createCursor(), - published, name + ".", entities); + published, OUString(name + "."), entities); } else { std::map<OUString, Entity>::iterator i( entities.insert( @@ -1040,7 +1041,7 @@ SAL_IMPLEMENT_MAIN() { } } std::map<OUString, Entity> ents; - scanMap(mgr, prov->createRootCursor(), published, "", ents); + scanMap(mgr, prov->createRootCursor(), published, u"", ents); std::vector<OUString> sorted(sort(ents)); std::vector<OUString> mods; for (const auto & i: sorted) { |