]> git.lyx.org Git - lyx.git/blobdiff - src/Text3.cpp
Kill indexing into the list of layouts.
[lyx.git] / src / Text3.cpp
index f6be355a4191c39158d15786be7432758ad8b959..d434eb5aaf25f5029e3e24f53085b7a2013653ba 100644 (file)
@@ -327,8 +327,10 @@ static void outline(OutlineOp mode, Cursor & cur)
                                toclevel = start->layout()->toclevel;
                                if (toclevel == Layout::NOT_IN_TOC)
                                        continue;
-                               for (size_t i = 0; i != tc.layoutCount(); ++i) {
-                                       LayoutPtr const & lt = tc.layout(i);
+                               DocumentClass::const_iterator lit = tc.begin();
+                               DocumentClass::const_iterator len = tc.end();
+                               for (; lit != len; ++lit) {
+                                       LayoutPtr const & lt = *lit;
                                        if (lt->toclevel == toclevel + 1 &&
                                            start->layout()->labeltype == lt->labeltype) {
                                                start->setLayout(lt);
@@ -345,8 +347,10 @@ static void outline(OutlineOp mode, Cursor & cur)
                                toclevel = start->layout()->toclevel;
                                if (toclevel == Layout::NOT_IN_TOC)
                                        continue;
-                               for (size_t i = 0; i != tc.layoutCount(); ++i) {
-                                       LayoutPtr const & lt = tc.layout(i);
+                               DocumentClass::const_iterator lit = tc.begin();
+                               DocumentClass::const_iterator len = tc.end();
+                               for (; lit != len; ++lit) {
+                                       LayoutPtr const & lt = *lit;
                                        if (lt->toclevel == toclevel - 1 &&
                                                start->layout()->labeltype == lt->labeltype) {
                                                        start->setLayout(lt);
@@ -854,7 +858,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                        */
                        if (cur.selection())
                                cutSelection(cur, true, false);
-                       insertInset(cur, inset);
+                       cur.insert(inset);
                        cur.posForward();
                }
                break;
@@ -935,7 +939,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                        pasteFromStack(cur, bv->buffer().errorList("Paste"),
                                       convert<unsigned int>(arg));
                } else {
-                       Clipboard::GraphicsType type;
+                       Clipboard::GraphicsType type = Clipboard::AnyGraphicsType;
                        if (arg == "pdf")
                                type = Clipboard::PdfGraphicsType;
                        else if (arg == "png")
@@ -1335,7 +1339,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
        }
 #if 0
        case LFUN_LIST_INSERT:
-       case LFUN_THEOREM_INSERT:
 #endif
        case LFUN_CAPTION_INSERT:
        case LFUN_FOOTNOTE_INSERT:
@@ -1926,9 +1929,6 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_LIST_INSERT:
                code = LIST_CODE;
                break;
-       case LFUN_THEOREM_INSERT:
-               code = THEOREM_CODE;
-               break;
 #endif
        case LFUN_CAPTION_INSERT:
                code = CAPTION_CODE;