vcl/qt5/Qt5Transferable.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit c51cada3dc0496fb2bcaa0d1360a202ce0efae80 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Feb 7 13:49:45 2020 +0100 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Mon Feb 10 08:12:30 2020 +0100 tdf#129809 qt5: take a reference in case m_aContents is replaced This takes over Caolán's solution for gtk3 from dbcdc5cd98df5756a96559e467cad95c629343ca ("tdf#129809 take a reference in case m_aContents is replaced") for the qt5 case as well, to prevent that the XTransferable is destroyed along with the Qt5MimeData object as new QMimeData are set in the clipboard, as follows: 1 Qt5Clipboard::setContents Qt5Clipboard.cxx 2 TransferableHelper::CopyToSelection transfer.cxx 3 TransferableHelper::CopyToSelection transfer.cxx 4 SwTransferable::CreateSelection swdtflvr.cxx 5 SwWrtShell::SttSelect select.cxx 6 SwWrtShell::SelectTextAttr move.cxx 7 SwTransferable::GetData swdtflvr.cxx 8 TransferableHelper::getTransferData2 transfer.cxx 9 TransferableHelper::getTransferData transfer.cxx 10 Qt5MimeData::retrieveData Qt5Transferable.cxx 11 QMimeDataPrivate::retrieveTypedData qvariant.h 12 QMimeData::data qmimedata.cpp 13 QInternalMimeData::renderDataHelper(QString const&, QMimeData const *) 14 ?? 15 ?? 16 ?? 17 QXcbConnection::handleXcbEvent(xcb_generic_event_t *) 18 QXcbConnection::processXcbEvents(QFlags<QEventLoop::ProcessEventsFlag>) 19 ?? 20 g_main_context_dispatch Change-Id: Ic712c901a31131efc596cac7f00f14bb6a7ce068 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88192 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> (cherry picked from commit 1d7b1a15059a77fde9afa14d0b9a508142bfc247) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88258 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/vcl/qt5/Qt5Transferable.cxx b/vcl/qt5/Qt5Transferable.cxx index 81a47871f411..3f19f6ec71cf 100644 --- a/vcl/qt5/Qt5Transferable.cxx +++ b/vcl/qt5/Qt5Transferable.cxx @@ -300,7 +300,10 @@ QVariant Qt5MimeData::retrieveData(const QString& mimeType, QVariant::Type) cons try { - aValue = m_aContents->getTransferData(aFlavor); + // tdf#129809 take a reference in case m_aContents is replaced during this call + css::uno::Reference<com::sun::star::datatransfer::XTransferable> xCurrentContents( + m_aContents); + aValue = xCurrentContents->getTransferData(aFlavor); } catch (...) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits