From f0580e54e08cbb1004cd353f927a828e0210de93 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Thu, 13 Jul 2006 08:54:51 +0000 Subject: INTEGRATION: CWS cowfixes01 (1.11.20); FILE MERGED 2006/03/21 13:36:26 thb 1.11.20.2: #i63310# Removed silly self-referentiality for the static default objects (causing infinite loops) 2006/03/17 23:16:35 thb 1.11.20.1: #i63310# Moved BxD(Poly)Polygon to cow_wrapper; added makeUnique() to all classes using COW internally (to at least facilitate deliberate unsharing in multi-threaded uses) --- basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx index 79cc4ecd3835..ba6130c226ad 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx @@ -4,9 +4,9 @@ * * $RCSfile: b2dpolypolygon.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: rt $ $Date: 2005-09-07 20:28:53 $ + * last change: $Author: obo $ $Date: 2006-07-13 09:54:51 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -40,6 +40,10 @@ #include #endif +#ifndef INCLUDED_O3TL_COW_WRAPPER_HXX +#include +#endif + // predeclarations class ImplB2DPolyPolygon; @@ -55,12 +59,11 @@ namespace basegfx { class B2DPolyPolygon { - private: - ImplB2DPolyPolygon* mpPolyPolygon; + public: + typedef o3tl::cow_wrapper< ImplB2DPolyPolygon > ImplType; - // internal method to force a ref-counted instance to be copied - // to a modifyable unique copy. - void implForceUniqueCopy(); + private: + ImplType mpPolyPolygon; public: B2DPolyPolygon(); @@ -71,6 +74,9 @@ namespace basegfx // assignment operator B2DPolyPolygon& operator=(const B2DPolyPolygon& rPolyPolygon); + /// unshare this poly-polygon (and all included polygons) with all internally shared instances + void makeUnique(); + // compare operators bool operator==(const B2DPolyPolygon& rPolyPolygon) const; bool operator!=(const B2DPolyPolygon& rPolyPolygon) const; -- cgit