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>
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 371912f..69be4bc2 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 4b4ca3d..ed9754a 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>
@@ -4981,7 +4982,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));

@@ -5281,12 +5282,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();
@@ -5420,6 +5422,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;
}