[Libreoffice-commits] core.git: Branch 'private/mst/sw_redlinehide_4a' - 2 commits - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Nov 30 17:07:14 UTC 2018


 sw/source/core/edit/autofmt.cxx                 |   11 ++---------
 sw/source/filter/xml/XMLRedlineImportHelper.cxx |   19 ++++++-------------
 sw/source/filter/xml/swxml.cxx                  |   15 +++++----------
 sw/source/filter/xml/wrtxml.cxx                 |   22 ++++------------------
 sw/source/uibase/uiview/view2.cxx               |   15 ++++-----------
 sw/source/uibase/uiview/viewstat.cxx            |    7 +------
 6 files changed, 22 insertions(+), 67 deletions(-)

New commits:
commit 6be6ab406ca0338f562b0ee872a3ada51e70ee42
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Nov 30 18:00:19 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Nov 30 18:00:19 2018 +0100

    HACK: ODF import: always hide redlines
    
    Change-Id: I275c6738943ee0d74ccacea69af1c1f4c9ede1df

diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 138dc19981c8..5b10130d6e8f 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -889,8 +889,10 @@ ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, con
     // restore redline mode from import info property set
     RedlineFlags nRedlineFlags = RedlineFlags::ShowInsert;
     aAny = xInfoSet->getPropertyValue( sShowChanges );
+#if 0
     if ( *o3tl::doAccess<bool>(aAny) )
         nRedlineFlags |= RedlineFlags::ShowDelete;
+#endif
     aAny = xInfoSet->getPropertyValue( sRecordChanges );
     if ( *o3tl::doAccess<bool>(aAny) || (aKey.getLength() > 0) )
         nRedlineFlags |= RedlineFlags::On;
commit ef505113d382183f17264b48e100236ac4b0318a
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Nov 30 17:54:41 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Nov 30 17:54:41 2018 +0100

    sw_redlinehide: make layout based Show/Hide mode the default
    
    remove ExperimentalMode checks
    
    Change-Id: Ie098eda0840bbd3231696cae43cc572ad61379fc

diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 7089ce157de3..048706bbce41 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -2267,21 +2267,14 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFormatFlags const &
                          m_nEndNdIdx = m_aEndNdIdx.GetIndex(),
                          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 ce3573b7b946..f956bbd85953 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -343,19 +343,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 0d5e53d4c319..ecdfd3fb3ba0 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -187,15 +187,9 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xS
     const OUString sShowChanges("ShowChanges");
     RedlineFlags nRedlineFlags = m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
     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;
@@ -418,15 +412,7 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xS
     nRedlineFlags = m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
     nRedlineFlags &= ~RedlineFlags::ShowMask;
     nRedlineFlags |= RedlineFlags::ShowInsert;
-    if (officecfg::Office::Common::Misc::ExperimentalMode::get(xContext))
-    {
-        nRedlineFlags |= RedlineFlags::ShowDelete;
-    }
-    else
-    {
-        if (*o3tl::doAccess<bool>(aAny))
-            nRedlineFlags |= RedlineFlags::ShowDelete;
-    }
+    nRedlineFlags |= RedlineFlags::ShowDelete;
     m_pDoc->getIDocumentRedlineAccess().SetRedlineFlags( nRedlineFlags );
 
     if (xStatusIndicator.is())
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index d753b849b97b..1e4c2bcff5a3 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 :


More information about the Libreoffice-commits mailing list