]> git.lyx.org Git - lyx.git/commitdiff
add forwardInset, operator! etc
authorAndré Pönitz <poenitz@gmx.net>
Sat, 27 Mar 2004 12:37:41 +0000 (12:37 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sat, 27 Mar 2004 12:37:41 +0000 (12:37 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8541 a592a061-630c-0410-9148-cb99ea01b6c8

src/dociterator.C
src/dociterator.h

index d4d51819ef886f5430652566ea45b6494b6246d9..6c3b43b3f3a334a46c67526b1041146df8fb9191 100644 (file)
@@ -302,6 +302,14 @@ void DocumentIterator::forwardChar()
 }
 
 
 }
 
 
+void DocumentIterator::forwardInset()
+{
+       forwardPos(); 
+       while (size() != 0 && (pos() == lastpos() || nextInset() == 0))
+               forwardPos();
+}
+
+
 void DocumentIterator::backwardChar()
 {
        lyxerr << "not implemented" << endl;
 void DocumentIterator::backwardChar()
 {
        lyxerr << "not implemented" << endl;
index c2663fb2ff9c72f93fd932df8783b75a61e39b24..10290c23219e0a2e60f8ed3b2c003834a5389bd8 100644 (file)
@@ -54,6 +54,11 @@ public:
        ///
        explicit DocumentIterator(InsetBase & inset);
 
        ///
        explicit DocumentIterator(InsetBase & inset);
 
+       /// is the iterator valid?
+       operator const void*() const { return empty() ? 0 : this; }
+       /// is this iterator invalid?
+       bool operator!() const { return empty(); }
+
        //
        // access to slice at tip
        //
        //
        // access to slice at tip
        //