Kaydet (Commit) b9a6760a authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

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: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst 0c02747e
...@@ -154,15 +154,15 @@ bool Qt5Bitmap::Create(const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount) ...@@ -154,15 +154,15 @@ bool Qt5Bitmap::Create(const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount)
buffer_data_pos += pBitmap->m_nScanline; buffer_data_pos += pBitmap->m_nScanline;
for (sal_uInt32 w = 0; w < nWidth; ++w) 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;
*image_data = reinterpret_cast<sal_uInt32>(colorTable.at(*buffer_data & 0xF)); *image_data = static_cast<sal_uInt32>(colorTable.at(*buffer_data & 0xF));
++image_data; ++image_data;
++buffer_data; ++buffer_data;
} }
if (isOdd) 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; ++image_data;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment