diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2019-02-27 09:40:50 +0100 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2019-03-04 14:39:48 +0100 |
commit | 14dca9a2197f1b43bf547ee47517e76e58309b93 (patch) | |
tree | b424e0ff4ead9ae774202181b74322142748fbbf /vcl/qt5 | |
parent | d98d3e2a0bc087ec9157e8e32e9f0ea4207d36e2 (diff) |
Unbreak internal DnD by using null MimeData
Regression from 67b0fcea9d748c4dd8101036cbb2c587d65f0bf7 (which
implements external DnD). QMimeData of internal DnD is never null,
it always contains internal MimeType (but empty byte array)
Change-Id: Ie12e9c3b7a3c7cebfd98064bb2fafec27c20a442
Reviewed-on: https://gerrit.libreoffice.org/68673
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/Qt5Frame.cxx | 5 | ||||
-rw-r--r-- | vcl/qt5/Qt5Widget.cxx | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index c687c4a279c3..958d9250c776 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -29,6 +29,7 @@ #include <Qt5Menu.hxx> #include <Qt5DragAndDrop.hxx> +#include <QtCore/QMimeData> #include <QtCore/QPoint> #include <QtCore/QSize> #include <QtGui/QIcon> @@ -1109,7 +1110,7 @@ void Qt5Frame::draggingStarted(const int x, const int y, const QMimeData* pQMime aEvent.SourceActions = css::datatransfer::dnd::DNDConstants::ACTION_MOVE; css::uno::Reference<css::datatransfer::XTransferable> xTransferable; - if (pQMimeData) + if (!pQMimeData->hasFormat(sInternalMimeType)) xTransferable = new Qt5DnDTransferable(pQMimeData); else xTransferable = Qt5DragSource::m_ActiveDragSource->GetTransferable(); @@ -1141,7 +1142,7 @@ void Qt5Frame::dropping(const int x, const int y, const QMimeData* pQMimeData) aEvent.SourceActions = css::datatransfer::dnd::DNDConstants::ACTION_MOVE; css::uno::Reference<css::datatransfer::XTransferable> xTransferable; - if (pQMimeData) + if (!pQMimeData->hasFormat(sInternalMimeType)) xTransferable = new Qt5DnDTransferable(pQMimeData); else xTransferable = Qt5DragSource::m_ActiveDragSource->GetTransferable(); diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx index 2baf7a37125a..ca2c3ada6a3c 100644 --- a/vcl/qt5/Qt5Widget.cxx +++ b/vcl/qt5/Qt5Widget.cxx @@ -193,7 +193,7 @@ void Qt5Widget::startDrag() { // internal drag source QMimeData* mimeData = new QMimeData; - mimeData->setData(m_InternalMimeType, nullptr); + mimeData->setData(sInternalMimeType, nullptr); QDrag* drag = new QDrag(this); drag->setMimeData(mimeData); @@ -202,7 +202,7 @@ void Qt5Widget::startDrag() void Qt5Widget::dragEnterEvent(QDragEnterEvent* event) { - if (event->mimeData()->hasFormat(m_InternalMimeType)) + if (event->mimeData()->hasFormat(sInternalMimeType)) event->accept(); else event->acceptProposedAction(); |