summaryrefslogtreecommitdiff
path: root/indra/llui/lltexteditor.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-08-24 19:22:00 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-08-24 19:22:00 +0100
commite416840f85dc4a367894036b9fe483f17d959c54 (patch)
treee12956cbe7a0082bbaaa545cb80d9e86b13f88e8 /indra/llui/lltexteditor.cpp
parent98cc2365034a93c69704daa69efb389799cc9627 (diff)
Backed out changeset c3d41f18ce2b
back-out the back-out for this branch. yay.
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
-rw-r--r--indra/llui/lltexteditor.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index e09df60704..94bf716e7d 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -283,6 +283,9 @@ void LLTextEditor::initFromParams( const LLTextEditor::Params& p)
{
LLTextBase::initFromParams(p);
+ // HACK: text editors always need to be enabled so that we can scroll
+ LLView::setEnabled(true);
+
if (p.commit_on_focus_lost.isProvided())
{
mCommitOnFocusLost = p.commit_on_focus_lost;
@@ -452,8 +455,13 @@ S32 LLTextEditor::nextWordPos(S32 cursorPos) const
const LLTextSegmentPtr LLTextEditor::getPreviousSegment() const
{
+ static LLPointer<LLIndexSegment> index_segment = new LLIndexSegment;
+
+ index_segment->setStart(mCursorPos);
+ index_segment->setEnd(mCursorPos);
+
// find segment index at character to left of cursor (or rightmost edge of selection)
- segment_set_t::const_iterator it = mSegments.lower_bound(new LLIndexSegment(mCursorPos));
+ segment_set_t::const_iterator it = mSegments.lower_bound(index_segment);
if (it != mSegments.end())
{