diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-10-04 12:22:51 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-10-05 10:28:29 +0200 |
commit | 0c59a1f7143e687768b56b14b1b0dcc6b7e96e79 (patch) | |
tree | a98a25dbf9f05149d7eeaea3cca9e11c4b513254 /sw/source | |
parent | 63a29bd44dfd6d5e58e4111c2e1562d1ee6ee6d0 (diff) |
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
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/xml/XMLRedlineImportHelper.cxx | 24 | ||||
-rw-r--r-- | sw/source/filter/xml/XMLRedlineImportHelper.hxx | 4 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexti.cxx | 2 |
3 files changed, 27 insertions, 3 deletions
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 ); } |