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 // can't use std::min as this creates a new object
21 return anchor_ < cursor_ ? anchor_ : cursor_;
25 LyXCursor const & TextCursor::selEnd() const
29 return anchor_ > cursor_ ? anchor_ : cursor_;
33 LyXCursor & TextCursor::selStart()
37 return anchor_ < cursor_ ? anchor_ : cursor_;
41 LyXCursor & TextCursor::selEnd()
45 return anchor_ > cursor_ ? anchor_ : cursor_;
49 void TextCursor::setSelection()
52 // a selection with no contents is not a selection
53 if (cursor_.par() == anchor_.par() && cursor_.pos() == anchor_.pos())
58 void TextCursor::clearSelection()
61 selection.mark(false);