summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-12-04 21:28:46 +0300
committerEike Rathke <erack@redhat.com>2018-12-20 01:01:48 +0100
commit9396cf7edb101983c56f44ae814029ce78f0fc71 (patch)
tree673638084d3870d165acd3aec38cf76aae4a8412 /sc
parent73cc724dc35551ea349b3da0c4ecd6cba2fdd0ae (diff)
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@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 6c5839d399c6277a7f2f0e214a20996761563525) Reviewed-on: https://gerrit.libreoffice.org/65027 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/condformat/condformatdlg.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 7776ea958f86..1df88cf003cc 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();