[Libreoffice-commits] core.git: vcl/source

Chris Sherlock (via logerrit) logerrit at kemper.freedesktop.org
Fri May 15 13:45:18 UTC 2020


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

New commits:
commit 449f23c44ccdf6d2bfe7baa143d32d8f585aef4b
Author:     Chris Sherlock <chris.sherlock79 at gmail.com>
AuthorDate: Tue May 12 07:13:17 2020 +1000
Commit:     Tomaž Vajngerl <quikee at 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 <quikee at 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


More information about the Libreoffice-commits mailing list