]> git.lyx.org Git - lyx.git/blobdiff - src/Text3.cpp
listerrors.lyx : Update a link.
[lyx.git] / src / Text3.cpp
index 1aee50488ac1b4bf40cbdca9711ca6ab7d937700..4c1d07bf46720cc8141b32cc79ba8a6034e76647 100644 (file)
@@ -93,6 +93,7 @@ using cap::pasteClipboardGraphics;
 using cap::replaceSelection;
 using cap::grabAndEraseSelection;
 using cap::selClearOrDel;
+using cap::pasteSimpleText;
 
 // globals...
 static Font freefont(ignore_font, ignore_language);
@@ -246,8 +247,10 @@ static bool doInsertInset(Cursor & cur, Text * text,
                        inset->edit(cur, true);
                // Now put this into inset
                Font const f(inherit_font, cur.current_font.language());
-               cur.text()->insertStringAsLines(cur, ds, f);
-               cur.leaveInset(*inset);
+               if (!ds.empty()) {
+                       cur.text()->insertStringAsLines(cur, ds, f);
+                       cur.leaveInset(*inset);
+               }
                return true;
        }
 
@@ -627,8 +630,12 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                // provide it with two different cursors.
                                Cursor dummy = cur;
                                dummy.pos() = dummy.pit() = 0;
-                               if (cur.bv().checkDepm(dummy, cur))
+                               if (cur.bv().checkDepm(dummy, cur)) {
                                        cur.forceBufferUpdate();
+                                       // DEPM may have requested a screen update
+                                       cur.screenUpdateFlags(
+                                               cur.screenUpdate() | dummy.screenUpdate());
+                               }
                        }
                }
                break;
@@ -654,8 +661,12 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                Cursor dummy = cur;
                                dummy.pos() = cur.lastpos();
                                dummy.pit() = cur.lastpit();
-                               if (cur.bv().checkDepm(dummy, cur))
+                               if (cur.bv().checkDepm(dummy, cur)) {
                                        cur.forceBufferUpdate();
+                                       // DEPM may have requested a screen update
+                                       cur.screenUpdateFlags(
+                                               cur.screenUpdate() | dummy.screenUpdate());
+                               }
                        }
                }
                break;
@@ -838,8 +849,12 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                // provide it with two different cursors.
                                Cursor dummy = cur;
                                dummy.pos() = dummy.pit() = 0;
-                               if (cur.bv().checkDepm(dummy, cur))
+                               if (cur.bv().checkDepm(dummy, cur)) {
                                        cur.forceBufferUpdate();
+                                       // DEPM may have requested a screen update
+                                       cur.screenUpdateFlags(
+                                               cur.screenUpdate() | dummy.screenUpdate());
+                               }
                        }
                }
                break;
@@ -888,8 +903,12 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                Cursor dummy = cur;
                                dummy.pos() = cur.lastpos();
                                dummy.pit() = cur.lastpit();
-                               if (cur.bv().checkDepm(dummy, cur))
+                               if (cur.bv().checkDepm(dummy, cur)) {
                                        cur.forceBufferUpdate();
+                                       // DEPM may have requested a screen update
+                                       cur.screenUpdateFlags(
+                                               cur.screenUpdate() | dummy.screenUpdate());
+                               }
                        }
                }
                break;
@@ -1318,6 +1337,11 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                bv->buffer().errors("Paste");
                break;
 
+       case LFUN_CLIPBOARD_PASTE_SIMPLE:
+               cur.clearSelection();
+               pasteSimpleText(cur, cmd.argument() == "paragraph");
+               break;
+
        case LFUN_PRIMARY_SELECTION_PASTE:
                pasteString(cur, theSelection().get(),
                            cmd.argument() == "paragraph");
@@ -2583,6 +2607,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
         }
 
        case LFUN_CLIPBOARD_PASTE:
+       case LFUN_CLIPBOARD_PASTE_SIMPLE:
                enable = !theClipboard().empty();
                break;