sw/source/uibase/utlui/content.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 63a9d8adedd5e9b2fcc689aae843c491f47261dd
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Mon Jan 10 08:36:19 2022 -0900
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Thu Jan 13 20:44:05 2022 +0100

    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 <rayk...@gmail.com>

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;
     });

Reply via email to