Commits

Richard Linden  committed 52c3e53

EXP-1512 FIX changing UI size changes cursor position in notecards
fixed case where adding text between 2 consecutive newlines created gibberish

  • Participants
  • Parent commits 046d8be

Comments (0)

Files changed (2)

File indra/llui/lltextbase.cpp

 LLTextBase::segment_set_t::iterator LLTextBase::getEditableSegIterContaining(S32 index)
 {
 	segment_set_t::iterator it = getSegIterContaining(index);
+	segment_set_t::iterator orig_it = it;
+
 	if (it == mSegments.end()) return it;
 
 	if (!(*it)->canEdit() 
 		&& it != mSegments.begin())
 	{
 		it--;
+		if ((*it)->canEdit())
+		{
+			return it;
+		}
 	}
-	return it;
+	return orig_it;
 }
 
 LLTextBase::segment_set_t::const_iterator LLTextBase::getEditableSegIterContaining(S32 index) const
 {
 	segment_set_t::const_iterator it = getSegIterContaining(index);
+	segment_set_t::const_iterator orig_it = it;
 	if (it == mSegments.end()) return it;
 
 	if (!(*it)->canEdit() 
 		&& it != mSegments.begin())
 	{
 		it--;
+		if ((*it)->canEdit())
+		{
+			return it;
+		}
 	}
-	return it;
+	return orig_it;
 }
 
 LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index)

File indra/llui/llview.h

 
 	S32			mNextInsertionOrdinal;
 
+	bool		mInDraw;
+
 	static LLWindow* sWindow;	// All root views must know about their window.
 
 	typedef std::map<std::string, LLView*> default_widget_map_t;