diff options
author | Eike Rathke <erack@redhat.com> | 2015-08-20 23:01:17 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-08-20 23:05:15 +0200 |
commit | e1ebe5723833eebdb8e68f56d2075cb174d57398 (patch) | |
tree | 5ff5476f5f677f0e48e7716c161b16698a15efbf /formula | |
parent | d8138cdd58a4f725bbfb50b8da3ef4927dd17a45 (diff) |
let the edit selection not jump back to 0,0 for every keystroke
... which instead of an input of 123 resulted in 321.
This Edit::SetText() has a side-effect that it sets a new Selection(0,0)
effectively invalidating the previous selection. We reach
RefEdit::SetRefString() also through notification of edit events that
already handled the key input in Edit::ImplInsertText() and adapted the
selection, the dialog then attempts to update all sort of argument
fields, including the one that was just edited. Setting the identical
text again confuses the selection and positions the cursor at the
beginning of the string instead of the end when typing. Additionally all
kind of invalidations and recalculations happen that were just correct..
This somehow worked before (what change?), maybe just by accident,
Edit::SetText() always set that new selection. However, calculating all
the rat tail for an identical text is unnecessary and hopefully nothing
relies on it. If something did, we'd need to remember and set the
original selection here after setting the text, or adapt the believer..
Change-Id: Ibe086f3620db921dc852280e73789218d81f5c39
Diffstat (limited to 'formula')
-rw-r--r-- | formula/source/ui/dlg/funcutl.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx index c620f383fb32..dc2c1603a314 100644 --- a/formula/source/ui/dlg/funcutl.cxx +++ b/formula/source/ui/dlg/funcutl.cxx @@ -507,7 +507,10 @@ void RefEdit::dispose() void RefEdit::SetRefString( const OUString& rStr ) { - Edit::SetText( rStr ); + // Prevent unwanted side effects by setting only a differing string. + // See commit message for reasons. + if (Edit::GetText() != rStr) + Edit::SetText( rStr ); } void RefEdit::SetRefValid(bool bValid) |