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