Move rarely used stuff out-of-line

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7211 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2003-06-26 09:42:28 +00:00
parent 37e207d926
commit 7ab4b6683f
5 changed files with 30 additions and 42 deletions

View File

@ -1,3 +1,11 @@
2003-06-26 André Pönitz <poenitz@gmx.net>
* lyxcursor.[Ch]: move rarely used operator==,!= out of line
remove unused/broken operator>,<,>=.
* text.C: remove only use of broken operator<= in an Assert().
2003-06-24 Alfredo Brauntein <abraunst@lyx.org>
* BufferView.[Ch] (getErrorList): removed unneeded forward declare,

View File

@ -133,3 +133,18 @@ RowList::iterator LyXCursor::irow() const
{
return irow_;
}
bool operator==(LyXCursor const & a, LyXCursor const & b)
{
return a.par() == b.par()
&& a.pos() == b.pos()
&& a.boundary() == b.boundary();
}
bool operator!=(LyXCursor const & a, LyXCursor const & b)
{
return !(a == b);
}

View File

@ -130,45 +130,9 @@ private:
RowList::iterator irow_;
};
/// these three dictate the others
inline
bool operator==(LyXCursor const & a, LyXCursor const & b)
{
return (a.par() == b.par())
&& (a.pos() == b.pos())
&& a.boundary() == b.boundary();
}
inline
bool operator!=(LyXCursor const & a, LyXCursor const & b)
{
return !(a == b);
}
/// only compares y() and pos(). Can this be done in another way?
inline
bool operator<(LyXCursor const & a, LyXCursor const & b)
{
return (a.y() < b.y() && a.pos() < b.pos());
}
inline
bool operator>(LyXCursor const & a, LyXCursor const & b)
{
return b < a;
}
inline
bool operator>=(LyXCursor const & a, LyXCursor const & b)
{
return !(a < b);
}
inline
bool operator<=(LyXCursor const & a, LyXCursor const & b)
{
return !(a > b);
}
///
bool operator==(LyXCursor const & a, LyXCursor const & b);
///
bool operator!=(LyXCursor const & a, LyXCursor const & b);
#endif // LYXCURSOR_H

View File

@ -626,6 +626,9 @@ public:
/// return true if this is owned by an inset.
bool isInInset() const;
///
void adjustCursor(int row, int offset);
};
/// return the default height of a row in pixels, considering font zoom

View File

@ -2363,8 +2363,6 @@ void LyXText::changeCase(LyXText::TextCase action)
setCursor(to.par(), to.pos() + 1);
}
lyx::Assert(from <= to);
setUndo(bv(), Undo::FINISH, from.par(), to.par());
pos_type pos = from.pos();