From d63b5f548fdde340f7b241d85d7abf63a74cbbec Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Tue, 11 Dec 2018 12:12:02 +0100 Subject: [PATCH] Fix #11241, FindAdv for wedge in subscript Patch from ajd, completed to include also latexifyFromCursor() --- src/lyxfind.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index ddb13bf69f..a3a0b8be50 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -1099,16 +1099,17 @@ docstring stringifyFromCursor(DocIterator const & cur, int len) AS_STR_INSETS | AS_STR_SKIPDELETE | AS_STR_PLAINTEXT, &runparams); } else if (cur.inMathed()) { - docstring s; CursorSlice cs = cur.top(); MathData md = cs.cell(); MathData::const_iterator it_end = (( len == -1 || cs.pos() + len > int(md.size())) ? md.end() : md.begin() + cs.pos() + len ); + MathData md2; for (MathData::const_iterator it = md.begin() + cs.pos(); it != it_end; ++it) - s = s + asString(*it); + md2.push_back(*it); + docstring s = asString(md2); LYXERR(Debug::FIND, "Stringified math: '" << s << "'"); return s; } @@ -1162,9 +1163,11 @@ docstring latexifyFromCursor(DocIterator const & cur, int len) ((len == -1 || cs.pos() + len > int(md.size())) ? md.end() : md.begin() + cs.pos() + len); + MathData md2; for (MathData::const_iterator it = md.begin() + cs.pos(); it != it_end; ++it) - ods << asString(*it); + md2.push_back(*it); + ods << asString(md2); // Retrieve the math environment type, and add '$' or '$]' // or others (\end{equation}) accordingly -- 2.39.5