summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-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
8 files changed, 19 insertions, 27 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();