diff options
author | Babak Mahbod <bmahbod@openoffice.org> | 2001-01-25 04:25:58 +0000 |
---|---|---|
committer | Babak Mahbod <bmahbod@openoffice.org> | 2001-01-25 04:25:58 +0000 |
commit | 222588f6da4a84817527e7150e4f90ce3d77c083 (patch) | |
tree | 79d4764acfe985996cb8eb606590cac73f2b5a35 | |
parent | a127eb0d4e58c6115c530ae2e9a1048b0660602d (diff) |
Destructor modified.
-rw-r--r-- | vcl/aqua/source/gdi/salgdi.cxx | 73 |
1 files changed, 33 insertions, 40 deletions
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index 8258a476894e..aebaac543f86 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -2,8 +2,8 @@ * * $RCSfile: salgdi.cxx,v $ * - * $Revision: 1.45 $ - * last change: $Author: bmahbod $ $Date: 2001-01-24 03:38:13 $ + * $Revision: 1.46 $ + * last change: $Author: bmahbod $ $Date: 2001-01-25 05:25:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1111,6 +1111,9 @@ SalGraphics::SalGraphics() SalGraphics::~SalGraphics() { + // Release memory taken up by clip region, off-screen + // graph world, and colour graph port + if ( maGraphicsData.mhClipRgn != NULL ) { DisposeRgn( maGraphicsData.mhClipRgn ); @@ -1126,6 +1129,9 @@ SalGraphics::~SalGraphics() DisposePort( maGraphicsData.mpCGrafPort ); } // if + // Initialize the rest of the fields to zero + + memset ( &maGraphicsData, 0, sizeof(SalGraphicsData) ); } // SalGraphics Class Destructor // ======================================================================= @@ -1248,50 +1254,37 @@ BOOL SalGraphics::UnionClipRegion( long nX, if ( hClipRegion != NULL ) { - SInt8 nState = noErr; + short nLeft = nX; + short nTop = nY; + short nRight = nX+nWidth; + short nBottom = nY+nHeight; - nState = HGetState( (Handle)hClipRegion ); + MacSetRectRgn ( hClipRegion, + nLeft, + nTop, + nRight, + nBottom + ); - if ( nState == noErr ) + if ( maGraphicsData.mhClipRgn != NULL ) { - HLock( (Handle)hClipRegion ); - - short nLeft = nX; - short nTop = nY; - short nRight = nX+nWidth; - short nBottom = nY+nHeight; - - MacSetRectRgn ( hClipRegion, - nLeft, - nTop, - nRight, - nBottom - ); - - if ( maGraphicsData.mhClipRgn != NULL ) - { - MacUnionRgn ( maGraphicsData.mhClipRgn, - hClipRegion, - maGraphicsData.mhClipRgn - ); - - maGraphicsData.mnOSStatus = QDErr(); + MacUnionRgn ( maGraphicsData.mhClipRgn, + hClipRegion, + maGraphicsData.mhClipRgn + ); - HSetState( (Handle)hClipRegion, nState ); - - DisposeRgn( hClipRegion ); - } // if - else - { - maGraphicsData.mhClipRgn = hClipRegion; + maGraphicsData.mnOSStatus = QDErr(); - HSetState( (Handle)hClipRegion, nState ); - } // else + DisposeRgn( hClipRegion ); + } // if + else + { + maGraphicsData.mhClipRgn = hClipRegion; + } // else - if ( maGraphicsData.mnOSStatus == noErr ) - { - bClipRegionsJoined = TRUE; - } // if + if ( maGraphicsData.mnOSStatus == noErr ) + { + bClipRegionsJoined = TRUE; } // if } // if |