diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-05-15 16:26:59 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2019-05-15 23:36:09 +0200 |
commit | 294d4ed6aab4ae6dbf859626545cf6d75194bacd (patch) | |
tree | ce2239a3983064ce6bda6bf1449ea028d0bd0974 /vcl/qt5 | |
parent | a348806baf31b4072f02886d142ac6c3e1bba665 (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>
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/Qt5Clipboard.cxx | 7 |
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); |