From a9466a07a34f33a6efeafb8a636617bf76f9fec8 Mon Sep 17 00:00:00 2001 From: Katarina Behrens Date: Tue, 10 Jul 2018 13:22:30 +0200 Subject: Bitmap cursors contain XBM data, read them accordingly Change-Id: I8d5cf48fb37db8e6e5c8058f92b69659838f3471 Reviewed-on: https://gerrit.libreoffice.org/57229 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski --- vcl/qt5/Qt5Data.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'vcl') diff --git a/vcl/qt5/Qt5Data.cxx b/vcl/qt5/Qt5Data.cxx index 350db44c3c16..60d555438944 100644 --- a/vcl/qt5/Qt5Data.cxx +++ b/vcl/qt5/Qt5Data.cxx @@ -161,12 +161,9 @@ Qt5Data::~Qt5Data() {} static QCursor* getQCursorFromXBM(const unsigned char* pBitmap, const unsigned char* pMask, int nWidth, int nHeight, int nXHot, int nYHot) { - QBitmap aPixmap; - aPixmap.loadFromData(pBitmap, nWidth * nHeight / 8, "XPM"); - QBitmap aMask; - aMask.loadFromData(pMask, nWidth * nHeight / 8, "XPM"); - aPixmap.setMask(aMask); - return new QCursor(aPixmap, nXHot, nYHot); + QBitmap aPixmap = QBitmap::fromData(QSize(nWidth, nHeight), pBitmap); + QBitmap aMask = QBitmap::fromData(QSize(nWidth, nHeight), pMask); + return new QCursor(aPixmap, aMask, nXHot, nYHot); } #define MAKE_CURSOR(vcl_name, name) \ -- cgit