Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B6C3EDBEB for ; Tue, 10 Jul 2012 12:46:33 +0000 (UTC) Received: (qmail 10264 invoked by uid 500); 10 Jul 2012 12:46:33 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 10121 invoked by uid 500); 10 Jul 2012 12:46:31 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 10090 invoked by uid 99); 10 Jul 2012 12:46:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2012 12:46:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2012 12:46:29 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id AD3EB23888E7; Tue, 10 Jul 2012 12:46:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1359641 - in /incubator/ooo/branches/AOO34: ./ main/ main/vcl/inc/vcl/region.hxx main/vcl/source/gdi/region.cxx Date: Tue, 10 Jul 2012 12:46:09 -0000 To: ooo-commits@incubator.apache.org From: af@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120710124609.AD3EB23888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: af Date: Tue Jul 10 12:46:09 2012 New Revision: 1359641 URL: http://svn.apache.org/viewvc?rev=1359641&view=rev Log: #i120096# Detect empty polygon in Region constructor and set impl object accordingly. (Merged from trunk) Reported by: Du Jing Fixed by: Andre Fischer Modified: incubator/ooo/branches/AOO34/ (props changed) incubator/ooo/branches/AOO34/main/ (props changed) incubator/ooo/branches/AOO34/main/vcl/inc/vcl/region.hxx incubator/ooo/branches/AOO34/main/vcl/source/gdi/region.cxx Propchange: incubator/ooo/branches/AOO34/ ------------------------------------------------------------------------------ Merged /incubator/ooo/trunk:r1357698 Propchange: incubator/ooo/branches/AOO34/main/ ------------------------------------------------------------------------------ Merged /incubator/ooo/trunk/main:r1357698 Modified: incubator/ooo/branches/AOO34/main/vcl/inc/vcl/region.hxx URL: http://svn.apache.org/viewvc/incubator/ooo/branches/AOO34/main/vcl/inc/vcl/region.hxx?rev=1359641&r1=1359640&r2=1359641&view=diff ============================================================================== --- incubator/ooo/branches/AOO34/main/vcl/inc/vcl/region.hxx (original) +++ incubator/ooo/branches/AOO34/main/vcl/inc/vcl/region.hxx Tue Jul 10 12:46:09 2012 @@ -61,6 +61,7 @@ private: SAL_DLLPRIVATE void ImplCopyData(); SAL_DLLPRIVATE void ImplCreateRectRegion( const Rectangle& rRect ); SAL_DLLPRIVATE void ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly ); + SAL_DLLPRIVATE void ImplCreatePolyPolyRegion( const basegfx::B2DPolyPolygon& rPolyPoly ); SAL_DLLPRIVATE void ImplPolyPolyRegionToBandRegionFunc(); SAL_DLLPRIVATE inline void ImplPolyPolyRegionToBandRegion(); SAL_DLLPRIVATE const ImplRegion* ImplGetImplRegion() const { return mpImplRegion; } Modified: incubator/ooo/branches/AOO34/main/vcl/source/gdi/region.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/branches/AOO34/main/vcl/source/gdi/region.cxx?rev=1359641&r1=1359640&r2=1359641&view=diff ============================================================================== --- incubator/ooo/branches/AOO34/main/vcl/source/gdi/region.cxx (original) +++ incubator/ooo/branches/AOO34/main/vcl/source/gdi/region.cxx Tue Jul 10 12:46:09 2012 @@ -1136,7 +1136,7 @@ Region::Region( const basegfx::B2DPolyPo DBG_CTOR( Region, ImplDbgTestRegion ); DBG_CHKOBJ( &rPolyPoly, PolyPolygon, NULL ); - mpImplRegion = new ImplRegion( rPolyPoly ); + ImplCreatePolyPolyRegion( rPolyPoly ); } // ----------------------------------------------------------------------- @@ -1226,6 +1226,16 @@ void Region::ImplCreatePolyPolyRegion( c // ----------------------------------------------------------------------- +void Region::ImplCreatePolyPolyRegion( const basegfx::B2DPolyPolygon& rPolyPoly ) +{ + if (rPolyPoly.count()==0 || rPolyPoly.getB2DRange().isEmpty()) + mpImplRegion = (ImplRegion*)(&aImplEmptyRegion); + else + mpImplRegion = new ImplRegion( rPolyPoly ); +} + +// ----------------------------------------------------------------------- + void Region::ImplPolyPolyRegionToBandRegionFunc() { // ensure to subdivide when bezier segemnts are used, it's going to