[Libreoffice-commits] core.git: include/vcl vcl/qa
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Tue May 4 18:02:24 UTC 2021
include/vcl/bitmap.hxx | 10 +++++-----
vcl/qa/cppunit/BitmapTest.cxx | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)
New commits:
commit e20254da3bf67d298b262066ea9c8bb376623ca1
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Tue May 4 18:34:33 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue May 4 20:01:48 2021 +0200
sal_uLong->sal_Int64 in Bitmap
Change-Id: Ia9796cca66f405c38545a5ba3aab7c76a465a0d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115106
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index 3b3cd9a1cb4e..f3bc3e1cdfe7 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -134,7 +134,7 @@ public:
Size GetSizePixel() const;
vcl::PixelFormat getPixelFormat() const;
- inline sal_uLong GetSizeBytes() const;
+ inline sal_Int64 GetSizeBytes() const;
bool HasGreyPalette8Bit() const;
bool HasGreyPaletteAny() const;
/** get system dependent bitmap data
@@ -569,12 +569,12 @@ inline void Bitmap::SetPrefSize( const Size& rSize )
maPrefSize = rSize;
}
-inline sal_uLong Bitmap::GetSizeBytes() const
+inline sal_Int64 Bitmap::GetSizeBytes() const
{
const auto aSizePixel = GetSizePixel();
- const sal_uInt64 aBitCount = vcl::pixelFormatBitCount(getPixelFormat());
- sal_uInt64 aSizeInBytes = (aSizePixel.Width() * aSizePixel.Height() * aBitCount) / 8;
- return sal_uLong(aSizeInBytes);
+ const sal_Int64 aBitCount = vcl::pixelFormatBitCount(getPixelFormat());
+ sal_Int64 aSizeInBytes = (aSizePixel.Width() * aSizePixel.Height() * aBitCount) / 8;
+ return aSizeInBytes;
}
#endif // INCLUDED_VCL_BITMAP_HXX
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx
index 962b06e8e977..4d033c9e37a3 100644
--- a/vcl/qa/cppunit/BitmapTest.cxx
+++ b/vcl/qa/cppunit/BitmapTest.cxx
@@ -91,7 +91,7 @@ void BitmapTest::testCreation()
CPPUNIT_ASSERT_MESSAGE("Not empty", aBmp.IsEmpty());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pixel format", vcl::PixelFormat::INVALID,
aBmp.getPixelFormat());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong byte size", static_cast<sal_uLong>(0),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong byte size", static_cast<sal_Int64>(0),
aBmp.GetSizeBytes());
}
@@ -104,7 +104,7 @@ void BitmapTest::testCreation()
CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pixel format", vcl::PixelFormat::N1_BPP,
aBmp.getPixelFormat());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong byte size", static_cast<sal_uLong>(12),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong byte size", static_cast<sal_Int64>(12),
aBmp.GetSizeBytes());
}
@@ -117,7 +117,7 @@ void BitmapTest::testCreation()
CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pixel format", vcl::PixelFormat::N8_BPP,
aBmp.getPixelFormat());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong byte size", static_cast<sal_uLong>(100),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong byte size", static_cast<sal_Int64>(100),
aBmp.GetSizeBytes());
}
@@ -130,7 +130,7 @@ void BitmapTest::testCreation()
CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pixel format", vcl::PixelFormat::N24_BPP,
aBmp.getPixelFormat());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong byte size", static_cast<sal_uLong>(300),
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong byte size", static_cast<sal_Int64>(300),
aBmp.GetSizeBytes());
}
@@ -147,7 +147,7 @@ void BitmapTest::testCreation()
CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pixel format", vcl::PixelFormat::N32_BPP,
aBmp.getPixelFormat());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong byte size", sal_uLong(400), aBmp.GetSizeBytes());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong byte size", sal_Int64(400), aBmp.GetSizeBytes());
}
}
More information about the Libreoffice-commits
mailing list