diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-30 17:54:41 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-12-18 22:30:17 +0100 |
commit | 94c1af65367dcbc7272455cf6d4940252a289b62 (patch) | |
tree | 98cced77a32f996d345ff3ead5ca6e300b05ffca | |
parent | a44be0f4d6ee7321f0cdf441b054a10ad6285440 (diff) |
sw_redlinehide: make layout based Show/Hide mode the default
remove ExperimentalMode checks
Change-Id: Ie098eda0840bbd3231696cae43cc572ad61379fc
(cherry picked from commit 32902f66e7749b2d06d13f50416be5323a0c0ea9)
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/xml/XMLRedlineImportHelper.cxx | 19 | ||||
-rw-r--r-- | sw/source/filter/xml/swxml.cxx | 13 | ||||
-rw-r--r-- | sw/source/filter/xml/wrtxml.cxx | 24 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlexp.cxx | 11 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 15 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewstat.cxx | 7 |
8 files changed, 25 insertions, 78 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index fa698b44450d..e2844a663ded 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -1525,8 +1525,11 @@ void SwUiWriterTest::testTdf83260() SwAutoCorrect corr(*SvxAutoCorrCfg::Get().GetAutoCorrect()); // enabled but not shown + CPPUNIT_ASSERT(pWrtShell->GetLayout()->IsHideRedlines()); +#if 0 CPPUNIT_ASSERT(IDocumentRedlineAccess::IsHideChanges( pDoc->getIDocumentRedlineAccess().GetRedlineFlags())); +#endif CPPUNIT_ASSERT(IDocumentRedlineAccess::IsRedlineOn( pDoc->getIDocumentRedlineAccess().GetRedlineFlags())); CPPUNIT_ASSERT(!pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty()); diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 6b3059e86f32..b12d9a1605ff 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -2273,21 +2273,14 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFormatFlags const & m_pDoc->GetDocShell() ); } - uno::Reference<uno::XComponentContext> const xContext( - comphelper::getProcessComponentContext()); - bool const isExp(officecfg::Office::Common::Misc::ExperimentalMode::get(xContext)); RedlineFlags eRedlMode = m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags(), eOldMode = eRedlMode; if( m_aFlags.bWithRedlining ) { m_pDoc->SetAutoFormatRedline( true ); - eRedlMode = isExp - ? RedlineFlags::On | (eOldMode & RedlineFlags::ShowMask) - : RedlineFlags::On | RedlineFlags::ShowInsert; + eRedlMode = RedlineFlags::On | (eOldMode & RedlineFlags::ShowMask); } else - eRedlMode = isExp - ? RedlineFlags::Ignore | (eOldMode & RedlineFlags::ShowMask) - : RedlineFlags::ShowInsert | RedlineFlags::Ignore; + eRedlMode = RedlineFlags::Ignore | (eOldMode & RedlineFlags::ShowMask); m_pDoc->getIDocumentRedlineAccess().SetRedlineFlags( eRedlMode ); // save undo state (might be turned off) diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index cec28a9b596a..d78e7e6b4849 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -344,19 +344,12 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper() aAny <<= bShowChanges; if ( bHandleShowChanges ) { - if (!utl::ConfigManager::IsFuzzing() && 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 ); - } + 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 xImportInfoPropertySet->setPropertyValue( g_sShowChanges, aAny ); diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index f36ffb47a147..138dc19981c8 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -856,8 +856,7 @@ 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 - (officecfg::Office::Common::Misc::ExperimentalMode::get(xContext) && - !*o3tl::doAccess<bool>(xInfoSet->getPropertyValue(sShowChanges))))) + !*o3tl::doAccess<bool>(xInfoSet->getPropertyValue(sShowChanges)))) { try { @@ -905,14 +904,8 @@ 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 (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)); - } - else - { - rDoc.getIDocumentRedlineAccess().SetRedlineFlags(nRedlineFlags); - } + // can't set it on the layout or view shell because it doesn't exist yet + rDoc.GetDocumentRedlineManager().SetHideRedlines(!(nRedlineFlags & RedlineFlags::ShowDelete)); lcl_EnsureValidPam( rPaM ); // move Pam into valid content diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index 34e51e8f2ed9..495cd765aaa3 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -165,7 +165,6 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xS xInfoSet->setPropertyValue( "TargetStorage", Any( xStg ) ); - uno::Any aAny; if (m_bShowProgress) { // set progress range and start status indicator @@ -188,15 +187,9 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xS RedlineFlags const nOrigRedlineFlags = m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags(); RedlineFlags nRedlineFlags(nOrigRedlineFlags); bool isShowChanges; - if (officecfg::Office::Common::Misc::ExperimentalMode::get(xContext)) - { // TODO: ideally this would be stored per-view... - SwRootFrame const*const pLayout(m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout()); - isShowChanges = pLayout == nullptr || !pLayout->IsHideRedlines(); - } - else - { - isShowChanges = IDocumentRedlineAccess::IsShowChanges(nRedlineFlags); - } + // TODO: ideally this would be stored per-view... + SwRootFrame const*const pLayout(m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout()); + isShowChanges = pLayout == nullptr || !pLayout->IsHideRedlines(); xInfoSet->setPropertyValue(sShowChanges, makeAny(isShowChanges)); // ... and hide redlines for export nRedlineFlags &= ~RedlineFlags::ShowMask; @@ -415,19 +408,10 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xS xObjectResolver = nullptr; // restore redline mode - aAny = xInfoSet->getPropertyValue( sShowChanges ); nRedlineFlags = m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags(); nRedlineFlags &= ~RedlineFlags::ShowMask; nRedlineFlags |= RedlineFlags::ShowInsert; - if (officecfg::Office::Common::Misc::ExperimentalMode::get(xContext)) - { - nRedlineFlags |= nOrigRedlineFlags & RedlineFlags::ShowMask; - } - else - { - if (*o3tl::doAccess<bool>(aAny)) - nRedlineFlags |= RedlineFlags::ShowDelete; - } + nRedlineFlags |= nOrigRedlineFlags & RedlineFlags::ShowMask; m_pDoc->getIDocumentRedlineAccess().SetRedlineFlags( nRedlineFlags ); if (xStatusIndicator.is()) diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 0fd2296e97e8..3e408bed91bb 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -278,15 +278,8 @@ ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) } } RedlineFlags nRedlineFlags = RedlineFlags::NONE; - if (officecfg::Office::Common::Misc::ExperimentalMode::get(getComponentContext())) - { - SwRootFrame const*const pLayout(m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout()); - m_bSavedShowChanges = pLayout == nullptr || !pLayout->IsHideRedlines(); - } - else - { - m_bSavedShowChanges = IDocumentRedlineAccess::IsShowChanges( pDoc->getIDocumentRedlineAccess().GetRedlineFlags() ); - } + SwRootFrame const*const pLayout(m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout()); + m_bSavedShowChanges = pLayout == nullptr || !pLayout->IsHideRedlines(); if( bSaveRedline ) { // now save and switch redline mode diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 94c30d3cc274..a832d8fb246c 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -638,17 +638,10 @@ void SwView::Execute(SfxRequest &rReq) if( static_cast<const SfxBoolItem*>(pItem)->GetValue() ) nMode |= RedlineFlags::ShowDelete; - 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()); - if (m_pWrtShell->IsRedlineOn()) - m_pWrtShell->SetInsMode(); - } - else - m_pWrtShell->SetRedlineFlagsAndCheckInsMode( nMode ); + m_pWrtShell->GetLayout()->SetHideRedlines( + !static_cast<const SfxBoolItem*>(pItem)->GetValue()); + if (m_pWrtShell->IsRedlineOn()) + m_pWrtShell->SetInsMode(); } break; case FN_MAILMERGE_SENDMAIL_CHILDWINDOW: diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index 38ffb27df5da..909ba9a67225 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -284,12 +284,7 @@ void SwView::GetState(SfxItemSet &rSet) { uno::Reference<uno::XComponentContext> const xContext( comphelper::getProcessComponentContext()); - if (officecfg::Office::Common::Misc::ExperimentalMode::get(xContext)) - { - rSet.Put(SfxBoolItem(nWhich, !m_pWrtShell->GetLayout()->IsHideRedlines())); - } - else - rSet.Put( SfxBoolItem( nWhich, IDocumentRedlineAccess::IsShowChanges(m_pWrtShell->GetRedlineFlags()) )); + rSet.Put(SfxBoolItem(nWhich, !m_pWrtShell->GetLayout()->IsHideRedlines())); } break; case SID_AVMEDIA_PLAYER : |