tdf#79197 enable comment of a selected change
with cursor position at the end of the change,
ie. now using "Next Track Change" not only
select the next track change, but it enables
the icon "Insert Track Change Comment" and the
menu item "Edit->Track Changes->Comment...",
and it's possible to add comments as expected.
Change-Id: I21318e70614d1285dd6fd90d8a7cc707fc0b5757
Reviewed-on: https://gerrit.libreoffice.org/67216
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
diff --git a/sw/source/core/edit/edredln.cxx b/sw/source/core/edit/edredln.cxx
index 2eadec1..f75b58b 100644
--- a/sw/source/core/edit/edredln.cxx
+++ b/sw/source/core/edit/edredln.cxx
@@ -119,7 +119,10 @@
const SwRangeRedline* SwEditShell::GetCurrRedline() const
{
return GetDoc()->getIDocumentRedlineAccess().GetRedline( *GetCursor()->GetPoint(), nullptr );
if (const SwRangeRedline* pRed = GetDoc()->getIDocumentRedlineAccess().GetRedline( *GetCursor()->GetPoint(), nullptr ))
return pRed;
// check the other side of the selection to handle completely selected changes, where the Point is at the end
return GetDoc()->getIDocumentRedlineAccess().GetRedline( *GetCursor()->GetMark(), nullptr );
}
void SwEditShell::UpdateRedlineAttr()
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx
index 6d97556..23b295e 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -567,7 +567,10 @@
rSh.EndAction();
rSh.ClearMark();
rSh.SelNextRedline(); // Select current redline.
// Select current redline.
pActRed = rSh.SelNextRedline();
if (pActRed != pRedline)
rSh.SelPrevRedline();
rSh.StartAction();
rSh.Push();