X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_rowst.h;h=602198d3095a07b660b9e9af2e520a4c3767844f;hb=d61590ccde8b76f1e324df16a916a41a54ce4a4f;hp=5c9c59383bd79d4c071738d269f0ab68533dcbae;hpb=13794d5ec36619c68996353e2d58091d8aaa2afe;p=lyx.git diff --git a/src/mathed/math_rowst.h b/src/mathed/math_rowst.h index 5c9c59383b..602198d309 100644 --- a/src/mathed/math_rowst.h +++ b/src/mathed/math_rowst.h @@ -3,6 +3,7 @@ #define MATH_ROWST_H #include +#include "support/LAssert.h" /** The physical structure of a row and aditional information is stored here. It allows to manage the extra info independently of the paragraph data. @@ -86,21 +87,27 @@ struct MathedRowContainer { /// struct iterator { /// - iterator(MathedRowContainer * m) : st_(m->data_) {} + iterator() : st_(0) {} + /// + explicit iterator(MathedRowSt * st) : st_(st) {} + /// "better" conversion to bool + explicit iterator(MathedRowContainer * m) : st_(m->data_) {} /// "better" conversion to bool operator void *() const { return st_; } /// - MathedRowStruct & operator*() { return *st_; } + MathedRowStruct & operator*() { Assert(st_); return *st_; } /// MathedRowStruct * operator->() { return st_; } /// - void operator++() { st_ = st_->next_; } + MathedRowStruct const * operator->() const { return st_; } + /// + void operator++() { Assert(st_); st_ = st_->next_; } /// - bool is_last() const { return st_->next_ == 0; } + bool is_last() const { Assert(st_); return st_->next_ == 0; } /// bool operator==(const iterator & it) const { return st_ == it.st_; } - private: + //private: /// MathedRowSt * st_; };