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

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


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

New commits:
commit e75609a450394e1fea11e6ab888247e92c9559ea
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.
    
    (cherry picked from commit 27a02d1708be7812668a84ea956edc8ecb312246)
    
    Change-Id: Ife3e58eeebd73ad895fe328662822b847cf9bfec
    Reviewed-on: https://gerrit.libreoffice.org/18041
    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 f59c732..7913153 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -651,6 +651,13 @@ void SwXMLImport::startDocument()
     if( !pDoc )
         return;
 
+    if (IMPORT_ALL == getImportFlags())
+    {
+        // for flat ODF - this is done in SwReader::Read() for package ODF
+        pDoc->SetInReading(true);
+        pDoc->SetInXMLImport(true);
+    }
+
     if( (getImportFlags() & IMPORT_CONTENT) != 0 && !IsStylesOnlyMode() )
     {
         pSttNdIdx = new SwNodeIndex( pDoc->GetNodes() );
@@ -875,6 +882,11 @@ void SwXMLImport::endDocument( void )
                 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