diff options
author | Eike Rathke <erack@redhat.com> | 2021-09-12 17:47:35 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2021-09-12 18:42:00 +0200 |
commit | db90a6cedbc261ad711ff13c4f69db65946486da (patch) | |
tree | 34b3d82d20055024fb701f7b8f86296a9f19c607 /cui | |
parent | cdf7352136f987f44e480777d302dfce9cbe3759 (diff) |
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
Diffstat (limited to 'cui')
-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 7f5ad32fce0b..92acc1bc0001 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1789,7 +1789,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 |