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 f275e019199baa931f1e4681e1bf29d68aae7a32 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Apr 26 09:36:14 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Apr 29 14:32:09 2021 +0200 Related: tdf#130326 drop ScContentTree::ObjectFresh this was introduced as part of the large IA2 integration commit b41332475783c31136673fb44cf4c411bb0148f8 Author: Steve Yin <stev...@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 of 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/+/114876 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Jenkins diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx index 1c0d2c27c4d5..f91636802901 100644 --- a/sc/source/ui/inc/content.hxx +++ b/sc/source/ui/inc/content.hxx @@ -55,7 +55,6 @@ class ScContentTree ScDocument* pHiddenDocument; // temporary bool bisInNavigatoeDlg; bool m_bFreeze; - OUString sKeyString; ImplSVEvent* m_nAsyncMouseReleaseId; o3tl::enumarray<ScContentId, sal_uInt16> pPosList; // for the sequence @@ -124,7 +123,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){ bisInNavigatoeDlg=isInNavigateDlg;}; void set_selection_mode(SelectionMode eMode) diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 9ec35128176b..692894ec8270 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -451,7 +451,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 ( bisInNavigatoeDlg ) { if(aCode.GetCode() == KEY_SPACE ) @@ -469,7 +470,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) @@ -503,7 +503,6 @@ IMPL_LINK(ScContentTree, KeyInputHdl, const KeyEvent&, rKEvt, bool) } if (!bHasMakredObject && pScTabViewShell) pScTabViewShell->SetDrawShell(false); - ObjectFresh(nType, xEntry.get()); } break; } @@ -663,56 +662,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 eb998e878e75..f9f196d3717b 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -536,11 +536,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 87f526a17996..220a2be35534 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -3528,8 +3528,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()); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits