[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Oct 5 08:29:14 UTC 2018


 sw/source/filter/xml/XMLRedlineImportHelper.cxx |   24 ++++++++++++++++++++++--
 sw/source/filter/xml/XMLRedlineImportHelper.hxx |    4 ++++
 sw/source/filter/xml/xmltexti.cxx               |    2 +-
 3 files changed, 27 insertions(+), 3 deletions(-)

New commits:
commit 0c59a1f7143e687768b56b14b1b0dcc6b7e96e79
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Oct 4 12:22:51 2018 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Oct 5 10:28:29 2018 +0200

    sw_redlinehide_2: import ShowRedlineChanges from flat-odt as well
    
    In this case a generic ImportInfo property set is created in
    XmlFilterAdaptor::importImpl(), so the XMLRedlineImportHelper
    is responsible for setting this.
    
    Change-Id: I6ec7ab2bab3ee10a585af88effb74f465e4bbae1

diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index c521b38189dd..a2d24c1844d2 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -33,6 +33,9 @@
 #include <tools/datetime.hxx>
 #include <poolfmt.hxx>
 #include <unoredline.hxx>
+#include <DocumentRedlineManager.hxx>
+#include "xmlimp.hxx"
+#include <officecfg/Office/Common.hxx>
 #include <o3tl/any.hxx>
 #include <xmloff/xmltoken.hxx>
 #include <vcl/svapp.hxx>
@@ -230,9 +233,12 @@ static const char g_sRecordChanges[] = "RecordChanges";
 static const char g_sRedlineProtectionKey[] = "RedlineProtectionKey";
 
 XMLRedlineImportHelper::XMLRedlineImportHelper(
+    SvXMLImport & rImport,
     bool bNoRedlinesPlease,
     const Reference<XPropertySet> & rModel,
-    const Reference<XPropertySet> & rImportInfo ) :
+    const Reference<XPropertySet> & rImportInfo )
+    :   m_rImport(rImport)
+    ,
         sInsertion( GetXMLToken( XML_INSERTION )),
         sDeletion( GetXMLToken( XML_DELETION )),
         sFormatChange( GetXMLToken( XML_FORMAT_CHANGE )),
@@ -336,7 +342,21 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper()
 
         aAny <<= bShowChanges;
         if ( bHandleShowChanges )
-            xModelPropertySet->setPropertyValue( g_sShowChanges, aAny );
+        {
+            if (officecfg::Office::Common::Misc::ExperimentalMode::get(comphelper::getProcessComponentContext()))
+            {
+                aAny <<= true;
+                xModelPropertySet->setPropertyValue( g_sShowChanges, aAny );
+                // TODO maybe we need some property for the view-setting?
+                SwDoc *const pDoc(SwImport::GetDocFromXMLImport(m_rImport));
+                assert(pDoc);
+                pDoc->GetDocumentRedlineManager().SetHideRedlines(!bShowChanges);
+            }
+            else
+            {
+                xModelPropertySet->setPropertyValue( g_sShowChanges, aAny );
+            }
+        }
         else
             xImportInfoPropertySet->setPropertyValue( g_sShowChanges, aAny );
 
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.hxx b/sw/source/filter/xml/XMLRedlineImportHelper.hxx
index a0918c71e771..ccf7446590d6 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.hxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.hxx
@@ -27,6 +27,7 @@
 
 #include <map>
 
+class SvXMLImport;
 class RedlineInfo;
 class SwRedlineData;
 class SwDoc;
@@ -40,6 +41,8 @@ typedef std::map< OUString, RedlineInfo* > RedlineMapType;
 
 class XMLRedlineImportHelper final
 {
+    SvXMLImport & m_rImport;
+
     const OUString sInsertion;
     const OUString sDeletion;
     const OUString sFormatChange;
@@ -60,6 +63,7 @@ class XMLRedlineImportHelper final
 public:
 
     XMLRedlineImportHelper(
+        SvXMLImport & rImport,
         bool bIgnoreRedlines,       // ignore redlines mode
         // property sets of model + import info for saving + restoring the
         // redline mode
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index b53404402342..d1b1253b66e5 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -154,7 +154,7 @@ SwXMLTextImportHelper::SwXMLTextImportHelper(
     pRedlineHelper( nullptr )
 {
     uno::Reference<XPropertySet> xDocPropSet( rModel, UNO_QUERY );
-    pRedlineHelper = new XMLRedlineImportHelper(
+    pRedlineHelper = new XMLRedlineImportHelper(rImport,
         bInsertM || bBlockM, xDocPropSet, rInfoSet );
 }
 


More information about the Libreoffice-commits mailing list