Il 26/05/2011 19:46, Richard Heck ha scritto:
On 05/26/2011 01:08 PM, tomm...@lyx.org wrote:
Author: tommaso
Date: Thu May 26 19:08:48 2011
New Revision: 38846
URL: http://www.lyx.org/trac/changeset/38846
- ParIterator it = buffer.par_iterator_begin();
- ParIterator end = buffer.par_iterator_end();
OutputParams runparams(&buffer.params().encoding());
- odocstringstream os;
[...]
- for (; it != end; ++it) {
+ for (pos_type pit = pos_type(0); pit<
(pos_type)buffer.paragraphs().size(); ++pit) {
This change doesn't look necessary for the rest. Using the ParIterator
is a bit more elegant....
In principle I agree (more elegant, more c++, more STL-like, etc.), but
it was doing something strange/weird: consider the buffer with a single
par, with a footnote inside. As it was before, it was iterating 2
paragraphs: the outer one (producing "[footnote: foo]") and then the
inner one in the footnote (producing "foo": total is "[footnote:
foo]foo"). That is, it was behaving like a DocIterator when you advance it.
Instead, here I want only to iterate outer paragraph(s) (mostly it's
only 1, but sometimes we have 2 if we search for something unusual) and
textify them.
T.