[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source

Michael Stahl mstahl at redhat.com
Sat Aug 29 13:17:13 PDT 2015


 sw/source/filter/xml/xmlimp.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit c5eb0eb4537182e0c8bc3c50acf30e69c454778d
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Aug 24 22:56:17 2015 +0200

    sw: Flat ODF import: set the InReading and InXMLImport flags
    
    Flat ODF Import does not use SwReader but uses
    SwXMLImport::startDocument() and SwXMLImport::endDocument() to set up
    the document, so make sure those set the import relevant SwDoc flags.
    
    Change-Id: Ife3e58eeebd73ad895fe328662822b847cf9bfec
    (cherry picked from commit 27a02d1708be7812668a84ea956edc8ecb312246)
    Reviewed-on: https://gerrit.libreoffice.org/18036
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index be9ad11..38120ed 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -652,6 +652,13 @@ void SwXMLImport::startDocument()
     if( !pDoc )
         return;
 
+    if (SvXMLImportFlags::ALL == getImportFlags())
+    {
+        // for flat ODF - this is done in SwReader::Read() for package ODF
+        pDoc->SetInReading(true);
+        pDoc->SetInXMLImport(true);
+    }
+
     if( (getImportFlags() & SvXMLImportFlags::CONTENT) && !IsStylesOnlyMode() )
     {
         pSttNdIdx = new SwNodeIndex( pDoc->GetNodes() );
@@ -876,6 +883,11 @@ void SwXMLImport::endDocument()
                 pDoc->PrtOLENotify( false );
             else if ( pDoc->IsOLEPrtNotifyPending() )
                 pDoc->PrtOLENotify( true );
+
+            assert(pDoc->IsInReading());
+            assert(pDoc->IsInXMLImport());
+            pDoc->SetInReading(false);
+            pDoc->SetInXMLImport(false);
         }
 
         SwDrawModel* pDrawModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();


More information about the Libreoffice-commits mailing list