summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-10-22 13:42:22 +0800
committerErik Kundiman <erik@megapahit.org>2024-10-22 16:49:53 +0800
commit35ee215d68c891bcbf3fd64709f000c0a8e7f597 (patch)
treeb045e073dc7b14d37ef1b4d30566b84f085c3cee /indra
parent705230a26ed4c33af2d3af07c160386ded740079 (diff)
Revert "First attempt to fix unicode input"
This reverts commit aaa8cb5a37a720ff67792d0a31fec793b03b3742.
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llfocusmgr.cpp6
-rw-r--r--indra/llui/llfocusmgr.h1
-rw-r--r--indra/llui/lllineeditor.cpp45
-rw-r--r--indra/llui/lllineeditor.h2
-rw-r--r--indra/llui/lltexteditor.cpp102
-rw-r--r--indra/llui/lltexteditor.h4
-rw-r--r--indra/llui/llview.cpp19
-rw-r--r--indra/llui/llview.h2
-rw-r--r--indra/llwindow/llwindowcallbacks.cpp4
-rw-r--r--indra/llwindow/llwindowcallbacks.h1
-rw-r--r--indra/newview/llviewerwindow.cpp8
-rw-r--r--indra/newview/llviewerwindow.h1
12 files changed, 0 insertions, 195 deletions
diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp
index 9773a0a526..0d7c98294f 100644
--- a/indra/llui/llfocusmgr.cpp
+++ b/indra/llui/llfocusmgr.cpp
@@ -59,12 +59,6 @@ bool LLFocusableElement::handleUnicodeChar(llwchar uni_char, bool called_from_pa
}
// virtual
-bool LLFocusableElement::handleUnicodeString(char *uni_str, bool called_from_parent)
-{
- return FALSE;
-}
-
-// virtual
bool LLFocusableElement::wantsKeyUpKeyDown() const
{
return false;
diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h
index 9cd442e8fc..1fa0ac137e 100644
--- a/indra/llui/llfocusmgr.h
+++ b/indra/llui/llfocusmgr.h
@@ -59,7 +59,6 @@ public:
virtual bool handleKey(KEY key, MASK mask, bool called_from_parent);
virtual bool handleKeyUp(KEY key, MASK mask, bool called_from_parent);
virtual bool handleUnicodeChar(llwchar uni_char, bool called_from_parent);
- virtual bool handleUnicodeString(char *uni_str, bool called_from_parent);
/**
* If true this LLFocusableElement wants to receive KEYUP and KEYDOWN messages
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 87b0c74916..60b6115b34 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -1031,21 +1031,6 @@ void LLLineEditor::addChar(const llwchar uni_char)
getWindow()->hideCursorUntilMouseMove();
}
-void LLLineEditor::addString(char *s)
-{
- if (hasSelection())
- deleteSelection();
- else if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode()) {
- if (!prevalidateInput(mText.getWString()
- .substr(getCursor(), 1)))
- return;
- mText.erase(getCursor(), 1);
- }
- mText.insert(getCursor(), utf8str_to_wstring(s));
- setCursor(getCursor() + 1);
- getWindow()->hideCursorUntilMouseMove();
-}
-
// Extends the selection box to the new cursor position
void LLLineEditor::extendSelection( S32 new_cursor_pos )
{
@@ -1700,36 +1685,6 @@ bool LLLineEditor::handleUnicodeCharHere(llwchar uni_char)
return handled;
}
-bool LLLineEditor::handleUnicodeStringHere(char *uni_str)
-{
- auto handled = FALSE;
-
- if ((gFocusMgr.getKeyboardFocus() == this)
- && getVisible() && !mReadOnly) {
- handled = TRUE;
- LLLineEditorRollback rollback(this);
-
- addString(uni_str);
-
- mKeystrokeTimer.reset();
- deselect();
- auto need_to_rollback = mPrevalidator
- && !mPrevalidator.validate(mText.getWString());
-
- if (need_to_rollback) {
- rollback.doRollback(this);
- LLUI::getInstance()->reportBadKeystroke();
- mPrevalidator.showLastErrorUsingTimeout();
- }
-
- if (!need_to_rollback && handled) {
- onKeystroke();
- mSpellCheckTimer.setTimerExpirySec(SPELLCHECK_DELAY);
- }
- }
-
- return handled;
-}
bool LLLineEditor::canDoDelete() const
{
diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h
index 5291f31d09..cdd22413e7 100644
--- a/indra/llui/lllineeditor.h
+++ b/indra/llui/lllineeditor.h
@@ -133,7 +133,6 @@ public:
/*virtual*/ bool handleRightMouseDown(S32 x, S32 y, MASK mask) override;
/*virtual*/ bool handleKeyHere(KEY key, MASK mask) override;
/*virtual*/ bool handleUnicodeCharHere(llwchar uni_char) override;
- /*virtual*/ bool handleUnicodeStringHere(char *uni_str) override;
/*virtual*/ void onMouseCaptureLost() override;
// LLEditMenuHandler overrides
@@ -301,7 +300,6 @@ public:
void removeChar();
void addChar(const llwchar c);
- void addString(char *s);
void setCursorAtLocalPos(S32 local_mouse_x);
S32 findPixelNearestPos(S32 cursor_offset = 0) const;
S32 calcCursorPos(S32 mouse_x);
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 6620b684f4..3537c764b9 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -167,50 +167,6 @@ private:
};
///////////////////////////////////////////////////////////////////
-class LLTextEditor::TextCmdAddString : public LLTextBase::TextCmd
-{
-public:
- TextCmdAddString(S32 pos, bool group_with_next, char *str,
- LLTextSegmentPtr segment) :
- TextCmd(pos, group_with_next, segment),
- mWString(utf8str_to_wstring(str)),
- mBlockExtensions(FALSE)
- {
- }
- virtual void blockExtensions()
- {
- mBlockExtensions = TRUE;
- }
- virtual bool canExtend(S32 pos) const
- {
- if (!mSegments.empty()) return FALSE;
-
- return !mBlockExtensions
- && (pos == getPosition() + (S32)mWString.length());
- }
- virtual bool execute(LLTextBase* editor, S32* delta)
- {
- *delta = insert(editor, getPosition(), mWString);
- LLWStringUtil::truncate(mWString, *delta);
- return (*delta != 0);
- }
- virtual S32 undo(LLTextBase* editor)
- {
- remove(editor, getPosition(), mWString.length());
- return getPosition();
- }
- virtual S32 redo(LLTextBase* editor)
- {
- insert(editor, getPosition(), mWString);
- return getPosition() + mWString.length();
- }
-
-private:
- LLWString mWString;
- bool mBlockExtensions;
-};
-
-///////////////////////////////////////////////////////////////////
class LLTextEditor::TextCmdOverwriteChar : public LLTextBase::TextCmd
{
@@ -1208,18 +1164,6 @@ S32 LLTextEditor::addChar(S32 pos, llwchar wc)
return execute(new TextCmdAddChar(pos, false, wc, LLTextSegmentPtr()));
}
-S32 LLTextEditor::addString(S32 pos, char *str)
-{
- if ((wstring_utf8_length(getWText()) + strlen(str))
- > mMaxTextByteLength) {
- make_ui_sound("UISndBadKeystroke");
- return 0;
- }
-
- return execute(new TextCmdAddString(pos, FALSE, str,
- LLTextSegmentPtr()));
-}
-
void LLTextEditor::addChar(llwchar wc)
{
if (!getEnabled())
@@ -1257,34 +1201,6 @@ void LLTextEditor::addChar(llwchar wc)
}
}
-void LLTextEditor::addString(char *str)
-{
- if (!getEnabled())
- return;
- if (hasSelection())
- deleteSelection(TRUE);
- else if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode())
- removeChar(mCursorPos);
-
- setCursorPos(mCursorPos + addString(mCursorPos, str));
-
- if (!mReadOnly && mAutoreplaceCallback != NULL) {
- S32 replacement_start;
- S32 replacement_length;
- LLWString replacement_string;
- S32 new_cursor_pos = mCursorPos;
- mAutoreplaceCallback(replacement_start, replacement_length,
- replacement_string, new_cursor_pos, getWText());
-
- if (replacement_length > 0 || !replacement_string.empty()) {
- remove(replacement_start, replacement_length, true);
- insert(replacement_start, replacement_string, false,
- LLTextSegmentPtr());
- setCursorPos(new_cursor_pos);
- }
- }
-}
-
void LLTextEditor::showEmojiHelper()
{
if (mReadOnly || !mShowEmojiHelper)
@@ -2056,24 +1972,6 @@ bool LLTextEditor::handleUnicodeCharHere(llwchar uni_char)
return handled;
}
-bool LLTextEditor::handleUnicodeStringHere(char *uni_str)
-{
- auto handled = FALSE;
-
- if (!mReadOnly) {
- addString(uni_str);
- getWindow()->hideCursorUntilMouseMove();
- handled = TRUE;
- }
-
- if (handled) {
- resetCursorBlink();
- deselect();
- onKeyStroke();
- }
-
- return handled;
-}
// virtual
bool LLTextEditor::canDoDelete() const
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index 24da5c04e5..0b5acf19a1 100644
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -105,7 +105,6 @@ public:
virtual bool handleKeyHere(KEY key, MASK mask );
virtual bool handleUnicodeCharHere(llwchar uni_char);
- virtual bool handleUnicodeStringHere(char *uni_str);
virtual void onMouseCaptureLost();
@@ -250,8 +249,6 @@ protected:
// Undoable operations
void addChar(llwchar c); // at mCursorPos
S32 addChar(S32 pos, llwchar wc);
- void addString(char *s);
- S32 addString(S32 pos, char *str);
void addLineBreakChar(bool group_together = false);
S32 overwriteChar(S32 pos, llwchar wc);
void removeChar();
@@ -313,7 +310,6 @@ private:
// Concrete TextCmd sub-classes used by the LLTextEditor base class
class TextCmdInsert;
class TextCmdAddChar;
- class TextCmdAddString;
class TextCmdOverwriteChar;
class TextCmdRemove;
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index cead5b5956..7d6c937b85 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -1080,31 +1080,12 @@ bool LLView::handleUnicodeChar(llwchar uni_char, bool called_from_parent)
return handled;
}
-bool LLView::handleUnicodeString(char *uni_str, bool called_from_parent)
-{
- auto handled = FALSE;
-
- if (getVisible() && getEnabled() && !handled) {
- handled = handleUnicodeStringHere(uni_str);
- if (handled && LLView::sDebugKeys)
- LL_INFOS() << "Unicode key handled by " << getName() << LL_ENDL;
- }
-
- if (!handled && !called_from_parent && mParentView)
- handled = mParentView->handleUnicodeString(uni_str, FALSE);
-
- return handled;
-}
bool LLView::handleUnicodeCharHere(llwchar uni_char )
{
return false;
}
-bool LLView::handleUnicodeStringHere(char *uni_str)
-{
- return FALSE;
-}
bool LLView::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop,
EDragAndDropType cargo_type, void* cargo_data,
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 7f57a8d7db..710ec3d05e 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -385,7 +385,6 @@ public:
/* virtual */ bool handleKey(KEY key, MASK mask, bool called_from_parent);
/* virtual */ bool handleKeyUp(KEY key, MASK mask, bool called_from_parent);
/* virtual */ bool handleUnicodeChar(llwchar uni_char, bool called_from_parent);
- /* virtual */ bool handleUnicodeString(char *uni_str, bool called_from_parent);
virtual bool handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop,
EDragAndDropType cargo_type,
@@ -519,7 +518,6 @@ public:
virtual bool handleKeyHere(KEY key, MASK mask);
virtual bool handleKeyUpHere(KEY key, MASK mask);
virtual bool handleUnicodeCharHere(llwchar uni_char);
- virtual bool handleUnicodeStringHere(char *uni_str);
virtual void handleReshape(const LLRect& rect, bool by_user);
virtual void dirtyRect();
diff --git a/indra/llwindow/llwindowcallbacks.cpp b/indra/llwindow/llwindowcallbacks.cpp
index ff46ae951e..c160382c17 100644
--- a/indra/llwindow/llwindowcallbacks.cpp
+++ b/indra/llwindow/llwindowcallbacks.cpp
@@ -52,10 +52,6 @@ bool LLWindowCallbacks::handleUnicodeChar(llwchar uni_char, MASK mask)
return false;
}
-bool LLWindowCallbacks::handleUnicodeString(char *uni_str)
-{
- return FALSE;
-}
bool LLWindowCallbacks::handleMouseDown(LLWindow *window, const LLCoordGL pos, MASK mask)
{
diff --git a/indra/llwindow/llwindowcallbacks.h b/indra/llwindow/llwindowcallbacks.h
index c7cb2b146c..63b585231f 100644
--- a/indra/llwindow/llwindowcallbacks.h
+++ b/indra/llwindow/llwindowcallbacks.h
@@ -37,7 +37,6 @@ public:
virtual bool handleTranslatedKeyUp(KEY key, MASK mask);
virtual void handleScanKey(KEY key, bool key_down, bool key_up, bool key_level);
virtual bool handleUnicodeChar(llwchar uni_char, MASK mask);
- virtual bool handleUnicodeString(char *uni_str);
virtual bool handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask);
virtual bool handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 0e2e57a84a..e694474a41 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3147,14 +3147,6 @@ bool LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask)
return false;
}
-bool LLViewerWindow::handleUnicodeString(char *uni_str)
-{
- auto keyboard_focus = gFocusMgr.getKeyboardFocus();
- if (keyboard_focus)
- keyboard_focus->handleUnicodeString(uni_str, FALSE);
-
- return TRUE;
-}
void LLViewerWindow::handleScrollWheel(S32 clicks)
{
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index 31bf5b5332..1b995ea650 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -194,7 +194,6 @@ public:
/*virtual*/ bool handleTranslatedKeyUp(KEY key, MASK mask);
/*virtual*/ void handleScanKey(KEY key, bool key_down, bool key_up, bool key_level);
/*virtual*/ bool handleUnicodeChar(llwchar uni_char, MASK mask); // NOT going to handle extended
- /*virtual*/ bool handleUnicodeString(char *uni_str);
/*virtual*/ bool handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask);
/*virtual*/ bool handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask);
/*virtual*/ bool handleCloseRequest(LLWindow *window);