diff options
-rw-r--r-- | vcl/inc/qt5/Qt5Tools.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/qt5/Qt5Widget.hxx | 2 | ||||
-rw-r--r-- | vcl/qt5/Qt5Frame.cxx | 5 | ||||
-rw-r--r-- | vcl/qt5/Qt5Widget.cxx | 4 |
4 files changed, 7 insertions, 6 deletions
diff --git a/vcl/inc/qt5/Qt5Tools.hxx b/vcl/inc/qt5/Qt5Tools.hxx index 57bf94793955..18b48690377b 100644 --- a/vcl/inc/qt5/Qt5Tools.hxx +++ b/vcl/inc/qt5/Qt5Tools.hxx @@ -118,6 +118,8 @@ inline sal_uInt16 getFormatBits(QImage::Format eFormat) } } +static const QString sInternalMimeType = "application/x-libreoffice-dnditem"; + typedef struct _cairo_surface cairo_surface_t; struct CairoDeleter { diff --git a/vcl/inc/qt5/Qt5Widget.hxx b/vcl/inc/qt5/Qt5Widget.hxx index 731498f11d13..3e5332bd77dc 100644 --- a/vcl/inc/qt5/Qt5Widget.hxx +++ b/vcl/inc/qt5/Qt5Widget.hxx @@ -66,8 +66,6 @@ class Qt5Widget : public QWidget void inputMethodEvent(QInputMethodEvent*) override; QVariant inputMethodQuery(Qt::InputMethodQuery) const override; - const QString m_InternalMimeType = "application/x-libreoffice-dnditem"; - public slots: static void showTooltip(const OUString& rTip); 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(); |