tdf#105600 rework section selection from Navigator
Corrects selection behavior when the section is empty or has
a single empty line before a table. Also, doesn't suffer the SelAll
function use selection misbehaviors when a table is at the start of the
document, other than for the case of a section containing a table at the
start of document, in which case, neither this rework nor SelAll
function selects the section.
Change-Id: Ibdefa0af417fc3c3262acaa1977fec811c8f24e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90181
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index bce33ac..340a3a9 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3453,9 +3453,13 @@ void SwContentTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry )
}
else if (eTypeId == ContentTypeId::REGION)
{
m_pActiveShell->EnterStdMode();
m_pActiveShell->GotoRegion(pCnt->GetName());
m_pActiveShell->Right(CRSR_SKIP_CHARS, false, 1, false );
m_pActiveShell->SelAll();
GotoCurrRegionAndSkip(m_pActiveShell->GetCurrentShellCursor(), fnRegionEnd, m_pActiveShell->IsReadOnlyAvailable());
m_pActiveShell->SttSelect();
GotoCurrRegionAndSkip(m_pActiveShell->GetCurrentShellCursor(), fnRegionStart, m_pActiveShell->IsReadOnlyAvailable());
m_pActiveShell->EndSelect();
m_pActiveShell->UpdateCursor();
}
m_pActiveShell->LeaveAddMode();
}