summaryrefslogtreecommitdiff
path: root/sc/source/ui/condformat/condformatdlg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/condformat/condformatdlg.cxx')
-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 64952101d0ea..79e0e3f233d6 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -674,7 +674,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();