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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 27 07:51:53 UTC 2021


 sc/source/ui/inc/content.hxx       |    2 -
 sc/source/ui/navipi/content.cxx    |   55 +------------------------------------
 sc/source/ui/navipi/navipi.cxx     |    5 ---
 sw/source/uibase/utlui/content.cxx |    4 +-
 4 files changed, 4 insertions(+), 62 deletions(-)

New commits:
commit c0cbd13c945c5f47057b413efc88b2e3bb72d025
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Apr 26 09:36:14 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Apr 27 09:51:15 2021 +0200

    Related: tdf#130326 drop ScContentTree::ObjectFresh
    
    this was introduced as part of the large IA2 integration
    
    commit b41332475783c31136673fb44cf4c411bb0148f8
    Author: Steve Yin <steve_y at apache.org>
    Date:   Mon Dec 2 15:54:29 2013 +0000
    
        Integrate branch of IAccessible2
    
    Both calc and writer gained the feature that "space" in the navigator
    for drawing objects selects the highlighted object, extending the
    selection if another one is already selected. (notably impress was
    left unchanged)
    
    In calc, but not writer, an ObjectFresh was added which fires
    on every SfxHintId::ScKillEditView which is broadcast on every
    exit of the cursor from a cell. Its purpose seems to be primarily to
    re-highlight the last selected-by-keyboard entry on a content refresh.
    
    As far as I can tell this doesn't seem necessary and we already refresh
    content on SfxHintId::ScDrawChanged events so we shouldn't need to
    additionally refresh on ScKillEditView and refreshing on every
    ScKillEditView is very slow on navigating through a calc document with a
    lot of drawing objects.
    
    Change-Id: I64b2840f8510d474314d108e657fc3367f8ab6c0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114650
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx
index 9156a72f14dc..88a2b9ac3dc3 100644
--- a/sc/source/ui/inc/content.hxx
+++ b/sc/source/ui/inc/content.hxx
@@ -54,7 +54,6 @@ class ScContentTree
     ScDocument*             pHiddenDocument;    // temporary
     bool                    bIsInNavigatorDlg;
     bool                    m_bFreeze;
-    OUString                sKeyString;
     ImplSVEvent*            m_nAsyncMouseReleaseId;
 
     o3tl::enumarray<ScContentId, sal_uInt16> pPosList;     // for the sequence
@@ -123,7 +122,6 @@ public:
     ScContentTree(std::unique_ptr<weld::TreeView> xTreeView, ScNavigatorDlg* pNavigatorDlg);
     ~ScContentTree();
 
-    void     ObjectFresh(ScContentId nType, const weld::TreeIter* pEntry = nullptr);
     void     SetNavigatorDlgFlag(bool isInNavigateDlg){ bIsInNavigatorDlg=isInNavigateDlg;};
 
     void    hide()
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 53b4e413de50..c870e156c163 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -455,7 +455,8 @@ IMPL_LINK(ScContentTree, KeyInputHdl, const KeyEvent&, rKEvt, bool)
             break;
         }
     }
-    //Make KEY_SPACE has same function as DoubleClick
+    //Make KEY_SPACE has same function as DoubleClick, and realize
+    //multi-selection.
     if ( bIsInNavigatorDlg )
     {
         if(aCode.GetCode() == KEY_SPACE )
@@ -473,7 +474,6 @@ IMPL_LINK(ScContentTree, KeyInputHdl, const KeyEvent&, rKEvt, bool)
                 if ( bHiddenDoc )
                     return true;                //! later...
                 OUString aText(m_xTreeView->get_text(*xEntry));
-                sKeyString = aText;
                 if (!aManualDoc.isEmpty())
                     pParentWindow->SetCurrentDoc( aManualDoc );
                 switch (nType)
@@ -507,7 +507,6 @@ IMPL_LINK(ScContentTree, KeyInputHdl, const KeyEvent&, rKEvt, bool)
                             }
                             if (!bHasMakredObject && pScTabViewShell)
                                 pScTabViewShell->SetDrawShell(false);
