Commits

Anonymous committed bd9a7bb Merge
  • Participants
  • Parent commits 172a649, af015d7

Comments (0)

Files changed (5)

indra/llui/lltextbase.cpp

 
 	pos = getEditableIndex(pos, true);
 
-	segment_set_t::iterator seg_iter = getSegIterContaining(pos);
+	segment_set_t::iterator seg_iter = getEditableSegIterContaining(pos);
 
 	LLTextSegmentPtr default_segment;
 
 	}
 }
 
+LLTextBase::segment_set_t::iterator LLTextBase::getEditableSegIterContaining(S32 index)
+{
+	segment_set_t::iterator it = getSegIterContaining(index);
+	if (it == mSegments.end()) return it;
+
+	if (!(*it)->canEdit() 
+		&& index == (*it)->getStart() 
+		&& it != mSegments.begin())
+	{
+		it--;
+	}
+	return it;
+}
+
+LLTextBase::segment_set_t::const_iterator LLTextBase::getEditableSegIterContaining(S32 index) const
+{
+	segment_set_t::const_iterator it = getSegIterContaining(index);
+	if (it == mSegments.end()) return it;
+
+	if (!(*it)->canEdit() 
+		&& index == (*it)->getStart() 
+		&& it != mSegments.begin())
+	{
+		it--;
+	}
+	return it;
+}
+
 LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index)
 {
+
 	static LLPointer<LLIndexSegment> index_segment = new LLIndexSegment();
 
 	if (index > getLength()) { return mSegments.end(); }

indra/llui/lltextbase.h

 	void                			getSegmentAndOffset( S32 startpos, segment_set_t::const_iterator* seg_iter, S32* offsetp ) const;
 	void                			getSegmentAndOffset( S32 startpos, segment_set_t::iterator* seg_iter, S32* offsetp );
 	LLTextSegmentPtr    			getSegmentAtLocalPos( S32 x, S32 y, bool hit_past_end_of_line = true);
+	segment_set_t::iterator			getEditableSegIterContaining(S32 index);
+	segment_set_t::const_iterator	getEditableSegIterContaining(S32 index) const;
 	segment_set_t::iterator			getSegIterContaining(S32 index);
 	segment_set_t::const_iterator	getSegIterContaining(S32 index) const;
 	void                			clearSegments();

indra/newview/skins/default/xui/en/menu_edit.xml

   <menu_item_call
    label="Undo"
    name="Undo"
+   allow_key_repeat="true"
    shortcut="control|Z">
     <menu_item_call.on_click
      function="Edit.Undo" />
   <menu_item_call
    label="Redo"
    name="Redo"
+   allow_key_repeat="true"
    shortcut="control|Y">
     <menu_item_call.on_click
      function="Edit.Redo" />
   <menu_item_call
    label="Paste"
    name="Paste"
+   allow_key_repeat="true"
    shortcut="control|V">
     <menu_item_call.on_click
      function="Edit.Paste" />

indra/newview/skins/default/xui/en/menu_viewer.xml

          enabled="false"
          label="Undo"
          name="Undo"
+         allow_key_repeat="true"
          shortcut="control|Z">
             <on_click
              function="Edit.Undo"
          enabled="false"
          label="Redo"
          name="Redo"
+         allow_key_repeat="true"
          shortcut="control|Y">
             <on_click
              function="Edit.Redo"

indra/newview/skins/paths.xml

-<paths>
+<paths> 
 	<directory>
     <subdir>xui</subdir>
     <subdir>en</subdir>