]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfind.cpp
Compile fix for qt versions below 4.6.
[lyx.git] / src / lyxfind.cpp
index 752d9b8f0ffdf5ac34693b6c26572f70a23b4206..86d8b9818189f11ded597a7e93c991317e18d07c 100644 (file)
@@ -40,6 +40,7 @@
 #include "mathed/InsetMathGrid.h"
 #include "mathed/InsetMathHull.h"
 #include "mathed/MathStream.h"
+#include "mathed/MathSupport.h"
 
 #include "support/convert.h"
 #include "support/debug.h"
@@ -966,15 +967,16 @@ docstring stringifyFromCursor(DocIterator const & cur, int len)
                                << cur << ", from pos: " << cur.pos() << ", end: " << end);
                        return par.stringify(cur.pos(), end, AS_STR_INSETS, runparams);
        } else if (cur.inMathed()) {
-                       odocstringstream os;
+                       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 );
                        for (MathData::const_iterator it = md.begin() + cs.pos(); it != it_end; ++it)
-                                       os << *it;
-                       return os.str();
+                               s = s + asString(*it);
+                       LYXERR(Debug::FIND, "Stringified math: '" << s << "'");
+                       return s;
        }
        LYXERR(Debug::FIND, "Don't know how to stringify from here: " << cur);
        return docstring();
@@ -1027,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