]> git.lyx.org Git - lyx.git/blobdiff - src/text3.C
Fix breakage caused by bad commits.
[lyx.git] / src / text3.C
index 5ad1714872ce420decd87bfa9559bfdd396226bb..7f0e8465726625e9381ab528e8290b07c0e51a14 100644 (file)
@@ -65,8 +65,8 @@
 #include "support/convert.h"
 #include "support/lyxtime.h"
 
-#include "mathed/math_hullinset.h"
-#include "mathed/math_macrotemplate.h"
+#include "mathed/InsetMathHull.h"
+#include "mathed/MathMacroTemplate.h"
 
 #include <boost/current_function.hpp>
 
@@ -148,7 +148,7 @@ namespace {
 
                if (sel.empty()) {
                        const int old_pos = cur.pos();
-                       cur.insert(new MathHullInset(hullSimple));
+                       cur.insert(new InsetMathHull(hullSimple));
                        BOOST_ASSERT(old_pos == cur.pos());
                        cur.nextInset()->edit(cur, true);
                        // don't do that also for LFUN_MATH_MODE
@@ -170,7 +170,7 @@ namespace {
                        if (sel.find("\\newcommand") == string::npos
                            && sel.find("\\def") == string::npos)
                        {
-                               MathHullInset * formula = new MathHullInset;
+                               InsetMathHull * formula = new InsetMathHull;
                                LyXLex lex(0, 0);
                                lex.setStream(is);
                                formula->read(cur.buffer(), lex);
@@ -274,8 +274,15 @@ bool doInsertInset(LCursor & cur, LyXText * text,
        if (edit)
                inset->edit(cur, true);
 
-       if (gotsel && pastesel)
+       if (gotsel && pastesel) {
                cur.bv().owner()->dispatch(FuncRequest(LFUN_PASTE));
+               // reset first par to default
+               if (cur.lastpit() != 0 || cur.lastpos() != 0) {
+                       LyXLayout_ptr const layout =
+                               cur.buffer().params().getLyXTextClass().defaultLayout();
+                       cur.text()->paragraphs().begin()->layout(layout);
+               }
+       }
        return true;
 }
 
@@ -599,7 +606,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
 
        case LFUN_CHAR_DELETE_BACKWARD:
                if (!cur.selection()) {
-                       if (bv->owner()->getIntl().getTransManager().backspace()) {
+                       if (bv->getIntl().getTransManager().backspace()) {
                                // Par boundary, full-screen update
                                if (cur.pos() == 0)
                                        singleParUpdate = false;
@@ -1070,7 +1077,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                docstring::const_iterator end = cmd.argument().end();
                for (; cit != end; ++cit)
 #if 0
-                       bv->owner()->getIntl().getTransManager().
+                       bv->getIntl().getTransManager().
                                translateAndInsert(*cit, this);
 #else
                        insertChar(bv->cursor(), *cit);
@@ -1223,7 +1230,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
        case LFUN_MATH_MATRIX:
        case LFUN_MATH_DELIM:
        case LFUN_MATH_BIGDELIM: {
-               cur.insert(new MathHullInset(hullSimple));
+               cur.insert(new InsetMathHull(hullSimple));
                cur.dispatch(FuncRequest(LFUN_CHAR_FORWARD));
                cur.dispatch(cmd);
                break;
@@ -1382,7 +1389,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                bv->owner()->getLyXFunc().handleKeyFunc(cmd.action);
                if (!cmd.argument().empty())
                        // FIXME: Are all these characters encoded in one byte in utf8?
-                       bv->owner()->getIntl().getTransManager()
+                       bv->getIntl().getTransManager()
                                .translateAndInsert(cmd.argument()[0], this);
                break;