summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit/text.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2023-12-04 11:17:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-12-07 09:32:14 +0100
commita214ac677481883d31800bc2b67fd3a9c504319d (patch)
tree97598a97a7b0745acaf4dc4e7587871794011227 /vcl/qa/cppunit/text.cxx
parent7101c620857cb885076b85cd1447e50d30cab528 (diff)
simplify and modernise ScopedBitmapAccess
(*) Make all of it use a "Scoped" paradigm (*) pass by value, no need to allocate on heap (*) make all of the construction go via the *Access constructors, instead of it being some via the constructors and some via the Acquire*Access methods. (*) take the Bitmap& by const& in the constructor, so we can avoid doing const_cast in random places. Change-Id: Ie03a9145c0965980ee8df9a89b8714a425e18f74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160293 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/qa/cppunit/text.cxx')
-rw-r--r--vcl/qa/cppunit/text.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/qa/cppunit/text.cxx b/vcl/qa/cppunit/text.cxx
index b2e837a32c40..cabe502db462 100644
--- a/vcl/qa/cppunit/text.cxx
+++ b/vcl/qa/cppunit/text.cxx
@@ -68,7 +68,7 @@ static bool isBlack(Color col)
static tools::Long getCharacterBaseWidth(VirtualDevice* device, const Point& start)
{
Bitmap bitmap = device->GetBitmap(Point(), device->GetOutputSizePixel());
- Bitmap::ScopedReadAccess access(bitmap);
+ BitmapScopedReadAccess access(bitmap);
tools::Long y = start.Y();
while (y >= 0 && !isBlack(access->GetColor(y, start.X())))
--y;
@@ -87,7 +87,7 @@ static tools::Long getCharacterBaseWidth(VirtualDevice* device, const Point& sta
static tools::Long getCharacterTopWidth(VirtualDevice* device, const Point& start)
{
Bitmap bitmap = device->GetBitmap(Point(), device->GetOutputSizePixel());
- Bitmap::ScopedReadAccess access(bitmap);
+ BitmapScopedReadAccess access(bitmap);
tools::Long y = start.Y();
while (y < bitmap.GetSizePixel().Height() && !isBlack(access->GetColor(y, start.X())))
++y;
@@ -108,7 +108,7 @@ static tools::Long getCharacterTopWidth(VirtualDevice* device, const Point& star
static tools::Long getCharacterLeftSideHeight(VirtualDevice* device, const Point& start)
{
Bitmap bitmap = device->GetBitmap(Point(), device->GetOutputSizePixel());
- Bitmap::ScopedReadAccess access(bitmap);
+ BitmapScopedReadAccess access(bitmap);
tools::Long x = start.X();
while (x < bitmap.GetSizePixel().Width() && !isBlack(access->GetColor(start.Y(), x)))
++x;