xmloff/source/meta/xmlversion.cxx |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit f53077423fe1d62eb4392dd393a9bf6df84bd517
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Apr 11 21:02:33 2020 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Apr 11 21:46:18 2020 +0200

    tdf#131931 No version history shown
    
    regression from
        commit 1872b44c9a2ee2bd00be54c6c310b72579d7a47f
        use FastParser for the XMLVersionListImport
    
    Change-Id: Ib6e9e14758c25c6ff090fe8f929984449e045c30
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92063
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/xmloff/source/meta/xmlversion.cxx 
b/xmloff/source/meta/xmlversion.cxx
index 0055fb56d802..b1c7f001da4f 100644
--- a/xmloff/source/meta/xmlversion.cxx
+++ b/xmloff/source/meta/xmlversion.cxx
@@ -22,6 +22,7 @@
 #include <xmloff/xmlnmspe.hxx>
 #include <xmloff/xmlmetae.hxx>
 #include <osl/diagnose.h>
+#include <sal/log.hxx>
 
 #include <xmloff/xmltoken.hxx>
 #include <comphelper/processfactory.hxx>
@@ -105,8 +106,6 @@ XMLVersionListImport::XMLVersionListImport(
 :   SvXMLImport(rContext, ""),
     maVersions( rVersions )
 {
-    GetNamespaceMap().Add( 
xmloff::token::GetXMLToken(xmloff::token::XML_NP_VERSIONS_LIST),
-                           
xmloff::token::GetXMLToken(xmloff::token::XML_N_VERSIONS_LIST), 
XML_NAMESPACE_VERSIONS_LIST );
 }
 
 XMLVersionListImport::~XMLVersionListImport() throw()
@@ -139,7 +138,8 @@ XMLVersionListContext::createFastChildContext(sal_Int32 
nElement,
 {
     SvXMLImportContext *pContext = nullptr;
 
-    if ( nElement == XML_ELEMENT(FRAMEWORK, xmloff::token::XML_VERSION_ENTRY) )
+    if ( nElement == XML_ELEMENT(FRAMEWORK, xmloff::token::XML_VERSION_ENTRY)
+        || nElement == XML_ELEMENT(VERSIONS_LIST, 
xmloff::token::XML_VERSION_ENTRY) )
     {
         pContext = new XMLVersionContext( GetImport(), xAttrList );
     }
@@ -161,16 +161,19 @@ XMLVersionContext::XMLVersionContext( 
XMLVersionListImport& rImport,
         switch( aIter.getToken() )
         {
         case XML_ELEMENT(FRAMEWORK, xmloff::token::XML_TITLE):
+        case XML_ELEMENT(VERSIONS_LIST, xmloff::token::XML_TITLE):
         {
             aInfo.Identifier = aIter.toString();
             break;
         }
         case XML_ELEMENT(FRAMEWORK, xmloff::token::XML_COMMENT):
+        case XML_ELEMENT(VERSIONS_LIST, xmloff::token::XML_COMMENT):
         {
             aInfo.Comment = aIter.toString();
             break;
         }
         case XML_ELEMENT(FRAMEWORK, xmloff::token::XML_CREATOR):
+        case XML_ELEMENT(VERSIONS_LIST, xmloff::token::XML_CREATOR):
         {
             aInfo.Author = aIter.toString();
             break;
@@ -182,6 +185,9 @@ XMLVersionContext::XMLVersionContext( XMLVersionListImport& 
rImport,
                 aInfo.TimeStamp = aTime;
             break;
         }
+        default:
+            SAL_WARN("xmloff", "unknown attribute " << 
SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << 
aIter.toString());
+            break;
         }
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to