vcl/qt5/Qt5Clipboard.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 294d4ed6aab4ae6dbf859626545cf6d75194bacd
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Wed May 15 16:26:59 2019 +0200
Commit:     Katarina Behrens <katarina.behr...@cib.de>
CommitDate: Wed May 15 23:36:09 2019 +0200

    do not add non-text to PRIMARY selection in VclQt5Clipboard
    
    E.g. tdf#80853 repeatedly sets the selection, which results
    in the entire document getting converted to html.
    
    Other VCL backends seem to be even faster, it looks like they convert
    the data only on-demand, but this at least makes things bearable.
    
    Change-Id: Ib08423bd89d7c7065ad0522338979f1ce66701c7
    Reviewed-on: https://gerrit.libreoffice.org/72369
    Tested-by: Jenkins
    Reviewed-by: Katarina Behrens <katarina.behr...@cib.de>

diff --git a/vcl/qt5/Qt5Clipboard.cxx b/vcl/qt5/Qt5Clipboard.cxx
index 5fdbc47dfd2c..d4df05504b8e 100644
--- a/vcl/qt5/Qt5Clipboard.cxx
+++ b/vcl/qt5/Qt5Clipboard.cxx
@@ -249,8 +249,13 @@ void VclQt5Clipboard::setContents(
     {
         css::uno::Sequence<css::datatransfer::DataFlavor> aFormats
             = xTrans->getTransferDataFlavors();
+        // Do not add non-text formats for the selection buffer,
+        // I don't think that one is ever used for anything else
+        // besides text and this gets called whenever something
+        // in LO gets selected (which may be e.g. an entire Calc sheet).
         bool bHasHtml = false, bHasImage = false;
-        lcl_peekFormats(aFormats, bHasHtml, bHasImage);
+        if (m_aClipboardMode != QClipboard::Selection)
+            lcl_peekFormats(aFormats, bHasHtml, bHasImage);
 
         std::unique_ptr<QMimeData> pMimeData(new QMimeData);
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to