avoid comparing the addresses of dereferenced 0 pointers

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15172 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-09-27 16:10:47 +00:00
parent 2e9ab2c009
commit 864515f3a3

View File

@ -79,7 +79,7 @@ CursorSlice::col_type CursorSlice::col() const
bool operator==(CursorSlice const & p, CursorSlice const & q) bool operator==(CursorSlice const & p, CursorSlice const & q)
{ {
return &p.inset() == &q.inset() return p.inset_ == q.inset_
&& p.idx() == q.idx() && p.idx() == q.idx()
&& p.pit() == q.pit() && p.pit() == q.pit()
&& p.pos() == q.pos(); && p.pos() == q.pos();
@ -88,7 +88,7 @@ bool operator==(CursorSlice const & p, CursorSlice const & q)
bool operator!=(CursorSlice const & p, CursorSlice const & q) bool operator!=(CursorSlice const & p, CursorSlice const & q)
{ {
return &p.inset() != &q.inset() return p.inset_ != q.inset_
|| p.idx() != q.idx() || p.idx() != q.idx()
|| p.pit() != q.pit() || p.pit() != q.pit()
|| p.pos() != q.pos(); || p.pos() != q.pos();