From aa2064c5c5f23f6f4b7bc44e12345b37f66995bc Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 27 Jan 2021 16:45:22 +0100 Subject: 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 --- sax/source/tools/fastserializer.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sax') 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[] = "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 const name( mxFastTokenHandler->getUTF8Identifier(TOKEN(nElement))); return OString(reinterpret_cast(ns.getConstArray()), ns.getLength()) - + OString(sColon, N_CHARS(sColon)) + + sColon + OString(reinterpret_cast(name.getConstArray()), name.getLength()); } else { Sequence const name( -- cgit