#endif
cur.insert(new InsetMathHull(cur.buffer(), hullSimple));
#ifdef ENABLE_ASSERTIONS
- LASSERT(old_pos == cur.pos(), /**/);
+ LATTEST(old_pos == cur.pos());
#endif
cur.nextInset()->edit(cur, true);
// don't do that also for LFUN_MATH_MODE
// at the end?
cur.noScreenUpdate();
- LASSERT(cur.text() == this, /**/);
+ LBUFERR(this == cur.text());
CursorSlice const oldTopSlice = cur.top();
bool const oldBoundary = cur.boundary();
bool const oldSelection = cur.selection();
// 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;
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;
// 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;
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;
case LFUN_PASTE: {
cur.message(_("Paste"));
- LASSERT(cur.selBegin().idx() == cur.selEnd().idx(), /**/);
+ LASSERT(cur.selBegin().idx() == cur.selEnd().idx(), break);
cap::replaceSelection(cur);
// without argument?
&& !theClipboard().hasTextContents())
pasteClipboardGraphics(cur, bv->buffer().errorList("Paste"));
else
- pasteClipboardText(cur, bv->buffer().errorList("Paste"));
+ pasteClipboardText(cur, bv->buffer().errorList("Paste"), true);
} else if (isStrUnsignedInt(arg)) {
// we have a numerical argument
pasteFromStack(cur, bv->buffer().errorList("Paste"),
convert<unsigned int>(arg));
+ } else if (arg == "html" || arg == "latex") {
+ Clipboard::TextType type = (arg == "html") ?
+ Clipboard::HtmlTextType : Clipboard::LaTeXTextType;
+ pasteClipboardText(cur, bv->buffer().errorList("Paste"), true, type);
} else {
Clipboard::GraphicsType type = Clipboard::AnyGraphicsType;
if (arg == "pdf")
type = Clipboard::EmfGraphicsType;
else if (arg == "wmf")
type = Clipboard::WmfGraphicsType;
-
else
- LASSERT(false, /**/);
+ // We used to assert, but couldn't the argument come from, say, the
+ // minibuffer and just be mistyped?
+ LYXERR0("Unrecognized graphics type: " << arg);
pasteClipboardGraphics(cur, bv->buffer().errorList("Paste"), type);
}
cap::replaceSelection(cur);
cur.insert(new InsetMathHull(cur.buffer(), hullSimple));
checkAndActivateInset(cur, true);
- LASSERT(cur.inMathed(), /**/);
+ LASSERT(cur.inMathed(), break);
cur.dispatch(cmd);
break;
}
bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- LASSERT(cur.text() == this, /**/);
+ LBUFERR(this == cur.text());
FontInfo const & fontinfo = cur.real_current_font.fontInfo();
bool enable = true;
break;
}
+ // explicit text type?
+ if (arg == "html") {
+ // Do not enable for PlainTextType, since some tidying in the
+ // frontend is needed for HTML, which is too unsafe for plain text.
+ enable = theClipboard().hasTextContents(Clipboard::HtmlTextType);
+ break;
+ } else if (arg == "latex") {
+ // LaTeX is usually not available on the clipboard with
+ // the correct MIME type, but in plain text.
+ enable = theClipboard().hasTextContents(Clipboard::PlainTextType) ||
+ theClipboard().hasTextContents(Clipboard::LaTeXTextType);
+ break;
+ }
+
// explicit graphics type?
Clipboard::GraphicsType type = Clipboard::AnyGraphicsType;
if ((arg == "pdf" && (type = Clipboard::PdfGraphicsType))