From: André Pönitz Date: Thu, 26 Jun 2003 09:42:28 +0000 (+0000) Subject: Move rarely used stuff out-of-line X-Git-Tag: 1.6.10~16598 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7ab4b6683f1067ffc9cc3fc1b0c56f3f0c1244a1;p=features.git Move rarely used stuff out-of-line git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7211 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index 939a36e74f..aa646750ea 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ + +2003-06-26 André Pönitz + + * 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 * BufferView.[Ch] (getErrorList): removed unneeded forward declare, diff --git a/src/lyxcursor.C b/src/lyxcursor.C index 03ef301756..2ec6731cc9 100644 --- a/src/lyxcursor.C +++ b/src/lyxcursor.C @@ -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); +} + diff --git a/src/lyxcursor.h b/src/lyxcursor.h index f19915e065..32a2540579 100644 --- a/src/lyxcursor.h +++ b/src/lyxcursor.h @@ -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 diff --git a/src/lyxtext.h b/src/lyxtext.h index 6aa0bdc3b1..3849d2665d 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -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 diff --git a/src/text.C b/src/text.C index d416acde64..ead3e5231d 100644 --- a/src/text.C +++ b/src/text.C @@ -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();