]> git.lyx.org Git - features.git/blobdiff - src/textcursor.C
use max & min
[features.git] / src / textcursor.C
index 275441471f652ae6d97d07e8e40e588ea67823c2..a372f3fd50cae7f25dda4e5a6f107111257188cf 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <config.h>
+#include <algorithm>
 
 #include "textcursor.h"
 
@@ -17,7 +18,7 @@ LyXCursor const & TextCursor::selStart() const
 {
        if (!selection.set())
                return cursor;
-       return selection.cursor < cursor ? selection.cursor : cursor;
+       return std::min(selection.cursor, cursor);
 }
 
 
@@ -25,7 +26,7 @@ LyXCursor const & TextCursor::selEnd() const
 {
        if (!selection.set())
                return cursor;
-       return selection.cursor < cursor ? cursor : selection.cursor;
+       return std::max(selection.cursor, cursor);
 }