summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-04-09 09:58:27 +0900
committerTomaž Vajngerl <quikee@gmail.com>2019-04-09 12:07:36 +0200
commit05a8749ee6f251d4b92eecb97763fa1fe94c68c8 (patch)
tree78c2be178e4e7fe3206cbe94a4751e16e8026d0a /svx
parent13f449221e550c84bb60c368b2520148104e6da9 (diff)
remove some usages of BitmapColor outside of VCL
You get BitmapColor only from reading pixels from a Bitmap and we want to avoid usage of Bitmap outside of VCL (and use BitmapEx as the alternative which will eventually replace Bitmap). Change-Id: Iddfa3ef739bfdd4dce5fb47fd9f67a5a36f3388b Reviewed-on: https://gerrit.libreoffice.org/70447 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/dlgctrl.cxx21
-rw-r--r--svx/source/xoutdev/xattrbmp.cxx2
2 files changed, 5 insertions, 18 deletions
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index 8b280e334051..01ad02c96341 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -873,25 +873,12 @@ void SvxPixelCtl::LoseFocus()
void SvxPixelCtl::SetXBitmap(const BitmapEx& rBitmapEx)
{
- BitmapColor aBack;
- BitmapColor aFront;
-
- if (vcl::bitmap::isHistorical8x8(rBitmapEx, aBack, aFront))
+ if (vcl::bitmap::isHistorical8x8(rBitmapEx, aBackgroundColor, aPixelColor))
{
- Bitmap aBitmap(rBitmapEx.GetBitmap());
- Bitmap::ScopedReadAccess pRead(aBitmap);
-
- aBackgroundColor = aBack.GetColor();
- aPixelColor = aFront.GetColor();
-
- for(sal_uInt16 i(0); i < nSquares; i++)
+ for (sal_uInt16 i = 0; i < nSquares; i++)
{
- const BitmapColor aColor(pRead->GetColor(i/8, i%8));
-
- if (aColor == aBack)
- maPixelData[i] = 0;
- else
- maPixelData[i] = 1;
+ Color aColor = rBitmapEx.GetPixelColor(i%8, i/8);
+ maPixelData[i] = (aColor == aBackgroundColor) ? 0 : 1;
}
}
}
diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index e15e11bc808c..140718bd056f 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -164,7 +164,7 @@ bool XFillBitmapItem::operator==(const SfxPoolItem& rItem) const
bool XFillBitmapItem::isPattern() const
{
- BitmapColor aBack, aFront;
+ Color aBack, aFront;
return vcl::bitmap::isHistorical8x8(GetGraphicObject().GetGraphic().GetBitmapEx(), aBack, aFront);
}