summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-07-15 12:00:27 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-07-15 14:51:56 +0200
commit2cd936a882418b6babd8f37a83077e1bab5fb934 (patch)
tree146f3c45f654f6f4a75a40acf993f9ecd056dbf5 /svx
parent5d0a231b29dfd4d587c7a4d1bbda6a511f94ec77 (diff)
tdf#143327 keep selection bounds on replacing color
so select-all and type 'a' will retain cursor at position 1 and delete/backspace keep cursor position in a semi-rational way Change-Id: I802f132e58cea9f111deb1c6d157706d08cb5b81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118978 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/hexcolorcontrol.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/svx/source/dialog/hexcolorcontrol.cxx b/svx/source/dialog/hexcolorcontrol.cxx
index ff9b10ca8da8..fbf6b9ea66d4 100644
--- a/svx/source/dialog/hexcolorcontrol.cxx
+++ b/svx/source/dialog/hexcolorcontrol.cxx
@@ -63,7 +63,10 @@ void HexColorControl::SetColor(Color nColor)
OUString sColor = aBuffer.makeStringAndClear().copy(1);
if (sColor == m_xEntry->get_text())
return;
+ int nStartPos, nEndPos;
+ m_xEntry->get_selection_bounds(nStartPos, nEndPos);
m_xEntry->set_text(sColor);
+ m_xEntry->select_region(nStartPos, nEndPos);
}
Color HexColorControl::GetColor() const