summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-09-17 12:01:46 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-09-19 10:08:55 +0200
commit18dbdd512b11c02b2b5c8d28355a4d2188003d46 (patch)
tree1abf224729ebcfd6531fce72ec91241feab699b6
parent1a33a6f1a9d0dc177e8ffbd9d65995aa747f87fd (diff)
sw_redlinehide_2: replace SW_REDLINEHIDE with ExperimentalMode config
So we can get more testing & many bug reports. Change-Id: I34fe456a58670baecf4fdf1a87da77aceab43891
-rw-r--r--sw/source/filter/xml/swxml.cxx6
-rw-r--r--sw/source/filter/xml/wrtxml.cxx6
-rw-r--r--sw/source/uibase/uiview/view2.cxx5
-rw-r--r--sw/source/uibase/uiview/viewstat.cxx5
4 files changed, 16 insertions, 6 deletions
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 08a086621031..cc4fe8616983 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/packages/WrongPasswordException.hpp>
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
#include <com/sun/star/xml/sax/XFastParser.hpp>
+#include <officecfg/Office/Common.hxx>
#include <o3tl/any.hxx>
#include <vcl/errinf.hxx>
#include <sfx2/docfile.hxx>
@@ -854,7 +855,8 @@ ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, con
if( !(IsOrganizerMode() || IsBlockMode() || m_bInsertMode ||
m_aOption.IsFormatsOnly() ||
// sw_redlinehide: disable layout cache for now
- (getenv("SW_REDLINEHIDE") && !*o3tl::doAccess<bool>(xInfoSet->getPropertyValue(sShowChanges)))))
+ (officecfg::Office::Common::Misc::ExperimentalMode::get(xContext) &&
+ !*o3tl::doAccess<bool>(xInfoSet->getPropertyValue(sShowChanges)))))
{
try
{
@@ -902,7 +904,7 @@ ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, con
// tdf#83260 ensure that the first call of CompressRedlines after loading
// the document is a no-op by calling it now
rDoc.getIDocumentRedlineAccess().CompressRedlines();
- if (getenv("SW_REDLINEHIDE"))
+ if (officecfg::Office::Common::Misc::ExperimentalMode::get(xContext))
{ // can't set it on the layout or view shell because it doesn't exist yet
rDoc.GetDocumentRedlineManager().SetHideRedlines(!(nRedlineFlags & RedlineFlags::ShowDelete));
}
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index 26a16a31ce29..87ecd70566fb 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -26,6 +26,8 @@
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/frame/XModule.hpp>
+#include <officecfg/Office/Common.hxx>
+
#include <comphelper/fileformat.h>
#include <comphelper/processfactory.hxx>
#include <comphelper/genericpropertyset.hxx>
@@ -184,7 +186,7 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xS
const OUString sShowChanges("ShowChanges");
RedlineFlags nRedlineFlags = m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
bool isShowChanges;
- if (getenv("SW_REDLINEHIDE"))
+ if (officecfg::Office::Common::Misc::ExperimentalMode::get(xContext))
{ // TODO: ideally this would be stored per-view...
isShowChanges = !m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->IsHideRedlines();
}
@@ -414,7 +416,7 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xS
nRedlineFlags = m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
nRedlineFlags &= ~RedlineFlags::ShowMask;
nRedlineFlags |= RedlineFlags::ShowInsert;
- if (getenv("SW_REDLINEHIDE"))
+ if (officecfg::Office::Common::Misc::ExperimentalMode::get(xContext))
{
nRedlineFlags |= RedlineFlags::ShowDelete;
}
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 06e3e8cc6bf0..e4b377fbaacb 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -28,6 +28,7 @@
#include <com/sun/star/ui/dialogs/ListboxControlActions.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
+#include <officecfg/Office/Common.hxx>
#include <svl/aeitem.hxx>
#include <SwStyleNameMapper.hxx>
#include <docary.hxx>
@@ -637,7 +638,9 @@ void SwView::Execute(SfxRequest &rReq)
if( static_cast<const SfxBoolItem*>(pItem)->GetValue() )
nMode |= RedlineFlags::ShowDelete;
- if (getenv("SW_REDLINEHIDE")) // TODO...
+ uno::Reference<uno::XComponentContext> const xContext(
+ comphelper::getProcessComponentContext());
+ if (officecfg::Office::Common::Misc::ExperimentalMode::get(xContext))
{
m_pWrtShell->GetLayout()->SetHideRedlines(
!static_cast<const SfxBoolItem*>(pItem)->GetValue());
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index 437fb12b11f0..49020bde88e1 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -22,6 +22,7 @@
#include <hintids.hxx>
#include <com/sun/star/linguistic2/XThesaurus.hpp>
+#include <officecfg/Office/Common.hxx>
#include <svl/aeitem.hxx>
#include <svl/whiter.hxx>
#include <svl/cjkoptions.hxx>
@@ -281,7 +282,9 @@ void SwView::GetState(SfxItemSet &rSet)
break;
case FN_REDLINE_SHOW:
{
- if (getenv("SW_REDLINEHIDE")) // TODO...
+ uno::Reference<uno::XComponentContext> const xContext(
+ comphelper::getProcessComponentContext());
+ if (officecfg::Office::Common::Misc::ExperimentalMode::get(xContext))
{
rSet.Put(SfxBoolItem(nWhich, !m_pWrtShell->GetLayout()->IsHideRedlines()));
}