diff options
author | Mark Palange (Mani) <palange@lindenlab.com> | 2009-10-01 18:19:45 -0700 |
---|---|---|
committer | Mark Palange (Mani) <palange@lindenlab.com> | 2009-10-01 18:19:45 -0700 |
commit | dde2153014cd7d7b8fa704f7067a41344bfbb1c2 (patch) | |
tree | f7633ccef179644660897c8bf3684abeda3545f8 /indra/llui/lltexteditor.cpp | |
parent | 9b8b0571645f8b607ecc24221c807cc02a03692f (diff) | |
parent | 85ea690d47208f6dda020c8ff81021179fbdd0b8 (diff) |
merge of latest lindenlab/svn-imports-viewer-20
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
-rw-r--r-- | indra/llui/lltexteditor.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 8d5f277b59..39f09b297f 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2001,6 +2001,8 @@ void LLTextEditor::cut() deleteSelection( FALSE ); needsReflow(); + + onKeyStroke(); } BOOL LLTextEditor::canCopy() const @@ -2105,6 +2107,8 @@ void LLTextEditor::pasteHelper(bool is_primary) deselect(); needsReflow(); + + onKeyStroke(); } @@ -2492,6 +2496,8 @@ BOOL LLTextEditor::handleKeyHere(KEY key, MASK mask ) if(text_may_have_changed) { needsReflow(); + + onKeyStroke(); } needsScroll(); } @@ -2534,6 +2540,8 @@ BOOL LLTextEditor::handleUnicodeCharHere(llwchar uni_char) deselect(); needsReflow(); + + onKeyStroke(); } return handled; @@ -2588,6 +2596,8 @@ void LLTextEditor::doDelete() setCursorPos(mCursorPos + 1); removeChar(); } + + onKeyStroke(); } needsReflow(); @@ -2634,6 +2644,8 @@ void LLTextEditor::undo() setCursorPos(pos); needsReflow(); + + onKeyStroke(); } BOOL LLTextEditor::canRedo() const @@ -2676,6 +2688,8 @@ void LLTextEditor::redo() setCursorPos(pos); needsReflow(); + + onKeyStroke(); } void LLTextEditor::onFocusReceived() @@ -4402,6 +4416,8 @@ void LLTextEditor::updatePreedit(const LLWString &preedit_string, // Update of the preedit should be caused by some key strokes. mKeystrokeTimer.reset(); + + onKeyStroke(); } BOOL LLTextEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect *bounds, LLRect *control) const @@ -4648,3 +4664,30 @@ void LLInlineViewSegment::linkToDocument(LLTextBase* editor) ed->addDocumentChild(mView); } } + +BOOL LLTextEditor::isDirty() const +{ + if(mReadOnly) + { + return FALSE; + } + + if( mPristineCmd ) + { + return ( mPristineCmd == mLastCmd ); + } + else + { + return ( NULL != mLastCmd ); + } +} + +void LLTextEditor::setKeystrokeCallback(const keystroke_signal_t::slot_type& callback) +{ + mKeystrokeSignal.connect(callback); +} + +void LLTextEditor::onKeyStroke() +{ + mKeystrokeSignal(this); +} |