diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-01-27 16:45:22 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-01-27 23:24:42 +0100 |
commit | aa2064c5c5f23f6f4b7bc44e12345b37f66995bc (patch) | |
tree | a5073b6d0b0c5846575671975341f0e0b393d98d /sax | |
parent | 686582b4890f458b6b8ee0e1ab19d9ad64793c85 (diff) |
Improve loplugin:stringliteralvar
...to also consider O[U]String ctors taking pointer and length
Change-Id: Iea5041634bfbf5054a1317701e30b56f72e940fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110025
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/tools/fastserializer.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx index e6538424891c..77ed2b29c3d5 100644 --- a/sax/source/tools/fastserializer.cxx +++ b/sax/source/tools/fastserializer.cxx @@ -44,7 +44,7 @@ using ::com::sun::star::io::XOutputStream; const char sClosingBracket[] = ">"; const char sSlashAndClosingBracket[] = "/>"; -const char sColon[] = ":"; +constexpr OStringLiteral sColon = ":"; const char sOpeningBracket[] = "<"; const char sOpeningBracketAndSlash[] = "</"; const char sQuote[] = "\""; @@ -296,7 +296,7 @@ namespace sax_fastparser { auto const Namespace(mxFastTokenHandler->getUTF8Identifier(NAMESPACE(nElement))); assert(Namespace.hasElements()); writeBytes(Namespace); - writeBytes(sColon, N_CHARS(sColon)); + writeBytes(sColon.getStr(), sColon.getLength()); auto const Element(mxFastTokenHandler->getUTF8Identifier(TOKEN(nElement))); assert(Element.hasElements()); writeBytes(Element); @@ -316,7 +316,7 @@ namespace sax_fastparser { Sequence<sal_Int8> const name( mxFastTokenHandler->getUTF8Identifier(TOKEN(nElement))); return OString(reinterpret_cast<char const*>(ns.getConstArray()), ns.getLength()) - + OString(sColon, N_CHARS(sColon)) + + sColon + OString(reinterpret_cast<char const*>(name.getConstArray()), name.getLength()); } else { Sequence<sal_Int8> const name( |