diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-04-14 15:56:48 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-04-14 16:22:25 +0100 |
commit | 0b037361b890a83a735186b98d5a3cef124027f4 (patch) | |
tree | 72c1c01fdd51d6c17869fea1b6c23e5f4db11691 /sw | |
parent | 5ec5bb3f8108aef32ae314fa0a809f95e791084c (diff) |
solve assert on restoring redline mode on exporting of abi9915-1.odt to doc
see also on export of ooo103014-1.odt to doc and many more
easiest thing is to move the restoration of the redline mode upwards for
all filters to the central SwWriter::Write after all pams have been
destroyed.
Change-Id: Ieb747ad2ed465d3fd3de81db0ef820073bc3ab55
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/basflt/shellio.cxx | 7 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexport.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 22 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 2 |
5 files changed, 16 insertions, 19 deletions
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index 20044921164f..567aad5cd8b5 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -856,8 +856,9 @@ sal_uLong SwWriter::Write( WriterRef& rxWriter, const OUString* pRealFileName ) pESh->StartAllAction(); } - bool bWasPurgeOle = pOutDoc->getIDocumentSettingAccess().get(DocumentSettingId::PURGE_OLE); + const bool bOrigPurgeOle = pOutDoc->getIDocumentSettingAccess().get(DocumentSettingId::PURGE_OLE); pOutDoc->getIDocumentSettingAccess().set(DocumentSettingId::PURGE_OLE, false); + const RedlineMode_t nOrigRedlineMode = pOutDoc->getIDocumentRedlineAccess().GetRedlineMode(); sal_uLong nError = 0; if( pMedium ) @@ -869,7 +870,7 @@ sal_uLong SwWriter::Write( WriterRef& rxWriter, const OUString* pRealFileName ) else if( xStg.is() ) nError = rxWriter->Write( *pPam, xStg, pRealFileName ); - pOutDoc->getIDocumentSettingAccess().set(DocumentSettingId::PURGE_OLE, bWasPurgeOle ); + pOutDoc->getIDocumentSettingAccess().set(DocumentSettingId::PURGE_OLE, bOrigPurgeOle ); if( pESh ) { @@ -887,10 +888,12 @@ sal_uLong SwWriter::Write( WriterRef& rxWriter, const OUString* pRealFileName ) else delete pPam; } + pOutDoc->getIDocumentRedlineAccess().SetRedlineMode(nOrigRedlineMode); } else { delete pPam; // delete the created Pam + pOutDoc->getIDocumentRedlineAccess().SetRedlineMode(nOrigRedlineMode); // Everything was written successfully? Tell the document! if ( !IsError( nError ) && !pDoc ) { diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 30ea86731545..24900660220b 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -421,7 +421,7 @@ void DocxExport::OutputDML(uno::Reference<drawing::XShape>& xShape) void DocxExport::ExportDocument_Impl() { // Set the 'Track Revisions' flag in the settings structure - m_aSettings.trackRevisions = 0 != ( nsRedlineMode_t::REDLINE_ON & mnRedlineMode ); + m_aSettings.trackRevisions = 0 != ( nsRedlineMode_t::REDLINE_ON & mnOrigRedlineMode ); InitStyles(); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index e6e503a459ff..60ca1f09e0c1 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -510,7 +510,7 @@ void RtfExport::ExportDocument_Impl() OutULong(pViewShell->GetViewOptions()->GetZoom()); } // Record changes? - if (nsRedlineMode_t::REDLINE_ON & mnRedlineMode) + if (nsRedlineMode_t::REDLINE_ON & mnOrigRedlineMode) Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_REVISIONS); // Mirror margins? if ((nsUseOnPage::PD_MIRROR & pDoc->GetPageDesc(0).ReadUseOn()) == nsUseOnPage::PD_MIRROR) diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 695a18929ab6..75732f1a46d1 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3050,11 +3050,13 @@ void MSWordExportBase::ExportDocument( bool bWriteAll ) // #i81405# - Collect anchored objects before changing the redline mode. maFrames = GetFrames( *pDoc, bWriteAll? NULL : pOrigPam ); - mnRedlineMode = pDoc->getIDocumentRedlineAccess().GetRedlineMode(); + mnOrigRedlineMode = pDoc->getIDocumentRedlineAccess().GetRedlineMode(); if ( !pDoc->getIDocumentRedlineAccess().GetRedlineTbl().empty() ) { - pDoc->getIDocumentRedlineAccess().SetRedlineMode( (RedlineMode_t)(mnRedlineMode | nsRedlineMode_t::REDLINE_SHOW_DELETE | - nsRedlineMode_t::REDLINE_SHOW_INSERT) ); + //restored to original state by SwWriter::Write + pDoc->getIDocumentRedlineAccess().SetRedlineMode(mnOrigRedlineMode | + nsRedlineMode_t::REDLINE_SHOW_DELETE | + nsRedlineMode_t::REDLINE_SHOW_INSERT); } maFontHelper.InitFontTable( SupportsUnicode(), *pDoc ); @@ -3067,14 +3069,6 @@ void MSWordExportBase::ExportDocument( bool bWriteAll ) pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage( 0 )->RecalcObjOrdNums(); ExportDocument_Impl(); - - // park curpam in a "safe place" now that document is fully exported before - // toggling redline mode to avoid ~SwIndexReg assert e.g. export - // ooo103014-1.odt to .doc - *pCurPam = *pOrigPam; - - if ( mnRedlineMode != pDoc->getIDocumentRedlineAccess().GetRedlineMode() ) - pDoc->getIDocumentRedlineAccess().SetRedlineMode( (RedlineMode_t)(mnRedlineMode) ); } bool SwWW8Writer::InitStd97CodecUpdateMedium( ::msfilter::MSCodec_Std97& rCodec ) @@ -3215,8 +3209,8 @@ void WW8Export::ExportDocument_Impl() pPiece = new WW8_WrPct( pFib->fcMin, bWrtWW8 ); pDop = new WW8Dop; - pDop->fRevMarking = 0 != ( nsRedlineMode_t::REDLINE_ON & mnRedlineMode ); - pDop->fRMView = 0 != ( nsRedlineMode_t::REDLINE_SHOW_DELETE & mnRedlineMode ); + pDop->fRevMarking = 0 != ( nsRedlineMode_t::REDLINE_ON & mnOrigRedlineMode ); + pDop->fRMView = 0 != ( nsRedlineMode_t::REDLINE_SHOW_DELETE & mnOrigRedlineMode ); pDop->fRMPrint = pDop->fRMView; // set AutoHyphenation flag if found in default para style @@ -3477,7 +3471,7 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM , nLastFmtId(0) , nUniqueList(0) , mnHdFtIndex(0) - , mnRedlineMode(0) + , mnOrigRedlineMode(0) , pAktPageDesc(0) , bPrevTextNodeIsEmpty(false) , pPapPlc(0) diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index bc0c12fca160..e2e2421d5b1f 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -477,7 +477,7 @@ public: sal_uInt16 nUniqueList; ///< current number for creating unique list names unsigned int mnHdFtIndex; - sal_uInt16 mnRedlineMode; ///< Remember the original redline mode + RedlineMode_t mnOrigRedlineMode; ///< Remember the original redline mode public: /* implicit bookmark vector containing pairs of node indexes and bookmark names */ |