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
>
> Log:
> Bugfix in how the search buffer was exported for the Advanced Find & Replace.
> For example, before this footnotes were not correctly found.
> Added also accompanying regression test.
>
> Modified: lyx-devel/trunk/src/lyxfind.cpp
> ==============================================================================
> --- lyx-devel/trunk/src/lyxfind.cpp   Thu May 26 18:54:51 2011        (r38845)
> +++ lyx-devel/trunk/src/lyxfind.cpp   Thu May 26 19:08:48 2011        (r38846)
> @@ -743,21 +743,19 @@
>       if (!opt.ignoreformat) {
>               str = buffer_to_latex(buffer);
>       } else {
> -             ParIterator it = buffer.par_iterator_begin();
> -             ParIterator end = buffer.par_iterator_end();
>               OutputParams runparams(&buffer.params().encoding());
> -             odocstringstream os;
>               runparams.nice = true;
>               runparams.flavor = OutputParams::LATEX;
>               runparams.linelen = 100000; //lyxrc.plaintext_linelen;
>               runparams.dryrun = true;
> -             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....

rh


> +                     Paragraph const & par = buffer.paragraphs().at(pit);
>                       LYXERR(Debug::FIND, "Adding to search string: '"
> -                             << it->asString(false)
> +                             << par.stringify(pos_type(0), par.size(),
> +                                              AS_STR_INSETS, runparams)
>                               << "'");
> -                     str +=
> -                             it->stringify(pos_type(0), it->size(),
> -                                           AS_STR_INSETS, runparams);
> +                     str += par.stringify(pos_type(0), par.size(),
> +                                          AS_STR_INSETS, runparams);
>               }
>       }
>       return str;

Reply via email to