vcl/inc/qt5/Qt5Frame.hxx |    9 +++++++++
 vcl/qt5/Qt5Bitmap.cxx    |    6 +++---
 vcl/qt5/Qt5Timer.cxx     |    8 +++++++-
 3 files changed, 19 insertions(+), 4 deletions(-)

New commits:
commit b9a6760a371f00d49614732790782c9a456f4e86
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Mon Aug 6 17:17:52 2018 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Tue Aug 7 16:43:38 2018 +0200

    Qt5 static_cast bitmap data should be enough
    
    This failed to build to on Haiku with:
    
    /sources/core/vcl/qt5/Qt5Bitmap.cxx:
     In member function 'virtual bool Qt5Bitmap::Create(const SalBitmap&, 
sal_uInt16)':
    /sources/core/vcl/qt5/Qt5Bitmap.cxx:155:92:
      error: invalid cast from type 'unsigned int' to type 'sal_uInt32 {aka 
long unsigned int}'
                    *image_data = 
reinterpret_cast<sal_uInt32>(colorTable.at(*buffer_data >> 4));
    
    Change-Id: Ib536901f8c55f854715089bce0ad5d954dd529e9
    Reviewed-on: https://gerrit.libreoffice.org/58651
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de>

diff --git a/vcl/qt5/Qt5Bitmap.cxx b/vcl/qt5/Qt5Bitmap.cxx
index 23cde0cb31da..b8e8e4bdf159 100644
--- a/vcl/qt5/Qt5Bitmap.cxx
+++ b/vcl/qt5/Qt5Bitmap.cxx
@@ -154,15 +154,15 @@ bool Qt5Bitmap::Create(const SalBitmap& rSalBmp, 
sal_uInt16 nNewBitCount)
             buffer_data_pos += pBitmap->m_nScanline;
             for (sal_uInt32 w = 0; w < nWidth; ++w)
             {
-                *image_data = 
reinterpret_cast<sal_uInt32>(colorTable.at(*buffer_data >> 4));
+                *image_data = 
static_cast<sal_uInt32>(colorTable.at(*buffer_data >> 4));
                 ++image_data;
-                *image_data = 
reinterpret_cast<sal_uInt32>(colorTable.at(*buffer_data & 0xF));
+                *image_data = 
static_cast<sal_uInt32>(colorTable.at(*buffer_data & 0xF));
                 ++image_data;
                 ++buffer_data;
             }
             if (isOdd)
             {
-                *image_data = 
reinterpret_cast<sal_uInt32>(colorTable.at(*buffer_data >> 4));
+                *image_data = 
static_cast<sal_uInt32>(colorTable.at(*buffer_data >> 4));
                 ++image_data;
             }
         }
commit 0c02747e54d34c4148a8a8fe389726703187ab5d
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Mon Aug 6 17:11:52 2018 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Tue Aug 7 16:43:25 2018 +0200

    Qt5 fix main loop locking when processing events
    
    In commit bded890a44cc ("Qt5 just release the SolarMutex for Qt
    event") the Qt5 main loop was switched to running non-locked, as
    most other backends do, so now we must take the lock when
    processing Qt events.
    
    Eventually CallCallback should be virtual for security?
    
    Change-Id: I8cbfc9bb8b3de677a70ad3bd5cb3910fabec9b87
    Reviewed-on: https://gerrit.libreoffice.org/58650
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de>

diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx
index 96446c28a358..310298879e52 100644
--- a/vcl/inc/qt5/Qt5Frame.hxx
+++ b/vcl/inc/qt5/Qt5Frame.hxx
@@ -25,6 +25,7 @@
 #include "Qt5Tools.hxx"
 
 #include <headless/svpgdi.hxx>
+#include <vcl/svapp.hxx>
 
 class Qt5Graphics;
 class Qt5Instance;
@@ -140,6 +141,14 @@ public:
 
     virtual void SetScreenNumber(unsigned int) override;
     virtual void SetApplicationID(const OUString&) override;
+
+    inline bool CallCallback(SalEvent nEvent, const void* pEvent) const;
 };
 
+inline bool Qt5Frame::CallCallback(SalEvent nEvent, const void* pEvent) const
+{
+    SolarMutexGuard aGuard;
+    return SalFrame::CallCallback(nEvent, pEvent);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/Qt5Timer.cxx b/vcl/qt5/Qt5Timer.cxx
index 2fa07886f60f..56dec31d7d31 100644
--- a/vcl/qt5/Qt5Timer.cxx
+++ b/vcl/qt5/Qt5Timer.cxx
@@ -23,6 +23,8 @@
 #include <QtWidgets/QApplication>
 #include <QtCore/QThread>
 
+#include <vcl/svapp.hxx>
+
 Qt5Timer::Qt5Timer()
 {
     m_aTimer.setSingleShot(true);
@@ -34,7 +36,11 @@ Qt5Timer::Qt5Timer()
 
 Qt5Timer::~Qt5Timer() {}
 
-void Qt5Timer::timeoutActivated() { CallCallback(); }
+void Qt5Timer::timeoutActivated()
+{
+    SolarMutexGuard aGuard;
+    CallCallback();
+}
 
 void Qt5Timer::startTimer() { m_aTimer.start(); }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to