[Libreoffice-commits] core.git: sw/source
Jim Raykowski (via logerrit)
logerrit at kemper.freedesktop.org
Sat Mar 27 07:23:36 UTC 2021
sw/source/uibase/utlui/content.cxx | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
New commits:
commit 2981e49878c967220854a5f7fbeff99b61645a4b
Author: Jim Raykowski <raykowj at gmail.com>
AuthorDate: Thu Mar 25 17:59:15 2021 -0800
Commit: Jim Raykowski <raykowj at gmail.com>
CommitDate: Sat Mar 27 08:22:59 2021 +0100
Sw Navigator: Improve chapter delete
by selecting to the start of the next outline node vs selecting to end
of the last paragraph before the next outline node.
Change-Id: I5a51ff5c1ced8d9ab0aee7c7b38fc5235027f384
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113140
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj at gmail.com>
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 265f2b28dc90..abce62691149 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -4027,10 +4027,11 @@ void SwContentTree::ExecuteContextMenuAction(const OString& rSelectedPopupEntry)
void SwContentTree::DeleteOutlineSelections()
{
- m_pActiveShell->StartAction();
- m_pActiveShell->EnterAddMode();
auto nChapters(0);
+ m_pActiveShell->StartAction();
+
+ m_pActiveShell->EnterAddMode();
m_xTreeView->selected_foreach([this, &nChapters](weld::TreeIter& rEntry){
++nChapters;
if (m_xTreeView->iter_has_child(rEntry) &&
@@ -4038,20 +4039,21 @@ void SwContentTree::DeleteOutlineSelections()
{
nChapters += m_xTreeView->iter_n_children(rEntry);
}
- m_pActiveShell->SttSelect();
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);
m_pActiveShell->EndSelect();
return false;
});
m_pActiveShell->LeaveAddMode();
+
SwRewriter aRewriter;
aRewriter.AddRule(UndoArg1, SwResId(STR_CHAPTERS, nChapters));
m_pActiveShell->StartUndo(SwUndoId::DELETE, &aRewriter);
- m_pActiveShell->SetTextFormatColl(nullptr);
m_pActiveShell->Delete();
- m_pActiveShell->ClearMark();
m_pActiveShell->EndUndo();
+
m_pActiveShell->EndAction();
}
More information about the Libreoffice-commits
mailing list