summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2020-05-12 06:31:39 +1000
committerTomaž Vajngerl <quikee@gmail.com>2020-05-15 08:08:48 +0200
commitf8820fea3f0c3c50a9755351a33dde9b082e6456 (patch)
tree975813c97275549cf6f22baf887084bb9625636d
parentb1e396d86655a0131498a4691dd8069ea76c3477 (diff)
vcl: refactor - move rect coverage check out of checkRect
Change-Id: I68d24fd0b94286155750ccb5fa83bf7a897ada5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94021 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--vcl/source/gdi/print2.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index d60ba034742c..481cafcf814e 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -89,6 +89,17 @@ bool DoesActionHandleTransparency( const MetaAction& rAct )
}
}
+bool doesRectCoverWithUniformColor(
+ tools::Rectangle const & rPrevRect,
+ tools::Rectangle const & rCurrRect,
+ OutputDevice const & rMapModeVDev)
+{
+ // shape needs to fully cover previous content, and have uniform
+ // color
+ return (rMapModeVDev.LogicToPixel(rCurrRect).IsInside(rPrevRect) &&
+ rMapModeVDev.IsFillColor());
+}
+
/** Check whether rCurrRect rectangle fully covers io_rPrevRect - if
yes, return true and update o_rBgColor
*/
@@ -97,11 +108,7 @@ bool checkRect( tools::Rectangle& io_rPrevRect,
const tools::Rectangle& rCurrRect,
OutputDevice const & rMapModeVDev )
{
- // shape needs to fully cover previous content, and have uniform
- // color
- const bool bRet(
- rMapModeVDev.LogicToPixel(rCurrRect).IsInside(io_rPrevRect) &&
- rMapModeVDev.IsFillColor() );
+ bool bRet = doesRectCoverWithUniformColor(io_rPrevRect, rCurrRect, rMapModeVDev);
if( bRet )
{