From 69ab1306a8b5f4a65e13467bc4938a14c99a34ec Mon Sep 17 00:00:00 2001 From: Tommaso Cucinotta Date: Sun, 29 May 2011 14:08:29 +0000 Subject: [PATCH] Avoid extra ' ' in text-only export of consecutive macros in math mode, for Advanced F&R matching, with ignore-format off. For example, this wasn't allowing to match '\beta\alpha' in the sequence '\alpha\beta\alpha', as in the accompanying regression test-case (added case for ignore-format off). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38888 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/autotests/findadv-17-in.txt | 9 +++++++++ src/lyxfind.cpp | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/development/autotests/findadv-17-in.txt b/development/autotests/findadv-17-in.txt index cb627030db..657cf6cbf0 100644 --- a/development/autotests/findadv-17-in.txt +++ b/development/autotests/findadv-17-in.txt @@ -3,7 +3,16 @@ Lang it_IT.utf8 TestBegin test.lyx -dbg find > lyx-log.txt 2>&1 KK: \Cm\\alpha\\beta\\alpha \C\[Home] +KK: \Cs KK: \CF KK: \Cm\\beta\\alpha \[Return] TestEnd Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 1\n with len: 2' lyx-log.txt + +TestBegin test.lyx -dbg find > lyx-log.txt 2>&1 +KK: \CF +# Uncheck ignore format +KK: \Az\Ag\Ae +KK: \Cm\\beta\\alpha \[Return] +TestEnd +Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 1\n with len: 2' lyx-log.txt diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 8a692eaf28..86d8b98181 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -1029,7 +1029,7 @@ docstring latexifyFromCursor(DocIterator const & cur, int len) MathData::const_iterator it_end = ( ( len == -1 || cs.pos() + len > int(md.size()) ) ? md.end() : md.begin() + cs.pos() + len ); for (MathData::const_iterator it = md.begin() + cs.pos(); it != it_end; ++it) - ods << *it; + ods << asString(*it); // Retrieve the math environment type, and add '$' or '$]' // or others (\end{equation}) accordingly