diff options
Diffstat (limited to 'codemaker/source')
-rw-r--r-- | codemaker/source/cppumaker/dumputils.cxx | 14 | ||||
-rw-r--r-- | codemaker/source/cppumaker/dumputils.hxx | 5 |
2 files changed, 10 insertions, 9 deletions
diff --git a/codemaker/source/cppumaker/dumputils.cxx b/codemaker/source/cppumaker/dumputils.cxx index 15b62e04a407..8524b1962ce2 100644 --- a/codemaker/source/cppumaker/dumputils.cxx +++ b/codemaker/source/cppumaker/dumputils.cxx @@ -48,16 +48,16 @@ bool dumpNamespaceOpen( } bool dumpNamespaceClose( - FileStream & out, OUString const & entityName, bool fullModuleType) + FileStream & out, std::u16string_view entityName, bool fullModuleType) { bool bOutput = false; bool bFirst = true; - for (sal_Int32 i = 0; i >= 0;) { - i = entityName.indexOf('.', i); - if (i >= 0) { + for (size_t i = 0; i != std::u16string_view::npos;) { + i = entityName.find('.', i); + if (i != std::u16string_view::npos) { ++i; } - if (fullModuleType || i >= 0) { + if (fullModuleType || i != std::u16string_view::npos) { if (!bFirst) { out << " "; } @@ -69,8 +69,8 @@ bool dumpNamespaceClose( return bOutput; } -void dumpTypeIdentifier(FileStream & out, OUString const & entityName) { - out << entityName.subView(entityName.lastIndexOf('.') + 1); +void dumpTypeIdentifier(FileStream & out, std::u16string_view entityName) { + out << entityName.substr(entityName.rfind('.') + 1); } } diff --git a/codemaker/source/cppumaker/dumputils.hxx b/codemaker/source/cppumaker/dumputils.hxx index 58ccdc93fac5..2fcd708c43fb 100644 --- a/codemaker/source/cppumaker/dumputils.hxx +++ b/codemaker/source/cppumaker/dumputils.hxx @@ -20,6 +20,7 @@ #pragma once #include <sal/config.h> +#include <string_view> namespace rtl { @@ -31,9 +32,9 @@ namespace codemaker::cppumaker { bool dumpNamespaceOpen(FileStream& out, rtl::OUString const& entityName, bool fullModuleType); -bool dumpNamespaceClose(FileStream& out, rtl::OUString const& entityName, bool fullModuleType); +bool dumpNamespaceClose(FileStream& out, std::u16string_view entityName, bool fullModuleType); -void dumpTypeIdentifier(FileStream& out, rtl::OUString const& entityName); +void dumpTypeIdentifier(FileStream& out, std::u16string_view entityName); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |