diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-09-17 21:49:21 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-09-20 12:10:44 +0200 |
commit | b22d4785310eac35696df771803dfba0871a50ac (patch) | |
tree | 56e394a3c38a2e1f17530fbc18dd8e6b3c5d5098 /sc/source/ui/view/printfun.cxx | |
parent | 3e2370260f2b79c43b4f8a86b123861aa95d3ef2 (diff) |
clean up ambiguous confusing rectangle APIs like IsInside()
Reading 'rectA.IsInside( rectB )' kind of suggests that the code
checks whether 'rectA is inside rectB', but it's actually the other
way around. Rename IsInside() -> Contains(), IsOver() -> Overlaps(),
which should make it clear which way the logic goes.
Change-Id: I9347450fe7dc34c96df6d636a4e3e660de1801ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122271
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sc/source/ui/view/printfun.cxx')
-rw-r--r-- | sc/source/ui/view/printfun.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index f8e7c302b971..eb7de664694b 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -1144,7 +1144,7 @@ void ScPrintFunc::SetDateTime( const DateTime& rDateTime ) static void lcl_DrawGraphic( const Graphic &rGraphic, vcl::RenderContext& rOutDev, const tools::Rectangle &rGrf, const tools::Rectangle &rOut ) { - const bool bNotInside = !rOut.IsInside( rGrf ); + const bool bNotInside = !rOut.Contains( rGrf ); if ( bNotInside ) { rOutDev.Push(); @@ -1273,7 +1273,7 @@ static void lcl_DrawGraphic( const SvxBrushItem &rBrush, vcl::RenderContext& rOu default: OSL_ENSURE( false, "new Graphic position?" ); } tools::Rectangle aGrf( aPos,aDrawSize ); - if ( bDraw && aGrf.IsOver( rOut ) ) + if ( bDraw && aGrf.Overlaps( rOut ) ) { lcl_DrawGraphic( *pGraphic, rOutDev, aGrf, rOut ); } |