vcl/source/gdi/print2.cxx |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 449f23c44ccdf6d2bfe7baa143d32d8f585aef4b
Author:     Chris Sherlock <chris.sherloc...@gmail.com>
AuthorDate: Tue May 12 07:13:17 2020 +1000
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Fri May 15 15:44:29 2020 +0200

    vcl: new local function setComponentsSizeAndColor()
    
    Change-Id: Icc837d6f90578dbae3c757d673334facd49a1109
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94023
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

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
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to