diff options
author | Eike Rathke <erack@redhat.com> | 2021-09-12 17:47:35 +0200 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2021-09-13 03:04:17 +0200 |
commit | aa2ebf7d77527a12246797f637a06af0e9dea5f9 (patch) | |
tree | 24f6e6e91985ac8e3799c12010d9cf24ec1a874c | |
parent | tdf#144085 XUsedAreaCursor broken: the methods don't accept formatted cells a... (diff) | |
download | core-aa2ebf7d77527a12246797f637a06af0e9dea5f9.tar.gz core-aa2ebf7d77527a12246797f637a06af0e9dea5f9.zip |
Resolves: tdf#144457 Use weld::set_text() instead of replace_selection()
... to replace entire field with modified text, instead of
inserting the text at the cursor position without selection, thus
effectively duplicating it (modulo modification).
Fallout from
commit 08101a1ab3b5d7c41488e93a2af518462286844f
CommitDate: Tue Jul 30 14:04:17 2019 +0200
weld OfaLanguagesTabPage
that did
if (bModified)
- {
- // Do not use SetText(...,GetSelection()) because internally the
- // reference's pointer of the selection is obtained resulting in the
- // entire text being selected at the end.
- Selection aSelection( rEd.GetSelection());
- rEd.SetText( aBuf.makeStringAndClear(), aSelection);
- }
+ rEd.replace_selection(aBuf.makeStringAndClear());
replacing the workaround needed for the old toolkit with something
similar from the new toolkit but behaving differently..
Change-Id: I9ff325eecd747bbecb36eb2a1150ae4472e475e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122000
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit db90a6cedbc261ad711ff13c4f69db65946486da)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121978
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r-- | cui/source/options/optgdlg.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index fd79d34926f1..4d376043ced7 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1783,7 +1783,7 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, weld::Entry&, rEd, void ) } } if (bModified) - rEd.replace_selection(aBuf.makeStringAndClear()); + rEd.set_text(aBuf.makeStringAndClear()); // This even keeps the cursor position so all good. if (bValid) rEd.set_message_type(weld::EntryMessageType::Normal); else |