From d928177812920d4d136374e74e45ed1267a621c1 Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sun, 15 Nov 2026 02:00:40 -0300
Subject: Replace null pointer constants in KGhostView
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Cover the KGhostView application and its Ghostgum DSC parser.

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 kghostview/dscparse/dscparse.cpp         | 343 +++++++++++++++----------------
 kghostview/dscparse/dscparse_adapter.cpp |  14 +-
 kghostview/infodialog.h                  |   2 +-
 kghostview/kdscerrordialog.cpp           |   2 +-
 kghostview/kdscerrordialog.h             |   2 +-
 kghostview/kgv_miniwidget.cpp            |  18 +-
 kghostview/kgv_miniwidget.h              |   4 +-
 kghostview/kgv_view.cpp                  |  30 +--
 kghostview/kgvconfigdialog.cpp           |   8 +-
 kghostview/kgvdocument.cpp               |  46 ++---
 kghostview/kgvdocument.h                 |   4 +-
 kghostview/kgvfactory.cpp                |   6 +-
 kghostview/kgvmainwidget.h               |   2 +-
 kghostview/kgvpagedecorator.h            |   2 +-
 kghostview/kgvpageview.cpp               |   4 +-
 kghostview/kgvpageview.h                 |   2 +-
 kghostview/kgvshell.cpp                  |   4 +-
 kghostview/kpswidget.cpp                 |   8 +-
 kghostview/kpswidget.h                   |   2 +-
 kghostview/logwindow.h                   |   2 +-
 kghostview/main.cpp                      |  10 +-
 kghostview/marklist.h                    |   2 +-
 kghostview/scrollbox.h                   |   2 +-
 kghostview/thumbnailservice.h            |   2 +-
 24 files changed, 260 insertions(+), 261 deletions(-)

