Alfredo Braunstein <[EMAIL PROTECTED]> writes:

| Lars Gullik Bjønnes wrote:
>
>> Can we begin by just applying the PosIterator files?
>> (makes further patches easier to digest)
>
| Ok, first step. Can I apply this?

yes + some comment.

| +using boost::prior;

which header file include next_prior.hpp?

| +PosIterator & PosIterator::operator--()
| +{
| +     while (!stack_.empty()) {
| +             {

why the strange block?

why not change the variable name or have a helper function?

| +PosIterator::PosIterator(ParagraphList * pl, ParagraphList::iterator pit,
| +                      lyx::pos_type pos)
| +{
| +     stack_.push(PosIteratorItem(pl,pit,pos));
| +}

space between args please.

| +     *this = PosIterator(par, pos);

hmm...

operator=(PosIterator(par, pos));

I don't know... I just find the *this = ... construct hard to read...
| +
| +#include "ParagraphList_fwd.h"
| +
| +#include <boost/scoped_ptr.hpp>

Is the scoped_ptr used here?


| @@ -1469,6 +1470,18 @@ bool Buffer::hasParWithID(int id) const
|                       return true;
|  
|       return false;
| +}
| +
| +
| +PosIterator Buffer::pos_iterator_begin()
| +{
| +     return PosIterator(&paragraphs(), paragraphs().begin(), 0);     
| +}
| +
| +
| +PosIterator Buffer::pos_iterator_end()
| +{
| +     return PosIterator(&paragraphs(), paragraphs().end(), 0);       
|  }

I wonder if there is a way, so that we don't need to have those
XXX_iterator_(begin|end) functions.

but ok for now.
  
| Index: iterators.C
| ===================================================================
| RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/iterators.C,v
| retrieving revision 1.23
| diff -u -p -u -r1.23 iterators.C
| --- iterators.C       29 Oct 2003 12:18:06 -0000      1.23
| +++ iterators.C       2 Nov 2003 09:43:44 -0000
| @@ -355,4 +357,18 @@ bool operator==(ParConstIterator const &
|  bool operator!=(ParConstIterator const & iter1, ParConstIterator const & iter2)
|  {
|       return !(iter1 == iter2);
| +}
| +
| +
| +PosIterator::PosIterator(ParIterator & parit, lyx::pos_type pos)
| +{

Why have this here? and not int he positerator.C file?

| Index: iterators.h
| ===================================================================
| RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/iterators.h,v
| retrieving revision 1.19
| diff -u -p -u -r1.19 iterators.h
| --- iterators.h       29 Oct 2003 12:18:06 -0000      1.19
| +++ iterators.h       2 Nov 2003 09:43:45 -0000
| @@ -56,6 +56,9 @@ public:
|       ///
|       friend
|       bool operator==(ParIterator const & iter1, ParIterator const & iter2);
| +     ///
| +     friend class PosIterator;
| +
|  private:
|       struct Pimpl;
|       boost::scoped_ptr<Pimpl> pimpl_;
| @@ -93,6 +96,8 @@ public:
|       friend
|       bool operator==(ParConstIterator const & iter1,
|                       ParConstIterator const & iter2);
| +     ///
| +     friend class PosIterator;
|  private:
|       struct Pimpl;
|       boost::scoped_ptr<Pimpl> pimpl_;

why do they have to be friends?

-- 
        Lgb

Reply via email to