summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2021-10-21 01:44:39 -0800
committerJim Raykowski <raykowj@gmail.com>2021-10-23 09:22:42 +0200
commit442be5242e2f541b8ad847cd629e715f3fd84205 (patch)
treeb4c985e34b334cfb3532e8424ca1815211071780 /sw
parentcc1598b806a8f63079de64512e0b322fc9b28714 (diff)
SwNavigator: Make tracked drawing object scroll into content tree view
Change-Id: I948c8b38f0df86f30f9c5af56aea5103c82c661c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123966 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/utlui/content.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 56ce7d9b5e87..c56a7fca4d83 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3512,7 +3512,11 @@ static void lcl_SelectDrawObjectByName(weld::TreeView& rContentTree, std::u16str
{
if (rName == rContentTree.get_text(*xIter))
{
- rContentTree.select(*xIter);
+ if (!rContentTree.is_selected(*xIter))
+ {
+ rContentTree.select(*xIter);
+ rContentTree.scroll_to_row(*xIter);
+ }
break;
}
}
@@ -3673,7 +3677,12 @@ void SwContentTree::UpdateTracking()
SelectionType::DbForm)) &&
!(m_bIsRoot && m_nRootType != ContentTypeId::DRAWOBJECT))
{
- m_xTreeView->unselect_all();
+ // Multiple selection is possible when in root content navigation view so unselect all
+ // selected entries before reselecting. This causes a bit of an annoyance when the treeview
+ // scroll bar is used and focus is in the document by causing the last selected entry to
+ // scroll back into view.
+ if (m_bIsRoot)
+ m_xTreeView->unselect_all();
SdrView* pSdrView = m_pActiveShell->GetDrawView();
if (pSdrView)
{