]> git.donarmstrong.com Git - lilypond.git/commitdiff
flower-1.0.2
authorfred <fred>
Fri, 11 Oct 1996 16:19:23 +0000 (16:19 +0000)
committerfred <fred>
Fri, 11 Oct 1996 16:19:23 +0000 (16:19 +0000)
flower/cursor.inl

index 0243d14a2b58777e371e46dbc4920c8174ea4745..a4e03492b536bb6b8e7a5dbbf334800762de1489 100644 (file)
@@ -1,4 +1,4 @@
- // cursor.inl
+ // cursor.inl -*-c++-*-
 #ifndef CURSOR_INL
 #define CURSOR_INL
 #include <assert.h>
@@ -10,7 +10,8 @@ Cursor<T>::Cursor( List<T>& list, Link<T>* 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<T>::insert( const T& thing )
 
 template<class T>
 inline void
-Cursor<T>::remove()
+Cursor<T>::backspace()
 {
-    assert( pointer_ );
+    Cursor<T> c(*this);
+    c--;        
     list_.remove( *this );
 }
 
+template<class T>
+inline void
+Cursor<T>::del()
+{
+    Cursor<T> c(*this);
+    c++;
+    list_.remove( *this );    
+    *this = c;
+}
+
 template<class T>
 inline const List<T>&
 Cursor<T>::list() const
@@ -97,4 +109,4 @@ Cursor<T>::ok()
     return ( pointer_ != 0 );
 }
 
-#endif
\ No newline at end of file
+#endif