From: fred Date: Fri, 11 Oct 1996 16:19:23 +0000 (+0000) Subject: flower-1.0.2 X-Git-Tag: release/1.5.59~7099 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=570ce8a2d299aee17b1567e776029fb68cf5504b;p=lilypond.git flower-1.0.2 --- diff --git a/flower/cursor.inl b/flower/cursor.inl index 0243d14a2b..a4e03492b5 100644 --- a/flower/cursor.inl +++ b/flower/cursor.inl @@ -1,4 +1,4 @@ - // cursor.inl + // cursor.inl -*-c++-*- #ifndef CURSOR_INL #define CURSOR_INL #include @@ -10,7 +10,8 @@ Cursor::Cursor( List& list, Link* pointer ) : list_( list ) { if ( list.size() ) - pointer_ = pointer ? pointer : list.top().pointer_; + pointer_ = pointer ? pointer : list.top_; + //list.top().pointer_; // ARGH! recursion. else pointer_ = pointer; } @@ -56,12 +57,23 @@ Cursor::insert( const T& thing ) template inline void -Cursor::remove() +Cursor::backspace() { - assert( pointer_ ); + Cursor c(*this); + c--; list_.remove( *this ); } +template +inline void +Cursor::del() +{ + Cursor c(*this); + c++; + list_.remove( *this ); + *this = c; +} + template inline const List& Cursor::list() const @@ -97,4 +109,4 @@ Cursor::ok() return ( pointer_ != 0 ); } -#endif \ No newline at end of file +#endif