vcl/source/pdf/XmpMetadata.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
New commits: commit 3dd81d22c7321e92f675a10f301924f65d1cebd9 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Wed Dec 13 13:11:03 2023 +0100 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 09:23:03 2024 +0100 Work around strange error seen at least with VS 2022 Preview 17.9.0 Preview 2.0 > vcl/source/pdf/XmpMetadata.cxx(39): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'rtl::OStringLiteral<55>' > vcl/source/pdf/XmpMetadata.cxx(39): note: Invalid aggregate initialization > vcl/source/pdf/XmpMetadata.cxx(39): note: too many initializers (Smells like a bug in that compiler's u8"..." handling, where it maybe gets tripped by the 3-byte UTF-8 encoding of \uFEFF?) Change-Id: I1c6a856a67c8328ed5fcc2f2fa6bb26f16319f55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160681 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> (cherry picked from commit 297a6673175308168669870882c016b496652a76) diff --git a/vcl/source/pdf/XmpMetadata.cxx b/vcl/source/pdf/XmpMetadata.cxx index 53bf3902ab2b..ddd638551bd5 100644 --- a/vcl/source/pdf/XmpMetadata.cxx +++ b/vcl/source/pdf/XmpMetadata.cxx @@ -8,6 +8,10 @@ * */ +#include <sal/config.h> + +#include <string_view> + #include <pdf/XmpMetadata.hxx> #include <tools/XmlWriter.hxx> @@ -35,8 +39,8 @@ void XmpMetadata::write() mpMemoryStream = std::make_unique<SvMemoryStream>(4096 /*Initial*/, 64 /*Resize*/); // Header - mpMemoryStream->WriteOString( - OStringLiteral(u8"<?xpacket begin=\"\uFEFF\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?> ")); + mpMemoryStream->WriteOString(std::string_view(reinterpret_cast<char const*>( + u8"<?xpacket begin=\"\uFEFF\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?> "))); { tools::XmlWriter aXmlWriter(mpMemoryStream.get());