+
+2004-01-07 Alfredo Braunstein <abraunst@lyx.org>
+
+ * lyxcursor.[Ch] (operator>): add
+ * textcursor.C (selStart, selEnd): use std::min and std::max
+
2004-01-06 Lars Gullik Bjonnes <larsbj@gullik.net>
* Chktex.C: include boost/format.hpp
return (a.par() < b.par() ||
(a.par() == b.par() && a.pos() < b.pos()));
}
+
+
+bool operator>(LyXCursor const & a, LyXCursor const & b)
+{
+ return (a.par() > b.par() ||
+ (a.par() == b.par() && a.pos() > b.pos()));
+}
bool operator!=(LyXCursor const & a, LyXCursor const & b);
///
bool operator<(LyXCursor const & a, LyXCursor const & b);
+///
+bool operator>(LyXCursor const & a, LyXCursor const & b);
#endif // LYXCURSOR_H
*/
#include <config.h>
+#include <algorithm>
#include "textcursor.h"
{
if (!selection.set())
return cursor;
- return selection.cursor < cursor ? selection.cursor : cursor;
+ return std::min(selection.cursor, cursor);
}
{
if (!selection.set())
return cursor;
- return selection.cursor < cursor ? cursor : selection.cursor;
+ return std::max(selection.cursor, cursor);
}