summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2020-05-12 07:13:17 +1000
committerTomaž Vajngerl <quikee@gmail.com>2020-05-15 15:44:29 +0200
commit449f23c44ccdf6d2bfe7baa143d32d8f585aef4b (patch)
tree4b5bc88bc922104cb31e04892b8906986dd936e1
parent6fa6704a7e7c6970b7a7c695a4a548f8dc693d03 (diff)
vcl: new local function setComponentsSizeAndColor()
Change-Id: Icc837d6f90578dbae3c757d673334facd49a1109 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94023 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--vcl/source/gdi/print2.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index e5ace36db0ac..d74a67078b98 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -100,6 +100,12 @@ bool doesRectCoverWithUniformColor(
rMapModeVDev.IsFillColor());
}
+void setComponentsSizeAndColor(ConnectedComponents &rBackgroundComponent, tools::Rectangle const & rRect, Color const& rColor)
+{
+ rBackgroundComponent.aBounds = rRect;
+ rBackgroundComponent.aBgColor = rColor;
+}
+
/** #107169# Convert BitmapEx to Bitmap with appropriately blended
color. Convert MetaTransparentAction to plain polygon,
appropriately colored
@@ -699,8 +705,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
if (!doesRectCoverWithUniformColor(aBackgroundComponent.aBounds, aRect, *aMapModeVDev))
{
- aBackgroundComponent.aBounds = aRect;
- aBackgroundComponent.aBgColor = aMapModeVDev->GetFillColor();
+ setComponentsSizeAndColor(aBackgroundComponent, aRect, aMapModeVDev->GetFillColor());
bStillBackground=false; // incomplete occlusion of background
}
else
@@ -718,8 +723,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
if (!basegfx::utils::isRectangle(aPoly.getB2DPolygon()) ||
!doesRectCoverWithUniformColor(aBackgroundComponent.aBounds, aRect, *aMapModeVDev))
{
- aBackgroundComponent.aBounds = aRect;
- aBackgroundComponent.aBgColor = aMapModeVDev->GetFillColor();
+ setComponentsSizeAndColor(aBackgroundComponent, aRect, aMapModeVDev->GetFillColor());
bStillBackground=false; // incomplete occlusion of background
}
else
@@ -738,8 +742,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
!basegfx::utils::isRectangle(aPoly[0].getB2DPolygon()) ||
!doesRectCoverWithUniformColor(aBackgroundComponent.aBounds, aRect, *aMapModeVDev))
{
- aBackgroundComponent.aBounds = aRect;
- aBackgroundComponent.aBgColor = aMapModeVDev->GetFillColor();
+ setComponentsSizeAndColor(aBackgroundComponent, aRect, aMapModeVDev->GetFillColor());
bStillBackground=false; // incomplete occlusion of background
}
else
@@ -755,8 +758,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
if (!doesRectCoverWithUniformColor(aBackgroundComponent.aBounds, aRect, *aMapModeVDev))
{
- aBackgroundComponent.aBounds = aRect;
- aBackgroundComponent.aBgColor = aMapModeVDev->GetFillColor();
+ setComponentsSizeAndColor(aBackgroundComponent, aRect, aMapModeVDev->GetFillColor());
bStillBackground=false; // incomplete occlusion of background
}
else