Kaydet (Commit) 99c3ac7a authored tarafından Michael Stahl's avatar Michael Stahl Kaydeden (comit) Andras Timar

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 27a02d17)
Reviewed-on: https://gerrit.libreoffice.org/18036Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst ba24290d
...@@ -652,6 +652,13 @@ void SwXMLImport::startDocument() ...@@ -652,6 +652,13 @@ void SwXMLImport::startDocument()
if( !pDoc ) if( !pDoc )
return; 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() ) if( (getImportFlags() & SvXMLImportFlags::CONTENT) && !IsStylesOnlyMode() )
{ {
pSttNdIdx = new SwNodeIndex( pDoc->GetNodes() ); pSttNdIdx = new SwNodeIndex( pDoc->GetNodes() );
...@@ -876,6 +883,11 @@ void SwXMLImport::endDocument() ...@@ -876,6 +883,11 @@ void SwXMLImport::endDocument()
pDoc->PrtOLENotify( false ); pDoc->PrtOLENotify( false );
else if ( pDoc->IsOLEPrtNotifyPending() ) else if ( pDoc->IsOLEPrtNotifyPending() )
pDoc->PrtOLENotify( true ); pDoc->PrtOLENotify( true );
assert(pDoc->IsInReading());
assert(pDoc->IsInXMLImport());
pDoc->SetInReading(false);
pDoc->SetInXMLImport(false);
} }
SwDrawModel* pDrawModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel(); SwDrawModel* pDrawModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment