summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-05-15 16:26:59 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2019-06-13 16:45:17 +0200
commitefef02cc463f73bd575237ce702f735b9b494733 (patch)
tree0a009d03e59114e55e7afbe81ec7df4854b0b679
parent7c54b11e98a7b8705eb2fc0ad41a6ec25f8e62e7 (diff)
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.Behrens@cib.de> (cherry picked from commit 294d4ed6aab4ae6dbf859626545cf6d75194bacd) Reviewed-on: https://gerrit.libreoffice.org/73928 Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r--vcl/qt5/Qt5Clipboard.cxx7
1 files changed, 6 insertions, 1 deletions
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);