From efef02cc463f73bd575237ce702f735b9b494733 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Wed, 15 May 2019 16:26:59 +0200 Subject: do not add non-text to PRIMARY selection in VclQt5Clipboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 294d4ed6aab4ae6dbf859626545cf6d75194bacd) Reviewed-on: https://gerrit.libreoffice.org/73928 Reviewed-by: Luboš Luňák Reviewed-by: Michael Weghorn --- vcl/qt5/Qt5Clipboard.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'vcl') 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 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 pMimeData(new QMimeData); -- cgit v1.2.3