diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2010-08-26 15:02:13 +0200 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2010-08-26 15:02:13 +0200 |
commit | 1086d8c4ec1339dc7be45e497f676d8f282360b8 (patch) | |
tree | de06207d5d0150d222f0c4ef4e6f9b3be7f35eb4 /vcl/aqua | |
parent | 38bf7f931e181e3cd9b8a1785c517f3a1f8d3512 (diff) |
impress200: #i114123# fix graphics context refcount for drawEPS
Diffstat (limited to 'vcl/aqua')
-rw-r--r-- | vcl/aqua/source/gdi/salgdi.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index 8a4744d1efcd..ca3fcc04769a 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -1453,16 +1453,24 @@ BOOL AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, // prepare the target context NSGraphicsContext* pOrigNSCtx = [NSGraphicsContext currentContext]; + [pOrigNSCtx retain]; + + // create new context NSGraphicsContext* pDrawNSCtx = [NSGraphicsContext graphicsContextWithGraphicsPort: mrContext flipped: IsFlipped()]; + // set it, setCurrentContext also releases the prviously set one [NSGraphicsContext setCurrentContext: pDrawNSCtx]; + // draw the EPS const NSRect aDstRect = {{nX,nY},{nWidth,nHeight}}; const BOOL bOK = [xEpsImage drawInRect: aDstRect]; + + // restore the NSGraphicsContext + [NSGraphicsContext setCurrentContext: pOrigNSCtx]; + [pOrigNSCtx release]; // restore the original retain count + CGContextRestoreGState( mrContext ); // mark the destination rectangle as updated RefreshRect( aDstRect ); - // restore the NSGraphicsContext, TODO: do we need this? - [NSGraphicsContext setCurrentContext: pOrigNSCtx]; return bOK; } |