diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-01-08 13:32:05 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-01-10 16:06:02 +0100 |
commit | 8db49bbc428e86fa628b7f7a7a91a2a598d7d905 (patch) | |
tree | 70255881eb476dd59b8eb1b54dd7368c96154a65 | |
parent | c3d38f3f0b54db8522c01f01299c48f1cf39efb2 (diff) |
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>
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 11 |
2 files changed, 11 insertions, 4 deletions
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; } |