[Libreoffice-commits] core.git: Branch 'libreoffice-6-2-0' - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Jan 10 15:06:28 UTC 2019


 sw/source/filter/ww8/wrtww8.cxx |    4 +++-
 sw/source/filter/ww8/ww8par.cxx |   11 ++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 8db49bbc428e86fa628b7f7a7a91a2a598d7d905
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Jan 8 13:32:05 2019 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Jan 10 16:06:02 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.Stahl at cib.de>
    (cherry picked from commit 2dda396f4de051cccf3442f17c84bf2ff5d1db1d)
    Reviewed-on: https://gerrit.libreoffice.org/65973
    Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit b4d942fce7e6764cd354517140e0249cb7382dd3)
    Reviewed-on: https://gerrit.libreoffice.org/66020
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.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;
 }
 


More information about the Libreoffice-commits mailing list