Blame SOURCES/0001-Convert-attribute-value-to-UTF-8-when-passing-it-to-.patch

0c7e3c
From 78fd31b17931e1217d3b11fcbd13a41d79d99055 Mon Sep 17 00:00:00 2001
0c7e3c
From: Stephan Bergmann <sbergman@redhat.com>
0c7e3c
Date: Wed, 23 Sep 2020 11:41:05 +0200
0c7e3c
Subject: [PATCH] Convert attribute value to UTF-8 when passing it to libxml2
0c7e3c
0c7e3c
Using toUtf8, requiring the OUString to actually contain well-formed data, but
0c7e3c
which is likely OK for this test-code--only function, and is also what similar
0c7e3c
dumpAsXml functions e.g. in editeng/source/items/textitem.cxx already use.
0c7e3c
0c7e3c
This appears to have been broken ever since the code's introduction in
0c7e3c
553f10c71a2cc92f5f5890e24948f5277e3d2758 "add dumpAsXml() to more pool items",
0c7e3c
and it would typically only have written the leading zero or one
0c7e3c
(depending on the architecture's endianness) characters.  (I ran across it on
0c7e3c
big-endian s390x, where CppunitTest_sd_tiledrendering
0c7e3c
SdTiledRenderingTest::testTdf104405 failed because of
0c7e3c
0c7e3c
> Entity: line 2: parser error : Input is not proper UTF-8, indicate encoding !
0c7e3c
> Bytes: 0xCF 0x22 0x2F 0x3E
0c7e3c
> ation=""/>
0c7e3c
>                                                                                ^
0c7e3c
0c7e3c
apparently reported from within libxml2.)
0c7e3c
0c7e3c
Change-Id: I4b116d3be84098bd8b8a13b6937da70a1ee02c7f
0c7e3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103236
0c7e3c
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
0c7e3c
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
0c7e3c
Tested-by: Jenkins
0c7e3c
(cherry picked from commit fd9422febc384208558487bfe4a69ec89ab0ddca)
0c7e3c
---
0c7e3c
 svl/source/items/poolitem.cxx | 3 ++-
0c7e3c
 1 file changed, 2 insertions(+), 1 deletion(-)
0c7e3c
0c7e3c
diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx
0c7e3c
index ec37b68d3417..ad07a0b60b4b 100644
0c7e3c
--- a/svl/source/items/poolitem.cxx
0c7e3c
+++ b/svl/source/items/poolitem.cxx
0c7e3c
@@ -548,7 +548,8 @@ void SfxPoolItem::dumpAsXml(xmlTextWriterPtr pWriter) const
0c7e3c
     OUString rText;
0c7e3c
     IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag());
0c7e3c
     if (GetPresentation( SfxItemPresentation::Complete, MapUnit::Map100thMM, MapUnit::Map100thMM, rText, aIntlWrapper))
0c7e3c
-        xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(rText.getStr()));
0c7e3c
+        xmlTextWriterWriteAttribute(
0c7e3c
+            pWriter, BAD_CAST("presentation"), BAD_CAST(rText.toUtf8().getStr()));
0c7e3c
     xmlTextWriterEndElement(pWriter);
0c7e3c
 }
0c7e3c
 
0c7e3c
-- 
0c7e3c
2.33.1
0c7e3c