diff options
author | László Németh <nemeth@numbertext.org> | 2019-06-12 13:26:16 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-06-12 21:00:05 +0200 |
commit | 0e27158c4f6a6a7676a77afb6b37dd30b3f6d100 (patch) | |
tree | 92690805a62542b837e7b17f6ed336736a4bf4ee /sw/source/filter/ww8 | |
parent | 6fd3eb533998c8f63430a43767b2a52aa5e71e3f (diff) |
tdf#89991 DOCX: import/export Show changes mode
handled by the optional w:revisionView OOXML setting.
Using disabled Show Changes mode, exported DOCX contains
<w:revisionView w:insDel="0" w:formatting="0"/>
as the documents exported from MSO with disabled Show Changes
and disabled Options -> Trust Center -> Trust Center Settings ->
Privacy Options -> Make hidden markup visible when opening or saving
(Note: this last setting needs also for opening the documents
really with disabled Show Changes in MSO).
Change-Id: I9f2c7df572f33838ae63185de21431102a7e139e
Reviewed-on: https://gerrit.libreoffice.org/73885
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r-- | sw/source/filter/ww8/docxexport.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexport.hxx | 1 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 1 |
4 files changed, 17 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index f0db6407c55d..6d6dd78ad1c9 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -508,7 +508,8 @@ void DocxExport::OutputDML(uno::Reference<drawing::XShape> const & xShape) ErrCode DocxExport::ExportDocument_Impl() { - // Set the 'Track Revisions' flag in the settings structure + // Set the 'Reviewing' flags in the settings structure + m_aSettings.revisionView = m_bOrigShowChanges; m_aSettings.trackRevisions = bool( RedlineFlags::On & m_nOrigRedlineFlags ); InitStyles(); @@ -955,6 +956,11 @@ void DocxExport::WriteSettings() } // Track Changes + if ( !m_aSettings.revisionView ) + pFS->singleElementNS( XML_w, XML_revisionView, + FSNS( XML_w, XML_insDel ), "0", + FSNS( XML_w, XML_formatting ), "0" ); + if ( m_aSettings.trackRevisions ) pFS->singleElementNS(XML_w, XML_trackRevisions); @@ -1662,6 +1668,7 @@ DocxExport::~DocxExport() DocxSettingsData::DocxSettingsData() : evenAndOddHeaders( false ) , defaultTabStop( 0 ) +, revisionView( true ) , trackRevisions( false ) { } @@ -1672,6 +1679,8 @@ bool DocxSettingsData::hasData() const return true; if( defaultTabStop != 0 ) return true; + if ( !revisionView ) + return true; if ( trackRevisions ) return true; diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 5b906debb0e9..1de037fb7662 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -60,6 +60,7 @@ struct DocxSettingsData bool hasData() const; /// returns true if there are any non-default settings (i.e. something to write) bool evenAndOddHeaders; int defaultTabStop; + bool revisionView; // don't show tracked changes bool trackRevisions; // Should 'Track Revisions' be set }; diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 09bf616a090b..bf8fb4665528 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3198,6 +3198,10 @@ ErrCode MSWordExportBase::ExportDocument( bool bWriteAll ) m_aFrames = GetFrames( *m_pDoc, bWriteAll? nullptr : m_pOrigPam ); m_nOrigRedlineFlags = m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags(); + + SwRootFrame const*const pLayout(m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout()); + m_bOrigShowChanges = pLayout == nullptr || !pLayout->IsHideRedlines(); + if ( !m_pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() ) { //restored to original state by SwWriter::Write @@ -3595,6 +3599,7 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM , m_nUniqueList(0) , m_nHdFtIndex(0) , m_nOrigRedlineFlags(RedlineFlags::NONE) + , m_bOrigShowChanges(true) , m_pCurrentPageDesc(nullptr) , m_bPrevTextNodeIsEmpty(false) , m_bFirstTOCNodeWithSection(false) diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 1be70995ca50..f72302f88538 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -480,6 +480,7 @@ public: unsigned int m_nHdFtIndex; RedlineFlags m_nOrigRedlineFlags; ///< Remember the original redline mode + bool m_bOrigShowChanges; ///< Remember the original Show Changes mode public: /* implicit bookmark vector containing pairs of node indexes and bookmark names */ |