tdf#122452 sw_redlinehide: WW8 import/export sets layout show/hide mode
... and not SetRedlineFlags(), similar to the way the ODF filter does it.
The RTF/DOCX filters don't appear to be able to export the show/hide
flag currently, they can only handle the enabled flag.
Change-Id: I76bc19292882d7de5c28ea6afe0f81eadbd4a04f
Reviewed-on: https://gerrit.libreoffice.org/65966
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
(cherry picked from commit 2dda396f4de051cccf3442f17c84bf2ff5d1db1d)
Reviewed-on: https://gerrit.libreoffice.org/65973
Tested-by: Xisco Faulí <xiscofauli@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit b4d942fce7e6764cd354517140e0249cb7382dd3)
Reviewed-on: https://gerrit.libreoffice.org/66020
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index a6dcefc..c1703e6 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -58,6 +58,7 @@
#include <fmtpdsc.hxx>
#include <fmtrowsplt.hxx>
#include <frmatr.hxx>
#include <../../core/inc/rootfrm.hxx>
#include <doc.hxx>
#include <IDocumentSettingAccess.hxx>
#include <IDocumentDrawModelAccess.hxx>
@@ -3352,7 +3353,8 @@
pDop.reset(new WW8Dop);
pDop->fRevMarking = bool( RedlineFlags::On & m_nOrigRedlineFlags );
pDop->fRMView = bool( RedlineFlags::ShowDelete & m_nOrigRedlineFlags );
SwRootFrame const*const pLayout(m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout());
pDop->fRMView = pLayout == nullptr || !pLayout->IsHideRedlines();
pDop->fRMPrint = pDop->fRMView;
// set AutoHyphenation flag if found in default para style
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index b117477..b2a0302 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -83,6 +83,7 @@
#include <IDocumentMarkAccess.hxx>
#include <IDocumentStylePoolAccess.hxx>
#include <IDocumentExternalData.hxx>
#include <../../core/inc/DocumentRedlineManager.hxx>
#include <docufld.hxx>
#include <swfltopt.hxx>
#include <viewsh.hxx>
@@ -4976,7 +4977,7 @@
SwNodeIndex aSttNdIdx( m_rDoc.GetNodes() );
SwRelNumRuleSpaces aRelNumRule(m_rDoc, m_bNewDoc);
RedlineFlags eMode = RedlineFlags::ShowInsert;
RedlineFlags eMode = RedlineFlags::ShowInsert | RedlineFlags::ShowDelete;
m_xSprmParser.reset(new wwSprmParser(*m_xWwFib));
@@ -5276,12 +5277,13 @@
}
}
bool isHideRedlines(false);
if (m_bNewDoc)
{
if( m_xWDop->fRevMarking )
eMode |= RedlineFlags::On;
if( m_xWDop->fRMView )
eMode |= RedlineFlags::ShowDelete;
isHideRedlines = !m_xWDop->fRMView;
}
m_aInsertedTables.DelAndMakeTableFrames();
@@ -5415,6 +5417,9 @@
UpdatePageDescs(m_rDoc, nPageDescOffset);
// can't set it on the layout or view shell because it doesn't exist yet
m_rDoc.GetDocumentRedlineManager().SetHideRedlines(isHideRedlines);
return ERRCODE_NONE;
}