From ece0c0a5e7e0b18beb58ccd868bde54c7be64f78 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 22 Nov 2019 14:46:58 +0100 Subject: Tidy nullptr usage Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll --- src/gui/painting/qpdf.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/gui/painting/qpdf.cpp') diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index f560e1f0f0..932c3e6f5a 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -439,8 +439,8 @@ QByteArray QPdf::generateDashes(const QPen &pen) static const char* const pattern_for_brush[] = { - 0, // NoBrush - 0, // SolidPattern + nullptr, // NoBrush + nullptr, // SolidPattern "0 J\n" "6 w\n" "[] 0 d\n" @@ -637,7 +637,7 @@ static void cubicToHook(qfixed c1x, qfixed c1y, } QPdf::Stroker::Stroker() - : stream(0), + : stream(nullptr), first(true), dashStroker(&basicStroker) { @@ -652,7 +652,7 @@ QPdf::Stroker::Stroker() void QPdf::Stroker::setPen(const QPen &pen, QPainter::RenderHints hints) { if (pen.style() == Qt::NoPen) { - stroker = 0; + stroker = nullptr; return; } qreal w = pen.widthF(); @@ -1469,7 +1469,7 @@ int QPdfEngine::metric(QPaintDevice::PaintDeviceMetric metricType) const QPdfEnginePrivate::QPdfEnginePrivate() : clipEnabled(false), allClipped(false), hasPen(true), hasBrush(false), simplePen(false), pdfVersion(QPdfEngine::Version_1_4), - outDevice(0), ownsDevice(false), + outDevice(nullptr), ownsDevice(false), embedFonts(true), grayscale(false), m_pageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(10, 10, 10, 10)) @@ -1477,8 +1477,8 @@ QPdfEnginePrivate::QPdfEnginePrivate() initResources(); resolution = 1200; currentObject = 1; - currentPage = 0; - stroker.stream = 0; + currentPage = nullptr; + stroker.stream = nullptr; streampos = 0; @@ -1547,12 +1547,12 @@ bool QPdfEngine::end() qDeleteAll(d->fonts); d->fonts.clear(); delete d->currentPage; - d->currentPage = 0; + d->currentPage = nullptr; if (d->outDevice && d->ownsDevice) { d->outDevice->close(); delete d->outDevice; - d->outDevice = 0; + d->outDevice = nullptr; } setActive(false); -- cgit v1.2.3