diff options
author | Michael Stahl <mstahl@redhat.com> | 2018-02-28 21:28:55 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2018-03-02 09:51:55 +0100 |
commit | 1bd9fcafe67cac9404c8c96553a262c048802c25 (patch) | |
tree | cff22442b06f8c803ce641627324ad6f4489b7c9 /sd | |
parent | 3d5a7631942171c2d73fbb172c2a9e7a50e9c3e3 (diff) |
tdf#115429 sax,xmloff: assert on empty attribute names & namespaces
Surely that's indication of a bug somewhere.
Change-Id: Ic6219d8eb7f22301d8c4da98b2132ae3ef0467b5
Reviewed-on: https://gerrit.libreoffice.org/50579
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/xml/sdtransform.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sd/source/filter/xml/sdtransform.cxx b/sd/source/filter/xml/sdtransform.cxx index c2ce55e066cd..e7d1ca8cc7a1 100644 --- a/sd/source/filter/xml/sdtransform.cxx +++ b/sd/source/filter/xml/sdtransform.cxx @@ -341,7 +341,18 @@ bool SdTransformOOo2xDocument::removeAlienAttributes( SfxItemSet& rSet, sal_uInt for( nItem = 0; nItem < nCount; nItem++ ) { if( nItem != nFound ) - aNewItem.AddAttr( rAttr.GetAttrPrefix(nItem),rAttr.GetAttrNamespace(nItem), rAttr.GetAttrLName(nItem), rAttr.GetAttrValue(nItem ) ); + { + OUString const& rNamespace(rAttr.GetAttrNamespace(nItem)); + OUString const& rPrefix(rAttr.GetAttrPrefix(nItem)); + if (rPrefix.isEmpty()) + { + aNewItem.AddAttr(rAttr.GetAttrLName(nItem), rAttr.GetAttrValue(nItem)); + } + else + { + aNewItem.AddAttr(rPrefix, rNamespace, rAttr.GetAttrLName(nItem), rAttr.GetAttrValue(nItem)); + } + } } rSet.Put( aNewItem ); |