summaryrefslogtreecommitdiff
path: root/indra/llui/lllineeditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lllineeditor.cpp')
-rw-r--r--indra/llui/lllineeditor.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index becb45fa79..cfab6b7fc8 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -125,6 +125,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)
mTextLeftEdge(0), // computed in updateTextPadding() below
mTextRightEdge(0), // computed in updateTextPadding() below
mCommitOnFocusLost( p.commit_on_focus_lost ),
+ mKeystrokeOnEsc(FALSE),
mRevertOnEsc( p.revert_on_esc ),
mKeystrokeCallback( p.keystroke_callback() ),
mIsSelecting( FALSE ),
@@ -1494,6 +1495,10 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
{
setText(mPrevText);
// Note, don't set handled, still want to loose focus (won't commit becase text is now unchanged)
+ if (mKeystrokeOnEsc)
+ {
+ onKeystroke();
+ }
}
break;
@@ -1630,12 +1635,12 @@ BOOL LLLineEditor::handleUnicodeCharHere(llwchar uni_char)
BOOL LLLineEditor::canDoDelete() const
{
- return ( !mReadOnly && mText.length() > 0 && (!mPassDelete || (hasSelection() || (getCursor() < mText.length()))) );
+ return ( !mReadOnly && (!mPassDelete || (hasSelection() || (getCursor() < mText.length()))) );
}
void LLLineEditor::doDelete()
{
- if (canDoDelete())
+ if (canDoDelete() && mText.length() > 0)
{
// Prepare for possible rollback
LLLineEditorRollback rollback( this );