From 973bb936248d7c060305f625ef7e5ee9f21f5aa6 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Tue, 19 Aug 2008 21:01:59 +0000 Subject: INTEGRATION: CWS aw033 (1.13.14); FILE MERGED 2008/07/11 11:30:55 aw 1.13.14.5: RESYNC: (1.14-1.15); FILE MERGED 2008/05/14 13:29:20 aw 1.13.14.4: RESYNC: (1.13-1.14); FILE MERGED 2007/12/18 14:56:23 aw 1.13.14.3: #i39532# corrected clipping changes 2007/12/12 13:17:26 aw 1.13.14.2: #i39532# clipping changes 2007/12/04 11:11:38 aw 1.13.14.1: #i39532# changes after resync --- canvas/source/tools/image.cxx | 64 ++++++------------------------------------- 1 file changed, 9 insertions(+), 55 deletions(-) (limited to 'canvas') diff --git a/canvas/source/tools/image.cxx b/canvas/source/tools/image.cxx index e9efb7ac89c9..49d1e7daa672 100644 --- a/canvas/source/tools/image.cxx +++ b/canvas/source/tools/image.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: image.cxx,v $ - * $Revision: 1.15 $ + * $Revision: 1.16 $ * * This file is part of OpenOffice.org. * @@ -55,6 +55,8 @@ #include #include #include +#include +#include #include "image.hxx" @@ -270,33 +272,9 @@ namespace canvas { namespace // clip contour against renderclip if( pRenderClip ) { - // TODO(F2): review subdivision algo, maybe use hybrid - // approach from mcseem also in basegfx - if(aPolyPolygon.areControlPointsUsed()) - aPolyPolygon = ::basegfx::tools::adaptiveSubdivideByAngle(aPolyPolygon); - - if( bIsFilledPolyPolygon ) - { - ::basegfx::B2DPolyPolygon clip(*pRenderClip); - aPolyPolygon = ::basegfx::tools::removeAllIntersections(aPolyPolygon); - aPolyPolygon = ::basegfx::tools::removeNeutralPolygons(aPolyPolygon, - sal_True); - clip = ::basegfx::tools::removeAllIntersections(clip); - clip = ::basegfx::tools::removeNeutralPolygons(clip, - sal_True); - aPolyPolygon.append(clip); - aPolyPolygon = ::basegfx::tools::removeAllIntersections(aPolyPolygon); - aPolyPolygon = ::basegfx::tools::removeNeutralPolygons(aPolyPolygon, - sal_False); - } - else - { - // TODO(F3): add AW's addition to clipPolyPolygonOnPolyPolygon - // regarding open/close state - aPolyPolygon = basegfx::tools::clipPolyPolygonOnPolyPolygon(aPolyPolygon, - *pRenderClip, - true); - } + // AW: Simplified + aPolyPolygon = basegfx::tools::clipPolyPolygonOnPolyPolygon( + aPolyPolygon, *pRenderClip, true, !bIsFilledPolyPolygon); } if( !aPolyPolygon.count() ) @@ -308,33 +286,9 @@ namespace canvas { namespace // clip contour against viewclip if( pViewClip ) { - // TODO(F2): review subdivision algo, maybe use hybrid - // approach from mcseem also in basegfx - if(aPolyPolygon.areControlPointsUsed()) - aPolyPolygon = ::basegfx::tools::adaptiveSubdivideByAngle(aPolyPolygon); - - if( bIsFilledPolyPolygon ) - { - ::basegfx::B2DPolyPolygon clip(*pViewClip); - aPolyPolygon = ::basegfx::tools::removeAllIntersections(aPolyPolygon); - aPolyPolygon = ::basegfx::tools::removeNeutralPolygons(aPolyPolygon, - sal_True); - clip = ::basegfx::tools::removeAllIntersections(clip); - clip = ::basegfx::tools::removeNeutralPolygons(clip, - sal_True); - aPolyPolygon.append(clip); - aPolyPolygon = ::basegfx::tools::removeAllIntersections(aPolyPolygon); - aPolyPolygon = ::basegfx::tools::removeNeutralPolygons(aPolyPolygon, - sal_False); - } - else - { - // TODO(F3): add AW's addition to clipPolyPolygonOnPolyPolygon - // regarding open/close state - aPolyPolygon = basegfx::tools::clipPolyPolygonOnPolyPolygon(aPolyPolygon, - *pViewClip, - true); - } + // AW: Simplified + aPolyPolygon = basegfx::tools::clipPolyPolygonOnPolyPolygon( + aPolyPolygon, *pViewClip, true, !bIsFilledPolyPolygon); } if(!(aPolyPolygon.count())) -- cgit