[Libreoffice-commits] core.git: sw/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 10 10:19:08 UTC 2020


 sw/source/filter/xml/xmlimpit.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 834e9db7f133fd4682497ad514277b1b1758d690
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Sep 10 10:35:43 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Sep 10 12:18:27 2020 +0200

    crashtesting ooo97840-2.odt assert in SvXMLAttrCollection::AddAttr
    
    because of empty namespace and prefix
    
    Change-Id: I5710e15c38fa5d22ca2dc7c875c2d9b1076fa93d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102365
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index af8a8b0c2781..2d70ac8013fb 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -175,8 +175,11 @@ void SvXMLImportItemMapper::importXML( SfxItemSet& rSet,
                     OUString aLocalName, aPrefix, aNamespace;
                     rNamespaceMap.GetKeyByAttrName( sAttrName, &aPrefix, &aLocalName,
                                                         &aNamespace );
-                    pUnknownItem->AddAttr( rAttrNamespacePrefix, aNamespace, aLocalName,
-                                           sValue );
+                    if ( !rAttrNamespacePrefix.isEmpty() )
+                        pUnknownItem->AddAttr( rAttrNamespacePrefix, aNamespace, aLocalName,
+                                               sValue );
+                    else
+                        pUnknownItem->AddAttr( aLocalName, sValue );
                 }
             }
         }


More information about the Libreoffice-commits mailing list