]> git.lyx.org Git - features.git/blobdiff - src/Text3.cpp
fix some compiler warnings
[features.git] / src / Text3.cpp
index e7bbb9b9b192ac602e85f587bf55023d75e8d682..d978e3f6e72e58189422641eb0b552b0c7cceea5 100644 (file)
@@ -320,8 +320,9 @@ static void outline(OutlineOp mode, Cursor & cur)
                        pars.erase(start, finish);
                        return;
                }
-               case OutlineIn:
-                       buf.undo().recordUndo(cur);
+               case OutlineIn: {
+                       pit_type const len = distance(start, finish);
+                       buf.undo().recordUndo(cur, ATOMIC_UNDO, pit, pit + len - 1);
                        for (; start != finish; ++start) {
                                toclevel = start->layout()->toclevel;
                                if (toclevel == Layout::NOT_IN_TOC)
@@ -336,9 +337,10 @@ static void outline(OutlineOp mode, Cursor & cur)
                                }
                        }
                        return;
-
-               case OutlineOut:
-                       buf.undo().recordUndo(cur);
+               }
+               case OutlineOut: {
+                       pit_type const len = distance(start, finish);
+                       buf.undo().recordUndo(cur, ATOMIC_UNDO, pit, pit + len - 1);
                        for (; start != finish; ++start) {
                                toclevel = start->layout()->toclevel;
                                if (toclevel == Layout::NOT_IN_TOC)
@@ -353,6 +355,7 @@ static void outline(OutlineOp mode, Cursor & cur)
                                }
                        }
                        return;
+               }
        }
 }
 
@@ -851,7 +854,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                        */
                        if (cur.selection())
                                cutSelection(cur, true, false);
-                       insertInset(cur, inset);
+                       cur.insert(inset);
                        cur.posForward();
                }
                break;
@@ -932,7 +935,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")