]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiClipboard.cpp
Handle correctly zero table special arguments.
[lyx.git] / src / frontends / qt4 / GuiClipboard.cpp
index 1de945ed8e8ee99cc568da5daa122ad558e9aaf3..1fa6aba835f1eb2bdc34167ae7a72a76ef7f5d54 100644 (file)
@@ -46,6 +46,7 @@
 #include <QString>
 #include <QStringList>
 #include <QTextDocument>
+#include <QTimer>
 
 #include <boost/crc.hpp>
 
@@ -112,7 +113,7 @@ GuiClipboard::GuiClipboard()
        connect(qApp->clipboard(), SIGNAL(dataChanged()),
                this, SLOT(on_dataChanged()));
        // initialize clipboard status.
-       on_dataChanged();
+       update();
 }
 
 
@@ -357,7 +358,7 @@ QString tidyHtml(QString input)
        converter.setHtml(input);
        return converter.toHtml("utf-8");
 }
-}
+} // namespace
 
 
 docstring const GuiClipboard::getAsText(TextType type) const
@@ -550,6 +551,17 @@ bool GuiClipboard::hasInternal() const
 
 
 void GuiClipboard::on_dataChanged()
+{
+       update();
+#if defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)
+       // Retry on Windows (#10109)
+       if (cache_.formats().count() == 0) {
+               QTimer::singleShot(100, this, SLOT(update()));
+       }
+#endif
+}
+
+void GuiClipboard::update()
 {
        //Note: we do not really need to run cache_.update() unless the
        //data has been changed *and* the GuiClipboard has been queried.