summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-10-27 01:59:25 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2015-10-27 02:33:18 +0000
commit3ce9af420afafa1a81de646220706fcdc8d84b55 (patch)
treefc73bb3f66a8bd7973cff8615de7feaa61c5a49d /vcl/win
parent64de38cf8eec4c0ff21fa886b616182acd8600a2 (diff)
loplugin:unusedmethods
Change-Id: I73180266c0af98dbd8d29bd3b11850996b94def9 Reviewed-on: https://gerrit.libreoffice.org/19195 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/source/gdi/gdiimpl.cxx53
1 files changed, 52 insertions, 1 deletions
diff --git a/vcl/win/source/gdi/gdiimpl.cxx b/vcl/win/source/gdi/gdiimpl.cxx
index 408639c119dc..c6afb9d3c78d 100644
--- a/vcl/win/source/gdi/gdiimpl.cxx
+++ b/vcl/win/source/gdi/gdiimpl.cxx
@@ -1051,6 +1051,57 @@ void WinSalGraphicsImpl::ResetClipRegion()
SelectClipRgn( mrParent.getHDC(), 0 );
}
+static bool containsOnlyHorizontalAndVerticalEdges(const basegfx::B2DPolygon& rCandidate)
+{
+ if(rCandidate.areControlPointsUsed())
+ {
+ return false;
+ }
+
+ const sal_uInt32 nPointCount(rCandidate.count());
+
+ if(nPointCount < 2)
+ {
+ return true;
+ }
+
+ const sal_uInt32 nEdgeCount(rCandidate.isClosed() ? nPointCount + 1 : nPointCount);
+ basegfx::B2DPoint aLast(rCandidate.getB2DPoint(0));
+
+ for(sal_uInt32 a(1); a < nEdgeCount; a++)
+ {
+ const sal_uInt32 nNextIndex(a % nPointCount);
+ const basegfx::B2DPoint aCurrent(rCandidate.getB2DPoint(nNextIndex));
+
+ if(!basegfx::fTools::equal(aLast.getX(), aCurrent.getX()) && !basegfx::fTools::equal(aLast.getY(), aCurrent.getY()))
+ {
+ return false;
+ }
+
+ aLast = aCurrent;
+ }
+
+ return true;
+}
+
+static bool containsOnlyHorizontalAndVerticalEdges(const basegfx::B2DPolyPolygon& rCandidate)
+{
+ if(rCandidate.areControlPointsUsed())
+ {
+ return false;
+ }
+
+ for(sal_uInt32 a(0); a < rCandidate.count(); a++)
+ {
+ if(!containsOnlyHorizontalAndVerticalEdges(rCandidate.getB2DPolygon(a)))
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
bool WinSalGraphicsImpl::setClipRegion( const vcl::Region& i_rClip )
{
if ( mrParent.mhRegion )
@@ -1078,7 +1129,7 @@ bool WinSalGraphicsImpl::setClipRegion( const vcl::Region& i_rClip )
if(!aPolyPolygon.areControlPointsUsed())
{
- if(basegfx::tools::containsOnlyHorizontalAndVerticalEdges(aPolyPolygon))
+ if(containsOnlyHorizontalAndVerticalEdges(aPolyPolygon))
{
bUsePolygon = false;
}