sw/source/filter/ww8/wrtww8.cxx | 4 +++- sw/source/filter/ww8/ww8par.cxx | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-)
New commits: commit b4d942fce7e6764cd354517140e0249cb7382dd3 Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Tue Jan 8 13:32:05 2019 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Jan 9 12:37:48 2019 +0100 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.st...@cib.de> (cherry picked from commit 2dda396f4de051cccf3442f17c84bf2ff5d1db1d) Reviewed-on: https://gerrit.libreoffice.org/65973 Tested-by: Xisco Faulí <xiscofa...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index a6dcefce8a89..c1703e6db15c 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 @@ ErrCode WW8Export::ExportDocument_Impl() 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 b1174771c554..b2a0302c0b44 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 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss) 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 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss) } } + 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 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss) 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; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits