summaryrefslogtreecommitdiff
path: root/vcl/quartz
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-11-03 18:27:36 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-11-03 19:35:07 +0100
commit074b2e327021c0a65fedf2fe9d327029c8be7a45 (patch)
tree7990cb720f1757f54e820a7584112d5db4c87b2e /vcl/quartz
parent709d75853105e4fd7e5981a37a6dd95e7b9620ee (diff)
Still use 'graphicsPort', even if deprecated in macOS 10.14
...macOS 10.9 reportedly doesn't yet support the 'CGContext' replacement, see the comments to <https://gerrit.libreoffice.org/#/c/61353/> "loplugin:redundantcast". This reverts c3c88d6bbe4109fcf1a6d53e947faec775c96e42 "loplugin:redundantcast" (whose commit message was rather misleading; the redundantcast warnings were merely a follow-up to the commit's actual meat, of replacing deprecated uses of 'graphicsPort' with 'CGContext'; I had failed to realize that when I chunked the various changes necessary for 10.14 into several individual commits) and adds SAL_WNODEPRECATED_DECLARATIONS_PUSH/POP instead. Change-Id: I778d7c3a29c780beff561fbbcc38df9e1494114c Reviewed-on: https://gerrit.libreoffice.org/62815 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/quartz')
-rw-r--r--vcl/quartz/salgdiutils.cxx8
-rw-r--r--vcl/quartz/salvd.cxx4
2 files changed, 9 insertions, 3 deletions
diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx
index 22a2ad041f65..6ef9a2430c29 100644
--- a/vcl/quartz/salgdiutils.cxx
+++ b/vcl/quartz/salgdiutils.cxx
@@ -118,7 +118,9 @@ bool AquaSalGraphics::CheckContext()
{
const CGSize aLayerSize = { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) };
NSGraphicsContext* pNSGContext = [NSGraphicsContext graphicsContextWithWindow: mpFrame->getNSWindow()];
- CGContextRef xCGContext = [pNSGContext CGContext];
+SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'graphicsPort' is deprecated: first deprecated in macOS 10.14
+ CGContextRef xCGContext = static_cast<CGContextRef>([pNSGContext graphicsPort]);
+SAL_WNODEPRECATED_DECLARATIONS_POP
mxLayer = CGLayerCreateWithContext( xCGContext, aLayerSize, nullptr );
SAL_INFO( "vcl.cg", "CGLayerCreateWithContext(" << xCGContext << "," << aLayerSize << ",NULL) = " << mxLayer );
if( mxLayer )
@@ -192,7 +194,9 @@ void AquaSalGraphics::UpdateWindow( NSRect& )
NSGraphicsContext* pContext = [NSGraphicsContext currentContext];
if( (mxLayer != nullptr) && (pContext != nullptr) )
{
- CGContextRef rCGContext = [pContext CGContext];
+SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'graphicsPort' is deprecated: first deprecated in macOS 10.14
+ CGContextRef rCGContext = static_cast<CGContextRef>([pContext graphicsPort]);
+SAL_WNODEPRECATED_DECLARATIONS_POP
SAL_INFO( "vcl.cg", "[[NSGraphicsContext currentContext] graphicsPort] = " << rCGContext );
CGMutablePathRef rClip = mpFrame->getClipPath();
diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx
index d752a2d84acf..333276678b57 100644
--- a/vcl/quartz/salvd.cxx
+++ b/vcl/quartz/salvd.cxx
@@ -264,7 +264,9 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
NSGraphicsContext* pNSContext = [NSGraphicsContext graphicsContextWithWindow: pNSWindow];
if( pNSContext )
{
- xCGContext = [pNSContext CGContext];
+SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'graphicsPort' is deprecated: first deprecated in macOS 10.14
+ xCGContext = static_cast<CGContextRef>([pNSContext graphicsPort]);
+SAL_WNODEPRECATED_DECLARATIONS_POP
}
}
// At least on macOS 10.14 during CppunitTests (that have hidden windows), it happens