]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathNest.cpp
... and RELEASE-NOTES
[lyx.git] / src / mathed / InsetMathNest.cpp
index 3e3877253f4040aacf23c7a0ed131c322de3ad24..ee3b92d4ebdf2ec33aaef48db659123c4d44592c 100644 (file)
@@ -52,6 +52,7 @@
 #include "LyXRC.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
+#include "TexRow.h"
 #include "Text.h"
 
 #include "frontends/Application.h"
 #include "frontends/Painter.h"
 #include "frontends/Selection.h"
 
-#include "support/lassert.h"
 #include "support/debug.h"
+#include "support/docstream.h"
 #include "support/gettext.h"
+#include "support/lassert.h"
 #include "support/lstrings.h"
 #include "support/textutils.h"
-#include "support/docstream.h"
 
 #include <algorithm>
 #include <sstream>
@@ -251,8 +252,7 @@ bool InsetMathNest::idxLast(Cursor & cur) const
 void InsetMathNest::dump() const
 {
        odocstringstream oss;
-       TexRow texrow(false);
-       otexrowstream ots(oss,texrow);
+       otexrowstream ots(oss);
        WriteStream os(ots);
        os << "---------------------------------------------\n";
        write(os);
@@ -380,9 +380,8 @@ void InsetMathNest::write(WriteStream & os) const
        docstring const latex_name = name();
        os << '\\' << latex_name;
        for (size_t i = 0; i < nargs(); ++i) {
-               os.pushRowEntry(TexRow::mathEntry(id(),i));
+               Changer dummy = os.changeRowEntry(TexRow::mathEntry(id(),i));
                os << '{' << cell(i) << '}';
-               os.popRowEntry();
        }
        if (nargs() == 0)
                os.pendingSpace(true);
@@ -408,13 +407,9 @@ void InsetMathNest::latex(otexstream & os, OutputParams const & runparams) const
                        runparams.dryrun ? WriteStream::wsDryrun : WriteStream::wsDefault,
                        runparams.encoding);
        wi.canBreakLine(os.canBreakLine());
-       if (runparams.lastid != -1) {
-               wi.pushRowEntry(os.texrow().textEntry(runparams.lastid,
-                                                                                         runparams.lastpos));
-               write(wi);
-               wi.popRowEntry();
-       } else
-               write(wi);
+       Changer dummy = wi.changeRowEntry(TexRow::textEntry(runparams.lastid,
+                                                           runparams.lastpos));
+       write(wi);
        // Reset parbreak status after a math inset.
        os.lastChar(0);
        os.canBreakLine(wi.canBreakLine());
@@ -583,7 +578,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                replaceSelection(cur);
                docstring topaste;
                if (cmd.argument().empty() && !theClipboard().isInternal())
-                       topaste = theClipboard().getAsText(Clipboard::PlainTextType);
+                       topaste = theClipboard().getAsText(frontend::Clipboard::PlainTextType);
                else {
                        size_t n = 0;
                        idocstringstream is(cmd.argument());
@@ -1555,7 +1550,7 @@ void InsetMathNest::lfunMousePress(Cursor & cur, FuncRequest & cmd)
                }
        }
        bool do_selection = cmd.button() == mouse_button::button1
-               && cmd.argument() == "region-select";
+               && cmd.modifier() == ShiftModifier;
        bv.mouseSetCursor(cur, do_selection);
        if (cmd.button() == mouse_button::button1) {
                //lyxerr << "## lfunMousePress: setting cursor to: " << cur << endl;
@@ -1861,7 +1856,7 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
                        cur.niceInsert(createInsetMath("sim", buf));
                        return true;
                }
-               if (currentMode() == InsetMath::MATH_MODE && !isAsciiOrMathAlpha(c)) {
+               if (currentMode() == InsetMath::MATH_MODE && Encodings::isUnicodeTextOnly(c)) {
                        MathAtom at = createInsetMath("text", buf);
                        at.nucleus()->cell(0).push_back(MathAtom(new InsetMathChar(c)));
                        cur.niceInsert(at);