vcl/source/pdf/XmpMetadata.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
New commits: commit 90f872b4c9eac6ea1955876ff292a962f95577dd Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Fri Jun 18 15:18:26 2021 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Fri Jun 18 22:17:06 2021 +0200 Simplify a std::string_view construction ...and combine three calls to SvStream::WriteOString into one. Despite its name, SvStream::WriteOString takes a std::string_view, but which cannot be constructed from a u8"..." char8_t string literal. Besides the OStringLiteral detour, other fixes could have been a reinterpret_cast<char const *> (but which would have defeated constexpr'ness of the std::string_view construction) or a plain "..." char string literal with the UTF-8 encoding of \uFEFF spelled out as \0xEF\xBB\xBF. Change-Id: I029f061134381a67516cbc4b0479942684c80c20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117461 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/vcl/source/pdf/XmpMetadata.cxx b/vcl/source/pdf/XmpMetadata.cxx index e1a6ecf02ce5..156e849f4097 100644 --- a/vcl/source/pdf/XmpMetadata.cxx +++ b/vcl/source/pdf/XmpMetadata.cxx @@ -35,9 +35,8 @@ void XmpMetadata::write() mpMemoryStream = std::make_unique<SvMemoryStream>(4096 /*Initial*/, 64 /*Resize*/); // Header - mpMemoryStream->WriteOString("<?xpacket begin=\""); - mpMemoryStream->WriteOString(OUStringToOString(u"\xFEFF", RTL_TEXTENCODING_UTF8)); - mpMemoryStream->WriteOString("\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>\n"); + mpMemoryStream->WriteOString( + OStringLiteral(u8"<?xpacket begin=\"\uFEFF\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>\n")); { tools::XmlWriter aXmlWriter(mpMemoryStream.get()); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits