sw/source/core/edit/edredln.cxx     |    5 ++++-
 sw/source/uibase/shells/textfld.cxx |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit ada64926dd025a0047d11cd7519f5268f4399ce9
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Thu Jan 31 14:27:06 2019 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Feb 8 15:44:38 2019 +0100

    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 <nem...@numbertext.org>
    (cherry picked from commit 9cb5b06eea8f0067bb9ddee9f4f1c992eda34a64)
    Reviewed-on: https://gerrit.libreoffice.org/67235
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/source/core/edit/edredln.cxx b/sw/source/core/edit/edredln.cxx
index e99aa5c36ae3..a78a54ec1698 100644
--- a/sw/source/core/edit/edredln.cxx
+++ b/sw/source/core/edit/edredln.cxx
@@ -120,7 +120,10 @@ bool SwEditShell::SetRedlineComment( const OUString& rS )
 
 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 d0861d7ab6ae..68c49f0f2d7c 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -567,7 +567,10 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                     rSh.EndAction();
 
                     rSh.ClearMark();
-                    rSh.SelNextRedline();   // Select current redline.
+                    // Select current redline.
+                    pActRed = rSh.SelNextRedline();
+                    if (pActRed != pRedline)
+                        rSh.SelPrevRedline();
 
                     rSh.StartAction();
                     rSh.Push();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to