summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-10-22 13:21:50 +0800
committerErik Kundiman <erik@megapahit.org>2024-10-22 16:49:53 +0800
commit705230a26ed4c33af2d3af07c160386ded740079 (patch)
treed812e7e68b43c5a9681482aa598a6346dd7193c8 /indra
parent9d38264521ef5aed9382e46c5b9ba82d0e681c79 (diff)
Revert "IME composition is now replaced by the result"
This reverts commit 60592ae0d7a98e071e516fcac70c5bf1427f20be.
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llfocusmgr.cpp2
-rw-r--r--indra/llui/llfocusmgr.h2
-rw-r--r--indra/llui/lllineeditor.cpp12
-rw-r--r--indra/llui/lllineeditor.h4
-rw-r--r--indra/llui/lltexteditor.cpp10
-rw-r--r--indra/llui/lltexteditor.h4
-rw-r--r--indra/llui/llview.cpp8
-rw-r--r--indra/llui/llview.h4
-rw-r--r--indra/llwindow/llwindowcallbacks.cpp2
-rw-r--r--indra/llwindow/llwindowcallbacks.h2
-rw-r--r--indra/newview/llviewerwindow.cpp4
-rw-r--r--indra/newview/llviewerwindow.h2
12 files changed, 24 insertions, 32 deletions
diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp
index 4f3d2328aa..9773a0a526 100644
--- a/indra/llui/llfocusmgr.cpp
+++ b/indra/llui/llfocusmgr.cpp
@@ -59,7 +59,7 @@ bool LLFocusableElement::handleUnicodeChar(llwchar uni_char, bool called_from_pa
}
// virtual
-bool LLFocusableElement::handleUnicodeString(char *uni_str, bool editing, bool called_from_parent)
+bool LLFocusableElement::handleUnicodeString(char *uni_str, bool called_from_parent)
{
return FALSE;
}
diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h
index 1ca6f50354..9cd442e8fc 100644
--- a/indra/llui/llfocusmgr.h
+++ b/indra/llui/llfocusmgr.h
@@ -59,7 +59,7 @@ 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 editing, 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 ac7948f735..87b0c74916 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -1031,7 +1031,7 @@ void LLLineEditor::addChar(const llwchar uni_char)
getWindow()->hideCursorUntilMouseMove();
}
-void LLLineEditor::addString(char *s, bool editing)
+void LLLineEditor::addString(char *s)
{
if (hasSelection())
deleteSelection();
@@ -1040,13 +1040,9 @@ void LLLineEditor::addString(char *s, bool editing)
.substr(getCursor(), 1)))
return;
mText.erase(getCursor(), 1);
- } else if (editing) {
- mText.clear();
- setCursor(0);
}
mText.insert(getCursor(), utf8str_to_wstring(s));
- if (editing) setCursor(strlen(s));
- else setCursor(getCursor() + 1);
+ setCursor(getCursor() + 1);
getWindow()->hideCursorUntilMouseMove();
}
@@ -1704,7 +1700,7 @@ bool LLLineEditor::handleUnicodeCharHere(llwchar uni_char)
return handled;
}
-bool LLLineEditor::handleUnicodeStringHere(char *uni_str, bool editing)
+bool LLLineEditor::handleUnicodeStringHere(char *uni_str)
{
auto handled = FALSE;
@@ -1713,7 +1709,7 @@ bool LLLineEditor::handleUnicodeStringHere(char *uni_str, bool editing)
handled = TRUE;
LLLineEditorRollback rollback(this);
- addString(uni_str, editing);
+ addString(uni_str);
mKeystrokeTimer.reset();
deselect();
diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h
index 3a39a7363d..5291f31d09 100644
--- a/indra/llui/lllineeditor.h
+++ b/indra/llui/lllineeditor.h
@@ -133,7 +133,7 @@ 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, bool editing) override;
+ /*virtual*/ bool handleUnicodeStringHere(char *uni_str) override;
/*virtual*/ void onMouseCaptureLost() override;
// LLEditMenuHandler overrides
@@ -301,7 +301,7 @@ public:
void removeChar();
void addChar(const llwchar c);
- void addString(char *s, bool editing);
+ 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 cbbb164cb2..6620b684f4 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -1257,7 +1257,7 @@ void LLTextEditor::addChar(llwchar wc)
}
}
-void LLTextEditor::addString(char *str, bool editing)
+void LLTextEditor::addString(char *str)
{
if (!getEnabled())
return;
@@ -1265,10 +1265,6 @@ void LLTextEditor::addString(char *str, bool editing)
deleteSelection(TRUE);
else if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode())
removeChar(mCursorPos);
- else if (editing) {
- clear();
- setCursorPos(0);
- }
setCursorPos(mCursorPos + addString(mCursorPos, str));
@@ -2060,12 +2056,12 @@ bool LLTextEditor::handleUnicodeCharHere(llwchar uni_char)
return handled;
}
-bool LLTextEditor::handleUnicodeStringHere(char *uni_str, bool editing)
+bool LLTextEditor::handleUnicodeStringHere(char *uni_str)
{
auto handled = FALSE;
if (!mReadOnly) {
- addString(uni_str, editing);
+ addString(uni_str);
getWindow()->hideCursorUntilMouseMove();
handled = TRUE;
}
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index 47dcadf090..24da5c04e5 100644
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -105,7 +105,7 @@ public:
virtual bool handleKeyHere(KEY key, MASK mask );
virtual bool handleUnicodeCharHere(llwchar uni_char);
- virtual bool handleUnicodeStringHere(char *uni_str, bool editing);
+ virtual bool handleUnicodeStringHere(char *uni_str);
virtual void onMouseCaptureLost();
@@ -250,7 +250,7 @@ protected:
// Undoable operations
void addChar(llwchar c); // at mCursorPos
S32 addChar(S32 pos, llwchar wc);
- void addString(char *s, bool editing);
+ void addString(char *s);
S32 addString(S32 pos, char *str);
void addLineBreakChar(bool group_together = false);
S32 overwriteChar(S32 pos, llwchar wc);
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index f2a1e16aad..cead5b5956 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -1080,18 +1080,18 @@ bool LLView::handleUnicodeChar(llwchar uni_char, bool called_from_parent)
return handled;
}
-bool LLView::handleUnicodeString(char *uni_str, bool editing, bool called_from_parent)
+bool LLView::handleUnicodeString(char *uni_str, bool called_from_parent)
{
auto handled = FALSE;
if (getVisible() && getEnabled() && !handled) {
- handled = handleUnicodeStringHere(uni_str, editing);
+ 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, editing, FALSE);
+ handled = mParentView->handleUnicodeString(uni_str, FALSE);
return handled;
}
@@ -1101,7 +1101,7 @@ bool LLView::handleUnicodeCharHere(llwchar uni_char )
return false;
}
-bool LLView::handleUnicodeStringHere(char *uni_str, bool editing)
+bool LLView::handleUnicodeStringHere(char *uni_str)
{
return FALSE;
}
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 876bfafaa3..7f57a8d7db 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -385,7 +385,7 @@ 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 editing, 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 +519,7 @@ 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, bool editing);
+ 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 624ecd5030..ff46ae951e 100644
--- a/indra/llwindow/llwindowcallbacks.cpp
+++ b/indra/llwindow/llwindowcallbacks.cpp
@@ -52,7 +52,7 @@ bool LLWindowCallbacks::handleUnicodeChar(llwchar uni_char, MASK mask)
return false;
}
-bool LLWindowCallbacks::handleUnicodeString(char *uni_str, bool editing)
+bool LLWindowCallbacks::handleUnicodeString(char *uni_str)
{
return FALSE;
}
diff --git a/indra/llwindow/llwindowcallbacks.h b/indra/llwindow/llwindowcallbacks.h
index 74660e1705..c7cb2b146c 100644
--- a/indra/llwindow/llwindowcallbacks.h
+++ b/indra/llwindow/llwindowcallbacks.h
@@ -37,7 +37,7 @@ 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, bool editing);
+ 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 c8ff744369..0e2e57a84a 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3147,11 +3147,11 @@ bool LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask)
return false;
}
-bool LLViewerWindow::handleUnicodeString(char *uni_str, bool editing)
+bool LLViewerWindow::handleUnicodeString(char *uni_str)
{
auto keyboard_focus = gFocusMgr.getKeyboardFocus();
if (keyboard_focus)
- keyboard_focus->handleUnicodeString(uni_str, editing, FALSE);
+ keyboard_focus->handleUnicodeString(uni_str, FALSE);
return TRUE;
}
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index acf9485eca..31bf5b5332 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -194,7 +194,7 @@ 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, bool editing);
+ /*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);