summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dyukov <adyukov@productengine.com>2010-08-13 19:33:18 +0300
committerAndrew Dyukov <adyukov@productengine.com>2010-08-13 19:33:18 +0300
commitf523a589a7b4456d86e6ef90ff5b77ae0b416eae (patch)
tree0b6d37353bb3d8e58a66b4697612c9a3733859e4
parent6cab04ce2fcbcff87b5b3b8d3387b9d812dc53d3 (diff)
EXT-8536 FIXED Fixed wrong behaviour of slidercontrol's lineeditor revert on escape.
Though bug description mentioned only appearance, bug reproduced for all slidercontrols. The cause of returning on escape to old value instead of last commited one was that on commit slidercontrol set text for it's lineeditor which was the same as the one currently typed into lineeditor(and it seems logical). But LLLineEditor::setText() has check at it's beginning which compares text which is being set to the one which is already there. If this check succeeds, we exit the method and thus saving of value for revert is not reached. That's why when revert happened on escape older value then the last commited was set in lineeditor. - Added additional call of setText() in sliderctrl to force changes in currently set text so that on next call with "real" text saving of reverted value was reached. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/856/ --HG-- branch : product-engine
-rw-r--r--indra/llui/llsliderctrl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp
index 04958075db..1c410cc1aa 100644
--- a/indra/llui/llsliderctrl.cpp
+++ b/indra/llui/llsliderctrl.cpp
@@ -235,6 +235,10 @@ void LLSliderCtrl::updateText()
std::string text = llformat(format.c_str(), displayed_value);
if( mEditor )
{
+ // Setting editor text here to "" before using actual text is here because if text which
+ // is set is the same as the one which is actually typed into lineeditor, LLLineEditor::setText()
+ // will exit at it's beginning, so text for revert on escape won't be saved. (EXT-8536)
+ mEditor->setText( LLStringUtil::null );
mEditor->setText( text );
}
else