]> git.lyx.org Git - lyx.git/blobdiff - src/Text3.cpp
this we don't need anymore
[lyx.git] / src / Text3.cpp
index da7b62a95b666f930130037788553c9f030c694d..9e8ce03dd8acee195c4d042e7fc2534f9a973100 100644 (file)
@@ -131,7 +131,9 @@ static void mathDispatch(Cursor & cur, FuncRequest const & cmd, bool display)
                const int old_pos = cur.pos();
 #endif
                cur.insert(new InsetMathHull(hullSimple));
-               BOOST_ASSERT(old_pos == cur.pos());
+#ifdef ENABLE_ASSERTIONS
+               LASSERT(old_pos == cur.pos(), /**/);
+#endif
                cur.nextInset()->edit(cur, true);
                // don't do that also for LFUN_MATH_MODE
                // unless you want end up with always changing
@@ -154,7 +156,7 @@ static void mathDispatch(Cursor & cur, FuncRequest const & cmd, bool display)
                {
                        InsetMathHull * formula = new InsetMathHull;
                        istringstream is(to_utf8(sel));
-                       Lexer lex(0, 0);
+                       Lexer lex;
                        lex.setStream(is);
                        formula->read(lex);
                        if (formula->getType() == hullNone)
@@ -390,7 +392,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
        // at the end?
        cur.noUpdate();
 
-       BOOST_ASSERT(cur.text() == this);
+       LASSERT(cur.text() == this, /**/);
        CursorSlice oldTopSlice = cur.top();
        bool oldBoundary = cur.boundary();
        bool sel = cur.selection();
@@ -924,7 +926,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                        else if (arg == "linkback")
                                type = Clipboard::LinkBackGraphicsType;
                        else
-                               BOOST_ASSERT(false);
+                               LASSERT(false, /**/);
 
                        pasteClipboardGraphics(cur, bv->buffer().errorList("Paste"), type);
                }
@@ -1170,6 +1172,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                cur.updateFlags(Update::SinglePar | Update::FitCursor);
                                break;                  
                        }
+               default:
+                       break;
                } // switch (cmd.button())
                break;
 
@@ -1285,7 +1289,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                }
                p["target"] = (cmd.argument().empty()) ?
                        content : cmd.argument();
-               string const data = InsetCommandMailer::params2string("href", p);
+               string const data = InsetCommand::params2string("href", p);
                if (p["target"].empty()) {
                        bv->showDialog("href", data);
                } else {
@@ -1301,7 +1305,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                p["name"] = (cmd.argument().empty()) ?
                        cur.getPossibleLabel() :
                        cmd.argument();
-               string const data = InsetCommandMailer::params2string("label", p);
+               string const data = InsetCommand::params2string("label", p);
 
                if (cmd.argument().empty()) {
                        bv->showDialog("label", data);
@@ -1485,7 +1489,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                cap::replaceSelection(cur);
                cur.insert(new InsetMathHull(hullSimple));
                checkAndActivateInset(cur, true);
-               BOOST_ASSERT(cur.inMathed());
+               LASSERT(cur.inMathed(), /**/);
                cur.dispatch(cmd);
                break;
        }
@@ -1671,11 +1675,17 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                breakParagraph(cur);
                        }
 
-                       //FIXME Check if this should be emptyLayout()
-                       setLayout(cur, tclass.defaultLayoutName());
+                       docstring const laystr = cur.inset().useEmptyLayout() ?
+                               tclass.emptyLayoutName() :
+                               tclass.defaultLayoutName();
+                       setLayout(cur, laystr);
                        ParagraphParameters p;
                        setParagraphs(cur, p);
-                       insertInset(cur, new InsetFloatList(to_utf8(cmd.argument())));
+                       // FIXME This should be simplified when InsetFloatList takes a 
+                       // Buffer in its constructor.
+                       InsetFloatList * ifl = new InsetFloatList(to_utf8(cmd.argument()));
+                       ifl->setBuffer(bv->buffer());
+                       insertInset(cur, ifl);
                        cur.posForward();
                } else {
                        lyxerr << "Non-existent float type: "
@@ -1819,7 +1829,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
 bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
                        FuncStatus & flag) const
 {
-       BOOST_ASSERT(cur.text() == this);
+       LASSERT(cur.text() == this, /**/);
 
        Font const & font = cur.real_current_font;
        FontInfo const & fontinfo = font.fontInfo();