if(!text_part || !graphic || !graphic->get_texture())
return;
- unsigned start = selection_pos;
- unsigned end = edit_pos;
- if(start>end)
- swap(start, end);
+ unsigned start, end;
+ get_selection(start, end);
unsigned row, col;
text.offset_to_coords(start, row, col);
void Entry::erase_selection()
{
- if(!selection_active)
+ unsigned start, end;
+ if(!get_selection(start, end))
return;
- unsigned start = selection_pos;
- unsigned end = edit_pos;
- if(start>end)
- swap(start, end);
-
text.erase(start, end-start);
set_edit_position(start, false);
}