From: Vincent van Ravesteijn Date: Sun, 3 May 2009 11:22:01 +0000 (+0000) Subject: Add the emf and wmf graphics format as parameters to LFUN_PASTE. X-Git-Tag: 2.0.0~6689 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c7a09888a1c15d20f8757b7e3b1001d757ba53f5;p=features.git Add the emf and wmf graphics format as parameters to LFUN_PASTE. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29509 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 1cab6e4bf0..dc8121a0bb 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -1121,7 +1121,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_PASTE * \li Action: Pastes material from the active clipboard. * \li Syntax: paste [] - * \li Params: : pdf|png|jpeg|linkback + * \li Params: : emf|pdf|png|jpeg|linkback|wmf * \endvar */ { LFUN_PASTE, "paste", Noop, Edit }, diff --git a/src/Text3.cpp b/src/Text3.cpp index 38e435ca7e..f306a6d2de 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1046,6 +1046,11 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) type = Clipboard::JpegGraphicsType; else if (arg == "linkback") type = Clipboard::LinkBackGraphicsType; + else if (arg == "emf") + type = Clipboard::EmfGraphicsType; + else if (arg == "wmf") + type = Clipboard::WmfGraphicsType; + else LASSERT(false, /**/); @@ -2220,11 +2225,14 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, } // explicit graphics type? - if ((arg == "pdf" && theClipboard().hasGraphicsContents(Clipboard::PdfGraphicsType)) - || (arg == "png" && theClipboard().hasGraphicsContents(Clipboard::PngGraphicsType)) - || (arg == "jpeg" && theClipboard().hasGraphicsContents(Clipboard::JpegGraphicsType)) - || (arg == "linkback" && theClipboard().hasGraphicsContents(Clipboard::LinkBackGraphicsType))) { - enable = true; + Clipboard::GraphicsType type = Clipboard::AnyGraphicsType; + if ((arg == "pdf" && (type = Clipboard::PdfGraphicsType)) + || (arg == "png" && (type = Clipboard::PngGraphicsType)) + || (arg == "jpeg" && (type = Clipboard::JpegGraphicsType)) + || (arg == "linkback" && (type = Clipboard::LinkBackGraphicsType)) + || (arg == "emf" && (type = Clipboard::EmfGraphicsType)) + || (arg == "wmf" && (type = Clipboard::WmfGraphicsType))) { + enable = theClipboard().hasGraphicsContents(type); break; }