From f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Fri, 15 Jun 2018 12:46:15 +0200 Subject: =?UTF-8?q?Run=20clang-tidy=E2=80=99s=20modernize-use-nullptr=20pa?= =?UTF-8?q?ss.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This replaces all NULL or 0 with nullptr when assigned to or returned as a pointer. --- src/extension/internal/pdfinput/pdf-input.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/extension/internal/pdfinput/pdf-input.cpp') diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index 552051eed..d078b5a9b 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -357,7 +357,7 @@ PdfImportDialog::PdfImportDialog(PDFDoc *doc, const gchar */*uri*/) _preview_height = 300; // Init preview - _thumb_data = NULL; + _thumb_data = nullptr; _pageNumberSpin_adj->set_value(1.0); _current_page = 1; _setPreviewPage(_current_page); @@ -594,7 +594,7 @@ void PdfImportDialog::_setPreviewPage(int page) { if (!_render_thumb) { if (_thumb_data) { gfree(_thumb_data); - _thumb_data = NULL; + _thumb_data = nullptr; } if (!_previewed_page->loadThumb(&_thumb_data, &_thumb_width, &_thumb_height, &_thumb_rowstride)) { @@ -714,7 +714,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from // glib gstdio.c GooString *filename_goo = new GooString(uri); - PDFDoc *pdf_doc = new PDFDoc(filename_goo, NULL, NULL, NULL); // TODO: Could ask for password + PDFDoc *pdf_doc = new PDFDoc(filename_goo, nullptr, nullptr, nullptr); // TODO: Could ask for password //delete filename_goo; #else wchar_t *wfilename = reinterpret_cast(g_utf8_to_utf16 (uri, -1, NULL, NULL, NULL)); @@ -754,17 +754,17 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { g_message("Failed to load document from data (error %d)", error); } - return NULL; + return nullptr; } - PdfImportDialog *dlg = NULL; + PdfImportDialog *dlg = nullptr; if (INKSCAPE.use_gui()) { dlg = new PdfImportDialog(pdf_doc, uri); if (!dlg->showDialog()) { _cancelled = true; delete dlg; delete pdf_doc; - return NULL; + return nullptr; } } @@ -779,12 +779,12 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { #endif } - SPDocument *doc = NULL; + SPDocument *doc = nullptr; bool saved = false; if(!is_importvia_poppler) { // native importer - doc = SPDocument::createNewDoc(NULL, TRUE, TRUE); + doc = SPDocument::createNewDoc(nullptr, TRUE, TRUE); saved = DocumentUndo::getUndoSensitive(doc); DocumentUndo::setUndoSensitive(doc, false); // No need to undo in this temporary document @@ -802,7 +802,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { dlg->getImportSettings(prefs); // Apply crop settings - PDFRectangle *clipToBox = NULL; + PDFRectangle *clipToBox = nullptr; double crop_setting; sp_repr_get_double(prefs, "cropTo", &crop_setting); -- cgit v1.2.3