-                            ObjectFresh(nType, xEntry.get());
                         }
                         break;
                     }
@@ -667,56 +666,6 @@ ScDocument* ScContentTree::GetSourceDocument()
     return nullptr;
 }
 
-//Move along and draw "*" sign .
-void ScContentTree::ObjectFresh(ScContentId nType, const weld::TreeIter* pEntry)
-{
-    if (bHiddenDoc && !pHiddenDocument)
-        return;     // other document displayed
-
-    if (!(nType == ScContentId::GRAPHIC || nType == ScContentId::OLEOBJECT || nType == ScContentId::DRAWING))
-        return;
-
-    auto nOldChildren = m_aRootNodes[nType] ? m_xTreeView->iter_n_children(*m_aRootNodes[nType]) : 0;
-    auto nOldPos = m_xTreeView->vadjustment_get_value();
-
-    freeze();
-    ClearType( nType );
-    GetDrawNames( nType/*, nId*/ );
-    thaw();
-
-    auto nNewChildren = m_aRootNodes[nType] ? m_xTreeView->iter_n_children(*m_aRootNodes[nType]) : 0;
-    bool bRestorePos = nOldChildren == nNewChildren;
-
-    if (!pEntry)
-        ApplyNavigatorSettings(bRestorePos, nOldPos);
-    if (!pEntry)
-        return;
-
-    weld::TreeIter* pParent = m_aRootNodes[nType].get();
-    std::unique_ptr<weld::TreeIter> xOldEntry;
-    std::unique_ptr<weld::TreeIter> xBeginEntry(m_xTreeView->make_iterator(pParent));
-    bool bBeginEntry = false;
-    if( pParent )
-        bBeginEntry = m_xTreeView->iter_children(*xBeginEntry);
-    while (bBeginEntry)
-    {
-        OUString aTempText(m_xTreeView->get_text(*xBeginEntry));
-        if (aTempText == sKeyString)
-        {
-            xOldEntry = m_xTreeView->make_iterator(xBeginEntry.get());
-            break;
-        }
-        bBeginEntry = m_xTreeView->iter_next(*xBeginEntry);
-    }
-    if (xOldEntry)
-    {
-        m_xTreeView->expand_row(*pParent);
-        m_xTreeView->select(*xOldEntry);
-        m_xTreeView->set_cursor(*xOldEntry);
-        StoreNavigatorSettings();
-    }
-}
-
 void ScContentTree::Refresh( ScContentId nType )
 {
     if ( bHiddenDoc && !pHiddenDocument )
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index ef8b85482c90..68fdf7eafb32 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -541,11 +541,6 @@ void ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
                 case SfxHintId::ScAnyDataChanged:
                     aContentIdle.Start();      // Do not search notes immediately
                     break;
-                case SfxHintId::ScKillEditView:
-                    m_xLbEntries->ObjectFresh( ScContentId::OLEOBJECT );
-                    m_xLbEntries->ObjectFresh( ScContentId::DRAWING );
-                    m_xLbEntries->ObjectFresh( ScContentId::GRAPHIC );
-                    break;
                 case SfxHintId::ScSelectionChanged:
                     UpdateSelection();
                     break;
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 221a161d21b1..2b3b057ab7b2 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3608,8 +3608,8 @@ IMPL_LINK(SwContentTree, KeyInputHdl, const KeyEvent&, rEvent, bool)
             }
         }
     }
-    //Make KEY_SPACE has same function as DoubleClick ,
-    //and realize multi-selection .
+    //Make KEY_SPACE has same function as DoubleClick, and realize
+    //multi-selection.
     else if (aCode.GetCode() == KEY_SPACE && 0 == aCode.GetModifier())
     {
         std::unique_ptr<weld::TreeIter> xEntry(m_xTreeView->make_iterator());


More information about the Libreoffice-commits mailing list