diff options
author | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2018-04-17 18:20:41 -0700 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2018-04-19 22:20:12 +0000 |
commit | 7ee44dcb9c5c4ffaba0043d7d58e0d43ccc06195 (patch) | |
tree | 5a0e04dd7cd7b808f4885ede50339418863f169b /src/plugins/platforms/cocoa/qprintengine_mac.mm | |
parent | 48defe41e1f6fb38800675922289dd7364fad8af (diff) |
Cocoa QPA: Clean up 0 as pointer
We use nil for Objective-C null pointers and nullptr everywhere
else, including CoreFoundation and similar opaque types.
Change-Id: Id75c59413dec54bf4d8e83cf7ed0ff7f3d8bb480
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qprintengine_mac.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qprintengine_mac.mm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/platforms/cocoa/qprintengine_mac.mm b/src/plugins/platforms/cocoa/qprintengine_mac.mm index b3d48c1ec3..d34d7ddb0d 100644 --- a/src/plugins/platforms/cocoa/qprintengine_mac.mm +++ b/src/plugins/platforms/cocoa/qprintengine_mac.mm @@ -117,7 +117,7 @@ bool QMacPrintEngine::end() if (d->paintEngine->type() == QPaintEngine::CoreGraphics) { // We don't need the paint engine to call restoreGraphicsState() static_cast<QCoreGraphicsPaintEngine*>(d->paintEngine)->d_func()->stackCount = 0; - static_cast<QCoreGraphicsPaintEngine*>(d->paintEngine)->d_func()->hd = 0; + static_cast<QCoreGraphicsPaintEngine*>(d->paintEngine)->d_func()->hd = nullptr; } d->paintEngine->end(); if (d->state != QPrinter::Idle) @@ -271,7 +271,7 @@ void QMacPrintEnginePrivate::releaseSession() PMSessionEndPageNoDialog(session()); PMSessionEndDocumentNoDialog(session()); [printInfo release]; - printInfo = 0; + printInfo = nil; } bool QMacPrintEnginePrivate::newPage_helper() @@ -291,7 +291,7 @@ bool QMacPrintEnginePrivate::newPage_helper() while (cgEngine->d_func()->stackCount > 0) cgEngine->d_func()->restoreGraphicsState(); - OSStatus status = PMSessionBeginPageNoDialog(session(), format(), 0); + OSStatus status = PMSessionBeginPageNoDialog(session(), format(), nullptr); if (status != noErr) { state = QPrinter::Error; return false; @@ -318,7 +318,7 @@ bool QMacPrintEnginePrivate::newPage_helper() if (m_pageLayout.mode() != QPageLayout::FullPageMode) CGContextTranslateCTM(cgContext, page.x() - paper.x(), page.y() - paper.y()); cgEngine->d_func()->orig_xform = CGContextGetCTM(cgContext); - cgEngine->d_func()->setClip(0); + cgEngine->d_func()->setClip(nullptr); cgEngine->state->dirtyFlags = QPaintEngine::DirtyFlag(QPaintEngine::AllDirty & ~(QPaintEngine::DirtyClipEnabled | QPaintEngine::DirtyClipRegion @@ -340,7 +340,7 @@ void QMacPrintEnginePrivate::setPageSize(const QPageSize &pageSize) // Get the PMPaper and check it is valid PMPaper macPaper = m_printDevice->macPaper(usePageSize); - if (macPaper == 0) { + if (!macPaper) { qWarning() << "QMacPrintEngine: Invalid PMPaper returned for " << pageSize; return; } |