X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxcursor.C;h=fb298015452f491df3df0e8cc6a0b0e70641ac49;hb=09e01879979643949f1f2c7216023f1f35d5ada2;hp=fc45d0a0b307602b20da5c144f113d6fba74f41f;hpb=cd6e293ed7c588748fe0cf5927f46dc5e9ae6e35;p=lyx.git diff --git a/src/lyxcursor.C b/src/lyxcursor.C index fc45d0a0b3..fb29801545 100644 --- a/src/lyxcursor.C +++ b/src/lyxcursor.C @@ -1,53 +1,47 @@ -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2001 The LyX Team. +/** + * \file lyxcursor.C + * Copyright 1995-2001 the LyX Team + * Read the file COPYING * - * ====================================================== */ + * \author Matthias Ettrich + */ #include -#ifdef __GNUG__ -#pragma implementation -#endif - #include "lyxcursor.h" LyXCursor::LyXCursor() - : par_(0), pos_(0), boundary_(false), - x_(0), x_fix_(0), y_(0), row_(0) + : par_(), pos_(0), boundary_(false), + x_(0), ix_(0), x_fix_(0), y_(0), iy_(0) {} -void LyXCursor::par(Paragraph * p) +void LyXCursor::par(ParagraphList::iterator pit) { - par_ = p; + par_ = pit; } -Paragraph * LyXCursor::par() const +ParagraphList::iterator LyXCursor::par() const { return par_; } -void LyXCursor::pos(pos_type p) +void LyXCursor::pos(lyx::pos_type p) { pos_ = p; } -LyXCursor::pos_type LyXCursor::pos() const +lyx::pos_type LyXCursor::pos() const { return pos_; } -void LyXCursor::boundary(bool b) +void LyXCursor::boundary(bool b) { boundary_ = b; } @@ -70,6 +64,17 @@ int LyXCursor::x() const } +void LyXCursor::ix(int n) +{ + ix_ = n; +} + +int LyXCursor::ix() const +{ + return ix_; +} + + void LyXCursor::x_fix(int i) { x_fix_ = i; @@ -94,13 +99,28 @@ int LyXCursor::y() const } -void LyXCursor::row(Row * r) +void LyXCursor::iy(int i) { - row_ = r; + iy_ = i; } -Row * LyXCursor::row() const +int LyXCursor::iy() const { - return row_; + return iy_; } + + +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); +} +