[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Dec 29 19:21:24 UTC 2018


 sc/source/ui/condformat/condformatdlg.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 9972e23fa2ac292310df86c5b7e7ec4d7d6acea6
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Dec 4 21:28:46 2018 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Dec 29 20:21:04 2018 +0100

    tdf#117332: select replaced text to properly replace it next time
    
    ... othervise the next drag event will insert the new range immediately
    after the just inserted, resulting in invalid reference.
    
    Regression after commit 42aece949ec96c775b31216bddd723aa5321e966
    
      don't replace content of formula field when selecting range, tdf#58635
    
    Change-Id: I7dfdc1ce041ebadf4406dbb605676d87cd489efa
    Reviewed-on: https://gerrit.libreoffice.org/64574
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 6c5839d399c6277a7f2f0e214a20996761563525)
    Reviewed-on: https://gerrit.libreoffice.org/65083
    Tested-by: Aron Budea <aron.budea at collabora.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 4f9f82568d1a..00adeac4e296 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -655,7 +655,13 @@ void ScCondFormatDlg::SetReference(const ScRange& rRef, ScDocument*)
         OUString aRefStr(rRef.Format(nFlags, mpViewData->GetDocument(),
             ScAddress::Details(mpViewData->GetDocument()->GetAddressConvention(), 0, 0)));
         if (pEdit != mpEdRange)
+        {
+            Selection sel = pEdit->GetSelection();
+            sel.Justify();            // in case of RtL selection
+            sel.Max() = sel.Min() + aRefStr.getLength();
             pEdit->ReplaceSelected(aRefStr);
+            pEdit->SetSelection(sel); // to replace it again with next drag event
+        }
         else
             pEdit->SetRefString( aRefStr );
         updateTitle();


More information about the Libreoffice-commits mailing list