mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
use max & min
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8310 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
839ee41559
commit
4ad759dbc4
@ -1,3 +1,9 @@
|
||||
|
||||
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
|
||||
|
@ -76,3 +76,10 @@ 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)
|
||||
{
|
||||
return (a.par() > b.par() ||
|
||||
(a.par() == b.par() && a.pos() > b.pos()));
|
||||
}
|
||||
|
@ -71,5 +71,7 @@ bool operator==(LyXCursor const & a, LyXCursor const & b);
|
||||
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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user