From ccb78b98e0618cce365562fe326d018892b8104a Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Thu, 7 Apr 2022 08:03:19 -0800 Subject: [PATCH] SwNavigator: set entry focus and update toolbox items sensitivity when content tree entry selection is made by the SelectContentType function The SelectContentType function is used when the Navigate By control combo box selection is changed by direct selection. This patch makes the tree entry cursor position be set to the selected content type entry so keyboard tab navigation will land on it. It also makes the move chapter up/down and promote/demote outline level toolbox items sensitivity update when the selection is made. Change-Id: I56675592678accc6db3eacb25bf9bccae8eb1cef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132689 Tested-by: Jenkins Reviewed-by: Jim Raykowski --- sw/source/uibase/utlui/content.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 3ee581276a76..583f159d2a33 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -5074,9 +5074,8 @@ void SwContentTree::SelectContentType(std::u16string_view rContentTypeName) { if (m_xTreeView->get_text(*xIter) == rContentTypeName) { - m_xTreeView->unselect_all(); - m_xTreeView->select(*xIter); - m_xTreeView->scroll_to_row(*xIter); + m_xTreeView->set_cursor(*xIter); + Select(); break; } } while (m_xTreeView->iter_next_sibling(*xIter));