From 47c140b81d868229187f85185e4721946430ad87 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Fri, 22 Jun 2012 17:04:47 +0300 Subject: CHUI-127 ADDITIONAL FIX (Make chat field auto resizable) - Fixed crash which occurred while navigating through history of sent messages --- indra/llui/llchatentry.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/llui/llchatentry.cpp') diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp index dea8ff9bb2..a6ba125406 100644 --- a/indra/llui/llchatentry.cpp +++ b/indra/llui/llchatentry.cpp @@ -170,13 +170,14 @@ BOOL LLChatEntry::handleSpecialKey(const KEY key, const MASK mask) case KEY_DOWN: if (mHasHistory && MASK_CONTROL == mask) { - if (!mLineHistory.empty() && ++mCurrentHistoryLine < mLineHistory.end()) + if (!mLineHistory.empty() && mCurrentHistoryLine < (mLineHistory.end() - 1) ) { - setText(*mCurrentHistoryLine); + setText(*(++mCurrentHistoryLine)); endOfDoc(); } - else if (!mLineHistory.empty() && mCurrentHistoryLine == mLineHistory.end()) + else if (!mLineHistory.empty() && mCurrentHistoryLine == (mLineHistory.end() - 1) ) { + mCurrentHistoryLine++; std::string empty(""); setText(empty); needsReflow(); -- cgit v1.2.3