sw/source/filter/xml/xmlimp.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+)
New commits: commit e75609a450394e1fea11e6ab888247e92c9559ea Author: Michael Stahl <mst...@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 <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@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();
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits