]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiClipboard.cpp
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / GuiClipboard.cpp
index efa14ec97e61c21c59d3ab4f1a459ee0e8923735..d96dd26f0be90fdaa5fe793208fbd7fa8a0a3981 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "FileDialog.h"
 
+#include "support/FileName.h"
 #include "GuiClipboard.h"
 #include "qt_helpers.h"
 
@@ -150,7 +151,7 @@ FileName GuiClipboard::getPastedGraphicsFileName(Cursor const & cur,
        if (hasGraphicsContents(Clipboard::JpegGraphicsType))
                types.push_back(Clipboard::JpegGraphicsType);
 
-       LASSERT(!types.empty(), /**/);
+       LASSERT(!types.empty(), return FileName());
 
        // select prefered type if AnyGraphicsType was passed
        if (type == Clipboard::AnyGraphicsType)
@@ -279,7 +280,7 @@ FileName GuiClipboard::getAsGraphics(Cursor const & cur, GraphicsType type) cons
                else if (type == JpegGraphicsType)
                        image.save(toqstr(filename.absFileName()), "JPEG");
                else
-                       LASSERT(false, /**/);
+                       LATTEST(false);
                
                return filename;
        }
@@ -291,7 +292,7 @@ FileName GuiClipboard::getAsGraphics(Cursor const & cur, GraphicsType type) cons
        case LinkBackGraphicsType: mime = pdfMimeType(); break;
        case EmfGraphicsType: mime = emfMimeType(); break;
        case WmfGraphicsType: mime = wmfMimeType(); break;
-       default: LASSERT(false, /**/);
+       default: LASSERT(false, return FileName());
        }
        
        // get data
@@ -322,7 +323,7 @@ FileName GuiClipboard::getAsGraphics(Cursor const & cur, GraphicsType type) cons
                ds << pdfLen; // big endian by default
 #else
                // only non-Mac this should never happen
-               LASSERT(false, /**/);
+               LATTEST(false);
 #endif // Q_WS_MACX
        }
 
@@ -412,6 +413,12 @@ docstring const GuiClipboard::getAsText(TextType type) const
 }
 
 
+void GuiClipboard::put(string const & text) const
+{
+       qApp->clipboard()->setText(toqstr(text));
+}
+
+
 void GuiClipboard::put(string const & lyx, docstring const & html, docstring const & text)
 {
        LYXERR(Debug::ACTION, "GuiClipboard::put(`" << lyx << "' `"
@@ -499,7 +506,7 @@ bool GuiClipboard::hasGraphicsContents(Clipboard::GraphicsType type) const
        case EmfGraphicsType: mime = emfMimeType(); break;
        case WmfGraphicsType: mime = wmfMimeType(); break;
        case PdfGraphicsType: mime = pdfMimeType(); break;
-       default: LASSERT(false, /**/);
+       default: LASSERT(false, return false);
        }
        
        return cache_.hasFormat(mime);