summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-04-27 19:22:52 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2021-04-28 10:51:19 +0200
commitc06f05e28cb66bd2aac5ea65bcfa3732808c51c6 (patch)
tree5ac03bd29d7d81adad2c101b8929a39d180882b6 /svl
parentd12acfa1405fa5b7c11d2a517286da68b3fd2eff (diff)
svl: fix crash in SfxItemSet::dumpAsXml()
Change-Id: I64cb14a740d6874ce288f249953984116648a470 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114759 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/itemset.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index dea82de88d64..b234543a28f4 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -1531,7 +1531,17 @@ void SfxItemSet::dumpAsXml(xmlTextWriterPtr pWriter) const
(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SfxItemSet"));
SfxItemIter aIter(*this);
for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
- pItem->dumpAsXml(pWriter);
+ {
+ if (IsInvalidItem(pItem))
+ {
+ (void)xmlTextWriterStartElement(pWriter, BAD_CAST("invalid"));
+ (void)xmlTextWriterEndElement(pWriter);
+ }
+ else
+ {
+ pItem->dumpAsXml(pWriter);
+ }
+ }
(void)xmlTextWriterEndElement(pWriter);
}