On Wed, Feb 04, 2004 at 09:50:12AM +0100, Andre Poenitz spake thusly: ... > > Index: cursor_slice.C > > =================================================================== > > RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor_slice.C,v > > retrieving revision 1.13 > > diff -u -p -r1.13 cursor_slice.C > > --- cursor_slice.C 2 Feb 2004 11:56:50 -0000 1.13 > > +++ cursor_slice.C 4 Feb 2004 07:05:48 -0000 > > @@ -34,7 +34,7 @@ CursorSlice::CursorSlice() > > {} > > > > > > -CursorSlice::CursorSlice(InsetBase * p) > > +CursorSlice::CursorSlice(InsetBase const * p) > > : inset_(p), idx_(0), par_(0), pos_(0), boundary_(false) > > { > > [...] > > /// pointer to an inset > > - InsetBase * inset_; > > + InsetBase const * inset_; > > That's conceptionally wrong. Our insets _are_ modifiable. We can't > stored just immutable ones. > > > /// Delete a cell and move cursor > > - virtual bool idxDelete(idx_type &) { return false; } > > + virtual bool idxDelete(idx_type &) const { return false; } > > > /// pulls cell after pressing erase > > - virtual void idxGlue(idx_type) {} > > + virtual void idxGlue(idx_type) const {} > > // returns list of cell indices that are "between" from and to for > > // selection purposes > > virtual bool idxBetween(idx_type idx, idx_type from, idx_type to) const; > > @@ -155,7 +155,7 @@ public: > > /// number of columns in gridlike structures > > virtual size_t ncols() const { return 0; } > > /// is called when the cursor leaves this inset > > - virtual void notifyCursorLeaves(idx_type) {} > > + virtual void notifyCursorLeaves(idx_type) const {} > > NO! The whole idea of these functions is to modify the insets logically. > They mustn't be const.
But why does it even compile then? > Andre' > - Martin
pgp00000.pgp
Description: PGP signature