summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-08-24 22:56:17 +0200
committerMichael Stahl <mstahl@redhat.com>2015-08-26 23:00:34 +0200
commit27a02d1708be7812668a84ea956edc8ecb312246 (patch)
tree4d93fb4bcdcb22d1b92c8b08ba236e764c5220b0
parente85a8110cd7494bae592329d3daa71f401778a22 (diff)
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
-rw-r--r--sw/source/filter/xml/xmlimp.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 6fa4e54c6a2c..b7e771a61b0b 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();