From: Tommaso Cucinotta Date: Fri, 27 May 2011 06:15:50 +0000 (+0000) Subject: (replaying r38846 from trunk) X-Git-Tag: 2.0.1~284 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=63e5421f224539ab95bdfb6f45d9a816ffc2e329;p=features.git (replaying r38846 from trunk) 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. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@38850 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 62b0b1c29a..1aa228b4a5 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -743,21 +743,19 @@ static docstring stringifySearchBuffer(Buffer & buffer, FindAndReplaceOptions co 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) { + 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;