3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "textcursor.h"
16 LyXCursor const & TextCursor::selStart() const
20 return selection.cursor < cursor ? selection.cursor : cursor;
24 LyXCursor const & TextCursor::selEnd() const
28 return selection.cursor < cursor ? cursor : selection.cursor;
32 LyXCursor & TextCursor::selStart()
34 TextCursor const & t = *this;
35 return const_cast<LyXCursor &>(t.selStart());
39 LyXCursor & TextCursor::selEnd()
41 TextCursor const & t = *this;
42 return const_cast<LyXCursor &>(t.selEnd());
46 void TextCursor::setSelection()
49 // a selection with no contents is not a selection
50 if (cursor.par() == selection.cursor.par() &&
51 cursor.pos() == selection.cursor.pos())
58 void TextCursor::clearSelection()
61 selection.mark(false);
62 selection.cursor = cursor;