+void pasteClipboardGraphics(Cursor & cur, ErrorList & errorList,
+ Clipboard::GraphicsType preferedType)
+{
+ BOOST_ASSERT(theClipboard().hasGraphicsContents(preferedType));
+
+ // get picture from clipboard
+ FileName filename = theClipboard().getAsGraphics(cur, preferedType);
+ if (filename.empty())
+ return;
+
+ // create inset for graphic
+ InsetGraphics * inset = new InsetGraphics;
+ InsetGraphicsParams params;
+ params.filename = EmbeddedFile(filename.absFilename(), cur.buffer().filePath());
+ inset->setParams(params);
+ cur.recordUndo();
+ cur.insert(inset);
+}
+
+