diff --git a/kghostview/dscparse/dscparse.cpp b/kghostview/dscparse/dscparse.cpp
index e31b9edd..3d1a694f 100644
--- a/kghostview/dscparse/dscparse.cpp
+++ b/kghostview/dscparse/dscparse.cpp
@@ -152,55 +152,55 @@ dsc_private const int dsc_severity[] = {
 
 const CDSCMEDIA dsc_known_media[CDSC_KNOWN_MEDIA] = {
     /* These sizes taken from Ghostscript gs_statd.ps */
-    {"11x17", 792, 1224, 0, NULL, NULL, NULL},
-    {"A0", 2380, 3368, 0, NULL, NULL, NULL},
-    {"A1", 1684, 2380, 0, NULL, NULL, NULL}, 
-    {"A2", 1190, 1684, 0, NULL, NULL, NULL}, 
-    {"A3", 842, 1190, 0, NULL, NULL, NULL},
-    {"A4", 595, 842, 0, NULL, NULL, NULL},
-    {"A5", 421, 595, 0, NULL, NULL, NULL},
-    {"A6", 297, 421, 0, NULL, NULL, NULL}, 
-    {"A7", 210, 297, 0, NULL, NULL, NULL}, 
-    {"A8", 148, 210, 0, NULL, NULL, NULL}, 
-    {"A9", 105, 148, 0, NULL, NULL, NULL}, 
-    {"A10", 74, 105, 0, NULL, NULL, NULL}, 
-    {"B0", 2836, 4008, 0, NULL, NULL, NULL}, 
-    {"B1", 2004, 2836, 0, NULL, NULL, NULL}, 
-    {"B2", 1418, 2004, 0, NULL, NULL, NULL}, 
-    {"B3", 1002, 1418, 0, NULL, NULL, NULL}, 
-    {"B4", 709, 1002, 0, NULL, NULL, NULL}, /* ISO, but not Adobe standard */
-    {"B5", 501, 709, 0, NULL, NULL, NULL},  /* ISO, but not Adobe standard */
-    {"B6", 354, 501, 0, NULL, NULL, NULL}, 
-    {"C0", 2600, 3677, 0, NULL, NULL, NULL}, 
-    {"C1", 1837, 2600, 0, NULL, NULL, NULL},  
-    {"C2", 1298, 1837, 0, NULL, NULL, NULL}, 
-    {"C3", 918, 1298, 0, NULL, NULL, NULL}, 
-    {"C4", 649, 918, 0, NULL, NULL, NULL}, 
-    {"C5", 459, 649, 0, NULL, NULL, NULL}, 
-    {"C6", 323, 459, 0, NULL, NULL, NULL}, 
-    {"Ledger", 1224, 792, 0, NULL, NULL, NULL},
-    {"Legal", 612, 1008, 0, NULL, NULL, NULL},
-    {"Letter", 612, 792, 0, NULL, NULL, NULL},
-    {"Note", 612, 792, 0, NULL, NULL, NULL},
+    {"11x17", 792, 1224, 0, nullptr, nullptr, nullptr},
+    {"A0", 2380, 3368, 0, nullptr, nullptr, nullptr},
+    {"A1", 1684, 2380, 0, nullptr, nullptr, nullptr},
+    {"A2", 1190, 1684, 0, nullptr, nullptr, nullptr},
+    {"A3", 842, 1190, 0, nullptr, nullptr, nullptr},
+    {"A4", 595, 842, 0, nullptr, nullptr, nullptr},
+    {"A5", 421, 595, 0, nullptr, nullptr, nullptr},
+    {"A6", 297, 421, 0, nullptr, nullptr, nullptr},
+    {"A7", 210, 297, 0, nullptr, nullptr, nullptr},
+    {"A8", 148, 210, 0, nullptr, nullptr, nullptr},
+    {"A9", 105, 148, 0, nullptr, nullptr, nullptr},
+    {"A10", 74, 105, 0, nullptr, nullptr, nullptr},
+    {"B0", 2836, 4008, 0, nullptr, nullptr, nullptr},
+    {"B1", 2004, 2836, 0, nullptr, nullptr, nullptr},
+    {"B2", 1418, 2004, 0, nullptr, nullptr, nullptr},
+    {"B3", 1002, 1418, 0, nullptr, nullptr, nullptr},
+    {"B4", 709, 1002, 0, nullptr, nullptr, nullptr}, /* ISO, but not Adobe standard */
+    {"B5", 501, 709, 0, nullptr, nullptr, nullptr},  /* ISO, but not Adobe standard */
+    {"B6", 354, 501, 0, nullptr, nullptr, nullptr},
+    {"C0", 2600, 3677, 0, nullptr, nullptr, nullptr},
+    {"C1", 1837, 2600, 0, nullptr, nullptr, nullptr},
+    {"C2", 1298, 1837, 0, nullptr, nullptr, nullptr},
+    {"C3", 918, 1298, 0, nullptr, nullptr, nullptr},
+    {"C4", 649, 918, 0, nullptr, nullptr, nullptr},
+    {"C5", 459, 649, 0, nullptr, nullptr, nullptr},
+    {"C6", 323, 459, 0, nullptr, nullptr, nullptr},
+    {"Ledger", 1224, 792, 0, nullptr, nullptr, nullptr},
+    {"Legal", 612, 1008, 0, nullptr, nullptr, nullptr},
+    {"Letter", 612, 792, 0, nullptr, nullptr, nullptr},
+    {"Note", 612, 792, 0, nullptr, nullptr, nullptr},
 // ISO and JIS B sizes are different....
-    {"jisb0", 2916, 4128, 0, NULL, NULL, NULL},
-    {"jisb1", 2064, 2916, 0, NULL, NULL, NULL}, 
-    {"jisb2", 1458, 2064, 0, NULL, NULL, NULL}, 
-    {"jisb3", 1032, 1458, 0, NULL, NULL, NULL}, 
-    {"jisb4", 729, 1032, 0, NULL, NULL, NULL}, 
-    {"jisb5", 516, 729, 0, NULL, NULL, NULL}, 
-    {"jisb6", 363, 516, 0, NULL, NULL, NULL}, 
+    {"jisb0", 2916, 4128, 0, nullptr, nullptr, nullptr},
+    {"jisb1", 2064, 2916, 0, nullptr, nullptr, nullptr},
+    {"jisb2", 1458, 2064, 0, nullptr, nullptr, nullptr},
+    {"jisb3", 1032, 1458, 0, nullptr, nullptr, nullptr},
+    {"jisb4", 729, 1032, 0, nullptr, nullptr, nullptr},
+    {"jisb5", 516, 729, 0, nullptr, nullptr, nullptr},
+    {"jisb6", 363, 516, 0, nullptr, nullptr, nullptr},
 // U.S. CAD standard paper sizes
-    {"archE", 2592, 3456, 0, NULL, NULL, NULL}, 
-    {"archD", 1728, 2592, 0, NULL, NULL, NULL}, 
-    {"archC", 1296, 1728, 0, NULL, NULL, NULL}, 
-    {"archB", 864, 1296, 0, NULL, NULL, NULL}, 
-    {"archA", 648, 864, 0, NULL, NULL, NULL}, 
+    {"archE", 2592, 3456, 0, nullptr, nullptr, nullptr},
+    {"archD", 1728, 2592, 0, nullptr, nullptr, nullptr},
+    {"archC", 1296, 1728, 0, nullptr, nullptr, nullptr},
+    {"archB", 864, 1296, 0, nullptr, nullptr, nullptr},
+    {"archA", 648, 864, 0, nullptr, nullptr, nullptr},
 // Other paper sizes
-    {"flsa", 612, 936, 0, NULL, NULL, NULL}, /* U.S. foolscap */
-    {"flse", 612, 936, 0, NULL, NULL, NULL}, /* European foolscap */
-    {"halfletter", 396, 612, 0, NULL, NULL, NULL}, 
-    {NULL, 0, 0, 0, NULL, NULL, NULL}
+    {"flsa", 612, 936, 0, nullptr, nullptr, nullptr}, /* U.S. foolscap */
+    {"flse", 612, 936, 0, nullptr, nullptr, nullptr}, /* European foolscap */
+    {"halfletter", 396, 612, 0, nullptr, nullptr, nullptr},
+    {nullptr, 0, 0, 0, nullptr, nullptr, nullptr}
 };
 
 /* parser state */
@@ -242,8 +242,8 @@ CDSC *
 dsc_init(void *caller_data)
 {
     CDSC *dsc = (CDSC *)malloc(sizeof(CDSC));
-    if (dsc == NULL)
-	return NULL;
+    if (!dsc)
+	return nullptr;
     memset(dsc, 0, sizeof(CDSC));
     dsc->caller_data = caller_data;
 
@@ -259,8 +259,8 @@ dsc_init_with_alloc(
     void *closure_data)
 {
     CDSC *dsc = (CDSC *)memalloc(sizeof(CDSC), closure_data);
-    if (dsc == NULL)
-	return NULL;
+    if (!dsc)
+	return nullptr;
     memset(dsc, 0, sizeof(CDSC));
     dsc->caller_data = caller_data;
 
@@ -277,7 +277,7 @@ dsc_init_with_alloc(
 void 
 dsc_free(CDSC *dsc)
 {
-    if (dsc == NULL)
+    if (!dsc)
 	return;
     dsc_reset(dsc);
     dsc_memfree(dsc, dsc);
@@ -306,7 +306,7 @@ dsc_scan_data(CDSC *dsc, const char *data, int length)
     int bytes_read;
     int code = 0;
 
-    if (dsc == NULL)
+    if (!dsc)
 	return CDSC_ERROR;
 
     if (dsc->id == CDSC_NOTDSC)
@@ -446,7 +446,7 @@ dsc_fixup(CDSC *dsc)
 	return 0;
 
     /* flush last partial line */
-    dsc_scan_data(dsc, NULL, 0);
+    dsc_scan_data(dsc, nullptr, 0);
 
     /* Fix DSC error: code between %%EndSetup and %%Page */
     if (dsc->page_count && (dsc->page[0].begin != dsc->endsetup)
@@ -487,7 +487,7 @@ dsc_fixup(CDSC *dsc)
 
     /* Warnings and Errors that we can now identify */
     if ((dsc->page_count != dsc->page_pages)) {
-	int rc = dsc_error(dsc, CDSC_MESSAGE_PAGES_WRONG, NULL, 0);
+	int rc = dsc_error(dsc, CDSC_MESSAGE_PAGES_WRONG, nullptr, 0);
 	switch (rc) {
 	    case CDSC_RESPONSE_OK:
 		/* adjust incorrect page count */
@@ -500,9 +500,9 @@ dsc_fixup(CDSC *dsc)
 	}
     }
 
-    if (dsc->epsf && (dsc->bbox == (CDSCBBOX *)NULL)) {
+    if (dsc->epsf && !dsc->bbox) {
 	/* EPS files MUST include a BoundingBox */
-	int rc = dsc_error(dsc, CDSC_MESSAGE_EPS_NO_BBOX, NULL, 0);
+	int rc = dsc_error(dsc, CDSC_MESSAGE_EPS_NO_BBOX, nullptr, 0);
 	switch (rc) {
 	    case CDSC_RESPONSE_OK:
 		/* Assume that it is EPS */
@@ -516,7 +516,7 @@ dsc_fixup(CDSC *dsc)
     }
 
     if (dsc->epsf && ((dsc->page_count > 1) || (dsc->page_pages > 1))) {
-	int rc = dsc_error(dsc, CDSC_MESSAGE_EPS_PAGES, NULL, 0);
+	int rc = dsc_error(dsc, CDSC_MESSAGE_EPS_PAGES, nullptr, 0);
 	switch (rc) {
 	    case CDSC_RESPONSE_OK:
 		/* Is an EPS file */
@@ -530,14 +530,14 @@ dsc_fixup(CDSC *dsc)
 	}
     }
 
-    if ((dsc->media_count == 1) && (dsc->page_media == NULL)) {
+    if (dsc->media_count == 1 && !dsc->page_media) {
 	/* if one only media was specified, and default page media */
 	/* was not specified, assume that default is the only media. */
 	dsc->page_media = dsc->media[0];
     }
 
-    if ((dsc->media_count != 0) && (dsc->page_media == NULL)) {
-	int rc = dsc_error(dsc, CDSC_MESSAGE_NO_MEDIA, NULL, 0);
+    if (dsc->media_count != 0 && !dsc->page_media) {
+	int rc = dsc_error(dsc, CDSC_MESSAGE_NO_MEDIA, nullptr, 0);
 	switch (rc) {
 	    case CDSC_RESPONSE_OK:
 		/* default media is first listed */
@@ -555,8 +555,7 @@ dsc_fixup(CDSC *dsc)
     for (i=0; i<dsc->page_count; i++) {
 	if (strlen(dsc->page[i].label) == 0) {
 	    sprintf(buf, "%d", i+1);
-	    if ((dsc->page[i].label = dsc_alloc_string(dsc, buf, strlen(buf))) 
-		== (char *)NULL)
+	    if (!(dsc->page[i].label = dsc_alloc_string(dsc, buf, strlen(buf))))
 		return CDSC_ERROR;	/* no memory */
 	}
     }
@@ -596,15 +595,15 @@ dsc_add_page(CDSC *dsc, int ordinal, char *label)
     dsc->page[dsc->page_count].begin = 0;
     dsc->page[dsc->page_count].end = 0;
     dsc->page[dsc->page_count].orientation = CDSC_ORIENT_UNKNOWN;
-    dsc->page[dsc->page_count].media = NULL;
-    dsc->page[dsc->page_count].bbox = NULL;
-    dsc->page[dsc->page_count].viewing_orientation = NULL;
+    dsc->page[dsc->page_count].media = nullptr;
+    dsc->page[dsc->page_count].bbox = nullptr;
+    dsc->page[dsc->page_count].viewing_orientation = nullptr;
 
     dsc->page_count++;
     if (dsc->page_count >= dsc->page_chunk_length) {
 	CDSCPAGE *new_page = (CDSCPAGE *)dsc_memalloc(dsc, 
 	    (CDSC_PAGE_CHUNK+dsc->page_count) * sizeof(CDSCPAGE));
-	if (new_page == NULL)
+	if (!new_page)
 	    return CDSC_ERROR;	/* out of memory */
 	memcpy(new_page, dsc->page, 
 	    dsc->page_count * sizeof(CDSCPAGE));
@@ -626,9 +625,9 @@ dsc_add_media(CDSC *dsc, CDSCMEDIA *media)
     /* extend media array  */
     newmedia_array = (CDSCMEDIA **)dsc_memalloc(dsc, 
 	(dsc->media_count + 1) * sizeof(CDSCMEDIA *));
-    if (newmedia_array == NULL)
+    if (!newmedia_array)
 	return CDSC_ERROR;	/* out of memory */
-    if (dsc->media != NULL) {
+    if (dsc->media) {
 	memcpy(newmedia_array, dsc->media, 
 	    dsc->media_count * sizeof(CDSCMEDIA *));
 	dsc_memfree(dsc, dsc->media);
@@ -638,22 +637,22 @@ dsc_add_media(CDSC *dsc, CDSCMEDIA *media)
     /* allocate new media */
     newmedia = dsc->media[dsc->media_count] =
 	(CDSCMEDIA *)dsc_memalloc(dsc, sizeof(CDSCMEDIA));
-    if (newmedia == NULL)
+    if (!newmedia)
 	return CDSC_ERROR;	/* out of memory */
-    newmedia->name = NULL;
+    newmedia->name = nullptr;
     newmedia->width = 595.0;
     newmedia->height = 842.0;
     newmedia->weight = 80.0;
-    newmedia->colour = NULL;
-    newmedia->type = NULL;
-    newmedia->mediabox = NULL;
+    newmedia->colour = nullptr;
+    newmedia->type = nullptr;
+    newmedia->mediabox = nullptr;
 
     dsc->media_count++;
 
     if (media->name) {
 	newmedia->name = dsc_alloc_string(dsc, media->name,
 	    strlen(media->name));
-	if (newmedia->name == NULL)
+	if (!newmedia->name)
 	    return CDSC_ERROR;	/* no memory */
     }
     newmedia->width = media->width;
@@ -662,20 +661,20 @@ dsc_add_media(CDSC *dsc, CDSCMEDIA *media)
     if (media->colour) {
 	newmedia->colour = dsc_alloc_string(dsc, media->colour, 
 	    strlen(media->colour));
-        if (newmedia->colour == NULL)
+        if (!newmedia->colour)
 	    return CDSC_ERROR;	/* no memory */
     }
     if (media->type) {
 	newmedia->type = dsc_alloc_string(dsc, media->type, 
 	    strlen(media->type));
-	if (newmedia->type == NULL)
+	if (!newmedia->type)
 	    return CDSC_ERROR;	/* no memory */
     }
-    newmedia->mediabox = NULL;
+    newmedia->mediabox = nullptr;
 
     if (media->mediabox) {
 	newmedia->mediabox = (CDSCBBOX *)dsc_memalloc(dsc, sizeof(CDSCBBOX));
-	if (newmedia->mediabox == NULL)
+	if (!newmedia->mediabox)
 	    return CDSC_ERROR;	/* no memory */
 	*newmedia->mediabox = *media->mediabox;
     }
@@ -692,10 +691,10 @@ dsc_set_page_bbox(CDSC *dsc, unsigned int page_number,
     if (page_number >= dsc->page_count)
 	return CDSC_ERROR;
     bbox = dsc->page[page_number].bbox;
-    if (bbox == NULL)
+    if (!bbox)
 	dsc->page[page_number].bbox = bbox = 
 	    (CDSCBBOX *)dsc_memalloc(dsc, sizeof(CDSCBBOX));
-    if (bbox == NULL)
+    if (!bbox)
 	return CDSC_ERROR;
     bbox->llx = llx;
     bbox->lly = lly;
@@ -733,29 +732,29 @@ dsc_init2(CDSC *dsc)
     dsc_reset(dsc);
 
     dsc->string_head = (CDSCSTRING *)dsc_memalloc(dsc, sizeof(CDSCSTRING));
-    if (dsc->string_head == NULL) {
+    if (!dsc->string_head) {
 	dsc_free(dsc);
-	return NULL;	/* no memory */
+	return nullptr;	/* no memory */
     }
     dsc->string = dsc->string_head;
-    dsc->string->next = NULL;
+    dsc->string->next = nullptr;
     dsc->string->data = (char *)dsc_memalloc(dsc, CDSC_STRING_CHUNK);
-    if (dsc->string->data == NULL) {
+    if (!dsc->string->data) {
 	dsc_free(dsc);
-	return NULL;	/* no memory */
+	return nullptr;	/* no memory */
     }
     dsc->string->index = 0;
     dsc->string->length = CDSC_STRING_CHUNK;
 	
     dsc->page = (CDSCPAGE *)dsc_memalloc(dsc, CDSC_PAGE_CHUNK * sizeof(CDSCPAGE));
-    if (dsc->page == NULL) {
+    if (!dsc->page) {
 	dsc_free(dsc);
-	return NULL;	/* no memory */
+	return nullptr;	/* no memory */
     }
     dsc->page_chunk_length = CDSC_PAGE_CHUNK;
     dsc->page_count = 0;
 	
-    dsc->line = NULL;
+    dsc->line = nullptr;
     dsc->data_length = 0;
     dsc->data_index = dsc->data_length;
 
@@ -775,7 +774,7 @@ dsc_reset(CDSC *dsc)
     dsc->pdf = FALSE;
     dsc->epsf = FALSE;
     dsc->preview = CDSC_NOPREVIEW;
-    dsc->dsc_version = NULL;	/* stored in dsc->string */
+    dsc->dsc_version = nullptr;	/* stored in dsc->string */
     dsc->language_level = 0;
     dsc->document_data = CDSC_DATA_UNKNOWN;
     dsc->begincomments = 0;
@@ -802,7 +801,7 @@ dsc_reset(CDSC *dsc)
     }
     if (dsc->page)
 	dsc_memfree(dsc, dsc->page);
-    dsc->page = NULL;
+    dsc->page = nullptr;
 	
     dsc->page_count = 0;
     dsc->page_pages = 0;
@@ -810,7 +809,7 @@ dsc_reset(CDSC *dsc)
     dsc->page_orientation = CDSC_ORIENT_UNKNOWN;
     if (dsc->viewing_orientation)
 	dsc_memfree(dsc, dsc->viewing_orientation);
-    dsc->viewing_orientation = NULL;
+    dsc->viewing_orientation = nullptr;
 	
     if (dsc->media) {
 	for (i=0; i<dsc->media_count; i++) {
@@ -823,26 +822,26 @@ dsc_reset(CDSC *dsc)
 	dsc_memfree(dsc, dsc->media);
     }
     dsc->media_count = 0;
-    dsc->media = NULL;
+    dsc->media = nullptr;
 
     /* page_media is pointer to an element of media or dsc_known_media */
     /* do not free it. */
-    dsc->page_media = NULL;
+    dsc->page_media = nullptr;
 
     if (dsc->bbox)
 	dsc_memfree(dsc, dsc->bbox);
-    dsc->bbox = NULL;
+    dsc->bbox = nullptr;
     if (dsc->page_bbox)
 	dsc_memfree(dsc, dsc->page_bbox);
-    dsc->page_bbox = NULL;
+    dsc->page_bbox = nullptr;
     if (dsc->doseps)
 	dsc_memfree(dsc, dsc->doseps);
-    dsc->doseps = NULL;
+    dsc->doseps = nullptr;
 	
-    dsc->dsc_title = NULL;
-    dsc->dsc_creator = NULL;
-    dsc->dsc_date = NULL;
-    dsc->dsc_for = NULL;
+    dsc->dsc_title = nullptr;
+    dsc->dsc_creator = nullptr;
+    dsc->dsc_date = nullptr;
+    dsc->dsc_for = nullptr;
 	
 
     dsc->max_error = DSC_MAX_ERROR;
@@ -870,7 +869,7 @@ dsc_reset(CDSC *dsc)
 
     dsc->eof = 0;
 	
-    dsc->line = 0;
+    dsc->line = nullptr;
     dsc->line_length = 0;
     dsc->eol = 0;
     dsc->last_cr = FALSE;
@@ -879,25 +878,25 @@ dsc_reset(CDSC *dsc)
     memset(dsc->last_line, 0, sizeof(dsc->last_line));
 
     dsc->string = dsc->string_head;
-    while (dsc->string != (CDSCSTRING *)NULL) {
+    while (dsc->string) {
 	if (dsc->string->data)
 	    dsc_memfree(dsc, dsc->string->data);
 	dsc->string_head = dsc->string;
 	dsc->string = dsc->string->next;
 	dsc_memfree(dsc, dsc->string_head);
     }
-    dsc->string_head = NULL;
-    dsc->string = NULL;
+    dsc->string_head = nullptr;
+    dsc->string = nullptr;
 
     /* don't touch caller functions */
 
     /* public data */
     if (dsc->hires_bbox)
 	dsc_memfree(dsc, dsc->hires_bbox);
-    dsc->hires_bbox = NULL;
+    dsc->hires_bbox = nullptr;
     if (dsc->crop_box)
 	dsc_memfree(dsc, dsc->crop_box);
-    dsc->crop_box = NULL;
+    dsc->crop_box = nullptr;
 }
 
 /* 
@@ -923,7 +922,7 @@ dsc_private int
 dsc_read_line(CDSC *dsc)
 {
     char *p, *last;
-    dsc->line = NULL;
+    dsc->line = nullptr;
 
     if (dsc->eof) {
 	/* return all that remains, even if line incomplete */
@@ -1023,12 +1022,12 @@ dsc_read_line(CDSC *dsc)
             memcpy(begindata, dsc->line, num);
             begindata[num] = '\0';
 	    numberof = strtok(begindata+12, " \r\n");
-	    strtok(NULL, " \r\n");	/* dump type */
-	    bytesorlines = strtok(NULL, " \r\n");
-	    if (bytesorlines == NULL)
+	    strtok(nullptr, " \r\n");	/* dump type */
+	    bytesorlines = strtok(nullptr, " \r\n");
+	    if (!bytesorlines)
 		bytesorlines = "Bytes";
 	   
-	    if ( (numberof == NULL) || (bytesorlines == NULL) ) {
+	    if (!numberof || !bytesorlines) {
 		/* invalid usage of %%BeginData */
 		/* ignore that we ever saw it */
 		int rc = dsc_error(dsc, CDSC_MESSAGE_INCORRECT_USAGE, 
@@ -1161,7 +1160,7 @@ dsc_private int
 dsc_read_doseps(CDSC *dsc)
 {
     unsigned char *line = (unsigned char *)dsc->line;
-    if ((dsc->doseps = (CDSCDOSEPS *)dsc_memalloc(dsc, sizeof(CDSCDOSEPS))) == NULL)
+    if (!(dsc->doseps = (CDSCDOSEPS *)dsc_memalloc(dsc, sizeof(CDSCDOSEPS))))
 	return CDSC_ERROR;	/* no memory */
 	
     dsc->doseps->ps_begin = dsc_get_dword(line+4);
@@ -1290,7 +1289,7 @@ dsc_parse_bounding_box(CDSC *dsc, CDSCBBOX** pbbox, int offset)
     float fllx, flly, furx, fury;
     char *p;
     /* Process first %%BoundingBox: in comments, and last in trailer */
-    if ((*pbbox != NULL) && (dsc->scan_section == scan_comments)) {
+    if (*pbbox && dsc->scan_section == scan_comments) {
 	int rc = dsc_error(dsc, CDSC_MESSAGE_DUP_COMMENT, dsc->line, 
 		dsc->line_length);
 	switch (rc) {
@@ -1301,7 +1300,7 @@ dsc_parse_bounding_box(CDSC *dsc, CDSCBBOX** pbbox, int offset)
 		return CDSC_NOTDSC;
 	}
     }
-    if ((*pbbox != NULL) && (dsc->scan_section == scan_pages)) {
+    if (*pbbox && dsc->scan_section == scan_pages) {
 	int rc = dsc_error(dsc, CDSC_MESSAGE_DUP_COMMENT, dsc->line, 
 		dsc->line_length);
 	switch (rc) {
@@ -1312,7 +1311,7 @@ dsc_parse_bounding_box(CDSC *dsc, CDSCBBOX** pbbox, int offset)
 		return CDSC_NOTDSC;
 	}
     }
-    if ((*pbbox != NULL) && (dsc->scan_section == scan_trailer)) {
+    if (*pbbox && dsc->scan_section == scan_trailer) {
 	int rc = dsc_error(dsc, CDSC_MESSAGE_DUP_TRAILER, dsc->line, 
 		dsc->line_length);
 	switch (rc) {
@@ -1323,9 +1322,9 @@ dsc_parse_bounding_box(CDSC *dsc, CDSCBBOX** pbbox, int offset)
 		return CDSC_NOTDSC;
 	}
     }
-    if (*pbbox != NULL) {
+    if (*pbbox) {
 	dsc_memfree(dsc, *pbbox);
-	*pbbox = NULL;
+	*pbbox = nullptr;
     }
 
     /* should only process first %%BoundingBox: */
@@ -1368,7 +1367,7 @@ dsc_parse_bounding_box(CDSC *dsc, CDSCBBOX** pbbox, int offset)
 	    ury = dsc_get_int(dsc->line+n, dsc->line_length-n, &i);
 	if (i) {
 	    *pbbox = (CDSCBBOX *)dsc_memalloc(dsc, sizeof(CDSCBBOX));
-	    if (*pbbox == NULL)
+	    if (!*pbbox)
 		return CDSC_ERROR;	/* no memory */
 	    (*pbbox)->llx = llx;
 	    (*pbbox)->lly = lly;
@@ -1395,7 +1394,7 @@ dsc_parse_bounding_box(CDSC *dsc, CDSCBBOX** pbbox, int offset)
 		    fury = dsc_get_real(dsc->line+n, dsc->line_length-n, &i);
 		if (i) {
 		    *pbbox = (CDSCBBOX *)dsc_memalloc(dsc, sizeof(CDSCBBOX));
-		    if (*pbbox == NULL)
+		    if (!*pbbox)
 			return CDSC_ERROR;	/* no memory */
 			(*pbbox)->llx = (int)fllx;
 			(*pbbox)->lly = (int)flly;
@@ -1422,7 +1421,7 @@ dsc_parse_float_bounding_box(CDSC *dsc, CDSCFBBOX** pbbox, int offset)
     /* Process first %%HiResBoundingBox: or %%CropBox: in comments, 
      * and last in trailer.
      */
-    if ((*pbbox != NULL) && (dsc->scan_section == scan_comments)) {
+    if (*pbbox && dsc->scan_section == scan_comments) {
 	int rc = dsc_error(dsc, CDSC_MESSAGE_DUP_COMMENT, dsc->line, 
 		dsc->line_length);
 	switch (rc) {
@@ -1433,7 +1432,7 @@ dsc_parse_float_bounding_box(CDSC *dsc, CDSCFBBOX** pbbox, int offset)
 		return CDSC_NOTDSC;
 	}
     }
-    if ((*pbbox != NULL) && (dsc->scan_section == scan_pages)) {
+    if (*pbbox && dsc->scan_section == scan_pages) {
 	int rc = dsc_error(dsc, CDSC_MESSAGE_DUP_COMMENT, dsc->line, 
 		dsc->line_length);
 	switch (rc) {
@@ -1444,7 +1443,7 @@ dsc_parse_float_bounding_box(CDSC *dsc, CDSCFBBOX** pbbox, int offset)
 		return CDSC_NOTDSC;
 	}
     }
-    if ((*pbbox != NULL) && (dsc->scan_section == scan_trailer)) {
+    if (*pbbox && dsc->scan_section == scan_trailer) {
 	int rc = dsc_error(dsc, CDSC_MESSAGE_DUP_TRAILER, dsc->line, 
 		dsc->line_length);
 	switch (rc) {
@@ -1455,9 +1454,9 @@ dsc_parse_float_bounding_box(CDSC *dsc, CDSCFBBOX** pbbox, int offset)
 		return CDSC_NOTDSC;
 	}
     }
-    if (*pbbox != NULL) {
+    if (*pbbox) {
 	dsc_memfree(dsc, *pbbox);
-	*pbbox = NULL;
+	*pbbox = nullptr;
     }
 
     /* should only process first %%BoundingBox: */
@@ -1500,7 +1499,7 @@ dsc_parse_float_bounding_box(CDSC *dsc, CDSCFBBOX** pbbox, int offset)
 	    fury = dsc_get_real(dsc->line+n, dsc->line_length-n, &i);
 	if (i) {
 	    *pbbox = (CDSCFBBOX *)dsc_memalloc(dsc, sizeof(CDSCFBBOX));
-	    if (*pbbox == NULL)
+	    if (!*pbbox)
 		return CDSC_ERROR;	/* no memory */
 	    (*pbbox)->fllx = fllx;
 	    (*pbbox)->flly = flly;
@@ -1647,7 +1646,7 @@ dsc_parse_media(CDSC *dsc, const CDSCMEDIA **page_media)
     unsigned int i;
 
     if (dsc_copy_string(media_name, sizeof(media_name)-1,
-	dsc->line+n, dsc->line_length-n, NULL)) {
+	dsc->line+n, dsc->line_length-n, nullptr)) {
 	for (i=0; i<dsc->media_count; i++) {
 	    if (dsc->media[i]->name && 
 		(dsc_stricmp(media_name, dsc->media[i]->name) == 0)) {
@@ -1689,9 +1688,9 @@ dsc_parse_document_media(CDSC *dsc)
 	char name[MAXSTR];
 	char colour[MAXSTR];
 	char type[MAXSTR];
-	lmedia.name = lmedia.colour = lmedia.type = (char *)NULL;
+	lmedia.name = lmedia.colour = lmedia.type = (char *)nullptr;
 	lmedia.width = lmedia.height = lmedia.weight = 0;
-	lmedia.mediabox = (CDSCBBOX *)NULL;
+	lmedia.mediabox = (CDSCBBOX *)nullptr;
 	lmedia.name = dsc_copy_string(name, sizeof(name)-1,
 		dsc->line+n, dsc->line_length-n, &i);
 	n+=i;
@@ -1731,9 +1730,9 @@ dsc_parse_viewing_orientation(CDSC *dsc, CDSCCTM **pctm)
     CDSCCTM ctm;
     unsigned int i, n;
 
-    if (*pctm != NULL) {
+    if (*pctm) {
 	dsc_memfree(dsc, *pctm);
-	*pctm = NULL;
+	*pctm = nullptr;
     }
 
     n = IS_DSC(dsc->line, "%%+") ? 3 : 21;  /* %%ViewingQt::Orientation: */
@@ -1756,7 +1755,7 @@ dsc_parse_viewing_orientation(CDSC *dsc, CDSCCTM **pctm)
     }
     else {
 	*pctm = (CDSCCTM *)dsc_memalloc(dsc, sizeof(CDSCCTM));
-	if (*pctm == NULL)
+	if (!*pctm)
 	    return CDSC_ERROR;	/* no memory */
 	**pctm = ctm;
     }
@@ -1884,7 +1883,7 @@ dsc_scan_type(CDSC *dsc)
     if (COMPARE(dsc->line, "%!PS-Adobe")) {
 	dsc->dsc = TRUE;
 	dsc->begincomments = DSC_START(dsc);
-	if (dsc->dsc_version == NULL)
+	if (!dsc->dsc_version)
 	    return CDSC_ERROR;	/* no memory */
 	p = (unsigned char *)dsc->line + 14;
 	while (IS_WHITE(*p))
@@ -1972,25 +1971,25 @@ dsc_scan_comments(CDSC *dsc)
     else if (IS_DSC(line, "%%Creator:")) {
 	dsc->id = CDSC_CREATOR;
 	dsc->dsc_creator = dsc_add_line(dsc, dsc->line+10, dsc->line_length-10);
-	if (dsc->dsc_creator==NULL)
+	if (!dsc->dsc_creator)
 	    return CDSC_ERROR;
     }
     else if (IS_DSC(line, "%%CreationDate:")) {
 	dsc->id = CDSC_CREATIONDATE;
 	dsc->dsc_date = dsc_add_line(dsc, dsc->line+15, dsc->line_length-15);
-	if (dsc->dsc_date==NULL)
+	if (!dsc->dsc_date)
 	    return CDSC_ERROR;
     }
     else if (IS_DSC(line, "%%Title:")) {
 	dsc->id = CDSC_TITLE;
 	dsc->dsc_title = dsc_add_line(dsc, dsc->line+8, dsc->line_length-8);
-	if (dsc->dsc_title==NULL)
+	if (!dsc->dsc_title)
 	    return CDSC_ERROR;
     }
     else if (IS_DSC(line, "%%For:")) {
 	dsc->id = CDSC_FOR;
 	dsc->dsc_for = dsc_add_line(dsc, dsc->line+6, dsc->line_length-6);
-	if (dsc->dsc_for==NULL)
+	if (!dsc->dsc_for)
 	    return CDSC_ERROR;
     }
     else if (IS_DSC(line, "%%LanguageLevel:")) {
@@ -2062,9 +2061,9 @@ dsc_scan_comments(CDSC *dsc)
 		    lmedia.width = 595.0;
 		    lmedia.height = 842.0;
 		    lmedia.weight = 80.0;
-		    lmedia.colour = NULL;
-		    lmedia.type = NULL;
-		    lmedia.mediabox = NULL;
+		    lmedia.colour = nullptr;
+		    lmedia.type = nullptr;
+		    lmedia.mediabox = nullptr;
 		    if (dsc_add_media(dsc, &lmedia))
 			return CDSC_ERROR;
 		}
@@ -2100,13 +2099,13 @@ dsc_scan_comments(CDSC *dsc)
 		if (count >= dsc->media_count) {
 		    /* set some default values */
 		    CDSCMEDIA lmedia;
-		    lmedia.name = NULL;
+		    lmedia.name = nullptr;
 		    lmedia.width = 595.0;
 		    lmedia.height = 842.0;
 		    lmedia.weight = 80.0;
-		    lmedia.colour = NULL;
+		    lmedia.colour = nullptr;
 		    lmedia.type = p;
-		    lmedia.mediabox = NULL;
+		    lmedia.mediabox = nullptr;
 		    if (dsc_add_media(dsc, &lmedia))
 			return CDSC_ERROR;
 		}
@@ -2133,13 +2132,13 @@ dsc_scan_comments(CDSC *dsc)
 		if (count >= dsc->media_count) {
 		    /* set some default values */
 		    CDSCMEDIA lmedia;
-		    lmedia.name = NULL;
+		    lmedia.name = nullptr;
 		    lmedia.width = 595.0;
 		    lmedia.height = 842.0;
 		    lmedia.weight = 80.0;
 		    lmedia.colour = p;
-		    lmedia.type = NULL;
-		    lmedia.mediabox = NULL;
+		    lmedia.type = nullptr;
+		    lmedia.mediabox = nullptr;
 		    if (dsc_add_media(dsc, &lmedia))
 			return CDSC_ERROR;
 		}
@@ -2164,13 +2163,13 @@ dsc_scan_comments(CDSC *dsc)
 		if (count >= dsc->media_count) {
 		    /* set some default values */
 		    CDSCMEDIA lmedia;
-		    lmedia.name = NULL;
+		    lmedia.name = nullptr;
 		    lmedia.width = 595.0;
 		    lmedia.height = 842.0;
 		    lmedia.weight = w;
-		    lmedia.colour = NULL;
-		    lmedia.type = NULL;
-		    lmedia.mediabox = NULL;
+		    lmedia.colour = nullptr;
+		    lmedia.type = nullptr;
+		    lmedia.mediabox = nullptr;
 		    if (dsc_add_media(dsc, &lmedia))
 			return CDSC_ERROR;
 		}
@@ -2608,7 +2607,7 @@ dsc_scan_setup(CDSC *dsc)
 	buf[0] = '\0';
 	dsc->id = CDSC_PAPERSIZE;
 	dsc_copy_string(buf, sizeof(buf)-1, dsc->line+n, dsc->line_length-n, 
-		NULL);
+		nullptr);
  	for (i=0; i<(int)dsc->media_count; i++) {
 	    if (dsc->media[i] && dsc->media[i]->name && 
 		(dsc_stricmp(buf, dsc->media[i]->name)==0)) {
@@ -2628,7 +2627,7 @@ dsc_scan_setup(CDSC *dsc)
 		}
 		m++;
 	    }
-	    if (m->name == NULL)
+	    if (!m->name)
 		dsc_unknown(dsc);
 	}
     }
@@ -2825,7 +2824,7 @@ dsc_scan_page(CDSC *dsc)
 	char buf[MAXSTR];
 	buf[0] = '\0';
 	dsc_copy_string(buf, sizeof(buf)-1, dsc->line+n, 
-	    dsc->line_length-n, NULL);
+	    dsc->line_length-n, nullptr);
  	for (i=0; i<(int)dsc->media_count; i++) {
 	    if (dsc->media[i] && dsc->media[i]->name && 
 		(dsc_stricmp(buf, dsc->media[i]->name)==0)) {
@@ -2845,7 +2844,7 @@ dsc_scan_page(CDSC *dsc)
 		}
 		m++;
 	    }
-	    if (m->name == NULL)
+	    if (!m->name)
 		dsc_unknown(dsc);
 	}
     }
@@ -3111,16 +3110,16 @@ dsc_private char *
 dsc_alloc_string(CDSC *dsc, const char *str, int len)
 {
     char *p;
-    if (dsc->string_head == NULL) {
+    if (!dsc->string_head) {
 	dsc->string_head = (CDSCSTRING *)dsc_memalloc(dsc, sizeof(CDSCSTRING));
-	if (dsc->string_head == NULL)
-	    return NULL;	/* no memory */
+	if (!dsc->string_head)
+	    return nullptr;	/* no memory */
 	dsc->string = dsc->string_head;
-	dsc->string->next = NULL;
+	dsc->string->next = nullptr;
 	dsc->string->data = (char *)dsc_memalloc(dsc, CDSC_STRING_CHUNK);
-	if (dsc->string->data == NULL) {
+	if (!dsc->string->data) {
 	    dsc_reset(dsc);
-	    return NULL;	/* no memory */
+	    return nullptr;	/* no memory */
 	}
 	dsc->string->index = 0;
 	dsc->string->length = CDSC_STRING_CHUNK;
@@ -3128,25 +3127,25 @@ dsc_alloc_string(CDSC *dsc, const char *str, int len)
     if ( dsc->string->index + len + 1 > dsc->string->length) {
 	/* allocate another string block */
 	CDSCSTRING *newstring = (CDSCSTRING *)dsc_memalloc(dsc, sizeof(CDSCSTRING));
-	if (newstring == NULL) {
+	if (!newstring) {
 	    dsc_debug_print(dsc, "Out of memory\n");
-	    return NULL;
+	    return nullptr;
 	}
-        newstring->next = NULL;
+        newstring->next = nullptr;
 	newstring->length = 0;
 	newstring->index = 0;
 	newstring->data = (char *)dsc_memalloc(dsc, CDSC_STRING_CHUNK);
-	if (newstring->data == NULL) {
+	if (!newstring->data) {
 	    dsc_memfree(dsc, newstring);
 	    dsc_debug_print(dsc, "Out of memory\n");
-	    return NULL;	/* no memory */
+	    return nullptr;	/* no memory */
 	}
 	newstring->length = CDSC_STRING_CHUNK;
 	dsc->string->next = newstring;
 	dsc->string = newstring;
     }
     if ( dsc->string->index + len + 1 > dsc->string->length)
-	return NULL;	/* failed */
+	return nullptr;	/* failed */
     p = dsc->string->data + dsc->string->index;
     memcpy(p, str, len);
     *(p+len) = '\0';
@@ -3165,8 +3164,8 @@ dsc_add_line(CDSC *dsc, const char *line, unsigned int len)
 	line++;
     }
     newline = dsc_alloc_string(dsc, line, len);
-    if (newline == NULL)
-	return NULL;
+    if (!newline)
+	return nullptr;
 
     for (i=0; i<len; i++) {
 	if (newline[i] == '\r') {
@@ -3273,7 +3272,7 @@ dsc_copy_string(char *str, unsigned int slen, char *line,
 	newlength++;
     }
     str[newlength] = '\0';
-    if (offset != (unsigned int *)NULL)
+    if (offset)
         *offset = i;
     return str;
 }
@@ -3299,7 +3298,7 @@ dsc_get_int(const char *line, unsigned int len, unsigned int *offset)
     while ((i<len) && IS_WHITE(line[i]))
 	i++;	/* skip trailing spaces */
     newline[newlength] = '\0';
-    if (offset != (unsigned int *)NULL)
+    if (offset)
         *offset = i;
     return atoi(newline);
 }
@@ -3328,7 +3327,7 @@ dsc_get_real(const char *line, unsigned int len, unsigned int *offset)
 
     newline[newlength] = '\0';
 
-    if (offset != (unsigned int *)NULL)
+    if (offset)
         *offset = i;
     return (float)atof(newline);
 }
@@ -3358,7 +3357,7 @@ dsc_parse_page(CDSC *dsc)
 
     p = dsc->line + 7;
     pl = dsc_copy_string(page_label, sizeof(page_label)-1, p, dsc->line_length-7, &i);
-    if (pl == NULL)
+    if (!pl)
 	return CDSC_ERROR;
     p += i;
     page_ordinal = atoi(p);
@@ -3385,7 +3384,7 @@ dsc_parse_page(CDSC *dsc)
     dsc->page[page_number].begin = DSC_START(dsc);
     dsc->page[page_number].end = DSC_START(dsc);
 
-    if (dsc->page[page_number].label == NULL)
+    if (!dsc->page[page_number].label)
 	return CDSC_ERROR;	/* no memory */
 	
     return CDSC_OK;
diff --git a/kghostview/dscparse/dscparse_adapter.cpp b/kghostview/dscparse/dscparse_adapter.cpp
index 5aae47b8..b6d4c4eb 100644
--- a/kghostview/dscparse/dscparse_adapter.cpp
+++ b/kghostview/dscparse/dscparse_adapter.cpp
@@ -118,11 +118,11 @@ KDSCErrorHandler::Response KDSCOkErrorHandler::error( const KDSCError& err )
 /*-- KDSC implementation ---------------------------------------------------*/
 
 KDSC::KDSC() :
-    _errorHandler( 0 ),
-    _commentHandler( 0 )
+    _errorHandler( nullptr ),
+    _commentHandler( nullptr )
 {
     _cdsc = dsc_init( this );
-    Q_ASSERT( _cdsc != 0 );
+    Q_ASSERT( _cdsc != nullptr );
     _scanHandler = new KDSCScanHandler( _cdsc );
 }
 
@@ -336,8 +336,8 @@ KDSCErrorHandler* KDSC::errorHandler() const
 void KDSC::setErrorHandler( KDSCErrorHandler* errorHandler )
 {
     _errorHandler = errorHandler;
-    if( errorHandler == 0 )
-	dsc_set_error_function( _cdsc, 0 );
+    if( !errorHandler )
+	dsc_set_error_function( _cdsc, nullptr );
     else
 	dsc_set_error_function( _cdsc, &errorFunction );
 }
@@ -349,12 +349,12 @@ KDSCCommentHandler* KDSC::commentHandler() const
 
 void KDSC::setCommentHandler( KDSCCommentHandler* commentHandler )
 {
-    if( _commentHandler != 0 && commentHandler == 0 )
+    if( _commentHandler && !commentHandler )
     {
 	delete _scanHandler;
 	_scanHandler = new KDSCScanHandler( _cdsc );
     }
-    else if( _commentHandler == 0 && commentHandler != 0 )
+    else if( !_commentHandler && commentHandler )
     {
 	delete _scanHandler;
 	_scanHandler = new KDSCScanHandlerByLine( _cdsc, commentHandler );
diff --git a/kghostview/infodialog.h b/kghostview/infodialog.h
index 4f01dca6..91d2fa4d 100644
--- a/kghostview/infodialog.h
+++ b/kghostview/infodialog.h
@@ -30,7 +30,7 @@ class InfoDialog : public KDialogBase
   
 
   public:
-    InfoDialog( TQWidget *parent=0, const char *name=0, bool modal=true );
+    InfoDialog( TQWidget *parent=nullptr, const char *name=nullptr, bool modal=true );
     void setup( const TQString &fileName, const TQString &documentTitle,
 		const TQString &publicationDate );
 
diff --git a/kghostview/kdscerrordialog.cpp b/kghostview/kdscerrordialog.cpp
index 3bcb7c31..3f17211e 100644
--- a/kghostview/kdscerrordialog.cpp
+++ b/kghostview/kdscerrordialog.cpp
@@ -37,7 +37,7 @@ KDSCErrorThreshold::KDSCErrorThreshold( int threshold,
 
 KDSCErrorHandler::Response KDSCErrorThreshold::error( const KDSCError& err )
 {
-    if( _errorHandler != 0 && err.severity() >= _threshold )
+    if( _errorHandler && err.severity() >= _threshold )
 	return _errorHandler->error( err );
     else
 	// Cancel is the default handling strategy for dsc_error_fn, so 
diff --git a/kghostview/kdscerrordialog.h b/kghostview/kdscerrordialog.h
index a753f9d8..05300e6f 100644
--- a/kghostview/kdscerrordialog.h
+++ b/kghostview/kdscerrordialog.h
@@ -45,7 +45,7 @@ class KDSCErrorDialog : public KDialog, public KDSCErrorHandler
   
 	
 public:
-    KDSCErrorDialog( TQWidget* parent = 0 );
+    KDSCErrorDialog( TQWidget* parent = nullptr );
     
     Response error( const KDSCError& );
 
diff --git a/kghostview/kgv_miniwidget.cpp b/kghostview/kgv_miniwidget.cpp
index bad774f2..4e141813 100644
--- a/kghostview/kgv_miniwidget.cpp
+++ b/kghostview/kgv_miniwidget.cpp
@@ -46,9 +46,9 @@ using namespace KGV;
 
 KGVMiniWidget::KGVMiniWidget( KGVPart* part, const char* name ) : 
     TQObject( part, name ),
-    _document( 0 ),
+    _document( nullptr ),
     _part( part ),
-    _psWidget( 0 ),
+    _psWidget( nullptr ),
     _usePageLabels( true ),
     _visiblePage( -1 )
 {
@@ -255,7 +255,7 @@ CDSC_ORIENTATION_ENUM KGVMiniWidget::orientation() const
 	return _options.overrideOrientation();
     else if( dsc()->page_orientation() != CDSC_ORIENT_UNKNOWN )
 	return static_cast< CDSC_ORIENTATION_ENUM >( dsc()->page_orientation());
-    else if( dsc()->bbox().get() != 0 
+    else if( dsc()->bbox().get()
 	  && dsc()->bbox()->width() > dsc()->bbox()->height() )
         return CDSC_LANDSCAPE;
     else
@@ -280,7 +280,7 @@ CDSC_ORIENTATION_ENUM KGVMiniWidget::orientation( int pagenumber ) const
     if( !dsc()->epsf() ) {
 	return CDSC_PORTRAIT;
     }
-    if( dsc()->bbox().get() != 0
+    if( dsc()->bbox().get()
           && dsc()->bbox()->width() > dsc()->bbox()->height() ) {
 	return CDSC_LANDSCAPE;
     }
@@ -304,9 +304,9 @@ TQString KGVMiniWidget::pageMedia() const
 {
     if( !_options.overridePageMedia().isNull() )
 	return _options.overridePageMedia();
-    else if( dsc()->page_media() != 0 )
+    else if( dsc()->page_media() )
 	return TQString( dsc()->page_media()->name );
-    else if( dsc()->bbox().get() != 0 )
+    else if( dsc()->bbox().get() )
 	return TQString( "BoundingBox" );
     else
 	return _fallBackPageMedia;
@@ -319,11 +319,11 @@ TQString KGVMiniWidget::pageMedia( int pagenumber ) const
     if ( unsigned( pagenumber ) >= dsc()->page_count() ) return pageMedia();
     if( !_options.overridePageMedia().isNull() )
 	return _options.overridePageMedia();
-    else if( dsc()->page()[ pagenumber ].media != 0 )
+    else if( dsc()->page()[ pagenumber ].media )
 	return TQString( dsc()->page()[ pagenumber ].media->name );
-    else if( dsc()->page_media() != 0 )
+    else if( dsc()->page_media() )
 	return TQString( dsc()->page_media()->name );
-    else if( dsc()->bbox().get() != 0 )
+    else if( dsc()->bbox().get() )
 	return TQString( "BoundingBox" );
     else
 	return _fallBackPageMedia;
diff --git a/kghostview/kgv_miniwidget.h b/kghostview/kgv_miniwidget.h
index dcbcb305..b8b8c05c 100644
--- a/kghostview/kgv_miniwidget.h
+++ b/kghostview/kgv_miniwidget.h
@@ -41,7 +41,7 @@ class KGVMiniWidget : public TQObject
   
 
 public:
-    KGVMiniWidget( KGVPart* part, const char* name = 0 );
+    KGVMiniWidget( KGVPart* part, const char* name = nullptr );
 
     void setDocument( KGVDocument* document );
 
@@ -143,7 +143,7 @@ private:
     void setMagnification( double );
 
     KDSC* const dsc() const
-    { return _document ? _document->dsc() : 0; }
+    { return _document ? _document->dsc() : nullptr; }
     FILE* psFile() 
     { return document()->psFile(); }
     KGVDocument* const document() const 
diff --git a/kghostview/kgv_view.cpp b/kghostview/kgv_view.cpp
index c3a7bf6b..7bd2d365 100644
--- a/kghostview/kgv_view.cpp
+++ b/kghostview/kgv_view.cpp
@@ -79,8 +79,8 @@ KGVPart::KGVPart( TQWidget* parentWidget, const char*,
                   const TQStringList &args ) :
     KParts::ReadOnlyPart( parent, name ),
     _fitTimer( new TQTimer( this ) ),
-    _job( 0 ),
-    _mimetypeScanner( 0 ),
+    _job( nullptr ),
+    _mimetypeScanner( nullptr ),
     _dirtyHandler( new TQTimer( this ) ),
     _isGuiInitialized( false ),
     _isFileDirty( false ),
@@ -222,9 +222,9 @@ KGVPart::KGVPart( TQWidget* parentWidget, const char*,
     // TODO -- disable entry if there aren't any page names
 
     //-- View Menu ----------------------------------------------------------
-    _selectOrientation = new TDESelectAction( i18n( "&Orientation" ), 0, 0, 0,
+    _selectOrientation = new TDESelectAction( i18n( "&Orientation" ), 0, nullptr, nullptr,
                                     actionCollection(), "orientation_menu" );
-    _selectMedia       = new TDESelectAction( i18n( "Paper &Size" ), 0, 0, 0,
+    _selectMedia       = new TDESelectAction( i18n( "Paper &Size" ), 0, nullptr, nullptr,
                                     actionCollection(), "media_menu" );
 
     _flick = new TDEToggleAction( i18n( "No &Flicker" ), 0,
@@ -400,10 +400,10 @@ TDEAboutData* KGVPart::createAboutData()
                       "espen@kde.org" );
     about->addCredit( "Russell Lang of Ghostgum Software Pty Ltd",
 		      I18N_NOOP( "for contributing GSView's DSC parser." ),
-                      0,
+                      nullptr,
                       "http://www.ghostgum.com.au/" );
     about->addCredit( "The Ghostscript authors",
-                      0, 0,
+                      nullptr, nullptr,
 		      "http://www.cs.wisc.edu/~ghost/" );
     return about;
 }
@@ -420,9 +420,9 @@ bool KGVPart::closeURL()
     if ( _job )
     {
 	_job -> kill();
-	_job = 0;
+	_job = nullptr;
     }
-    if( _mimetypeScanner != 0 )
+    if( _mimetypeScanner )
 	_mimetypeScanner->abort();
     if( !m_file.isEmpty() )
         _fileWatcher->removeFile( m_file );
@@ -671,7 +671,7 @@ void KGVPart::openURLContinue()
     kdDebug(4500) << "KGVPart::openURLContinue()" << endl;
     if( m_url.isLocalFile() )
     {
-	emit started( 0 );
+	emit started( nullptr );
 	m_file = m_url.path();
 	document()->openFile( m_file, _mimetype );
     }
@@ -787,14 +787,14 @@ void KGVPart::slotMimetypeFinished( const TQString& type )
 	emit canceled( TQString() );
     else
 	openURLContinue();
-    _mimetypeScanner = 0;
+    _mimetypeScanner = nullptr;
 }
 
 void KGVPart::slotMimetypeError()
 {
     kdDebug(4500) << "KGVPart::slotMimetypeError()" << endl;
-    _mimetypeScanner = 0;
-    emit started( 0 );
+    _mimetypeScanner = nullptr;
+    emit started( nullptr );
     //tdeApp->processEvents();
     emit canceled( TQString() );
 }
@@ -805,7 +805,7 @@ void KGVPart::slotJobFinished( TDEIO::Job* job )
 
     kdDebug(4500) << "KGVPart::slotJobFinished" << endl;
 
-    _job = 0;
+    _job = nullptr;
 
     _tmpFile.close();
 
@@ -926,7 +926,7 @@ void KGVPart::slotFitToScreen()
 {
     kdDebug(4500) << "KGVPart::slotFitToScreen()" << endl;
     if ( _fitTimer->isActive() ) {
-	disconnect( _fitTimer, TQ_SIGNAL( timeout() ), this, 0 );
+	disconnect( _fitTimer, TQ_SIGNAL( timeout() ), this, nullptr );
 	connect( _fitTimer, TQ_SIGNAL( timeout() ), TQ_SLOT( slotDoFitToScreen() ) );
     }
     else slotDoFitToScreen();
@@ -1010,7 +1010,7 @@ void KGVRun::foundMimeType( const TQString& mimetype )
     {
 	TDEIO::TransferJob *job = static_cast< TDEIO::TransferJob* >( m_job );
 	job->putOnHold();
-	m_job = 0;
+	m_job = nullptr;
     }
 
     _mimetype = mimetype;
diff --git a/kghostview/kgvconfigdialog.cpp b/kghostview/kgvconfigdialog.cpp
index b1febcee..49c6efbe 100644
--- a/kghostview/kgvconfigdialog.cpp
+++ b/kghostview/kgvconfigdialog.cpp
@@ -109,7 +109,7 @@ namespace {
 	TQString version = getGSVersion( Configuration::interpreter() );
 	TQString recommended = recommendSetSafe( version );
 	if ( !recommended.isNull() ) {
-	    KMessageBox::sorry( 0,
+	    KMessageBox::sorry( nullptr,
 		    i18n( "Your version of gs (version %1) is too old, since it has security issues "
 			"which are impossible to resolve. Please upgrade to a newer version.\n"
 			"KGhostView will try to work with it, but it may not display any files at all.\n"
@@ -137,11 +137,11 @@ void  ConfigDialog::showSettings( KGVPart* main ) {
 
     if ( Configuration::redetectionCounter() < currentRedetection ) redoGSDetection();
 
-    TDEConfigDialog* dialog = new TDEConfigDialog( 0, name,
+    TDEConfigDialog* dialog = new TDEConfigDialog( nullptr, name,
 	    Configuration::self(), KDialogBase::IconList );
-    dialog->addPage( new GeneralSettingsWidget( 0, "general-settings" ),
+    dialog->addPage( new GeneralSettingsWidget( nullptr, "general-settings" ),
 	    i18n( "General" ), TQString::fromLatin1( "kghostview" ) );
-    GSSettingsWidget *gssw = new GSSettingsWidget( 0, "gs-settings" );
+    GSSettingsWidget *gssw = new GSSettingsWidget( nullptr, "gs-settings" );
     dialog->addPage( gssw, i18n( "Ghostscript\nConfiguration" ), TQString::fromLatin1( "application-pdf" ) );
 
     gssw->setDetectedVersion(Configuration::version());
diff --git a/kghostview/kgvdocument.cpp b/kghostview/kgvdocument.cpp
index 9d4e06de..5b8ace16 100644
--- a/kghostview/kgvdocument.cpp
+++ b/kghostview/kgvdocument.cpp
@@ -52,13 +52,13 @@ using namespace KGV;
 
 KGVDocument::KGVDocument( KGVPart* part, const char* name ) : 
     TQObject( part, name ),
-    _psFile( 0 ),
+    _psFile( nullptr ),
     _part( part ),
-    _tmpUnzipped( 0 ),
-    _tmpFromPDF( 0 ),
-    _tmpDSC( 0 ),
+    _tmpUnzipped( nullptr ),
+    _tmpFromPDF( nullptr ),
+    _tmpDSC( nullptr ),
     _isFileOpen( false ),
-    _dsc( 0 )
+    _dsc( nullptr )
 
 {
     readSettings();
@@ -257,7 +257,7 @@ void KGVDocument::openPSFile(const TQString &file)
     kdDebug(4500) << "KGVDocument::openPSFile (" << fileName << ")" << endl;
     
     FILE* fp = fopen( TQFile::encodeName( fileName ), "r");
-    if( fp == 0 ) 
+    if( !fp )
     {
 	KMessageBox::error( _part->widget(),
 		i18n( "<qt>Error opening file <nobr><strong>%1</strong></nobr>: %2</qt>" )
@@ -329,12 +329,12 @@ void KGVDocument::close()
     _isFileOpen = false;
 
     delete _dsc; 
-    _dsc = 0;
+    _dsc = nullptr;
 
     if( _psFile )
     {
 	fclose( _psFile );
-	_psFile = 0;
+	_psFile = nullptr;
     }
 
     clearTemporaryFiles();
@@ -389,17 +389,17 @@ void KGVDocument::clearTemporaryFiles()
     if( _tmpUnzipped ) {
 	_tmpUnzipped->setAutoDelete( true );
 	delete _tmpUnzipped;
-	_tmpUnzipped = 0;
+	_tmpUnzipped = nullptr;
     }
     if( _tmpFromPDF ) {
 	_tmpFromPDF->setAutoDelete( true );
 	delete _tmpFromPDF;
-	_tmpFromPDF = 0;
+	_tmpFromPDF = nullptr;
     }
     if( _tmpDSC ) {
 	_tmpDSC->setAutoDelete( true );
 	delete _tmpDSC;
-	_tmpDSC = 0;
+	_tmpDSC = nullptr;
     }
 }
 
@@ -429,7 +429,7 @@ TQStringList KGVDocument::mediaNames() const
 const CDSCMEDIA* KGVDocument::findMediaByName( const TQString& mediaName ) const
 {
     if( !isOpen() )
-	return 0;
+	return nullptr;
     
     if( dsc()->media() ) {
 	for( unsigned int i = 0; i < dsc()->media_count(); i++ ) {
@@ -450,7 +450,7 @@ const CDSCMEDIA* KGVDocument::findMediaByName( const TQString& mediaName ) const
 	m++;
     }
 
-    return 0;
+    return nullptr;
 }
 
 TQSize KGVDocument::computePageSize( const TQString& mediaName ) const
@@ -458,7 +458,7 @@ TQSize KGVDocument::computePageSize( const TQString& mediaName ) const
     kdDebug(4500) << "KGVDocument::computePageSize( " << mediaName << " )" << endl;
 
     if( mediaName == "BoundingBox" ) {
-	if( dsc()->bbox().get() != 0 )
+	if( dsc()->bbox().get() )
 	    return dsc()->bbox()->size();
 	else
 	    return TQSize( 0, 0 );
@@ -528,14 +528,14 @@ void KGVDocument::print()
 	    if( tf.status() == 0 ) 
 	    {
 		if ( printer.pageList().empty() ) { 
-		    KMessageBox::sorry( 0,
+		    KMessageBox::sorry( nullptr,
 			    i18n( "Printing failed because the list of "
 				"pages to be printed was empty." ),
 			    i18n( "Error Printing" ) );
 		} else if ( savePages( tf.name(), printer.pageList() ) ) {
 		    printer.printFiles( TQStringList( tf.name() ), true );
 		} else {
-		    KMessageBox::error( 0, i18n( "<qt><strong>Printing failure:</strong><br>Could not convert to PostScript</qt>" ) );
+		    KMessageBox::error( nullptr, i18n( "<qt><strong>Printing failure:</strong><br>Could not convert to PostScript</qt>" ) );
 		}
 	    }
 	    else 
@@ -566,7 +566,7 @@ void KGVDocument::saveAs()
                           TQString(), 
                           _part->widget(), 
                           TQString() );
-    if( !TDEIO::NetAccess::upload( _fileName, saveURL, 0 ) ) {
+    if( !TDEIO::NetAccess::upload( _fileName, saveURL, nullptr ) ) {
 	// TODO: Proper error dialog
     }
 }
@@ -657,7 +657,7 @@ bool KGVDocument::psCopyDoc( const TQString& inputFile,
     pages = pageList.size();
 
     if( pages == 0 ) {
-	KMessageBox::sorry( 0,
+	KMessageBox::sorry( nullptr,
 		i18n( "Printing failed because the list of "
 				"pages to be printed was empty." ),
 			  i18n( "Error Printing" ) );
@@ -676,7 +676,7 @@ bool KGVDocument::psCopyDoc( const TQString& inputFile,
 	FILE* fp = fopen( TQFile::encodeName( inputFile ), "r");
 	char buf[256];
 	int count;
-	dsc = dsc_init( 0 );
+	dsc = dsc_init( nullptr );
 	while( ( count = fread( buf, 1, sizeof( buf ), fp ) ) != 0 )
 	    dsc_scan_data( dsc, buf, count );
 	fclose( fp );
@@ -802,7 +802,7 @@ void KGVDocument::pdf2psExited( TDEProcess* process )
 
 Pdf2dsc::Pdf2dsc( const TQString& ghostscriptPath, TQObject* parent, const char* name ) :
     TQObject( parent, name ),
-    _process( 0 ),
+    _process( nullptr ),
     _ghostscriptPath( ghostscriptPath )
 {}
 
@@ -840,11 +840,11 @@ void Pdf2dsc::run( const TQString& pdfName, const TQString& dscName )
 
 void Pdf2dsc::kill()
 {
-    if( _process != 0 )
+    if( _process )
     {
 	kdDebug(4500) << "Pdf2dsc: killing current process" << endl;
 	delete _process;
-	_process = 0;
+	_process = nullptr;
     }
 }
 
@@ -854,7 +854,7 @@ void Pdf2dsc::processExited()
     
     emit finished( _process->normalExit() && _process->exitStatus() == 0 );
     delete _process;
-    _process = 0;
+    _process = nullptr;
 }
 
 #include "kgvdocument.moc"
diff --git a/kghostview/kgvdocument.h b/kghostview/kgvdocument.h
index 2de2fc69..90866b57 100644
--- a/kghostview/kgvdocument.h
+++ b/kghostview/kgvdocument.h
@@ -39,7 +39,7 @@ class KGVDocument : public TQObject
 public:
     enum Format { PS, PDF };
 
-    KGVDocument( KGVPart* part, const char* name = 0 );
+    KGVDocument( KGVPart* part, const char* name = nullptr );
     ~KGVDocument();
 
     void readSettings();
@@ -163,7 +163,7 @@ class Pdf2dsc : public TQObject
   
 	
 public:
-    Pdf2dsc( const TQString& ghostscriptPath, TQObject* parent = 0, const char* name = 0 );
+    Pdf2dsc( const TQString& ghostscriptPath, TQObject* parent = nullptr, const char* name = nullptr );
     ~Pdf2dsc();
     
     void run( const TQString& pdfName, const TQString& dscName );
diff --git a/kghostview/kgvfactory.cpp b/kghostview/kgvfactory.cpp
index 713feb4b..49120af1 100644
--- a/kghostview/kgvfactory.cpp
+++ b/kghostview/kgvfactory.cpp
@@ -37,9 +37,9 @@ KGVFactory::~KGVFactory()
 {
     delete s_aboutData;
     delete s_instance;
-    s_aboutData = 0;
-    s_instance = 0;
-    s_self = 0;
+    s_aboutData = nullptr;
+    s_instance = nullptr;
+    s_self = nullptr;
 }
 
 TDEInstance *KGVFactory::createInstance()
diff --git a/kghostview/kgvmainwidget.h b/kghostview/kgvmainwidget.h
index 78965728..cca1c142 100644
--- a/kghostview/kgvmainwidget.h
+++ b/kghostview/kgvmainwidget.h
@@ -29,7 +29,7 @@ class KGVMainWidget : public TQWidget
   
     
 public:
-    KGVMainWidget( TQWidget* parent = 0, const char* name = 0 );
+    KGVMainWidget( TQWidget* parent = nullptr, const char* name = nullptr );
 
 signals:
     void spacePressed();
diff --git a/kghostview/kgvpagedecorator.h b/kghostview/kgvpagedecorator.h
index 250c1da4..a6c95549 100644
--- a/kghostview/kgvpagedecorator.h
+++ b/kghostview/kgvpagedecorator.h
@@ -24,7 +24,7 @@
 class KGVPageDecorator : public TQHBox
 {
 public:
-    KGVPageDecorator( TQWidget* parent = 0, const char* name = 0 );
+    KGVPageDecorator( TQWidget* parent = nullptr, const char* name = nullptr );
     ~KGVPageDecorator() { ; }
 
     unsigned int margin()      const;
diff --git a/kghostview/kgvpageview.cpp b/kghostview/kgvpageview.cpp
index 10651383..0944111e 100644
--- a/kghostview/kgvpageview.cpp
+++ b/kghostview/kgvpageview.cpp
@@ -25,7 +25,7 @@
 KGVPageView::KGVPageView( TQWidget* parent, const char* name )
   : TQScrollView( parent, name )
 {
-    _page = 0;
+    _page = nullptr;
 
     setFocusPolicy( TQWidget::StrongFocus );
     viewport()->setFocusPolicy( TQWidget::WheelFocus );
@@ -33,7 +33,7 @@ KGVPageView::KGVPageView( TQWidget* parent, const char* name )
 
 void KGVPageView::setPage( TQWidget* page )
 {
-    if( page != 0 ) {
+    if( page ) {
 	addChild( page );
 	centerContents();
 	_page = page;
diff --git a/kghostview/kgvpageview.h b/kghostview/kgvpageview.h
index dadbbfe2..8ce5485d 100644
--- a/kghostview/kgvpageview.h
+++ b/kghostview/kgvpageview.h
@@ -33,7 +33,7 @@ class KGVPageView : public TQScrollView
   
 
 public:
-    KGVPageView( TQWidget* parent = 0, const char* name = 0 );
+    KGVPageView( TQWidget* parent = nullptr, const char* name = nullptr );
     ~KGVPageView() { ; }
     
     void setPage( TQWidget* );
diff --git a/kghostview/kgvshell.cpp b/kghostview/kgvshell.cpp
index 166edc39..03237d70 100644
--- a/kghostview/kgvshell.cpp
+++ b/kghostview/kgvshell.cpp
@@ -57,7 +57,7 @@
 //TODO -- don't stay open when no file, go directly to KFileDialog
 
 KGVShell::KGVShell() :
-    _tmpFile( 0 )
+    _tmpFile( nullptr )
 {
     m_gvpart = KParts::ComponentFactory::createPartInstanceFromLibrary< KGVPart >( "libkghostviewpart", this, "kgvpart",
                                                                                    this, "kgvpart" );
@@ -136,7 +136,7 @@ KGVShell::~KGVShell()
     {
 	_tmpFile->setAutoDelete( true );
 	delete _tmpFile;
-	_tmpFile = 0;
+	_tmpFile = nullptr;
     }
 
     // delete m_gvpart;
diff --git a/kghostview/kpswidget.cpp b/kghostview/kpswidget.cpp
index e89d19e3..37d717b0 100644
--- a/kghostview/kpswidget.cpp
+++ b/kghostview/kpswidget.cpp
@@ -90,8 +90,8 @@ KPSWidget::KPSWidget( TQWidget* parent, const char* name ) :
     _magnification    ( 1 ),
     _palette          ( Configuration::EnumPalette::Color ),
     _widgetDirty      ( true ),
-    _process          ( 0 ),
-    _buffer           ( 0 ),
+    _process          ( nullptr ),
+    _buffer           ( nullptr ),
     _stdinReady       ( false ),
     _interpreterBusy  ( false ),
     _interpreterReady ( false )
@@ -400,7 +400,7 @@ void KPSWidget::stopInterpreter()
     if( isInterpreterRunning() )
 	_process->kill( SIGHUP );
 
-    _process = 0;
+    _process = nullptr;
     while ( !_inputQueue.empty() ) _inputQueue.pop();
 
     _interpreterBusy = false;
@@ -424,7 +424,7 @@ void KPSWidget::slotProcessExited( TDEProcess* process )
 	} else {
 	    emit ghostscriptError( TQString( i18n( "Process killed or crashed." ) ) );
 	}
-	_process = 0;
+	_process = nullptr;
 	stopInterpreter();
 	unsetCursor();
     }
diff --git a/kghostview/kpswidget.h b/kghostview/kpswidget.h
index d1c41c25..8a2152fc 100644
--- a/kghostview/kpswidget.h
+++ b/kghostview/kpswidget.h
@@ -49,7 +49,7 @@ class KPSWidget : public TQWidget
   
 
 public:
-    KPSWidget( TQWidget* parent = 0, const char* name = 0 );
+    KPSWidget( TQWidget* parent = nullptr, const char* name = nullptr );
     ~KPSWidget();
 
     /**
diff --git a/kghostview/logwindow.h b/kghostview/logwindow.h
index daa9f03d..522f8723 100644
--- a/kghostview/logwindow.h
+++ b/kghostview/logwindow.h
@@ -32,7 +32,7 @@ class LogWindow : public KDialogBase
 
 public:
     LogWindow( const TQString& caption,
-               TQWidget* parent = 0, const char* name = 0 );
+               TQWidget* parent = nullptr, const char* name = nullptr );
 
 public slots:
     void append( const TQString& message );
diff --git a/kghostview/main.cpp b/kghostview/main.cpp
index 38a2f2e0..50e43101 100644
--- a/kghostview/main.cpp
+++ b/kghostview/main.cpp
@@ -33,13 +33,13 @@ static TDECmdLineOptions options[] =
     { "page <page-no>",   I18N_NOOP( "Page to open. Use --page=3 to show the third page, for example. Note that if the page does not exist, any other page may be displayed" ),     "1" },
     { "scale <factor>",   I18N_NOOP( "Magnification of the display" ),    "1.0" },
     { "orientation <orientation>",   I18N_NOOP( "The orientation of the shown image. Use either \"auto\", \"portrait\", \"landscape\", \"upsidedown\" or \"seascape\"" ),    "auto" },
-    { "portrait",   I18N_NOOP( "Equivalent to orientation=portrait" ), 0 },
-    { "landscape",   I18N_NOOP( "Equivalent to orientation=landscape" ), 0 },
-    { "upsidedown",   I18N_NOOP( "Equivalent to orientation=upsidedown" ), 0 },
-    { "seascape",   I18N_NOOP( "Equivalent to orientation=seascape" ), 0 },
+    { "portrait",   I18N_NOOP( "Equivalent to orientation=portrait" ), nullptr },
+    { "landscape",   I18N_NOOP( "Equivalent to orientation=landscape" ), nullptr },
+    { "upsidedown",   I18N_NOOP( "Equivalent to orientation=upsidedown" ), nullptr },
+    { "seascape",   I18N_NOOP( "Equivalent to orientation=seascape" ), nullptr },
     // { "watch",   I18N_NOOP( "Turns on watching of a file. This means that whenever the file changes while you are viewing it, kghostview automatically reloads it. This option (which can also be turned on in the menu) is especially useful if you are generating your files from latex or a similar tool." ), 0 },
     // { "page-size", I18N_NOOP( "The page size.\nUse either something like \"A4\" or you can display exact pixel size width-height" ), "auto" }
-    { "+[URL]", I18N_NOOP( "Location to open" ), 0 },
+    { "+[URL]", I18N_NOOP( "Location to open" ), nullptr },
     TDECmdLineLastOption
 };
 
diff --git a/kghostview/marklist.h b/kghostview/marklist.h
index e8b4f54c..6188289b 100644
--- a/kghostview/marklist.h
+++ b/kghostview/marklist.h
@@ -58,7 +58,7 @@ class MarkList: public TQTable
   
 
 public:
-    MarkList( TQWidget* parent = 0, const char* name = 0, KGVMiniWidget* = 0 );
+    MarkList( TQWidget* parent = nullptr, const char* name = nullptr, KGVMiniWidget* = nullptr );
 
     TQValueList<int> markList() const;
     void insertItem( const TQString& text, int index = -1,
diff --git a/kghostview/scrollbox.h b/kghostview/scrollbox.h
index fa0a4441..2e68cdb5 100644
--- a/kghostview/scrollbox.h
+++ b/kghostview/scrollbox.h
@@ -28,7 +28,7 @@ class ScrollBox: public TQFrame
   
 
 public:
-    ScrollBox( TQWidget* parent = 0, const char* name = 0 );
+    ScrollBox( TQWidget* parent = nullptr, const char* name = nullptr );
 
 public slots:
     void setPageSize( const TQSize& );
diff --git a/kghostview/thumbnailservice.h b/kghostview/thumbnailservice.h
index edc33d4a..b5331908 100644
--- a/kghostview/thumbnailservice.h
+++ b/kghostview/thumbnailservice.h
@@ -32,7 +32,7 @@ class ThumbnailService : public TQObject {
 	TQ_OBJECT
   
 	public:
-		ThumbnailService( KGVMiniWidget* parent, const char* name = 0 );
+		ThumbnailService( KGVMiniWidget* parent, const char* name = nullptr );
 		~ThumbnailService();
 
 	public slots:
-- 
cgit v1.2.3

