summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2022-01-02 22:17:33 -0900
committerJim Raykowski <raykowj@gmail.com>2022-01-09 04:50:29 +0100
commit35d8a3f15266e5280c9a1255417c47b5ad22a5e6 (patch)
tree9ee842d438aaf0dabac23d902711a3911ac764d2 /sw/source
parent3a683edd9c77e20255357879fc70ce49c9217fa8 (diff)
SwNavigator: Fix outline select when table is the only content
Prior to this patch for outline content having only a table(s), right- click on an outline entry without the cursor and choosing 'Select' from the context menu only selects the outline paragraph when the current cursor position in the document is after the outline to be selected. The solution given here is to move the document cursor to the outline being selected before the outline selection is made. Change-Id: Ie25bfc81306dfb10a8ced8369e0ee7de0f3eacff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127884 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/utlui/content.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 0be83743b438..19bf803c6fe9 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -4645,10 +4645,16 @@ void SwContentTree::ExecuteContextMenuAction(const OString& rSelectedPopupEntry)
const ContentTypeId eTypeId = pCnt->GetParent()->GetType();
if (eTypeId == ContentTypeId::OUTLINE)
{
+ SwOutlineNodes::size_type nActPos = reinterpret_cast<SwOutlineContent*>(
+ m_xTreeView->get_id(*xFirst).toInt64())->GetOutlinePos();
+ m_pActiveShell->GotoOutline(nActPos);
m_xTreeView->selected_foreach([this](weld::TreeIter& rEntry){
+ SwOutlineNodes::size_type nPos = reinterpret_cast<SwOutlineContent*>(
+ m_xTreeView->get_id(rEntry).toInt64())->GetOutlinePos();
m_pActiveShell->SttSelect();
- SwOutlineNodes::size_type nActPos = reinterpret_cast<SwOutlineContent*>(m_xTreeView->get_id(rEntry).toInt64())->GetOutlinePos();
- m_pActiveShell->MakeOutlineSel(nActPos, nActPos, !m_xTreeView->get_row_expanded(rEntry), false); // select children if not expanded
+ // select children if not expanded and don't kill PaMs
+ m_pActiveShell->MakeOutlineSel(nPos, nPos,
+ !m_xTreeView->get_row_expanded(rEntry), false);
m_pActiveShell->EndSelect();
return false;
});