diff options
author | Jim Raykowski <raykowj@gmail.com> | 2022-01-10 08:36:19 -0900 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2022-01-13 20:44:05 +0100 |
commit | 63a9d8adedd5e9b2fcc689aae843c491f47261dd (patch) | |
tree | 239c173648a7b175a236006a7253f2a70a09c506 /sw/source/uibase/utlui | |
parent | 935761709fb7629c8d23aa5dc8bfcbd2988f5bbf (diff) |
SwNavigator: fix outline delete removes first character of next outline
paragraph
The to be deleted outline selection may already be to the start of the
following outline paragraph as happens when a table is the last
content of the to be deleted outline. In this case do not extend the
selection right or the first character of the following outline
paragraph will be removed. Also check if no selection was made which
indicates an empty paragraph and the selection right is needed.
Change-Id: I5b2516bd7b1e88ee415986dbe9313f93039dbac0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128264
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw/source/uibase/utlui')
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 19bf803c6fe9..0a796d77711e 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -4731,7 +4731,13 @@ void SwContentTree::DeleteOutlineSelections() SwOutlineNodes::size_type nActPos = reinterpret_cast<SwOutlineContent*>(m_xTreeView->get_id(rEntry).toInt64())->GetOutlinePos(); m_pActiveShell->SttSelect(); m_pActiveShell->MakeOutlineSel(nActPos, nActPos, !m_xTreeView->get_row_expanded(rEntry), false); // select children if not expanded - m_pActiveShell->Right(CRSR_SKIP_CHARS, true, 1, false); + // The outline selection may already be to the start of the following outline paragraph + // as happens when a table is the last content of the to be deleted outline. In this case + // do not extend the to be deleted selection right or the first character of the following + // outline paragraph will be removed. Also check if no selection was made which indicates + // an empty paragraph and selection right is needed. + if (!m_pActiveShell->IsSttPara() || !m_pActiveShell->HasSelection()) + m_pActiveShell->Right(CRSR_SKIP_CHARS, true, 1, false); m_pActiveShell->EndSelect(); return false; }); |