summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-08-24 22:56:17 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-08-29 20:16:49 +0000
commitc5eb0eb4537182e0c8bc3c50acf30e69c454778d (patch)
treea44839c69335518db28f510846526b5782bdff2a
parent11b8ef34669e01f5bd9847537f4248be48066d9b (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 (cherry picked from commit 27a02d1708be7812668a84ea956edc8ecb312246) Reviewed-on: https://gerrit.libreoffice.org/18036 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-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 be9ad1189feb..38120ed4e321 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();