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

KDVI and KViewShell share the multipage viewer infrastructure.

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 kdvi/TeXFontDefinition.cpp                         | 48 +++++++-------
 kdvi/TeXFont_PFB.cpp                               | 12 ++--
 kdvi/TeXFont_PFB.h                                 |  2 +-
 kdvi/TeXFont_PK.cpp                                | 16 ++---
 kdvi/dviFile.cpp                                   | 18 +++---
 kdvi/dviRenderer.cpp                               | 74 +++++++++++-----------
 kdvi/dviRenderer.h                                 |  2 +-
 kdvi/dviRenderer_draw.cpp                          | 48 +++++++-------
 kdvi/dviRenderer_export.cpp                        | 52 +++++++--------
 kdvi/dviRenderer_prescan.cpp                       | 12 ++--
 kdvi/dviWidget.cpp                                 |  4 +-
 kdvi/fontEncodingPool.cpp                          |  4 +-
 kdvi/fontpool.cpp                                  | 38 +++++------
 kdvi/fontpool.h                                    |  2 +-
 kdvi/fontprogress.cpp                              |  8 +--
 kdvi/fontprogress.h                                |  4 +-
 kdvi/infodialog.cpp                                |  2 +-
 kdvi/infodialog.h                                  |  2 +-
 kdvi/kdvi_multipage.cpp                            | 14 ++--
 kdvi/kdvi_multipage_texthandling.cpp               |  4 +-
 kdvi/main.cpp                                      | 10 +--
 kdvi/optionDialogFontsWidget.h                     |  2 +-
 kdvi/optionDialogSpecialWidget.h                   |  2 +-
 kdvi/psgs.cpp                                      | 22 +++----
 kdvi/special.cpp                                   | 12 ++--
 kdvi/util.cpp                                      |  2 +-
 kdvi/vf.cpp                                        | 10 +--
 kviewshell/documentPageCache.cpp                   | 10 +--
 kviewshell/documentWidget.cpp                      | 22 +++----
 kviewshell/history.cpp                             |  4 +-
 kviewshell/kprintDialogPage_pageoptions.cpp        | 38 +++++------
 kviewshell/kprintDialogPage_pageoptions.h          |  2 +-
 kviewshell/kviewpart.cpp                           | 46 +++++++-------
 kviewshell/main.cpp                                | 14 ++--
 kviewshell/marklist.cpp                            |  8 +--
 kviewshell/marklist.h                              |  2 +-
 kviewshell/pageSize.cpp                            |  8 +--
 kviewshell/pageSizeDialog.cpp                      |  6 +-
 kviewshell/pageSizeDialog.h                        |  2 +-
 kviewshell/pageSizeWidget.h                        |  2 +-
 kviewshell/pageView.cpp                            | 20 +++---
 kviewshell/pageView.h                              |  4 +-
 kviewshell/plugins/djvu/djvumultipage.cpp          | 10 +--
 kviewshell/plugins/djvu/djvurenderer.cpp           | 22 +++----
 .../kprintDialogPage_DJVUconversionoptions.cpp     |  8 +--
 .../djvu/kprintDialogPage_DJVUconversionoptions.h  |  2 +-
 .../djvu/kprintDialogPage_DJVUpageoptions.cpp      | 20 +++---
 .../djvu/kprintDialogPage_DJVUpageoptions.h        |  2 +-
 kviewshell/plugins/djvu/pageRangeWidget.cpp        |  2 +-
 kviewshell/plugins/djvu/pageRangeWidget.h          |  6 +-
 kviewshell/renderedDocumentPagePixmap.cpp          |  4 +-
 kviewshell/renderedDocumentPagePrinter.cpp         |  6 +-
 kviewshell/searchWidget.h                          |  2 +-
 kviewshell/sizePreview.h                           |  2 +-
 kviewshell/tableOfContents.h                       |  2 +-
 kviewshell/tdemultipage.cpp                        | 54 ++++++++--------
 kviewshell/units.cpp                               |  4 +-
 kviewshell/units.h                                 |  2 +-
 58 files changed, 381 insertions(+), 381 deletions(-)

diff --git a/kdvi/TeXFontDefinition.cpp b/kdvi/TeXFontDefinition.cpp
index 58d21f1b..7162b78d 100644
--- a/kdvi/TeXFontDefinition.cpp
+++ b/kdvi/TeXFontDefinition.cpp
@@ -41,15 +41,15 @@ TeXFontDefinition::TeXFontDefinition(TQString nfontname, double _displayResoluti
   enlargement              = _enlargement;
   font_pool                = pool;
   fontname                 = nfontname;
-  font                     = 0;
+  font                     = nullptr;
   displayResolution_in_dpi = _displayResolution_in_dpi;
   checksum                 = chk;
   flags                    = TeXFontDefinition::FONT_IN_USE;
-  file                     = 0; 
+  file                     = nullptr;
   filename                 = TQString();
   scaled_size_in_DVI_units = _scaled_size_in_DVI_units;
   
-  macrotable               = 0;
+  macrotable               = nullptr;
   
   // By default, this font contains only empty characters. After the
   // font has been loaded, this function pointer will be replaced by
@@ -64,19 +64,19 @@ TeXFontDefinition::~TeXFontDefinition()
   kdDebug(4300) << "discarding font " << fontname << " at " << (int)(enlargement * MFResolutions[font_pool->getMetafontMode()] + 0.5) << " dpi" << endl;
 #endif
   
-  if (font != 0) {
+  if (font) {
     delete font;
-    font = 0;
+    font = nullptr;
   }
-  if (macrotable != 0) {
+  if (macrotable) {
     delete [] macrotable;
-    macrotable = 0;
+    macrotable = nullptr;
   }
 
   if (flags & FONT_LOADED) {
-    if (file != 0) {
+    if (file) {
       fclose(file);
-      file = 0;
+      file = nullptr;
     }
     if (flags & FONT_VIRTUAL)
       vf_table.clear();
@@ -101,10 +101,10 @@ void TeXFontDefinition::fontNameReceiver(const TQString& fname)
   // Check if the file could be opened. If not, try to find the file
   // in the DVI file's directory. If that works, modify the filename
   // accordingly and go on.
-  if (file == 0) {
+  if (!file) {
     TQString filename_test(font_pool->getExtraSearchPath() + "/" + filename);
     file = fopen( TQFile::encodeName(filename_test), "r");
-    if (file == 0) {
+    if (!file) {
       kdError(4300) << i18n("Cannot find font %1, file %2.").arg(fontname).arg(filename) << endl;
       return;
     } else
@@ -117,7 +117,7 @@ void TeXFontDefinition::fontNameReceiver(const TQString& fname)
   if (fname.endsWith("pk"))
     if (magic == PK_MAGIC) {
       fclose(file);
-      file = 0;
+      file = nullptr;
       font = new TeXFont_PK(this);
       set_char_p = &dviRenderer::set_char;
       if ((checksum != 0) && (checksum != font->checksum)) 
@@ -136,7 +136,7 @@ void TeXFontDefinition::fontNameReceiver(const TQString& fname)
 
   if (fname.endsWith(".tfm")) {
       fclose(file);
-      file = 0;
+      file = nullptr;
       font = new TeXFont_TFM(this);
       set_char_p = &dviRenderer::set_char;
       fontTypeName = i18n("TeX Font Metric");
@@ -146,7 +146,7 @@ void TeXFontDefinition::fontNameReceiver(const TQString& fname)
   // None of these known types? Then it should be one of the font
   // formats that are handled by the FreeType library
   fclose(file);
-  file = 0;
+  file = nullptr;
 #ifdef HAVE_FREETYPE
   // Find the encoding for that font
   const TQString &enc = font_pool->fontsByTeXName.findEncoding(fontname);
@@ -176,20 +176,20 @@ void TeXFontDefinition::fontNameReceiver(const TQString& fname)
 
 void TeXFontDefinition::reset()
 {
-  if (font != 0) {
+  if (font) {
     delete font;
-    font = 0;
+    font = nullptr;
   }
 
-  if (macrotable != 0) {
+  if (macrotable) {
     delete [] macrotable;
-    macrotable = 0;
+    macrotable = nullptr;
   }
   
   if (flags & FONT_LOADED) {
-    if (file != 0) {
+    if (file) {
       fclose(file);
-      file = 0;
+      file = nullptr;
     }
     if (flags & FONT_VIRTUAL)
       vf_table.clear();
@@ -204,7 +204,7 @@ void TeXFontDefinition::reset()
 void TeXFontDefinition::setDisplayResolution(double _displayResolution_in_dpi)
 {
   displayResolution_in_dpi = _displayResolution_in_dpi;
-  if (font != 0)
+  if (font)
     font->setDisplayResolution();
 }
 
@@ -236,8 +236,8 @@ void TeXFontDefinition::mark_as_used()
 
 macro::macro()
 {
-  pos     = 0;		/* address of first byte of macro */
-  end     = 0;		/* address of last+1 byte */
+  pos     = nullptr;		/* address of first byte of macro */
+  end     = nullptr;		/* address of last+1 byte */
   dvi_advance_in_units_of_design_size_by_2e20 = 0;	/* DVI units to move reference point */
   free_me = false;
 }
@@ -245,6 +245,6 @@ macro::macro()
 
 macro::~macro()
 {
-  if ((pos != 0L) && (free_me == true))
+  if (pos && free_me)
     delete [] pos;
 }
diff --git a/kdvi/TeXFont_PFB.cpp b/kdvi/TeXFont_PFB.cpp
index a8d55c48..af2f2e2b 100644
--- a/kdvi/TeXFont_PFB.cpp
+++ b/kdvi/TeXFont_PFB.cpp
@@ -62,10 +62,10 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
     transformationMatrix.yx = 0;
     transformationMatrix.yy = 0x10000;
     
-    FT_Set_Transform( face, &transformationMatrix, 0);
+    FT_Set_Transform( face, &transformationMatrix, nullptr);
   }
   
-  if (face->family_name != 0)
+  if (face->family_name)
     parent->fullFontName = face->family_name;
 
   // Finally, we need to set up the charMap array, which maps TeX
@@ -73,7 +73,7 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
   // charMap, and the font encoding procedure is necessary, because
   // TeX is only able to address character codes 0-255 while
   // e.g. Type1 fonts may contain several thousands of characters)
-  if (enc != 0) {
+  if (enc) {
     parent->fullEncodingName = enc->encodingFullName.remove(TQString::fromLatin1( "Encoding" ));
     parent->fullEncodingName = enc->encodingFullName.remove(TQString::fromLatin1( "encoding" ));
 
@@ -94,7 +94,7 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
     // If there is no encoding vector available, we check if the font
     // itself contains a charmap that could be used. An admissible
     // charMap will be stored under platform_id=7 and encoding_id=2.
-    FT_CharMap  found = 0;
+    FT_CharMap  found = nullptr;
     for (int n = 0; n<face->num_charmaps; n++ ) {
       FT_CharMap charmap = face->charmaps[n];
       if ( charmap->platform_id == 7 && charmap->encoding_id == 2 ) {
@@ -103,7 +103,7 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
       }
     }
     
-    if ((found != 0) && (FT_Set_Charmap( face, found ) == 0)) {
+    if (found && (FT_Set_Charmap( face, found ) == 0)) {
       // Feed the charMap array with the charmap data found in the
       // previous step.
 #ifdef DEBUG_PFB
@@ -112,7 +112,7 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
       for(int i=0; i<256; i++) 
 	charMap[i] = FT_Get_Char_Index( face, i );
     } else {
-      if ((found == 0) && (face->charmap != 0)) {
+      if (!found && face->charmap) {
 #ifdef DEBUG_PFB
 	kdDebug(4300) << "No encoding given: using charmap platform=" << face->charmap->platform_id <<
 	  ", encoding=" << face->charmap->encoding_id << " that is contained in the font." << endl;
diff --git a/kdvi/TeXFont_PFB.h b/kdvi/TeXFont_PFB.h
index 4c3c2a7b..297e7c90 100644
--- a/kdvi/TeXFont_PFB.h
+++ b/kdvi/TeXFont_PFB.h
@@ -22,7 +22,7 @@ class glyph;
 
 class TeXFont_PFB : public TeXFont {
  public:
-  TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc=0, double slant=0.0 );
+  TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc=nullptr, double slant=0.0 );
   ~TeXFont_PFB();
   
   glyph* getGlyph(TQ_UINT16 character, bool generateCharacterPixmap=false, const TQColor& color=TQt::black);
diff --git a/kdvi/TeXFont_PK.cpp b/kdvi/TeXFont_PK.cpp
index f84375cc..d677603f 100644
--- a/kdvi/TeXFont_PK.cpp
+++ b/kdvi/TeXFont_PK.cpp
@@ -88,9 +88,9 @@ TeXFont_PK::TeXFont_PK(TeXFontDefinition *parent)
 #endif
 
   for(unsigned int i=0; i<TeXFontDefinition::max_num_of_chars_in_font; i++)
-    characterBitmaps[i] = 0;
+    characterBitmaps[i] = nullptr;
   file = fopen(TQFile::encodeName(parent->filename), "r");
-  if (file == 0) 
+  if (!file)
     kdError(4300) << i18n("Cannot open font file %1.").arg(parent->filename) << endl;
 #ifdef DEBUG_PK
   else
@@ -109,9 +109,9 @@ TeXFont_PK::~TeXFont_PK()
 {
   //@@@ Release bitmaps
 
-  if (file != 0) {
+  if (file) {
     fclose(file);
-    file = 0;
+    file = nullptr;
   }
 }
 
@@ -132,7 +132,7 @@ glyph* TeXFont_PK::getGlyph(TQ_UINT16 ch, bool generateCharacterPixmap, const TQ
   struct glyph *g = glyphtable+ch;
 
   // Check if the glyph is loaded. If not, load it now.
-  if (characterBitmaps[ch] == 0) {
+  if (!characterBitmaps[ch]) {
     // If the character is not defined in the PK file, mark the
     // character as missing, and print an error message
     if (g->addr == 0) {
@@ -151,7 +151,7 @@ glyph* TeXFont_PK::getGlyph(TQ_UINT16 ch, bool generateCharacterPixmap, const TQ
     read_PK_char(ch);
     // Check if the character could be loaded. If not, mark the
     // character as 'missing', and return a pointer.
-    if (characterBitmaps[ch]->bits == 0) {
+    if (!characterBitmaps[ch]->bits) {
       g->addr = -1;
       return g;
     }
@@ -502,7 +502,7 @@ void TeXFont_PK::read_PK_char(unsigned int ch)
   kdDebug(4300) << "loading pk char " << ch << ", char type " << n << endl;
 #endif
 
-  if (characterBitmaps[ch] == 0)
+  if (!characterBitmaps[ch])
     characterBitmaps[ch] = new bitmap();
   
   /*
@@ -726,7 +726,7 @@ void TeXFont_PK::read_PK_index()
   kdDebug(4300) << "TeXFont_PK::read_PK_index() called" << endl;
 #endif
 
-  if (file == 0) {
+  if (!file) {
     kdError(4300) << "TeXFont_PK::read_PK_index(): file == 0" << endl;
     return;
   }
diff --git a/kdvi/dviFile.cpp b/kdvi/dviFile.cpp
index c9c8db92..c0064f58 100644
--- a/kdvi/dviFile.cpp
+++ b/kdvi/dviFile.cpp
@@ -74,7 +74,7 @@ dvifile::dvifile(const dvifile *old, fontPool *fp)
   errorMsg     = TQString();
   errorCounter = 0;
   page_offset  = 0;
-  suggestedPageSize = 0;
+  suggestedPageSize = nullptr;
   numberOfExternalPSFiles = 0;
   numberOfExternalNONPSFiles = 0;
   sourceSpecialMarker = old->sourceSpecialMarker;
@@ -84,7 +84,7 @@ dvifile::dvifile(const dvifile *old, fontPool *fp)
   filename = old->filename;
   size_of_file = old->size_of_file;
   end_pointer = dvi_Data()+size_of_file; 
-  if (dvi_Data() == 0) {
+  if (!dvi_Data()) {
     kdError(4300) << "Not enough memory to copy the DVI-file." << endl;
     return;
   }
@@ -205,7 +205,7 @@ void dvifile::read_postamble()
     // shall be enlarged by the following factor before it is used.
     double enlargement_factor = (double(scale) * double(_magnification))/(double(design) * 1000.0);
     
-    if (font_pool != 0) {
+    if (font_pool) {
       TeXFontDefinition *fontp = font_pool->appendx(fontname, checksum, scale, enlargement_factor);
       
       // Insert font in dictionary and make sure the dictionary is big
@@ -228,7 +228,7 @@ void dvifile::read_postamble()
 
   // Now we remove all those fonts from the memory which are no longer
   // in use.
-  if (font_pool != 0)
+  if (font_pool)
     font_pool->release_fonts();
 }
 
@@ -276,7 +276,7 @@ dvifile::dvifile(const TQString& fname, fontPool* pool)
   errorMsg     = TQString();
   errorCounter = 0;
   page_offset  = 0;
-  suggestedPageSize = 0;
+  suggestedPageSize = nullptr;
   numberOfExternalPSFiles = 0;
   numberOfExternalNONPSFiles = 0;
   font_pool    = pool;
@@ -290,7 +290,7 @@ dvifile::dvifile(const TQString& fname, fontPool* pool)
   // Sets the end pointer for the bigEndianByteReader so that the
   // whole memory buffer is readable
   end_pointer = dvi_Data()+size_of_file; 
-  if (dvi_Data() == 0) {
+  if (!dvi_Data()) {
     kdError() << i18n("Not enough memory to load the DVI-file.");
     return;
   }
@@ -323,9 +323,9 @@ dvifile::~dvifile()
   for ( it = convertedFiles.begin(); it != convertedFiles.end(); ++it ) 
     TQFile::remove(it.data());
 
-  if (suggestedPageSize != 0)
+  if (suggestedPageSize)
     delete suggestedPageSize;
-  if (font_pool != 0)
+  if (font_pool)
     font_pool->mark_fonts_as_unused();
 }
 
@@ -393,7 +393,7 @@ TQString dvifile::convertPDFtoPS(const TQString &PDFFilename)
 
 bool dvifile::saveAs(const TQString &filename)
 {
-  if (dvi_Data() == 0)
+  if (!dvi_Data())
     return false;
 
   TQFile out(filename);
diff --git a/kdvi/dviRenderer.cpp b/kdvi/dviRenderer.cpp
index 67013f82..4bb25311 100644
--- a/kdvi/dviRenderer.cpp
+++ b/kdvi/dviRenderer.cpp
@@ -75,7 +75,7 @@ dviRenderer::dviRenderer(TQWidget *par)
 #endif
 
   // initialize the dvi machinery
-  dviFile                = 0;
+  dviFile                = nullptr;
 
   connect(&font_pool, TQ_SIGNAL( setStatusBarText( const TQString& ) ), this, TQ_SIGNAL( setStatusBarText( const TQString& ) ) );
 
@@ -86,17 +86,17 @@ dviRenderer::dviRenderer(TQWidget *par)
 
   connect( &clearStatusBarTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(clearStatusBar()) );
 
-  currentlyDrawnPage = 0;
+  currentlyDrawnPage = nullptr;
   editorCommand         = "";
 
-  PostScriptOutPutString = NULL;
-  HTML_href              = NULL;
+  PostScriptOutPutString = nullptr;
+  HTML_href              = nullptr;
   _postscript            = 0;
 
   // Storage used for dvips and friends, i.e. for the "export" functions.
-  proc                   = 0;
-  progress               = 0;
-  export_printer         = 0;
+  proc                   = nullptr;
+  progress               = nullptr;
+  export_printer         = nullptr;
   export_fileName        = "";
   export_tmpFileName     = "";
   export_errorString     = "";
@@ -121,7 +121,7 @@ dviRenderer::~dviRenderer()
   delete dviFile;
   // Don't delete the export printer. This is owned by the
   // kdvi_multipage.
-  export_printer = 0;
+  export_printer = nullptr;
 }
 
 
@@ -154,7 +154,7 @@ void dviRenderer::drawPage(double resolution, RenderedDocumentPage *page)
 #endif
   
   // Paranoid safety checks
-  if (page == 0) {
+  if (!page) {
     kdError(4300) << "dviRenderer::drawPage(documentPage *) called with argument == 0" << endl; 
     return;
   }
@@ -164,7 +164,7 @@ void dviRenderer::drawPage(double resolution, RenderedDocumentPage *page)
   }
 
   mutex.lock();
-  if ( dviFile == 0 ) {
+  if ( !dviFile ) {
     kdError(4300) << "dviRenderer::drawPage(documentPage *) called, but no dviFile class allocated." << endl;
     page->clear();
     mutex.unlock();
@@ -176,7 +176,7 @@ void dviRenderer::drawPage(double resolution, RenderedDocumentPage *page)
     mutex.unlock();
     return;
   }
-  if ( dviFile->dvi_Data() == 0 ) {
+  if ( !dviFile->dvi_Data() ) {
     kdError(4300) << "dviRenderer::drawPage(documentPage *) called, but no dviFile is loaded yet." << endl;
     page->clear();
     mutex.unlock();
@@ -197,7 +197,7 @@ void dviRenderer::drawPage(double resolution, RenderedDocumentPage *page)
 
   TQApplication::setOverrideCursor( waitCursor );
   foreGroundPainter = page->getPainter();
-  if (foreGroundPainter != 0) {
+  if (foreGroundPainter) {
     errorMsg = TQString();
     draw_page();
     page->returnPainter(foreGroundPainter);
@@ -211,7 +211,7 @@ void dviRenderer::drawPage(double resolution, RenderedDocumentPage *page)
 				    "likely this means that the DVI file is broken.</qt>"),
 			       errorMsg, i18n("DVI File Error"));
     errorMsg = TQString();
-    currentlyDrawnPage = 0;
+    currentlyDrawnPage = nullptr;
     mutex.unlock();
     return;
   }
@@ -229,7 +229,7 @@ void dviRenderer::drawPage(double resolution, RenderedDocumentPage *page)
     }
   }
   
-  currentlyDrawnPage = 0;
+  currentlyDrawnPage = nullptr;
   mutex.unlock();
 }
 
@@ -330,11 +330,11 @@ void dviRenderer::embedPostScript()
       command_pointer = dviFile->dvi_Data() + dviFile->page_offset[current_page];
       end_pointer     = dviFile->dvi_Data() + dviFile->page_offset[current_page+1];
     } else
-      command_pointer = end_pointer = 0;
+      command_pointer = end_pointer = nullptr;
 
     memset((char *) &currinf.data, 0, sizeof(currinf.data));
     currinf.fonttable = &(dviFile->tn_table);
-    currinf._virtual  = NULL;
+    currinf._virtual  = nullptr;
     prescan(&dviRenderer::prescan_embedPS);
   }
 
@@ -364,11 +364,11 @@ void dviRenderer::embedPostScript()
       command_pointer = dviFile->dvi_Data() + dviFile->page_offset[current_page];
       end_pointer     = dviFile->dvi_Data() + dviFile->page_offset[current_page+1];
     } else
-      command_pointer = end_pointer = 0;
+      command_pointer = end_pointer = nullptr;
 
     memset((char *) &currinf.data, 0, sizeof(currinf.data));
     currinf.fonttable = &(dviFile->tn_table);
-    currinf._virtual  = NULL;
+    currinf._virtual  = nullptr;
 
     prescan(&dviRenderer::prescan_parseSpecials);
 
@@ -376,7 +376,7 @@ void dviRenderer::embedPostScript()
       PS_interface->setPostScript(current_page, *PostScriptOutPutString);
     delete PostScriptOutPutString;
   }
-  PostScriptOutPutString = NULL;
+  PostScriptOutPutString = nullptr;
 
 
 #ifdef PERFORMANCE_MEASUREMENT
@@ -426,9 +426,9 @@ bool dviRenderer::setFile(const TQString &fname, const KURL &base)
   // the dvifile and the pixmap.
   if (fname.isEmpty()) {
     // Delete DVI file
-    info->setDVIData(0);
+    info->setDVIData(nullptr);
     delete dviFile;
-    dviFile = 0;
+    dviFile = nullptr;
     return true;
   }
   
@@ -469,12 +469,12 @@ bool dviRenderer::setFile(const TQString &fname, const KURL &base)
   TQApplication::setOverrideCursor( waitCursor );
   dvifile *dviFile_new = new dvifile(filename, &font_pool);
   
-  if ((dviFile == 0) || (dviFile->filename != filename))
+  if (!dviFile || dviFile->filename != filename)
     dviFile_new->sourceSpecialMarker = true;
   else
     dviFile_new->sourceSpecialMarker = false;
   
-  if ((dviFile_new->dvi_Data() == NULL)||(dviFile_new->errorMsg.isEmpty() != true)) {
+  if (!dviFile_new->dvi_Data() || (dviFile_new->errorMsg.isEmpty() != true)) {
     TQApplication::restoreOverrideCursor();
     if (dviFile_new->errorMsg.isEmpty() != true)
       KMessageBox::detailedError(parentWidget,
@@ -525,7 +525,7 @@ bool dviRenderer::setFile(const TQString &fname, const KURL &base)
   font_pool.locateFonts();
   
   // Update the list of fonts in the info window
-  if (info != 0)
+  if (info)
     info->setFontInfo(&font_pool);
   
   // We should pre-scan the document now (to extract embedded,
@@ -548,18 +548,18 @@ bool dviRenderer::setFile(const TQString &fname, const KURL &base)
       command_pointer = dviFile->dvi_Data() + dviFile->page_offset[current_page];
       end_pointer     = dviFile->dvi_Data() + dviFile->page_offset[current_page+1];
     } else
-      command_pointer = end_pointer = 0;
+      command_pointer = end_pointer = nullptr;
     
     memset((char *) &currinf.data, 0, sizeof(currinf.data));
     currinf.fonttable = &(dviFile->tn_table);
-    currinf._virtual  = NULL;
+    currinf._virtual  = nullptr;
     prescan(&dviRenderer::prescan_parseSpecials);
     
     if (!PostScriptOutPutString->isEmpty())
       PS_interface->setPostScript(current_page, *PostScriptOutPutString);
     delete PostScriptOutPutString;
   }
-  PostScriptOutPutString = NULL;
+  PostScriptOutPutString = nullptr;
   
   // Generate the list of bookmarks
   bookmarks.clear();
@@ -588,7 +588,7 @@ bool dviRenderer::setFile(const TQString &fname, const KURL &base)
   
   
   pageSizes.resize(0);
-  if (dviFile->suggestedPageSize != 0) {
+  if (dviFile->suggestedPageSize) {
     // Fill the vector pageSizes with total_pages identical entries
     pageSizes.resize(dviFile->total_pages, *(dviFile->suggestedPageSize));
   }
@@ -606,7 +606,7 @@ Anchor dviRenderer::parseReference(const TQString &reference)
   kdError(4300) << "dviRenderer::parseReference( " << reference << " ) called" << endl;
 #endif
 
-  if (dviFile == 0) {
+  if (!dviFile) {
     mutex.unlock();
     return Anchor();
   }    
@@ -766,15 +766,15 @@ void dviRenderer::handleSRCLink(const TQString &linkText, TQMouseEvent *e, Docum
   // want to mix the output of several programs, we will
   // henceforth dimiss the output of the older programm. "If it
   // hasn't failed until now, we don't care."
-  if (proc != 0) {
-    tqApp->disconnect(proc, TQ_SIGNAL(receivedStderr(TDEProcess *, char *, int)), 0, 0);
-    tqApp->disconnect(proc, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int)), 0, 0);
-    proc = 0;
+  if (proc) {
+    tqApp->disconnect(proc, TQ_SIGNAL(receivedStderr(TDEProcess *, char *, int)), nullptr, nullptr);
+    tqApp->disconnect(proc, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int)), nullptr, nullptr);
+    proc = nullptr;
   }
   
   // Set up a shell process with the editor command.
   proc = new KShellProcess();
-  if (proc == 0) {
+  if (!proc) {
     kdError(4300) << "Could not allocate ShellProcess for the editor command." << endl;
     return;
   }
@@ -822,15 +822,15 @@ TQString dviRenderer::PDFencodingToTQString(const TQString& _pdfstring)
   int pos;
   TQRegExp rx( "(\\\\)(\\d\\d\\d)" );  // matches "\xyz" where x,y,z are numbers
   while((pos = rx.search( pdfstring )) != -1) {
-    pdfstring = pdfstring.replace(pos, 4, TQChar(rx.cap(2).toInt(0,8)));
+    pdfstring = pdfstring.replace(pos, 4, TQChar(rx.cap(2).toInt(nullptr,8)));
   }
   rx.setPattern( "(\\\\)(\\d\\d)" );  // matches "\xy" where x,y are numbers
   while((pos = rx.search( pdfstring )) != -1) {
-    pdfstring = pdfstring.replace(pos, 3, TQChar(rx.cap(2).toInt(0,8)));
+    pdfstring = pdfstring.replace(pos, 3, TQChar(rx.cap(2).toInt(nullptr,8)));
   }
   rx.setPattern( "(\\\\)(\\d)" );  // matches "\x" where x is a number
   while((pos = rx.search( pdfstring )) != -1) {
-    pdfstring = pdfstring.replace(pos, 4, TQChar(rx.cap(2).toInt(0,8)));
+    pdfstring = pdfstring.replace(pos, 4, TQChar(rx.cap(2).toInt(nullptr,8)));
   }
   return pdfstring;
 }
diff --git a/kdvi/dviRenderer.h b/kdvi/dviRenderer.h
index e8ccdb0b..f3308b5a 100644
--- a/kdvi/dviRenderer.h
+++ b/kdvi/dviRenderer.h
@@ -127,7 +127,7 @@ public:
   void          draw_page();
 
 public slots:
-  void          exportPS(const TQString& fname = TQString(), const TQString& options = TQString(), KPrinter* printer = 0);
+  void          exportPS(const TQString& fname = TQString(), const TQString& options = TQString(), KPrinter* printer = nullptr);
   void          exportPDF();
 
   void          showInfo();
diff --git a/kdvi/dviRenderer_draw.cpp b/kdvi/dviRenderer_draw.cpp
index 8433b5d4..08236d16 100644
--- a/kdvi/dviRenderer_draw.cpp
+++ b/kdvi/dviRenderer_draw.cpp
@@ -93,7 +93,7 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch)
     g = ((TeXFont *)(currinf.fontp->font))->getGlyph(ch, true, globalColor);
   else
     g = ((TeXFont *)(currinf.fontp->font))->getGlyph(ch, true, colorStack.top());
-  if (g == NULL)
+  if (!g)
     return;
 
   long dvi_h_sav = currinf.data.dvi_h;
@@ -107,7 +107,7 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch)
   
   // Are we drawing text for a hyperlink? And are hyperlinks
   // enabled?
-  if (HTML_href != NULL) {
+  if (HTML_href) {
     // Now set up a rectangle which is checked against every mouse
     // event.
     if (line_boundary_encountered == true) {
@@ -128,7 +128,7 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch)
   // If we are printing source hyperlinks are irrelevant, otherwise we
   // actually got a pointer to a RenderedDviPagePixmap.
   RenderedDviPagePixmap* currentDVIPage = dynamic_cast<RenderedDviPagePixmap*>(currentlyDrawnPage);
-  if (source_href != 0 && currentDVIPage) {
+  if (source_href && currentDVIPage) {
     // Now set up a rectangle which is checked against every mouse
     // event.
     if (line_boundary_encountered == true) {
@@ -136,7 +136,7 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch)
       Hyperlink dhl;
       dhl.baseline = currinf.data.pxl_v;
       dhl.box.setRect(x, y, pix.width(), pix.height());
-      if (source_href != NULL) 
+      if (source_href)
         dhl.linkText = *source_href;
       else
         dhl.linkText = "";
@@ -219,7 +219,7 @@ void dviRenderer::set_vf_char(unsigned int cmd, unsigned int ch)
 
   static unsigned char   c;
   macro *m = &currinf.fontp->macrotable[ch];
-  if (m->pos == NULL) {
+  if (!m->pos) {
     kdError(4300) << "Character " << ch << " not defined in font " << currinf.fontp->fontname << endl;
     m->pos = m->end = &c;
     return;
@@ -260,7 +260,7 @@ void dviRenderer::set_no_char(unsigned int cmd, unsigned int ch)
   
   if (currinf._virtual) {
     currinf.fontp = currinf._virtual->first_font;
-    if (currinf.fontp != NULL) {
+    if (currinf.fontp) {
       currinf.set_char_p = currinf.fontp->set_char_p;
       (this->*currinf.set_char_p)(cmd, ch);
       return;
@@ -281,7 +281,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
   TQ_INT32 RRtmp=0, WWtmp=0, XXtmp=0, YYtmp=0, ZZtmp=0;
   TQ_UINT8 ch;
 
-  currinf.fontp        = NULL;
+  currinf.fontp        = nullptr;
   currinf.set_char_p   = &dviRenderer::set_no_char;
 
   for (;;) {
@@ -291,7 +291,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
     } else
       if (FNTNUM0 <= ch && ch <= (unsigned char) (FNTNUM0 + 63)) {
 	currinf.fontp = currinf.fonttable->find(ch - FNTNUM0);
-	if (currinf.fontp == NULL) {
+	if (!currinf.fontp) {
 	  errorMsg = i18n("The DVI code referred to font #%1, which was not previously defined.").arg(ch - FNTNUM0);
 	  return;
 	}
@@ -411,7 +411,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
 	  // comparatively large backspaces when it positions
 	  // accents. (comments stolen from the source of dvitype)
 	  if ((is_vfmacro == false) &&
-	      (currinf.fontp != 0) &&
+	      currinf.fontp &&
 	      ((RRtmp >= currinf.fontp->scaled_size_in_DVI_units/6) || (RRtmp <= -4*(currinf.fontp->scaled_size_in_DVI_units/6))) && 
 	      (currentlyDrawnPage->textBoxList.size() > 0))
 	    currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += ' ';
@@ -426,7 +426,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
 	  currinf.data.w = ((long) (WWtmp *  current_dimconv));
 	case W0:
 	  if ((is_vfmacro == false) && 
-	      (currinf.fontp != 0) &&
+	      currinf.fontp &&
 	      ((WWtmp >= currinf.fontp->scaled_size_in_DVI_units/6) || (WWtmp <= -4*(currinf.fontp->scaled_size_in_DVI_units/6))) && 
 	      (currentlyDrawnPage->textBoxList.size() > 0) )
 	    currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += ' ';
@@ -441,7 +441,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
 	  currinf.data.x = ((long) (XXtmp *  current_dimconv));
 	case X0:
 	  if ((is_vfmacro == false)  && 
-	      (currinf.fontp != 0) &&
+	      currinf.fontp &&
 	      ((XXtmp >= currinf.fontp->scaled_size_in_DVI_units/6) || (XXtmp <= -4*(currinf.fontp->scaled_size_in_DVI_units/6))) && 
 	      (currentlyDrawnPage->textBoxList.size() > 0))
 	    currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += ' ';
@@ -455,7 +455,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
 	  {
 	    TQ_INT32 DDtmp = readINT(ch - DOWN1 + 1);
 	    if ((is_vfmacro == false) &&
-		(currinf.fontp != 0) &&
+		currinf.fontp &&
 		(abs(DDtmp) >= 5*(currinf.fontp->scaled_size_in_DVI_units/6)) && 
 		(currentlyDrawnPage->textBoxList.size() > 0)) {
 	      word_boundary_encountered = true;
@@ -476,7 +476,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
 	  currinf.data.y    = ((long) (YYtmp *  current_dimconv));
 	case Y0:
 	  if ((is_vfmacro == false) &&
-	      (currinf.fontp != 0) &&
+	      currinf.fontp &&
 	      (abs(YYtmp) >= 5*(currinf.fontp->scaled_size_in_DVI_units/6)) && 
 	      (currentlyDrawnPage->textBoxList.size() > 0)) {
 	    word_boundary_encountered = true;
@@ -496,7 +496,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
 	  currinf.data.z    = ((long) (ZZtmp *  current_dimconv));
 	case Z0:
 	  if ((is_vfmacro == false) &&
-	      (currinf.fontp != 0) &&
+	      currinf.fontp &&
 	      (abs(ZZtmp) >= 5*(currinf.fontp->scaled_size_in_DVI_units/6)) && 
 	      (currentlyDrawnPage->textBoxList.size() > 0)) {
 	    word_boundary_encountered = true;
@@ -512,7 +512,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
 	case FNT2:
 	case FNT3:
 	  currinf.fontp = currinf.fonttable->find(readUINT(ch - FNT1 + 1));
-	  if (currinf.fontp == NULL) {
+	  if (!currinf.fontp) {
 	    errorMsg = i18n("The DVI code referred to a font which was not previously defined.");
 	    return;
 	  }
@@ -521,7 +521,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
 
 	case FNT4:
 	  currinf.fontp = currinf.fonttable->find(readINT(ch - FNT1 + 1));
-	  if (currinf.fontp == NULL) {
+	  if (!currinf.fontp) {
 	    errorMsg = i18n("The DVI code referred to a font which was not previously defined.");
 	    return;
 	  }
@@ -578,8 +578,8 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
 void dviRenderer::draw_page()
 {
   // Reset a couple of variables
-  HTML_href         = 0;
-  source_href       = 0;
+  HTML_href         = nullptr;
+  source_href       = nullptr;
   penWidth_in_mInch = 0.0;
 
   // Calling resize() here rather than clear() means that the memory
@@ -641,21 +641,21 @@ void dviRenderer::draw_page()
     command_pointer = dviFile->dvi_Data() + dviFile->page_offset[current_page];
     end_pointer     = dviFile->dvi_Data() + dviFile->page_offset[current_page+1];
   } else
-    command_pointer = end_pointer = 0;
+    command_pointer = end_pointer = nullptr;
   
   memset((char *) &currinf.data, 0, sizeof(currinf.data));
   currinf.fonttable      = &(dviFile->tn_table);
-  currinf._virtual       = 0;
+  currinf._virtual       = nullptr;
   
   double fontPixelPerDVIunit = dviFile->getCmPerDVIunit() * 1200.0/2.54;
   
   draw_part(65536.0*fontPixelPerDVIunit, false);
-  if (HTML_href != 0) {
+  if (HTML_href) {
     delete HTML_href;
-    HTML_href = 0;
+    HTML_href = nullptr;
   }
-  if (source_href != 0) {
+  if (source_href) {
     delete source_href;
-    source_href = 0;
+    source_href = nullptr;
   }
 }
diff --git a/kdvi/dviRenderer_export.cpp b/kdvi/dviRenderer_export.cpp
index cae3007c..fb1616a0 100644
--- a/kdvi/dviRenderer_export.cpp
+++ b/kdvi/dviRenderer_export.cpp
@@ -59,15 +59,15 @@ void dviRenderer::exportPDF()
   // attached to the slow "exportCommand_terminated", which is smart
   // enough to ignore the exit status of the editor if another command
   // has been called meanwhile. See also the exportPS method.
-  if (proc != 0) {
+  if (proc) {
     // Make sure all further output of the programm is ignored
-    tqApp->disconnect(proc, TQ_SIGNAL(receivedStderr(TDEProcess *, char *, int)), 0, 0);
-    tqApp->disconnect(proc, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int)), 0, 0);
-    proc = 0;
+    tqApp->disconnect(proc, TQ_SIGNAL(receivedStderr(TDEProcess *, char *, int)), nullptr, nullptr);
+    tqApp->disconnect(proc, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int)), nullptr, nullptr);
+    proc = nullptr;
   }
 
   // That sould also not happen.
-  if (dviFile == NULL)
+  if (!dviFile)
     return;
 
   // Is the dvipdfm-Programm available ??
@@ -81,7 +81,7 @@ void dviRenderer::exportPDF()
     }
   }
   if (found == false) {
-    KMessageBox::sorry(0, i18n("KDVI could not locate the program 'dvipdfm' on your computer. That program is "
+    KMessageBox::sorry(nullptr, i18n("KDVI could not locate the program 'dvipdfm' on your computer. That program is "
 			       "essential for the export function to work. You can, however, convert "
 			       "the DVI-file to PDF using the print function of KDVI, but that will often "
 			       "produce documents which print ok, but are of inferior quality if viewed in the "
@@ -117,18 +117,18 @@ void dviRenderer::exportPDF()
 					  "Please be patient."),
 				     i18n("Waiting for dvipdfm to finish..."),
 				     parentWidget, i18n("dvipdfm progress dialog"), false );
-  if (progress != 0) {
+  if (progress) {
     progress->TextLabel2->setText( i18n("Please be patient") );
     progress->setTotalSteps( dviFile->total_pages );
     tqApp->connect(progress, TQ_SIGNAL(finished()), this, TQ_SLOT(abortExternalProgramm()));
   }
 
   proc = new KShellProcess();
-  if (proc == 0) {
+  if (!proc) {
     kdError(4300) << "Could not allocate ShellProcess for the dvipdfm command." << endl;
     return;
   }
-  tqApp->disconnect( this, TQ_SIGNAL(mySignal()), 0, 0 );
+  tqApp->disconnect( this, TQ_SIGNAL(mySignal()), nullptr, nullptr );
 
   tqApp->connect(proc, TQ_SIGNAL(receivedStderr(TDEProcess *, char *, int)), this, TQ_SLOT(dvips_output_receiver(TDEProcess *, char *, int)));
   tqApp->connect(proc, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int)), this, TQ_SLOT(dvips_output_receiver(TDEProcess *, char *, int)));
@@ -166,14 +166,14 @@ void dviRenderer::exportPS(const TQString& fname, const TQString& options, KPrin
   // attached to the slow "exportCommand_terminated", which is smart
   // enough to ignore the exit status of the editor if another command
   // has been called meanwhile. See also the exportPDF method.
-  if (proc != 0) {
-    tqApp->disconnect(proc, TQ_SIGNAL(receivedStderr(TDEProcess *, char *, int)), 0, 0);
-    tqApp->disconnect(proc, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int)), 0, 0);
-    proc = 0;
+  if (proc) {
+    tqApp->disconnect(proc, TQ_SIGNAL(receivedStderr(TDEProcess *, char *, int)), nullptr, nullptr);
+    tqApp->disconnect(proc, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int)), nullptr, nullptr);
+    proc = nullptr;
   }
 
   // That sould also not happen.
-  if (dviFile == NULL)
+  if (!dviFile)
     return;
 
   if (dviFile->numberOfExternalNONPSFiles != 0) {
@@ -220,7 +220,7 @@ void dviRenderer::exportPS(const TQString& fname, const TQString& options, KPrin
 					  "Please be patient."),
 				     i18n("Waiting for dvips to finish..."),
 				     parentWidget, i18n("dvips progress dialog"), false );
-  if (progress != 0) {
+  if (progress) {
     progress->TextLabel2->setText( i18n("Please be patient") );
     progress->setTotalSteps( dviFile->total_pages );
     tqApp->connect(progress, TQ_SIGNAL(finished()), this, TQ_SLOT(abortExternalProgramm()));
@@ -248,7 +248,7 @@ void dviRenderer::exportPS(const TQString& fname, const TQString& options, KPrin
   // Sourcefile is the name of the DVI which is used by dvips, either
   // the original file, or a temporary file with a new numbering.
   TQString sourceFileName = dviFile->filename;
-  if ((options.isEmpty() == false) || (dviFile->suggestedPageSize != 0) ) {
+  if (!options.isEmpty() || dviFile->suggestedPageSize) {
     // Get a name for a temporary file.
     KTempFile export_tmpFile;
     export_tmpFileName = export_tmpFile.name();
@@ -274,11 +274,11 @@ void dviRenderer::exportPS(const TQString& fname, const TQString& options, KPrin
 	command_pointer = dviFile->dvi_Data() + dviFile->page_offset[current_page];
 	end_pointer     = dviFile->dvi_Data() + dviFile->page_offset[current_page+1];
       } else
-	command_pointer = end_pointer = 0;
+	command_pointer = end_pointer = nullptr;
       
       memset((char *) &currinf.data, 0, sizeof(currinf.data));
       currinf.fonttable = &(dviFile->tn_table);
-      currinf._virtual  = NULL;
+      currinf._virtual  = nullptr;
       prescan(&dviRenderer::prescan_removePageSizeInfo);
     }
     
@@ -289,7 +289,7 @@ void dviRenderer::exportPS(const TQString& fname, const TQString& options, KPrin
   
   // Allocate and initialize the shell process.
   proc = new KShellProcess();
-  if (proc == 0) {
+  if (!proc) {
     kdError(4300) << "Could not allocate ShellProcess for the dvips command." << endl;
     return;
   }
@@ -305,7 +305,7 @@ void dviRenderer::exportPS(const TQString& fname, const TQString& options, KPrin
   proc->clearArguments();
   TQFileInfo finfo(dviFile->filename);
   *proc << TQString("cd %1; dvips").arg(KShellProcess::quote(finfo.dirPath(true)));
-  if (printer == 0)
+  if (!printer)
     *proc << "-z"; // export Hyperlinks
   if (options.isEmpty() == false)
     *proc << options;
@@ -328,7 +328,7 @@ void dviRenderer::dvips_output_receiver(TDEProcess *, char *buffer, int buflen)
   TQString op = TQString::fromLocal8Bit(buffer, buflen);
 
   info->outputReceiver(op);
-  if (progress != 0)
+  if (progress)
     progress->show();
 }
 
@@ -343,7 +343,7 @@ void dviRenderer::dvips_terminated(TDEProcess *sproc)
   if ((proc == sproc) && (sproc->normalExit() == true) && (sproc->exitStatus() != 0))
     KMessageBox::error( parentWidget, export_errorString );
 
-  if (export_printer != 0)
+  if (export_printer)
     export_printer->printFiles( TQStringList(export_fileName), true );
 
   // Kill and delete the remaining process, delete the printer, etc.
@@ -373,20 +373,20 @@ void dviRenderer::editorCommand_terminated(TDEProcess *sproc)
 void dviRenderer::abortExternalProgramm()
 {
   delete proc; // Deleting the TDEProcess kills the child.
-  proc = 0;
+  proc = nullptr;
   
   if (export_tmpFileName.isEmpty() != true) {
     unlink(TQFile::encodeName(export_tmpFileName)); // That should delete the file.
     export_tmpFileName = "";
   }
   
-  if (progress != 0) {
+  if (progress) {
     progress->hide();
     delete progress;
-    progress = 0;
+    progress = nullptr;
   }
   
   delete export_printer;
-  export_printer  = 0;
+  export_printer  = nullptr;
   export_fileName = "";
 }
diff --git a/kdvi/dviRenderer_prescan.cpp b/kdvi/dviRenderer_prescan.cpp
index c285642c..bb00c0f6 100644
--- a/kdvi/dviRenderer_prescan.cpp
+++ b/kdvi/dviRenderer_prescan.cpp
@@ -581,12 +581,12 @@ void dviRenderer::prescan_parseSpecials(char *cp, TQ_UINT8 *)
 void dviRenderer::prescan_setChar(unsigned int ch)
 {
   TeXFontDefinition *fontp = currinf.fontp;
-  if (fontp == NULL)
+  if (!fontp)
     return;
 
   if (currinf.set_char_p == &dviRenderer::set_char) {
     glyph *g = ((TeXFont *)(currinf.fontp->font))->getGlyph(ch, true, globalColor);
-    if (g == NULL)
+    if (!g)
       return;
     currinf.data.dvi_h += (int)(currinf.fontp->scaled_size_in_DVI_units * dviFile->getCmPerDVIunit() * 
 				(1200.0 / 2.54)/16.0 * g->dvi_advance_in_units_of_design_size_by_2e20 + 0.5);
@@ -595,7 +595,7 @@ void dviRenderer::prescan_setChar(unsigned int ch)
  
   if (currinf.set_char_p == &dviRenderer::set_vf_char) {
     macro *m = &currinf.fontp->macrotable[ch];
-    if (m->pos == NULL) 
+    if (!m->pos)
       return;
     currinf.data.dvi_h += (int)(currinf.fontp->scaled_size_in_DVI_units * dviFile->getCmPerDVIunit() * 
 				(1200.0 / 2.54)/16.0 * m->dvi_advance_in_units_of_design_size_by_2e20 + 0.5);
@@ -619,7 +619,7 @@ void dviRenderer::prescan(parseSpecials specialParser)
 
   stack.clear();
 
-  currinf.fontp        = NULL;
+  currinf.fontp        = nullptr;
   currinf.set_char_p   = &dviRenderer::set_no_char;
 
   for (;;) {
@@ -632,7 +632,7 @@ void dviRenderer::prescan(parseSpecials specialParser)
 
     if (FNTNUM0 <= ch && ch <= (unsigned char) (FNTNUM0 + 63)) {
       currinf.fontp = currinf.fonttable->find(ch - FNTNUM0);
-      if (currinf.fontp == NULL) {
+      if (!currinf.fontp) {
 	errorMsg = i18n("The DVI code referred to font #%1, which was not previously defined.").arg(ch - FNTNUM0);
 	return;
       }
@@ -751,7 +751,7 @@ void dviRenderer::prescan(parseSpecials specialParser)
     case FNT3:
     case FNT4:
       currinf.fontp = currinf.fonttable->find(readUINT(ch - FNT1 + 1));
-      if (currinf.fontp == NULL) 
+      if (!currinf.fontp)
 	return;
       currinf.set_char_p = currinf.fontp->set_char_p;
       break;
diff --git a/kdvi/dviWidget.cpp b/kdvi/dviWidget.cpp
index 614a2704..655305a9 100644
--- a/kdvi/dviWidget.cpp
+++ b/kdvi/dviWidget.cpp
@@ -36,7 +36,7 @@ void DVIWidget::mousePressEvent(TQMouseEvent* e)
 
   // Get a pointer to the page contents
   RenderedDviPagePixmap* pageData = dynamic_cast<RenderedDviPagePixmap*>(documentCache->getPage(pageNr));
-  if (pageData == 0)
+  if (!pageData)
   {
     kdDebug(4300) << "DVIWidget::mousePressEvent(...) pageData for page #" << pageNr << " is empty" << endl;
     return;
@@ -92,7 +92,7 @@ void DVIWidget::mouseMoveEvent(TQMouseEvent* e)
   if ( e->state() == 0 ) {
     // Get a pointer to the page contents
     RenderedDviPagePixmap* pageData = dynamic_cast<RenderedDviPagePixmap*>(documentCache->getPage(pageNr));
-    if (pageData == 0) {
+    if (!pageData) {
       kdDebug(4300) << "DVIWidget::mouseMoveEvent(...) pageData for page #" << pageNr << " is empty" << endl;
       return;
     }
diff --git a/kdvi/fontEncodingPool.cpp b/kdvi/fontEncodingPool.cpp
index 59b38167..fb48eb72 100644
--- a/kdvi/fontEncodingPool.cpp
+++ b/kdvi/fontEncodingPool.cpp
@@ -20,13 +20,13 @@ fontEncoding *fontEncodingPool::findByName(const TQString &name)
 {
   fontEncoding *ptr = dictionary.find( name );
   
-  if (ptr == 0) {
+  if (!ptr) {
     ptr = new fontEncoding(name);
     if (ptr->isValid())
       dictionary.insert(name, ptr );
     else {
       delete ptr;
-      ptr = 0;
+      ptr = nullptr;
     }
   } 
   
diff --git a/kdvi/fontpool.cpp b/kdvi/fontpool.cpp
index 3edd31e3..8cad57a2 100644
--- a/kdvi/fontpool.cpp
+++ b/kdvi/fontpool.cpp
@@ -49,7 +49,7 @@ fontPool::fontPool()
 		     "For this, KDVI uses a number of external programs, such as MetaFont. You can find "
 		     "the output of these programs later in the document info dialog." ),
 	       i18n( "KDVI is generating fonts. Please wait." ),
-	       0 )
+	       nullptr )
 {
 #ifdef DEBUG_FONTPOOL
   kdDebug(4300) << "fontPool::fontPool() called" << endl;
@@ -127,7 +127,7 @@ void fontPool::setParameters( bool _useFontHints )
   if (_useFontHints != useFontHints) {
     double displayResolution = displayResolution_in_dpi;
     TeXFontDefinition *fontp = fontList.first();
-    while(fontp != 0 ) {
+    while(fontp ) {
       fontp->setDisplayResolution(displayResolution * fontp->enlargement);
       fontp=fontList.next();
     }
@@ -143,7 +143,7 @@ TeXFontDefinition* fontPool::appendx(const TQString& fontname, TQ_UINT32 checksu
   // natural resolution is already in the fontpool, and use that, if
   // possible.
   TeXFontDefinition *fontp = fontList.first();
-  while( fontp != 0 ) {
+  while( fontp ) {
     if ((fontname == fontp->fontname) && ( (int)(enlargement*1000.0+0.5)) == (int)(fontp->enlargement*1000.0+0.5)) {
       // if font is already in the list
       fontp->mark_as_used();
@@ -157,7 +157,7 @@ TeXFontDefinition* fontPool::appendx(const TQString& fontname, TQ_UINT32 checksu
   double displayResolution = displayResolution_in_dpi;
 
   fontp = new TeXFontDefinition(fontname, displayResolution*enlargement, checksum, scale, this, enlargement);
-  if (fontp == 0) {
+  if (!fontp) {
     kdError(4300) << i18n("Could not allocate memory for a font structure!") << endl;
     exit(0);
   }
@@ -195,14 +195,14 @@ TQString fontPool::status()
 	       .arg(i18n("Comment")) );
 
  TeXFontDefinition *fontp = fontList.first();
-  while ( fontp != 0 ) {
+  while ( fontp ) {
     TQString errMsg, encoding;
 
     if (!(fontp->flags & TeXFontDefinition::FONT_VIRTUAL)) {
 #ifdef HAVE_FREETYPE
       encoding = fontp->getFullEncodingName();
 #endif
-      if (fontp->font != 0)
+      if (fontp->font)
 	errMsg = fontp->font->errorMessage;
       else
 	errMsg = i18n("Font file not found");
@@ -237,7 +237,7 @@ bool fontPool::areFontsLocated()
 
   // Is there a font whose name we did not try to find out yet?
   TeXFontDefinition *fontp = fontList.first();
-  while( fontp != 0 ) {
+  while( fontp ) {
     if ( !fontp->isLocated() )
       return false;
     fontp=fontList.next();
@@ -281,7 +281,7 @@ void fontPool::locateFonts()
   if (!areFontsLocated()) {
     markFontsAsLocated();
     TQString details = TQString("<qt><p><b>PATH:</b> %1</p>%2</qt>").arg(getenv("PATH")).arg(kpsewhichOutput);
-    KMessageBox::detailedError( 0, i18n("<qt><p>KDVI was not able to locate all the font files "
+    KMessageBox::detailedError( nullptr, i18n("<qt><p>KDVI was not able to locate all the font files "
 					"which are necessary to display the current DVI file. "
 					"Your document might be unreadable.</p></qt>"),
 				details,
@@ -325,7 +325,7 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo
   // Names of fonts that shall be located
   TQ_UINT16 numFontsInJob = 0;
   TeXFontDefinition *fontp = fontList.first();
-  while ( fontp != 0 ) {
+  while ( fontp ) {
     if (!fontp->isLocated()) {
       numFontsInJob++;
       
@@ -363,7 +363,7 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo
 			"and your document might by unreadable. If this error is reproducable "
 			"please report the issue to the KDVI developers using the 'Help' menu.<p>" );
     TQApplication::restoreOverrideCursor();
-    KMessageBox::error( 0, TQString("<qt>%1%2</qt>").arg(importanceOfKPSEWHICH).arg(msg),
+    KMessageBox::error( nullptr, TQString("<qt>%1%2</qt>").arg(importanceOfKPSEWHICH).arg(msg),
 			i18n("Problem locating fonts - KDVI") );
     markFontsAsLocated();
     return;
@@ -379,7 +379,7 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo
   
   // Handle fatal errors.
   if (!kpsewhichIO.normalExit()) {
-    KMessageBox::sorry( 0, "<qt><p>The font generation was aborted. As a result, "
+    KMessageBox::sorry( nullptr, "<qt><p>The font generation was aborted. As a result, "
 			"some font files could not be located, and your document might be unreadable.</p></qt>",
 			i18n("Font generation aborted - KDVI") );
     
@@ -401,7 +401,7 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo
 			  "really works.</p>");
       TQString details = TQString("<qt><p><b>PATH:</b> %1</p>%2</qt>").arg(getenv("PATH")).arg(kpsewhichOutput);
       
-      KMessageBox::detailedError( 0, TQString("<qt>%1%2</qt>").arg(importanceOfKPSEWHICH).arg(msg), details,
+      KMessageBox::detailedError( nullptr, TQString("<qt>%1%2</qt>").arg(importanceOfKPSEWHICH).arg(msg), details,
 				  i18n("Problem locating fonts - KDVI") );
       // This makes sure the we don't try to run kpsewhich again
       markFontsAsLocated();
@@ -416,7 +416,7 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo
   
   // Now associate the file names found with the fonts
   fontp=fontList.first();
-  while ( fontp != 0 ) {
+  while ( fontp ) {
     if (fontp->filename.isEmpty() == true) {
       TQStringList matchingFiles;
 #ifdef HAVE_FREETYPE
@@ -435,7 +435,7 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo
 	fontp->fontNameReceiver(fname);
 	fontp->flags |= TeXFontDefinition::FONT_KPSE_NAME;
 	if (fname.endsWith(".vf")) {
-	  if (virtualFontsFound != 0)
+	  if (virtualFontsFound)
 	    *virtualFontsFound = true;
 	  // Constructing a virtual font will most likely insert other
 	  // fonts into the fontList. After that, fontList.next() will
@@ -462,7 +462,7 @@ void fontPool::setCMperDVIunit( double _CMperDVI )
   CMperDVIunit = _CMperDVI;
 
   TeXFontDefinition *fontp = fontList.first();
-  while(fontp != 0 ) {
+  while(fontp ) {
     fontp->setDisplayResolution(displayResolution_in_dpi * fontp->enlargement);
     fontp=fontList.next();
   }
@@ -490,7 +490,7 @@ void fontPool::setDisplayResolution( double _displayResolution_in_dpi )
   double displayResolution = displayResolution_in_dpi;
   
   TeXFontDefinition *fontp = fontList.first();
-  while(fontp != 0 ) {
+  while(fontp ) {
     fontp->setDisplayResolution(displayResolution * fontp->enlargement);
     fontp=fontList.next();
   }
@@ -505,7 +505,7 @@ void fontPool::setDisplayResolution( double _displayResolution_in_dpi )
 void fontPool::markFontsAsLocated()
 {
   TeXFontDefinition *fontp=fontList.first();
-  while ( fontp != 0 ) {
+  while ( fontp ) {
     fontp->markAsLocated();
     fontp = fontList.next();
   }
@@ -520,7 +520,7 @@ void fontPool::mark_fonts_as_unused()
 #endif
   
   TeXFontDefinition  *fontp = fontList.first();
-  while ( fontp != 0 ) {
+  while ( fontp ) {
     fontp->flags &= ~TeXFontDefinition::FONT_IN_USE;
     fontp=fontList.next();
   }
@@ -534,7 +534,7 @@ void fontPool::release_fonts()
 #endif
 
   TeXFontDefinition  *fontp = fontList.first();
-  while(fontp != 0) {
+  while(fontp) {
     if ((fontp->flags & TeXFontDefinition::FONT_IN_USE) != TeXFontDefinition::FONT_IN_USE) {
       fontList.removeRef(fontp);
       fontp = fontList.first();
diff --git a/kdvi/fontpool.h b/kdvi/fontpool.h
index 7928fed0..5dbf547b 100644
--- a/kdvi/fontpool.h
+++ b/kdvi/fontpool.h
@@ -175,7 +175,7 @@ private:
  // characters. If not null, the bool pointed at by virtualFontsFound
  // is set to true if one of the fonts found is a virtual font. If no
  // virtual font is found, the variable remains untouched.
- void locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFound=0);
+ void locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFound=nullptr);
 
  // This TQString is used internally by the mf_output_receiver()
  // method.  This string is set to TQString() in locateFonts(bool,
diff --git a/kdvi/fontprogress.cpp b/kdvi/fontprogress.cpp
index 5cd64aaf..cec8365f 100644
--- a/kdvi/fontprogress.cpp
+++ b/kdvi/fontprogress.cpp
@@ -52,7 +52,7 @@ fontProgressDialog::fontProgressDialog(const TQString& helpIndex, const TQString
     TQWhatsThis::add( ProgressBar1, whatsThis );
     TQToolTip::add( ProgressBar1, ttip );
   } else 
-    ProgressBar1 = NULL;
+    ProgressBar1 = nullptr;
   
   TextLabel2   = new TQLabel( "", page, "TextLabel2" );
   TextLabel2->setAlignment( int( TQLabel::AlignCenter ) );
@@ -60,7 +60,7 @@ fontProgressDialog::fontProgressDialog(const TQString& helpIndex, const TQString
   TQToolTip::add( TextLabel2, ttip );
 
   progress = 0;
-  procIO = 0;
+  procIO = nullptr;
   tqApp->connect(this, TQ_SIGNAL(finished()), this, TQ_SLOT(killProcIO()));
 }
 
@@ -77,7 +77,7 @@ fontProgressDialog::~fontProgressDialog()
 
 void fontProgressDialog::increaseNumSteps(const TQString& explanation)
 {
-  if (ProgressBar1 != 0)
+  if (ProgressBar1)
     ProgressBar1->setProgress(progress++);
   TextLabel2->setText( explanation );
 }
@@ -86,7 +86,7 @@ void fontProgressDialog::increaseNumSteps(const TQString& explanation)
 void fontProgressDialog::setTotalSteps(int steps, TDEProcIO *proc)
 {
   procIO = proc;
-  if (ProgressBar1 != 0) {
+  if (ProgressBar1) {
     ProgressBar1->setTotalSteps(steps);
     ProgressBar1->setProgress(0);
   }
diff --git a/kdvi/fontprogress.h b/kdvi/fontprogress.h
index 20eae300..c1177cd4 100644
--- a/kdvi/fontprogress.h
+++ b/kdvi/fontprogress.h
@@ -34,7 +34,7 @@ class fontProgressDialog : public KDialogBase
 
 public:
     fontProgressDialog( const TQString& helpIndex, const TQString& label, const TQString& abortTip, const TQString& whatsThis, const TQString& ttip,
-			TQWidget* parent = 0, const TQString &name = 0, bool progressbar=true );
+			TQWidget* parent = nullptr, const TQString &name = nullptr, bool progressbar=true );
     ~fontProgressDialog();
     
     /** The number of steps already done is increased, the text received
@@ -45,7 +45,7 @@ public:
 	non-zero, the associated process will be killed when the "abort"
 	button is pressed. The FontProgress uses a TQGuarderPtr
 	internally, so it is save to delete the TDEProcIO anytime. */
-    void setTotalSteps(int, TDEProcIO *proc=0);
+    void setTotalSteps(int, TDEProcIO *proc=nullptr);
     
    TQLabel* TextLabel2;
 
diff --git a/kdvi/infodialog.cpp b/kdvi/infodialog.cpp
index 4434109e..bf7d7502 100644
--- a/kdvi/infodialog.cpp
+++ b/kdvi/infodialog.cpp
@@ -60,7 +60,7 @@ void infoDialog::setDVIData(dvifile *dviFile)
 {
   TQString text = "";
 
-  if (dviFile == NULL)
+  if (!dviFile)
     text = i18n("There is no DVI file loaded at the moment.");
   else {
     text.append("<table WIDTH=\"100%\" NOSAVE >");
diff --git a/kdvi/infodialog.h b/kdvi/infodialog.h
index 0d0bdc00..f3edd52e 100644
--- a/kdvi/infodialog.h
+++ b/kdvi/infodialog.h
@@ -22,7 +22,7 @@ class infoDialog : public KDialogBase
   
 
 public:
-    infoDialog( TQWidget* parent = 0 );
+    infoDialog( TQWidget* parent = nullptr );
 
     /** This method is used to set the data coming from the DVI
         file. Note that 0 is a permissible argument, that just means:
diff --git a/kdvi/kdvi_multipage.cpp b/kdvi/kdvi_multipage.cpp
index a6aa58b8..c7f9ad40 100644
--- a/kdvi/kdvi_multipage.cpp
+++ b/kdvi/kdvi_multipage.cpp
@@ -129,7 +129,7 @@ void KDVIMultiPage::slotEmbedPostScript()
 
 void KDVIMultiPage::setEmbedPostScriptAction()
 {
-  if ((DVIRenderer.dviFile == 0) || (DVIRenderer.dviFile->numberOfExternalPSFiles == 0))
+  if (!DVIRenderer.dviFile || DVIRenderer.dviFile->numberOfExternalPSFiles == 0)
     embedPSAction->setEnabled(false);
   else
     embedPSAction->setEnabled(true);
@@ -150,7 +150,7 @@ void KDVIMultiPage::slotSave()
     formats = fileFormats().grep(ending).join("\n");
   }
 
-  TQString fileName = KFileDialog::getSaveFileName(TQString(), formats, 0, i18n("Save File As"));
+  TQString fileName = KFileDialog::getSaveFileName(TQString(), formats, nullptr, i18n("Save File As"));
 
   if (fileName.isEmpty())
     return;
@@ -161,14 +161,14 @@ void KDVIMultiPage::slotSave()
     fileName = fileName+ending;
 
   if (TQFile(fileName).exists()) {
-    int r = KMessageBox::warningContinueCancel (0, i18n("The file %1\nexists. Do you want to overwrite that file?").arg(fileName),
+    int r = KMessageBox::warningContinueCancel (nullptr, i18n("The file %1\nexists. Do you want to overwrite that file?").arg(fileName),
                        i18n("Overwrite File"), i18n("Overwrite"));
     if (r == KMessageBox::Cancel)
       return;
   }
 
   // TODO: error handling...
-  if ((DVIRenderer.dviFile != 0) && (DVIRenderer.dviFile->dvi_Data() != 0))
+  if (DVIRenderer.dviFile && DVIRenderer.dviFile->dvi_Data())
     DVIRenderer.dviFile->saveAs(fileName);
   
   return;
@@ -178,7 +178,7 @@ void KDVIMultiPage::slotSave()
 void KDVIMultiPage::slotSave_defaultFilename()
 {
   // TODO: error handling...
-  if (DVIRenderer.dviFile != 0)
+  if (DVIRenderer.dviFile)
     DVIRenderer.dviFile->saveAs(m_file);
   return;
 }
@@ -200,7 +200,7 @@ TQStringList KDVIMultiPage::fileFormats() const
 
 void KDVIMultiPage::addConfigDialogs(TDEConfigDialog* configDialog)
 {
-  static optionDialogFontsWidget* fontConfigWidget = 0;
+  static optionDialogFontsWidget* fontConfigWidget = nullptr;
   
   fontConfigWidget = new optionDialogFontsWidget(scrollView());
   optionDialogSpecialWidget* specialConfigWidget = new optionDialogSpecialWidget(scrollView());
@@ -232,7 +232,7 @@ void KDVIMultiPage::print()
   // entries in the "Page Size & Placement" tab of the printer dialog.
   KPrinter *printer = getPrinter(false);
   // Abort with an error message if no KPrinter could be initialized
-  if (printer == 0) {
+  if (!printer) {
     kdError(4300) << "KPrinter not available" << endl;
     return;
   }
diff --git a/kdvi/kdvi_multipage_texthandling.cpp b/kdvi/kdvi_multipage_texthandling.cpp
index f087f4b1..d7bd6f31 100644
--- a/kdvi/kdvi_multipage_texthandling.cpp
+++ b/kdvi/kdvi_multipage_texthandling.cpp
@@ -51,9 +51,9 @@ void KDVIMultiPage::doExportText()
 #endif
 
   // Paranoid safety checks
-  if (DVIRenderer.dviFile == 0)
+  if (!DVIRenderer.dviFile)
     return;
-  if (DVIRenderer.dviFile->dvi_Data() == 0 )
+  if (!DVIRenderer.dviFile->dvi_Data() )
     return;
   
   if (KMessageBox::warningContinueCancel( scrollView(),
diff --git a/kdvi/main.cpp b/kdvi/main.cpp
index d96db4a2..16e612a8 100644
--- a/kdvi/main.cpp
+++ b/kdvi/main.cpp
@@ -17,11 +17,11 @@
 
 static TDECmdLineOptions options[] =
 {
-  { "u", 0, 0 },
-  { "unique", I18N_NOOP("Check if the file is loaded in another KDVI.\nIf it is, bring up the other KDVI. Otherwise, load the file."), 0 },
-  { "g", 0, 0 },
-  { "goto <pagenumber>", I18N_NOOP("Navigate to this page"), 0 },
-  { "+file(s)", I18N_NOOP("Files to load"), 0 },
+  { "u", nullptr, nullptr },
+  { "unique", I18N_NOOP("Check if the file is loaded in another KDVI.\nIf it is, bring up the other KDVI. Otherwise, load the file."), nullptr },
+  { "g", nullptr, nullptr },
+  { "goto <pagenumber>", I18N_NOOP("Navigate to this page"), nullptr },
+  { "+file(s)", I18N_NOOP("Files to load"), nullptr },
   TDECmdLineLastOption
 };
 
diff --git a/kdvi/optionDialogFontsWidget.h b/kdvi/optionDialogFontsWidget.h
index 263409fe..ac0a37a9 100644
--- a/kdvi/optionDialogFontsWidget.h
+++ b/kdvi/optionDialogFontsWidget.h
@@ -17,7 +17,7 @@ class optionDialogFontsWidget : public optionDialogFontsWidget_base
   
     
  public:
-  optionDialogFontsWidget( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+  optionDialogFontsWidget( TQWidget* parent = nullptr, const char* name = nullptr, WFlags fl = 0 );
   ~optionDialogFontsWidget();
 };
 
diff --git a/kdvi/optionDialogSpecialWidget.h b/kdvi/optionDialogSpecialWidget.h
index feb09a57..bab5b268 100644
--- a/kdvi/optionDialogSpecialWidget.h
+++ b/kdvi/optionDialogSpecialWidget.h
@@ -17,7 +17,7 @@ class optionDialogSpecialWidget : public optionDialogSpecialWidget_base
   
     
  public:
-  optionDialogSpecialWidget( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+  optionDialogSpecialWidget( TQWidget* parent = nullptr, const char* name = nullptr, WFlags fl = 0 );
   ~optionDialogSpecialWidget();
   
  public slots:
diff --git a/kdvi/psgs.cpp b/kdvi/psgs.cpp
index 3e58c2f4..bf8aa55f 100644
--- a/kdvi/psgs.cpp
+++ b/kdvi/psgs.cpp
@@ -34,7 +34,7 @@ pageInfo::pageInfo(const TQString& _PostScriptString) {
 
 
 pageInfo::~pageInfo() {
-  if (PostScriptString != 0L)
+  if (PostScriptString)
     delete PostScriptString;
 }
 
@@ -54,7 +54,7 @@ ghostscript_interface::ghostscript_interface() {
 }
 
 ghostscript_interface::~ghostscript_interface() {
-  if (PostScriptHeaderString != 0L)
+  if (PostScriptHeaderString)
     delete PostScriptHeaderString;
 }
 
@@ -64,7 +64,7 @@ void ghostscript_interface::setPostScript(const PageNumber& page, const TQString
   kdDebug(4300) << "ghostscript_interface::setPostScript( " << page << ", ... )" << endl;
 #endif
 
-  if (pageList.find(page) == 0) {
+  if (!pageList.find(page)) {
     pageInfo *info = new pageInfo(PostScript);
     // Check if dict is big enough
     if (pageList.count() > pageList.size() -2)
@@ -88,7 +88,7 @@ void ghostscript_interface::setBackgroundColor(const PageNumber& page, const TQC
   kdDebug(4300) << "ghostscript_interface::setBackgroundColor( " << page << ", " << background_color << " )" << endl;
 #endif
 
-  if (pageList.find(page) == 0) {
+  if (!pageList.find(page)) {
     pageInfo *info = new pageInfo(TQString());
     info->background = background_color;
     if (permanent)
@@ -109,7 +109,7 @@ void ghostscript_interface::restoreBackgroundColor(const PageNumber& page)
 #ifdef DEBUG_PSGS
   kdDebug(4300) << "ghostscript_interface::restoreBackgroundColor( " << page << " )" << endl;
 #endif
-  if (pageList.find(page) == 0)
+  if (!pageList.find(page))
     return;
 
   pageInfo *info = pageList.find(page);
@@ -124,7 +124,7 @@ TQColor ghostscript_interface::getBackgroundColor(const PageNumber& page) const
   kdDebug(4300) << "ghostscript_interface::getBackgroundColor( " << page << " )" << endl;
 #endif
 
-  if (pageList.find(page) == 0) 
+  if (!pageList.find(page))
     return TQt::white;
   else 
     return pageList.find(page)->background;
@@ -186,7 +186,7 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
         // Start page
      << "1 0 bop 0 0 a \n";
 
-  if (PostScriptHeaderString->latin1() != NULL)
+  if (PostScriptHeaderString->latin1())
     os << PostScriptHeaderString->latin1();
 
   if (info->background != TQt::white) {
@@ -197,7 +197,7 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
     os << colorCommand.latin1();
   }
 
-  if (info->PostScriptString->latin1() != NULL)
+  if (info->PostScriptString->latin1())
     os << info->PostScriptString->latin1();
 
   os << "end\n"
@@ -246,7 +246,7 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
 	gsDevice = knownDevices.begin();
 	if (knownDevices.isEmpty())
 	  // TODO: show a requestor of some sort.
-	  KMessageBox::detailedError(0, 
+	  KMessageBox::detailedError(nullptr,
 				     i18n("<qt>The version of Ghostview that is installed on this computer does not contain "
 					  "any of the Ghostview device drivers that are known to KDVI. PostScript "
 					  "support has therefore been turned off in KDVI.</qt>"), 
@@ -283,7 +283,7 @@ void ghostscript_interface::graphics(const PageNumber& page, double dpi, long ma
   kdDebug(4300) << "ghostscript_interface::graphics( " << page << ", " << dpi << ", ... ) called." << endl;
 #endif
 
-  if (paint == 0) {
+  if (!paint) {
     kdError(4300) << "ghostscript_interface::graphics(PageNumber page, double dpi, long magnification, TQPainter *paint) called with paint == 0" << endl;
     return;
   }
@@ -296,7 +296,7 @@ void ghostscript_interface::graphics(const PageNumber& page, double dpi, long ma
   pageInfo *info = pageList.find(page);
 
   // No PostScript? Then return immediately.
-  if ((info == 0) || (info->PostScriptString->isEmpty())) {
+  if (!info || info->PostScriptString->isEmpty()) {
 #ifdef DEBUG_PSGS
     kdDebug(4300) << "No PostScript found. Not drawing anything." << endl;
 #endif
diff --git a/kdvi/special.cpp b/kdvi/special.cpp
index 4f5ba4ac..5647b2ad 100644
--- a/kdvi/special.cpp
+++ b/kdvi/special.cpp
@@ -269,9 +269,9 @@ void dviRenderer::html_anchor_end()
   kdDebug(4300) << "HTML-special, anchor-end" << endl;
 #endif
 
-  if (HTML_href != NULL) {
+  if (HTML_href) {
     delete HTML_href;
-    HTML_href = NULL;
+    HTML_href = nullptr;
   }
 }
 
@@ -608,9 +608,9 @@ void dviRenderer::applicationDoSpecial(char *cp)
     // special, where the destination is specified. This special is
     // treated below.
     if ((special_command == "ps:SDict begin H.R end") || special_command.endsWith("H.L end")) {
-      if (HTML_href != NULL) {
+      if (HTML_href) {
 	delete HTML_href;
-	HTML_href = NULL;
+	HTML_href = nullptr;
       }
       return; // end of hyperref rectangle
     }
@@ -627,9 +627,9 @@ void dviRenderer::applicationDoSpecial(char *cp)
     // hyperlink-anchor rectangle therefore never contains characters,
     // so no character will by accidentally underlined in blue.
     if (special_command.endsWith("H.A end")) {
-      if (HTML_href != NULL) {
+      if (HTML_href) {
 	delete HTML_href;
-	HTML_href = NULL;
+	HTML_href = nullptr;
       }
       while (!currentlyDrawnPage->hyperLinkList.isEmpty())
 	if (currentlyDrawnPage->hyperLinkList.last().linkText == "glopglyph")
diff --git a/kdvi/util.cpp b/kdvi/util.cpp
index bcdc3130..0c6e9864 100644
--- a/kdvi/util.cpp
+++ b/kdvi/util.cpp
@@ -74,7 +74,7 @@ void oops(TQString message)
 {
   kdError() << i18n("Fatal Error! ") << message << endl;
 
-  KMessageBox::error( NULL,
+  KMessageBox::error( nullptr,
 		      i18n("Fatal error.\n\n") +
 		      message +
 		      i18n("\n\n\
diff --git a/kdvi/vf.cpp b/kdvi/vf.cpp
index 8532223f..c5a3be7a 100644
--- a/kdvi/vf.cpp
+++ b/kdvi/vf.cpp
@@ -88,7 +88,7 @@ void TeXFontDefinition::read_VF_index()
   (void) four(VF_file);		/* skip design size */
 
   // Read the fonts.
-  first_font = NULL;
+  first_font = nullptr;
   while ((cmnd = one(VF_file)) >= FNTDEF1 && cmnd <= FNTDEF4) {
     int   TeXnumber = num(VF_file, (int) cmnd - FNTDEF1 + 1);
     TQ_UINT32 checksum  = four(VF_file);
@@ -122,19 +122,19 @@ void TeXFontDefinition::read_VF_index()
       vf_table.resize(vf_table.size()*2); 
     vf_table.insert(TeXnumber, newfontp);
     
-    if (first_font == NULL)
+    if (!first_font)
       first_font = newfontp;
   }
 
   // Prepare macro array.
   macrotable = new macro[max_num_of_chars_in_font];
-  if (macrotable == 0) {
+  if (!macrotable) {
     kdError() << i18n("Could not allocate memory for a macro table.") << endl;
     exit(0);
   }
 
   // Read macros.
-  avail = availend = NULL;
+  avail = availend = nullptr;
   for (; cmnd <= LONG_CHAR; cmnd = one(VF_file)) {
     macro *m;
     int len;
@@ -180,5 +180,5 @@ void TeXFontDefinition::read_VF_index()
     oops(i18n("Wrong command byte found in VF macro list: %1").arg(cmnd));
   
   fclose (VF_file);
-  file = NULL;
+  file = nullptr;
 }
diff --git a/kviewshell/documentPageCache.cpp b/kviewshell/documentPageCache.cpp
index 720285df..9d393f38 100644
--- a/kviewshell/documentPageCache.cpp
+++ b/kviewshell/documentPageCache.cpp
@@ -178,15 +178,15 @@ RenderedDocumentPagePixmap* DocumentPageCache::getPage(const PageNumber& pageNr)
   // Paranoid checks
   if (renderer.isNull()) {
     kdError(1223) << "DocumentPageCache::getPage(..) called but no renderer was set" << endl;
-    return 0;
+    return nullptr;
   }
   if (!pageNr.isValid()) {
     kdError(1223) << "DocumentPageCache::getPage( " << pageNr << " ) called, with invalid argument." << endl;
-    return 0;
+    return nullptr;
   }
   if (renderer->totalPages() < pageNr) {
     kdError(1223) << "DocumentPageCache::getPage( " << pageNr << " ) called but document contains only " << renderer->totalPages() << " pages." << endl;
-    return 0;
+    return nullptr;
   }
 
   // First check if the page that we are looking for is in the cache
@@ -201,9 +201,9 @@ RenderedDocumentPagePixmap* DocumentPageCache::getPage(const PageNumber& pageNr)
   page = createDocumentPagePixmap();
 
   // If that failed, issue an error message and quit.
-  if (page == 0) {
+  if (!page) {
     kdError(1223) << "DocumentPageCache::getPage(..) cannot allocate DocumentPage structure" << endl;
-    return 0;
+    return nullptr;
   }
   
   // Now 'page' contains a point to a page structure that we can
diff --git a/kviewshell/documentWidget.cpp b/kviewshell/documentWidget.cpp
index dfd97033..8321d817 100644
--- a/kviewshell/documentWidget.cpp
+++ b/kviewshell/documentWidget.cpp
@@ -54,13 +54,13 @@ TQColor DocumentWidget::backgroundColorForCorners;
 namespace {
 
 /** Holds the icon used as a overlay on pages which are not drawn yet. */
-TQPixmap* busyIcon = 0;
+TQPixmap* busyIcon = nullptr;
 
 /** Internal storages used in the shadow drawing routines in the
     drawContents method.*/
-TQPixmap* URShadow = 0;
-TQPixmap* BRShadow = 0;
-TQPixmap* BLShadow = 0;
+TQPixmap* URShadow = nullptr;
+TQPixmap* BRShadow = nullptr;
+TQPixmap* BLShadow = nullptr;
 
 } // namespace anon
 
@@ -266,7 +266,7 @@ void DocumentWidget::paintEvent(TQPaintEvent *e)
   }
 
   RenderedDocumentPagePixmap *pageData = documentCache->getPage(pageNr);
-  if (pageData == 0) {
+  if (!pageData) {
 #ifdef DEBUG_DOCUMENTWIDGET
     kdDebug(1223) << "DocumentWidget::paintEvent: no documentPage generated" << endl;
 #endif
@@ -382,7 +382,7 @@ void DocumentWidget::select(const TextSelection& newSelection)
 {
   // Get a pointer to the page contents
   RenderedDocumentPage *pageData = documentCache->getPage(pageNr);
-  if (pageData == 0) {
+  if (!pageData) {
     kdDebug(1223) << "DocumentWidget::select() pageData for page #" << pageNr << " is empty" << endl;
     return;
   }
@@ -404,7 +404,7 @@ void DocumentWidget::selectAll()
 
   // Get a pointer to the page contents
   RenderedDocumentPage *pageData = documentCache->getPage(pageNr);
-  if (pageData == 0) {
+  if (!pageData) {
     kdDebug(1223) << "DocumentWidget::selectAll() pageData for page #" << pageNr << " is empty" << endl;
     return;
   }
@@ -444,7 +444,7 @@ void DocumentWidget::mousePressEvent ( TQMouseEvent * e )
 
   // Get a pointer to the page contents
   RenderedDocumentPage *pageData = documentCache->getPage(pageNr);
-  if (pageData == 0) {
+  if (!pageData) {
     kdDebug(1223) << "DocumentWidget::selectAll() pageData for page #" << pageNr << " is empty" << endl;
     return;
   }
@@ -496,7 +496,7 @@ void DocumentWidget::mouseReleaseEvent ( TQMouseEvent *e )
 
       // Get a pointer to the page contents
       RenderedDocumentPage* pageData = documentCache->getPage(pageNr);
-      if (pageData == 0) 
+      if (!pageData)
       {
         kdDebug(1223) << "DocumentWidget::mouseReleaseEvent() pageData for page #" << pageNr << " is empty" << endl;
         return;
@@ -527,7 +527,7 @@ void DocumentWidget::mouseMoveEvent ( TQMouseEvent * e )
 
   // Get a pointer to the page contents
   RenderedDocumentPage *pageData = documentCache->getPage(pageNr);
-  if (pageData == 0) {
+  if (!pageData) {
     kdDebug(1223) << "DocumentWidget::selectAll() pageData for page #" << pageNr << " is empty" << endl;
     return;
   }
@@ -638,7 +638,7 @@ void DocumentWidget::updateSelection(const TextSelection& newTextSelection)
 
       // Get a pointer to the page contents
       RenderedDocumentPage* pageData = documentCache->getPage(pageNr);
-      if (pageData == 0) 
+      if (!pageData)
       {
         kdDebug(1223) << "DocumentWidget::mouseReleaseEvent() pageData for page #" << pageNr << " is empty" << endl;
         return;
diff --git a/kviewshell/history.cpp b/kviewshell/history.cpp
index 4aade99d..66707695 100644
--- a/kviewshell/history.cpp
+++ b/kviewshell/history.cpp
@@ -61,7 +61,7 @@ void History::add(TQ_UINT32 page, TQ_UINT32 ypos)
 HistoryItem* History::forward()
 {
   if (historyList.empty() || currentItem == historyList.fromLast())
-    return 0;
+    return nullptr;
     
     currentItem++;
   emit backItem(true);
@@ -72,7 +72,7 @@ HistoryItem* History::forward()
 HistoryItem* History::back()
 {
   if (historyList.empty() || currentItem == historyList.begin())
-    return 0;
+    return nullptr;
   
     currentItem--;
   emit backItem(currentItem != historyList.begin());
diff --git a/kviewshell/kprintDialogPage_pageoptions.cpp b/kviewshell/kprintDialogPage_pageoptions.cpp
index f3577ab1..afae9cff 100644
--- a/kviewshell/kprintDialogPage_pageoptions.cpp
+++ b/kviewshell/kprintDialogPage_pageoptions.cpp
@@ -25,20 +25,20 @@ KPrintDialogPage_PageOptions::KPrintDialogPage_PageOptions( TQWidget *parent, co
 {
   setTitle( i18n("Page Size & Placement") );
 
-  kprintDialogPage_pageoptions_baseLayout = 0;
-  checkBox_center = 0;
-  checkBox_rotate = 0;
-  checkBox_shrink = 0;
-  checkBox_expand = 0;
+  kprintDialogPage_pageoptions_baseLayout = nullptr;
+  checkBox_center = nullptr;
+  checkBox_rotate = nullptr;
+  checkBox_shrink = nullptr;
+  checkBox_expand = nullptr;
 
   kprintDialogPage_pageoptions_baseLayout = new TQVBoxLayout( this, 11, 6, "kprintDialogPage_pageoptions_baseLayout"); 
-  if (kprintDialogPage_pageoptions_baseLayout == 0) {
+  if (!kprintDialogPage_pageoptions_baseLayout) {
     kdError(1223) << "KPrintDialogPage_PageOptions::KPrintDialogPage_PageOptions() cannot create layout" << endl;
     return;
   }
     
   checkBox_center = new TQCheckBox( this, "checkBox_center" );
-  if (checkBox_center != 0) {
+  if (checkBox_center) {
     checkBox_center->setText( i18n( "Center the page on paper" ) );
     TQToolTip::add( checkBox_center, i18n( "If this option is enabled, the pages are centered on the paper." ) );
     TQWhatsThis::add( checkBox_center, i18n( "<qt><p>If this option is enabled, the pages will be printed centered on the paper; this makes "
@@ -48,7 +48,7 @@ KPrintDialogPage_PageOptions::KPrintDialogPage_PageOptions( TQWidget *parent, co
   }
 
   checkBox_rotate = new TQCheckBox( this, "checkBox_rotate" );
-  if (checkBox_rotate != 0) {
+  if (checkBox_rotate) {
     checkBox_rotate->setText( i18n( "Automatically choose landscape or portrait orientation" ) );
     TQToolTip::add( checkBox_rotate, i18n( "If this option is enabled, some pages might be rotated to better fit the paper size." ) );
     TQWhatsThis::add( checkBox_rotate, i18n( "<qt><p>If this option is enabled, landscape or portrait orientation are automatically chosen on a "
@@ -61,7 +61,7 @@ KPrintDialogPage_PageOptions::KPrintDialogPage_PageOptions( TQWidget *parent, co
   }
   
   TQFrame *line = new TQFrame( this, "line1" );
-  if (line != 0) {
+  if (line) {
     line->setFrameShape( TQFrame::HLine );
     line->setFrameShadow( TQFrame::Sunken );
     line->setFrameShape( TQFrame::HLine );
@@ -69,7 +69,7 @@ KPrintDialogPage_PageOptions::KPrintDialogPage_PageOptions( TQWidget *parent, co
   }
   
   checkBox_shrink = new TQCheckBox( this, "checkBox_shrink" );
-  if (checkBox_shrink != 0) {
+  if (checkBox_shrink) {
     checkBox_shrink->setText( i18n( "Shrink oversized pages to fit paper size" ) );
     TQToolTip::add( checkBox_shrink, i18n( "If this option is enabled, large pages that would not fit the printer's paper size will be shrunk." ) );
     TQWhatsThis::add( checkBox_shrink, i18n( "<qt><p>If this option is enabled, large pages that would not fit the printer's paper size will be "
@@ -80,7 +80,7 @@ KPrintDialogPage_PageOptions::KPrintDialogPage_PageOptions( TQWidget *parent, co
   }
     
   checkBox_expand = new TQCheckBox( this, "checkBox_expand" );
-  if (checkBox_expand != 0) {
+  if (checkBox_expand) {
     checkBox_expand->setText( i18n( "Expand small pages to fit paper size" ) );
     TQToolTip::add( checkBox_expand, i18n( "If this option is enabled, small pages will be enlarged so that they fit the printer's paper size." ) );
     TQWhatsThis::add( checkBox_expand, i18n( "<qt><p>If this option is enabled, small pages will be enlarged so that they fit the printer's "
@@ -104,28 +104,28 @@ void KPrintDialogPage_PageOptions::getOptions( TQMap<TQString,TQString>& opts, b
   // not. Warning: The default values are also coded into setOptions()
   // and tdemultipage::print(..).
   
-  if (checkBox_center != 0)
+  if (checkBox_center)
     if ( incldef || !checkBox_center->isChecked() )
       if (checkBox_center->isChecked())
 	opts[ "kde-kviewshell-centerpage" ] = "true";
       else
 	opts[ "kde-kviewshell-centerpage" ] = "false";
 
-  if (checkBox_rotate != 0)
+  if (checkBox_rotate)
     if ( incldef || !checkBox_rotate->isChecked() )
       if (checkBox_rotate->isChecked())
 	opts[ "kde-kviewshell-rotatepage" ] = "true";
       else
 	opts[ "kde-kviewshell-rotatepage" ] = "false";
   
-  if (checkBox_shrink != 0)
+  if (checkBox_shrink)
     if ( incldef || checkBox_shrink->isChecked() )
       if (checkBox_shrink->isChecked())
 	opts[ "kde-kviewshell-shrinkpage" ] = "true";
       else
 	opts[ "kde-kviewshell-shrinkpage" ] = "false";
   
-  if (checkBox_expand != 0)
+  if (checkBox_expand)
     if ( incldef || checkBox_expand->isChecked() )  
       if (checkBox_expand->isChecked())
 	opts[ "kde-kviewshell-expandpage" ] = "true";
@@ -140,22 +140,22 @@ void KPrintDialogPage_PageOptions::setOptions( const TQMap<TQString,TQString>& o
   // checked. Warning: All default values are also coded into
   // getOptions() and tdemultipage::print(..).
   TQString op = opts[ "kde-kviewshell-centerpage" ];
-  if (checkBox_center != 0)
+  if (checkBox_center)
     checkBox_center->setChecked( op != "false" );
 
   // same for rotation
   op = opts[ "kde-kviewshell-rotatepage" ];
-  if (checkBox_rotate != 0)
+  if (checkBox_rotate)
     checkBox_rotate->setChecked( op != "false" );
   
   // Sets the shrink option. By default, this option is not checked
   op = opts[ "kde-kviewshell-shrinkpage" ];
-  if (checkBox_shrink != 0)
+  if (checkBox_shrink)
     checkBox_shrink->setChecked( op == "true" );
   
   // Sets the expand option. By default, this option is not checked
   op = opts[ "kde-kviewshell-expandpage" ];
-  if (checkBox_expand != 0)
+  if (checkBox_expand)
     checkBox_expand->setChecked( op == "true" );
 }
 
diff --git a/kviewshell/kprintDialogPage_pageoptions.h b/kviewshell/kprintDialogPage_pageoptions.h
index 68fe8a8c..1cac2ff5 100644
--- a/kviewshell/kprintDialogPage_pageoptions.h
+++ b/kviewshell/kprintDialogPage_pageoptions.h
@@ -23,7 +23,7 @@ class TQVBoxLayout;
 class KPrintDialogPage_PageOptions : public KPrintDialogPage
 {
  public:
-  KPrintDialogPage_PageOptions( TQWidget *parent = 0, const char *name = 0 );
+  KPrintDialogPage_PageOptions( TQWidget *parent = nullptr, const char *name = nullptr );
   
   void getOptions( TQMap<TQString,TQString>& opts, bool incldef = false );
   void setOptions( const TQMap<TQString,TQString>& opts );
diff --git a/kviewshell/kviewpart.cpp b/kviewshell/kviewpart.cpp
index 794297bc..6f3be8d9 100644
--- a/kviewshell/kviewpart.cpp
+++ b/kviewshell/kviewpart.cpp
@@ -58,12 +58,12 @@ K_EXPORT_COMPONENT_FACTORY(kviewerpart, KViewPartFactory)
 
 KViewPart::KViewPart(TQWidget *parentWidget, const char *widgetName, TQObject *parent,
                      const char *name, const TQStringList& args)
-  : KViewPart_Iface(parent, name), showSidebar(0), saveAction(0), partManager(0),
-    multiPageLibrary(TQString()), aboutDialog(0)
+  : KViewPart_Iface(parent, name), showSidebar(nullptr), saveAction(nullptr), partManager(nullptr),
+    multiPageLibrary(TQString()), aboutDialog(nullptr)
 {
   TDEGlobal::locale()->insertCatalogue("kviewshell");
 
-  tmpUnzipped = 0L;
+  tmpUnzipped = nullptr;
   pageChangeIsConnected = false;
   setInstance(KViewPartFactory::instance());
 
@@ -193,8 +193,8 @@ KViewPart::KViewPart(TQWidget *parentWidget, const char *widgetName, TQObject *p
   showSidebar = new TDEToggleAction (i18n("Show &Sidebar"), "show_side_panel", 0, this,
                                    TQ_SLOT(slotShowSidebar()), actionCollection(), "show_sidebar");
   showSidebar->setCheckedState(i18n("Hide &Sidebar"));
-  watchAct = new TDEToggleAction(i18n("&Watch File"), 0, 0, 0, actionCollection(), "watch_file");
-  scrollbarHandling = new TDEToggleAction (i18n("Show Scrollbars"), 0, 0, 0, actionCollection(), "scrollbarHandling");
+  watchAct = new TDEToggleAction(i18n("&Watch File"), 0, nullptr, nullptr, actionCollection(), "watch_file");
+  scrollbarHandling = new TDEToggleAction (i18n("Show Scrollbars"), 0, nullptr, nullptr, actionCollection(), "scrollbarHandling");
   scrollbarHandling->setCheckedState(i18n("Hide Scrollbars"));
 
   // View modes
@@ -203,19 +203,19 @@ KViewPart::KViewPart(TQWidget *parentWidget, const char *widgetName, TQObject *p
   viewModes.append(i18n("Continuous"));
   viewModes.append(i18n("Continuous - Facing"));
   viewModes.append(i18n("Overview"));
-  viewModeAction = new TDESelectAction (i18n("View Mode"), 0, 0, 0, actionCollection(), "viewmode");
+  viewModeAction = new TDESelectAction (i18n("View Mode"), 0, nullptr, nullptr, actionCollection(), "viewmode");
   viewModeAction->setItems(viewModes);
 
   // Orientation menu
   TQStringList orientations;
   orientations.append(i18n("Portrait"));
   orientations.append(i18n("Landscape"));
-  orientation = new TDESelectAction (i18n("Preferred &Orientation"), 0, 0, 0, actionCollection(), "view_orientation");
+  orientation = new TDESelectAction (i18n("Preferred &Orientation"), 0, nullptr, nullptr, actionCollection(), "view_orientation");
   orientation->setItems(orientations);
   connect(orientation, TQ_SIGNAL(activated (int)), &userRequestedPaperSize, TQ_SLOT(setOrientation(int)));
 
   // Zoom Menu
-  zoom_action = new TDESelectAction (i18n("&Zoom"), 0, 0, 0, actionCollection(), "view_zoom");
+  zoom_action = new TDESelectAction (i18n("&Zoom"), 0, nullptr, nullptr, actionCollection(), "view_zoom");
   zoom_action->setEditable(true);
   zoom_action->setItems(_zoomVal.zoomNames());
 
@@ -227,7 +227,7 @@ KViewPart::KViewPart(TQWidget *parentWidget, const char *widgetName, TQObject *p
   emit(zoomChanged("100%"));
 
   // Paper Size Menu
-  media = new TDESelectAction (i18n("Preferred Paper &Size"), 0, 0, 0, actionCollection(), "view_media");
+  media = new TDESelectAction (i18n("Preferred Paper &Size"), 0, nullptr, nullptr, actionCollection(), "view_media");
   TQStringList items = userRequestedPaperSize.pageSizeNames();
   items.prepend(i18n("Custom Size..."));
   media->setItems(items);
@@ -326,7 +326,7 @@ KViewPart::KViewPart(TQWidget *parentWidget, const char *widgetName, TQObject *p
 
   // The page size dialog is constructed on first usage -- saves some
   // memory when not used.
-  _pageSizeDialog = 0;
+  _pageSizeDialog = nullptr;
 
   checkActions();
   viewModeAction->setCurrentItem(KVSPrefs::viewMode());
@@ -343,11 +343,11 @@ KViewPart::~KViewPart()
   // Without the next two lines, konqueror crashes when it is quit
   // while displaying a DVI file. I don't really understand
   // why... --Stefan.
-  if (manager() != 0)
+  if (manager())
     manager()->removePart(this);
 
   // Delete the partManager;
-  setManager(0);
+  setManager(nullptr);
   delete partManager;
 
   delete multiPage;
@@ -452,7 +452,7 @@ void KViewPart::saveDocumentRestoreInfo(TDEConfig* config)
 void KViewPart::slotFileOpen()
 {
   if ((!multiPage.isNull()) && (multiPage->isModified() == true)) {
-    int ans = KMessageBox::warningContinueCancel( 0,
+    int ans = KMessageBox::warningContinueCancel( nullptr,
 					 i18n("Your document has been modified. Do you really want to open another document?"),
 					 i18n("Warning - Document Was Modified"),KStdGuiItem::open());
     if (ans == KMessageBox::Cancel)
@@ -493,7 +493,7 @@ TQStringList KViewPart::supportedMimeTypes()
   // uncompress them on the fly.
 
   // Check if this version of TDE supports bzip2
-  bool bzip2Available = (KFilterBase::findFilterByMimeType( "application/x-bzip2" ) != 0L);
+  bool bzip2Available = (KFilterBase::findFilterByMimeType( "application/x-bzip2" ) != nullptr);
 
   supportedMimeTypes << "application/x-gzip";
 
@@ -547,7 +547,7 @@ TQStringList KViewPart::fileFormats() const
   // for bzip2 is compiled into TDE.
 
   // Check if this version of TDE supports bzip2
-  bool bzip2Available = (KFilterBase::findFilterByMimeType( "application/x-bzip2" ) != 0L);
+  bool bzip2Available = (KFilterBase::findFilterByMimeType( "application/x-bzip2" ) != nullptr);
 
   TQStringList compressedPattern;
 
@@ -662,11 +662,11 @@ bool KViewPart::openFile()
       ( mimetype->parentMimeType() == "application/x-bzip2" ))
   {
     // The file is compressed. Make a temporary file, and store an uncompressed version there...
-    if (tmpUnzipped != 0L)  // Delete old temporary file
+    if (tmpUnzipped)  // Delete old temporary file
       delete tmpUnzipped;
 
     tmpUnzipped = new KTempFile;
-    if (tmpUnzipped == 0L)
+    if (!tmpUnzipped)
     {
       KMessageBox::error(mainWidget, i18n("<qt><strong>File Error!</strong> Could not create "
                          "temporary file.</qt>"));
@@ -690,7 +690,7 @@ bool KViewPart::openFile()
       filterDev = KFilterDev::deviceForFile(m_file, mimetype->parentMimeType());
     else
       filterDev = KFilterDev::deviceForFile(m_file);
-    if (filterDev == 0L)
+    if (!filterDev)
     {
       emit setWindowCaption(TQString());
       emit setStatusBarText(TQString());
@@ -710,7 +710,7 @@ bool KViewPart::openFile()
       return false;
     }
 
-    KProgressDialog* prog = new KProgressDialog(0L, "uncompress-progress",
+    KProgressDialog* prog = new KProgressDialog(nullptr, "uncompress-progress",
         i18n("Uncompressing..."),
         i18n("<qt>Uncompressing the file <nobr><strong>%1</strong></nobr>. Please wait.</qt>").arg(m_file));
 
@@ -925,7 +925,7 @@ bool KViewPart::closeURL_ask()
     return false;
 
   if (multiPage->isModified() == true) {
-    int ans = KMessageBox::warningContinueCancel( 0,
+    int ans = KMessageBox::warningContinueCancel( nullptr,
 					 i18n("Your document has been modified. Do you really want to close it?"),
 					 i18n("Document Was Modified"), KStdGuiItem::close());
     if (ans == KMessageBox::Cancel)
@@ -970,9 +970,9 @@ void KViewPart::slotMedia(int id)
   // member, if the user clicks ok/accept. The signal/slot mechanism
   // will then make sure that the necessary updates in the GUI are
   // done.
-  if (_pageSizeDialog == 0) {
+  if (!_pageSizeDialog) {
     _pageSizeDialog = new pageSizeDialog(mainWidget, &userRequestedPaperSize);
-    if (_pageSizeDialog == 0) {
+    if (!_pageSizeDialog) {
       kdError(1223) << "Could not construct the page size dialog!" << endl;
       return;
     }
@@ -1414,7 +1414,7 @@ TDEAboutData* KViewPart::createAboutData()
 
 void KViewPart::aboutKViewShell()
 {
-  if (aboutDialog == 0)
+  if (!aboutDialog)
   {
     // Create Dialog
     aboutDialog = new TDEAboutDialog(mainWidget, "about_kviewshell");
diff --git a/kviewshell/main.cpp b/kviewshell/main.cpp
index b2c1ba47..c24f0be9 100644
--- a/kviewshell/main.cpp
+++ b/kviewshell/main.cpp
@@ -18,13 +18,13 @@
 
 static TDECmdLineOptions options[] =
 {
-  { "u", 0, 0},
-  { "unique", I18N_NOOP("Check if the file is loaded in another kviewshell.\nIf it is, bring up the other kviewshell. Otherwise, load the file."), 0 },
-  { "m", 0, 0},
-  { "mimetype <mimetype>", I18N_NOOP("Loads a plugin which supports files of type <mimetype>,\nif one is installed."), 0 },
-  { "g", 0, 0},
-  { "goto <pagenumber>", I18N_NOOP("Navigate to this page"), 0 },
-  { "+file(s)", I18N_NOOP("Files to load"), 0 },
+  { "u", nullptr, nullptr},
+  { "unique", I18N_NOOP("Check if the file is loaded in another kviewshell.\nIf it is, bring up the other kviewshell. Otherwise, load the file."), nullptr },
+  { "m", nullptr, nullptr},
+  { "mimetype <mimetype>", I18N_NOOP("Loads a plugin which supports files of type <mimetype>,\nif one is installed."), nullptr },
+  { "g", nullptr, nullptr},
+  { "goto <pagenumber>", I18N_NOOP("Navigate to this page"), nullptr },
+  { "+file(s)", I18N_NOOP("Files to load"), nullptr },
   TDECmdLineLastOption
 };
 
diff --git a/kviewshell/marklist.cpp b/kviewshell/marklist.cpp
index fcd80160..7632f6e0 100644
--- a/kviewshell/marklist.cpp
+++ b/kviewshell/marklist.cpp
@@ -47,7 +47,7 @@
 namespace {
 
 /** Holds the icon used as a overlay on pages which are not drawn yet. */
-TQPixmap* waitIcon = 0;
+TQPixmap* waitIcon = nullptr;
 
 } // namespace anon
 
@@ -171,7 +171,7 @@ MarkListWidget::MarkListWidget(TQWidget* _parent, MarkList* _markList, const Pag
 {
   TQBoxLayout* layout = new TQVBoxLayout(this, margin);
 
-  thumbnailWidget = 0;
+  thumbnailWidget = nullptr;
   if (showThumbnail)
   {
     thumbnailWidget = new ThumbnailWidget(this, pageNumber, pageCache);
@@ -273,7 +273,7 @@ void MarkListWidget::mousePressEvent(TQMouseEvent* e)
 
 
 MarkList::MarkList(TQWidget* parent, const char* name)
-  : TQScrollView(parent, name), clickedThumbnail(0), showThumbnails(true), contextMenu(0)
+  : TQScrollView(parent, name), clickedThumbnail(0), showThumbnails(true), contextMenu(nullptr)
 {
   currentPage = PageNumber::invalidPage;
   widgetList.setAutoDelete(true);
@@ -555,7 +555,7 @@ void MarkList::repaintThumbnails()
 
 void MarkList::showPopupMenu(const PageNumber& pageNumber, const TQPoint& position)
 {
-  if (contextMenu == 0)
+  if (!contextMenu)
   {
     // Initialize Contextmenu
     contextMenu = new TDEPopupMenu(this, "markListContext");
diff --git a/kviewshell/marklist.h b/kviewshell/marklist.h
index 9375b73d..37b05696 100644
--- a/kviewshell/marklist.h
+++ b/kviewshell/marklist.h
@@ -128,7 +128,7 @@ class MarkList: public TQScrollView
   
 
 public:
-  MarkList(TQWidget* parent = 0, const char* name = 0);
+  MarkList(TQWidget* parent = nullptr, const char* name = nullptr);
   virtual ~MarkList();
 
   void setPageCache(DocumentPageCache*);
diff --git a/kviewshell/pageSize.cpp b/kviewshell/pageSize.cpp
index 6a94aeed..fc7f4094 100644
--- a/kviewshell/pageSize.cpp
+++ b/kviewshell/pageSize.cpp
@@ -39,7 +39,7 @@ static pageSizeItem staticList[] = { {"DIN A0",    841.0, 1189.0, "mm"},
 				     {"DIN B5",    176.0, 250.0, "mm"},
 				     {"US Letter", 215.9, 279.4, "in"}, 
 				     {"US Legal",  215.9, 355.6, "in"},
-				     {0,  0.0, 0.0, 0} // marks the end of the list.
+				     {nullptr,  0.0, 0.0, nullptr} // marks the end of the list.
 };
 
 
@@ -65,7 +65,7 @@ bool pageSize::setPageSize(const TQString& name)
 {
   // See if we can recognize the string
   TQString currentName;
-  for(int i=0; staticList[i].name != 0; i++) {
+  for(int i=0; staticList[i].name; i++) {
     currentName = staticList[i].name;
     if (currentName == name) {
       currentSize = i;  
@@ -251,7 +251,7 @@ TQStringList pageSize::pageSizeNames()
 {
   TQStringList names;
   
-  for(int i=0; staticList[i].name != 0; i++) 
+  for(int i=0; staticList[i].name; i++)
     names << staticList[i].name;
 
   return names;
@@ -310,7 +310,7 @@ TQString pageSize::serialize() const
 
 void pageSize::reconstructCurrentSize()
 {
-  for(int i=0; staticList[i].name != 0; i++) {
+  for(int i=0; staticList[i].name; i++) {
     if ((fabs(staticList[i].width - pageWidth.getLength_in_mm()) <= 2) && (fabs(staticList[i].height - pageHeight.getLength_in_mm()) <= 2)) {
       currentSize = i;
       pageWidth.setLength_in_mm(staticList[currentSize].width);
diff --git a/kviewshell/pageSizeDialog.cpp b/kviewshell/pageSizeDialog.cpp
index aaede928..0ee651d2 100644
--- a/kviewshell/pageSizeDialog.cpp
+++ b/kviewshell/pageSizeDialog.cpp
@@ -39,7 +39,7 @@ pageSizeDialog::pageSizeDialog( TQWidget *parent, pageSize *userPrefdPageSize, c
 
 void pageSizeDialog::slotOk()
 {
-  if (userPreferredPageSize != 0)
+  if (userPreferredPageSize)
     *userPreferredPageSize = pageSizeW->pageSizeData();
   accept();
 }
@@ -47,14 +47,14 @@ void pageSizeDialog::slotOk()
 
 void pageSizeDialog::slotApply()
 {
-  if (userPreferredPageSize != 0)
+  if (userPreferredPageSize)
     *userPreferredPageSize = pageSizeW->pageSizeData();
 }
 
 
 void pageSizeDialog::setPageSize(const TQString& name)
 {
-  if (pageSizeW == 0)
+  if (!pageSizeW)
     return;
   pageSizeW->setPageSize(name);
 }
diff --git a/kviewshell/pageSizeDialog.h b/kviewshell/pageSizeDialog.h
index 00300105..ff1e61a0 100644
--- a/kviewshell/pageSizeDialog.h
+++ b/kviewshell/pageSizeDialog.h
@@ -36,7 +36,7 @@ public:
   // value whenever the user clicks on 'accept' or 'ok'. Programmers
   // can then connect to the signal sizeChanged() of the object to be
   // informed about the changes.
-  pageSizeDialog( TQWidget *parent=0, pageSize *userPrefdPageSize=0, const char *name=0, bool modal=true);
+  pageSizeDialog( TQWidget *parent=nullptr, pageSize *userPrefdPageSize=nullptr, const char *name=nullptr, bool modal=true);
   void setPageSize(const TQString&);
 
 protected slots:
diff --git a/kviewshell/pageSizeWidget.h b/kviewshell/pageSizeWidget.h
index dbbfe269..feacc0dd 100644
--- a/kviewshell/pageSizeWidget.h
+++ b/kviewshell/pageSizeWidget.h
@@ -21,7 +21,7 @@ class pageSizeWidget : public pageSizeWidget_base
   
 
 public:
-  pageSizeWidget( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+  pageSizeWidget( TQWidget* parent = nullptr, const char* name = nullptr, WFlags fl = 0 );
 
   // Sets the page size. If the dialog is already shown, updates all
   // the GUI. Accepts the same strings as input as the setPageSize()
diff --git a/kviewshell/pageView.cpp b/kviewshell/pageView.cpp
index 028522f1..b07d5032 100644
--- a/kviewshell/pageView.cpp
+++ b/kviewshell/pageView.cpp
@@ -35,7 +35,7 @@ PageView::PageView( TQWidget* parent, const char* name )
 {
   moveTool = true;
 
-  widgetList = 0;
+  widgetList = nullptr;
   viewport()->setFocusPolicy(TQWidget::StrongFocus);
 
   setResizePolicy(TQScrollView::Manual);
@@ -60,7 +60,7 @@ PageView::PageView( TQWidget* parent, const char* name )
 
 void PageView::addChild( TQPtrVector<DocumentWidget> *wdgList )
 {
-  if( wdgList == 0 ) {
+  if( !wdgList ) {
     kdError(1223) << "PageView::addChild(...) called with invalid arguments" << endl;
     return;
   }
@@ -90,7 +90,7 @@ bool PageView::readUp()
     // Coordinate of the top of the viewport
     int top = contentsY();
 
-    DocumentWidget* widget = 0;
+    DocumentWidget* widget = nullptr;
     // Find the widget(s) that intersect the top of the viewport
     // TODO: It would be better to use a binary search.
     for(TQ_UINT16 i=0; i<widgetList->size(); i++)
@@ -119,7 +119,7 @@ bool PageView::readDown()
     // Coordinate of the bottom of the viewport
     int bottom = contentsY() + visibleHeight();
 
-    DocumentWidget* widget = 0;
+    DocumentWidget* widget = nullptr;
     // Find the widget(s) that intersect the bottom of the viewport
     // TODO: It would be better to use a binary search.
     for(TQ_UINT16 i=0; i<widgetList->size(); i++)
@@ -298,7 +298,7 @@ void PageView::setFullScreenMode(bool fullScreen)
 void PageView::layoutPages(bool zoomChanged)
 {
   // Paranoid safety check
-  if (widgetList == 0)
+  if (!widgetList)
     return;
 
   // If there are no widgets, e.g. because the last widget has been
@@ -492,7 +492,7 @@ void PageView::viewportPaintEvent(TQPaintEvent* e)
   // Region from which rectangles occupied by child widgets will by substracted.
   TQRegion backgroundArea(e->rect());
 
-  if (widgetList != 0)
+  if (widgetList)
   {
     for (unsigned int i = 0; i < widgetList->count(); i++)
     {
@@ -531,7 +531,7 @@ void PageView::viewportPaintEvent(TQPaintEvent* e)
 void PageView::calculateCurrentPageNumber(int x, int y)
 {
   // Safety check
-  if (widgetList == 0)
+  if (!widgetList)
     return;
 
   TQRect viewportRect(x, y, visibleWidth(), visibleHeight());
@@ -540,13 +540,13 @@ void PageView::calculateCurrentPageNumber(int x, int y)
   //          << viewportRect.width() << ", " << viewportRect.height() << ")" << endl;
 
   int maxVisiblePixels = 0;
-  DocumentWidget* _currentWidget = 0;
+  DocumentWidget* _currentWidget = nullptr;
 
   for (TQ_UINT16 i = 0; i < widgetList->size(); i++)
   {
     DocumentWidget* documentWidget = widgetList->at(i);
     // Safety check
-    if (documentWidget == 0)
+    if (!documentWidget)
       continue;
 
     // Check if the Widget is visible
@@ -573,7 +573,7 @@ void PageView::calculateCurrentPageNumber(int x, int y)
   }
 
   // No page is visible
-  if (_currentWidget == 0)
+  if (!_currentWidget)
     return;
 
   // Return the number of the current page
diff --git a/kviewshell/pageView.h b/kviewshell/pageView.h
index 2664f4f9..7c5f21e1 100644
--- a/kviewshell/pageView.h
+++ b/kviewshell/pageView.h
@@ -39,7 +39,7 @@ class PageView : public TQScrollView
   
 
 public:
-    PageView( TQWidget* parent = 0, const char* name = 0 );
+    PageView( TQWidget* parent = nullptr, const char* name = nullptr );
     ~PageView() {}
 
     void addChild( TQPtrVector<DocumentWidget> *wdgList );
@@ -71,7 +71,7 @@ public:
     widgets. The number i returned always satisfies 1 <= i <= nrCols,
     where nrCols is the private variable of the same nane.
     */
-    TQ_UINT8 getNrColumns() const { return  (widgetList==0) ? 1 : TQMIN(nrCols, TQMAX(1, widgetList->size())); }
+    TQ_UINT8 getNrColumns() const { return  !widgetList ? 1 : TQMIN(nrCols, TQMAX(1, widgetList->size())); }
 
     TQ_UINT8 getNrRows() const { return nrRows; }
     bool isContinuous() const { return continuousViewmode; }
diff --git a/kviewshell/plugins/djvu/djvumultipage.cpp b/kviewshell/plugins/djvu/djvumultipage.cpp
index 8cfde527..ebaecbfe 100644
--- a/kviewshell/plugins/djvu/djvumultipage.cpp
+++ b/kviewshell/plugins/djvu/djvumultipage.cpp
@@ -62,7 +62,7 @@ DjVuMultiPage::DjVuMultiPage(TQWidget *parentWidget, const char *widgetName, TQO
   renderModes.append(i18n("Black and White"));
   renderModes.append(i18n("Show foreground only"));
   renderModes.append(i18n("Show background only"));
-  renderModeAction = new TDESelectAction (i18n("Render Mode"), 0, 0, 0, actionCollection(), "render_mode");
+  renderModeAction = new TDESelectAction (i18n("Render Mode"), 0, nullptr, nullptr, actionCollection(), "render_mode");
   renderModeAction->setItems(renderModes);
 
   renderModeAction->setCurrentItem(Prefs::renderMode());
@@ -200,11 +200,11 @@ void DjVuMultiPage::print()
 
   // Allocate the printer structure
   KPrinter *printer = getPrinter(false);
-  if (printer == 0)
+  if (!printer)
     return;
 
   KPrintDialogPage_DJVUPageOptions *pageOptions = new KPrintDialogPage_DJVUPageOptions();
-  if (pageOptions == 0) {
+  if (!pageOptions) {
     kdError(1223) << "DjVuMultiPage::print(): Cannot allocate new KPrintDialogPage_PageOptions structure" << endl;
     delete printer;
     return;
@@ -212,7 +212,7 @@ void DjVuMultiPage::print()
   printer->addDialogPage( pageOptions );
 
   KPrintDialogPage_DJVUConversionOptions *conversionOptions = new KPrintDialogPage_DJVUConversionOptions();
-  if (pageOptions == 0) {
+  if (!pageOptions) {
     kdError(1223) << "DjVuMultiPage::print(): Cannot allocate new KPrintDialogPage_ConversionOptions structure" << endl;
     delete printer;
     return;
@@ -323,7 +323,7 @@ void DjVuMultiPage::slotSave()
     formats = fileFormats().grep(ending).join("\n");
   }
 
-  TQString fileName = KFileDialog::getSaveFileName(TQString(), formats, 0, i18n("Save File As"));
+  TQString fileName = KFileDialog::getSaveFileName(TQString(), formats, nullptr, i18n("Save File As"));
 
   if (fileName.isEmpty())
     return;
diff --git a/kviewshell/plugins/djvu/djvurenderer.cpp b/kviewshell/plugins/djvu/djvurenderer.cpp
index 2fac80bb..c400a2f3 100644
--- a/kviewshell/plugins/djvu/djvurenderer.cpp
+++ b/kviewshell/plugins/djvu/djvurenderer.cpp
@@ -88,7 +88,7 @@ void DjVuRenderer::drawPage(double resolution, RenderedDocumentPage* page)
 #endif
 
   // Paranoid safety checks
-  if (page == 0) {
+  if (!page) {
     kdError() << "DjVuRenderer::drawPage(documentPage*) called with argument == 0" << endl;
     return;
   }
@@ -152,7 +152,7 @@ void DjVuRenderer::drawPage(double resolution, RenderedDocumentPage* page)
     djvuPixmap = djvuPage->get_bg_pixmap(pageRect, pageRect);
 
   TQPainter* foreGroundPaint = page->getPainter();
-  if (foreGroundPaint != 0) 
+  if (foreGroundPaint)
   {
     if(djvuPixmap && Prefs::renderMode() != Prefs::EnumRenderMode::BlackAndWhite)
     {
@@ -382,7 +382,7 @@ void DjVuRenderer::getAnnotations(RenderedDocumentPage* page, GP<DjVuImage> djvu
 
 bool DjVuRenderer::initializeDocument()
 {
-  if (document == 0)
+  if (!document)
     return false;
 
   if (!document->wait_for_complete_init()) {
@@ -456,7 +456,7 @@ GP<DjVuTXT> DjVuRenderer::getText(PageNumber pageNumber)
       iff->close_chunk();
     }
   }
-  return 0;
+  return nullptr;
 }
 
 void DjVuRenderer::fillInText(RenderedDocumentPage* page, const GP<DjVuTXT>& text, DjVuTXT::Zone& zone, TQSize& djvuPageSize)
@@ -569,7 +569,7 @@ void DjVuRenderer::getText(RenderedDocumentPage* page)
 
 bool DjVuRenderer::convertToPSFile( DjVuToPS &converter, TQString filename, TQValueList<int> &pageList )
 {
-  if (document == 0) {
+  if (!document) {
     kdError(1223) << "DjVuRenderer::convertToPSFile(..) called when document was 0" << endl;
     return false;
   }
@@ -621,7 +621,7 @@ bool DjVuRenderer::convertToPSFile( DjVuToPS &converter, TQString filename, TQVa
 void DjVuRenderer::deletePages(TQ_UINT16 from, TQ_UINT16 to)
 {
   // Paranoia security checks
-  if (document == 0) {
+  if (!document) {
     kdError(1223) << "DjVuRenderer::deletePages(...) called when no document was loaded" << endl;
     return;
   }
@@ -632,7 +632,7 @@ void DjVuRenderer::deletePages(TQ_UINT16 from, TQ_UINT16 to)
 
   TQMutexLocker locker( &mutex );
 
-  KProgressDialog *pdialog = 0;
+  KProgressDialog *pdialog = nullptr;
   if (to-from > 9) {
     pdialog = new KProgressDialog(parentWidget, "Printing-ProgressDialog", i18n("Deleting pages..."), i18n("Please wait while pages are removed..."), true);
     pdialog->showCancelButton(false);
@@ -645,10 +645,10 @@ void DjVuRenderer::deletePages(TQ_UINT16 from, TQ_UINT16 to)
   // set the document pointer temporarily to 0, so that no-one tries
   // to render a page while we are deleting pages
   GP<DjVuDocEditor> document_new = document;
-  document = 0;
+  document = nullptr;
 
   // Delete pages
-  if (pdialog == 0) {
+  if (!pdialog) {
     GList<int> pageList;
     for(TQ_UINT16 i=from; i<= to; i++)
       pageList.append(i-1);
@@ -671,7 +671,7 @@ void DjVuRenderer::deletePages(TQ_UINT16 from, TQ_UINT16 to)
 
 bool DjVuRenderer::save(const TQString &filename)
 {
-  if (document == 0) {
+  if (!document) {
     kdError() << "DjVuRenderer::save(..) called when document==0" << endl;
     return false;
   }
@@ -698,7 +698,7 @@ bool DjVuRenderer::save(const TQString &filename)
 
 void DjVuRenderer::printerInfoCallBack(int page_num, int page_count, int, DjVuToPS::Stage, void *pd)
 {
-  if (pd == 0)
+  if (!pd)
     return;
   
   // Update the progress dialog.
diff --git a/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.cpp b/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.cpp
index 325effeb..54852e32 100644
--- a/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.cpp
+++ b/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.cpp
@@ -35,13 +35,13 @@ KPrintDialogPage_DJVUConversionOptions::KPrintDialogPage_DJVUConversionOptions(
   setTitle( i18n("DJVU to PS Conversion") );
 
   kprintDialogPage_pageoptions_baseLayout = new TQVBoxLayout( this, 11, 6, "kprintDialogPage_pageoptions_baseLayout"); 
-  if (kprintDialogPage_pageoptions_baseLayout == 0) {
+  if (!kprintDialogPage_pageoptions_baseLayout) {
     kdError(1223) << "KPrintDialogPage_DJVUPageOptions::KPrintDialogPage_DJVUPageOptions() cannot create layout" << endl;
     return;
   }
   
   wdg = new kprintDialogPage_DJVUconversionoptions_basewidget(this, "basewdg" );
-  if (wdg != 0) {
+  if (wdg) {
     kprintDialogPage_pageoptions_baseLayout->addWidget( wdg );
   }
 }
@@ -50,7 +50,7 @@ KPrintDialogPage_DJVUConversionOptions::KPrintDialogPage_DJVUConversionOptions(
 
 void KPrintDialogPage_DJVUConversionOptions::getOptions( TQMap<TQString,TQString>& opts, bool )
 {
-  if (wdg == 0) 
+  if (!wdg)
     return;
 
   opts["kde-kdjvu-pslevel"] = TQString::number(wdg->psLevel->currentItem() + 1);
@@ -75,7 +75,7 @@ void KPrintDialogPage_DJVUConversionOptions::getOptions( TQMap<TQString,TQString
 
 void KPrintDialogPage_DJVUConversionOptions::setOptions( const TQMap<TQString,TQString>& opts )
 {
-  if (wdg == 0)
+  if (!wdg)
     return;
 
   bool ok;
diff --git a/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.h b/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.h
index 0c15d1ea..a86c4590 100644
--- a/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.h
+++ b/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.h
@@ -34,7 +34,7 @@ class kprintDialogPage_DJVUconversionoptions_basewidget;
 class KPrintDialogPage_DJVUConversionOptions : public KPrintDialogPage
 {
  public:
-  KPrintDialogPage_DJVUConversionOptions( TQWidget *parent = 0, const char *name = 0 );
+  KPrintDialogPage_DJVUConversionOptions( TQWidget *parent = nullptr, const char *name = nullptr );
   
   void getOptions( TQMap<TQString,TQString>& opts, bool incldef = false );
   void setOptions( const TQMap<TQString,TQString>& opts );
diff --git a/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.cpp b/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.cpp
index c192b7ff..83b97b57 100644
--- a/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.cpp
+++ b/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.cpp
@@ -33,19 +33,19 @@ KPrintDialogPage_DJVUPageOptions::KPrintDialogPage_DJVUPageOptions( TQWidget *pa
 {
   setTitle( i18n("Page Size & Placement") );
 
-  kprintDialogPage_pageoptions_baseLayout = 0;
-  checkBox_rotate = 0;
-  checkBox_fitpage = 0;
+  kprintDialogPage_pageoptions_baseLayout = nullptr;
+  checkBox_rotate = nullptr;
+  checkBox_fitpage = nullptr;
 
 
   kprintDialogPage_pageoptions_baseLayout = new TQVBoxLayout( this, 11, 6, "kprintDialogPage_pageoptions_baseLayout");
-  if (kprintDialogPage_pageoptions_baseLayout == 0) {
+  if (!kprintDialogPage_pageoptions_baseLayout) {
     kdError(1223) << "KPrintDialogPage_DJVUPageOptions::KPrintDialogPage_DJVUPageOptions() cannot create layout" << endl;
     return;
   }
 
   checkBox_rotate = new TQCheckBox( this, "checkBox_rotate" );
-  if (checkBox_rotate != 0) {
+  if (checkBox_rotate) {
     checkBox_rotate->setText( i18n( "Automatically choose landscape or portrait orientation" ) );
     TQToolTip::add( checkBox_rotate, i18n( "If this option is enabled, some pages might be rotated to better fit the paper size." ) );
     TQWhatsThis::add( checkBox_rotate, i18n( "<qt><p>If this option is enabled, landscape or portrait orientation are automatically chosen on a "
@@ -58,7 +58,7 @@ KPrintDialogPage_DJVUPageOptions::KPrintDialogPage_DJVUPageOptions( TQWidget *pa
   }
 
   checkBox_fitpage = new TQCheckBox( this, "checkBox_shrink" );
-  if (checkBox_fitpage != 0) {
+  if (checkBox_fitpage) {
     checkBox_fitpage->setText( i18n( "Scale pages to fit paper size" ) );
     TQToolTip::add( checkBox_fitpage, i18n( "If this option is enabled, all pages will be scaled to optimally fit the printer's paper size." ) );
     TQWhatsThis::add( checkBox_fitpage, i18n( "<qt><p>If this option is enabled, all pages will be scaled to optimally fit the printer's "
@@ -82,13 +82,13 @@ void KPrintDialogPage_DJVUPageOptions::getOptions( TQMap<TQString,TQString>& opt
   // The default values are also coded into setOptions() and
   // tdemultipage::print(..).
 
-  if (checkBox_rotate != 0)
+  if (checkBox_rotate)
     if (checkBox_rotate->isChecked())
       opts[ "kde-kviewshell-rotatepage" ] = "true";
     else
       opts[ "kde-kviewshell-rotatepage" ] = "false";
 
-  if (checkBox_fitpage != 0)
+  if (checkBox_fitpage)
     if (checkBox_fitpage->isChecked())
       opts[ "kde-kdjvu-fitpage" ] = "true";
     else
@@ -103,12 +103,12 @@ void KPrintDialogPage_DJVUPageOptions::setOptions( const TQMap<TQString,TQString
 
   // same for rotation
   TQString op = opts[ "kde-kviewshell-rotatepage" ];
-  if (checkBox_rotate != 0)
+  if (checkBox_rotate)
     checkBox_rotate->setChecked( op != "false" );
 
   // Sets the fitpage option. By default, this option is not checked
   op = opts[ "kde-kdjvu-fitpage" ];
-  if (checkBox_fitpage != 0)
+  if (checkBox_fitpage)
     checkBox_fitpage->setChecked( op == "true" );
 }
 
diff --git a/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.h b/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.h
index c23b7efb..c63d0851 100644
--- a/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.h
+++ b/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.h
@@ -25,7 +25,7 @@ class TQCheckBox;
 class KPrintDialogPage_DJVUPageOptions : public KPrintDialogPage
 {
  public:
-  KPrintDialogPage_DJVUPageOptions( TQWidget *parent = 0, const char *name = 0 );
+  KPrintDialogPage_DJVUPageOptions( TQWidget *parent = nullptr, const char *name = nullptr );
   
   void getOptions( TQMap<TQString,TQString>& opts, bool incldef = false );
   void setOptions( const TQMap<TQString,TQString>& opts );
diff --git a/kviewshell/plugins/djvu/pageRangeWidget.cpp b/kviewshell/plugins/djvu/pageRangeWidget.cpp
index 4acd8294..51039943 100644
--- a/kviewshell/plugins/djvu/pageRangeWidget.cpp
+++ b/kviewshell/plugins/djvu/pageRangeWidget.cpp
@@ -26,7 +26,7 @@
 PageRangeWidget::PageRangeWidget( TQ_UINT16 _from, TQ_UINT16 _to, TQ_UINT16 _current, TQWidget *parent, const char *name) : PageRangeWidget_base(parent, name)
 {
   // Paranoid security checks
-  if ((from == 0) || (to == 0))
+  if (!from || !to)
     return;
   if (_from > _to) {
     kdError() << "PageRangeWidget::PageRangeWidget(..): from > to" << endl;
diff --git a/kviewshell/plugins/djvu/pageRangeWidget.h b/kviewshell/plugins/djvu/pageRangeWidget.h
index 4f353b10..678bf482 100644
--- a/kviewshell/plugins/djvu/pageRangeWidget.h
+++ b/kviewshell/plugins/djvu/pageRangeWidget.h
@@ -32,10 +32,10 @@ TQ_OBJECT
   
 
 public:
-  PageRangeWidget( TQ_UINT16 _from, TQ_UINT16 _to, TQ_UINT16 _current, TQWidget *parent = 0, const char *name = 0 );
+  PageRangeWidget( TQ_UINT16 _from, TQ_UINT16 _to, TQ_UINT16 _current, TQWidget *parent = nullptr, const char *name = nullptr );
 
-  TQ_UINT16 getFrom() const {return (from == 0) ? 0 : from->value(); }
-  TQ_UINT16 getTo() const {return (to == 0) ? 0 : to->value(); }
+  TQ_UINT16 getFrom() const {return from ? from->value() : 0; }
+  TQ_UINT16 getTo() const {return to ? to->value() : 0; }
 
 private slots:
   void toValueChanged(int val);
diff --git a/kviewshell/renderedDocumentPagePixmap.cpp b/kviewshell/renderedDocumentPagePixmap.cpp
index 1632cbd9..07413cba 100644
--- a/kviewshell/renderedDocumentPagePixmap.cpp
+++ b/kviewshell/renderedDocumentPagePixmap.cpp
@@ -28,7 +28,7 @@
 #include "renderedDocumentPagePixmap.h"
 
 RenderedDocumentPagePixmap::RenderedDocumentPagePixmap()
-  : _accessiblePixmap(0), dirty(true)
+  : _accessiblePixmap(nullptr), dirty(true)
 {
 }
 
@@ -42,7 +42,7 @@ TQPainter* RenderedDocumentPagePixmap::getPainter()
 {
   if (paintingActive()) {
     kdError(1223) << "RenderedDocumentPagePixmap::getPainter() called when painting was active" << endl;
-    return 0;
+    return nullptr;
   } else
     return new TQPainter(this);
 }
diff --git a/kviewshell/renderedDocumentPagePrinter.cpp b/kviewshell/renderedDocumentPagePrinter.cpp
index ff5171a0..eca18221 100644
--- a/kviewshell/renderedDocumentPagePrinter.cpp
+++ b/kviewshell/renderedDocumentPagePrinter.cpp
@@ -30,9 +30,9 @@
 RenderedDocumentPagePrinter::RenderedDocumentPagePrinter(KPrinter *kp)
 {
   printer = kp;
-  printerPainter = 0;
+  printerPainter = nullptr;
 
-  if (printer == 0) {
+  if (!printer) {
     kdError(1223) << "RenderedDocumentPagePrinter::RenderedDocumentPagePixmap() called with printer == 0" << endl;
     return;
   }
@@ -43,7 +43,7 @@ RenderedDocumentPagePrinter::RenderedDocumentPagePrinter(KPrinter *kp)
 
 TQSize RenderedDocumentPagePrinter::size()
 {
-  if (printer == 0) {
+  if (!printer) {
     kdError(1223) << "RenderedDocumentPagePrinter::size() called with printer == 0" << endl;
     return TQSize(0,0);
   }
diff --git a/kviewshell/searchWidget.h b/kviewshell/searchWidget.h
index 13c1590e..9250e237 100644
--- a/kviewshell/searchWidget.h
+++ b/kviewshell/searchWidget.h
@@ -36,7 +36,7 @@ class SearchWidget : public TQWidget
   
 
 public:
-  SearchWidget(TQWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+  SearchWidget(TQWidget* parent = nullptr, const char* name = nullptr, WFlags fl = 0);
   ~SearchWidget();
 
   TQString getText() const;
diff --git a/kviewshell/sizePreview.h b/kviewshell/sizePreview.h
index 768306aa..9ca46b81 100644
--- a/kviewshell/sizePreview.h
+++ b/kviewshell/sizePreview.h
@@ -21,7 +21,7 @@ class SizePreview : public TQWidget
   
 
 public:
-  SizePreview( TQWidget *parent, const char* name=0, WFlags f=0 );
+  SizePreview( TQWidget *parent, const char* name=nullptr, WFlags f=0 );
 
 public slots:
   // Sets the size.
diff --git a/kviewshell/tableOfContents.h b/kviewshell/tableOfContents.h
index 9eaeb610..315b51ee 100644
--- a/kviewshell/tableOfContents.h
+++ b/kviewshell/tableOfContents.h
@@ -60,7 +60,7 @@ signals:
   void gotoPage(const Anchor&);
 
 private:
-  void addItems(const TQPtrList<Bookmark>& bookmarks, TocItem* parent = 0);
+  void addItems(const TQPtrList<Bookmark>& bookmarks, TocItem* parent = nullptr);
 
 private slots:
   void itemClicked(TQListViewItem*);
diff --git a/kviewshell/tdemultipage.cpp b/kviewshell/tdemultipage.cpp
index b11f9b38..5074e047 100644
--- a/kviewshell/tdemultipage.cpp
+++ b/kviewshell/tdemultipage.cpp
@@ -155,7 +155,7 @@ void KMultiPage::slotSave()
     formats = fileFormats().grep(ending).join("\n");
   }
 
-  TQString fileName = KFileDialog::getSaveFileName(TQString(), formats, 0, i18n("Save File As"));
+  TQString fileName = KFileDialog::getSaveFileName(TQString(), formats, nullptr, i18n("Save File As"));
 
   if (fileName.isEmpty())
     return;
@@ -166,7 +166,7 @@ void KMultiPage::slotSave()
     fileName = fileName+ending;
 
   if (TQFile(fileName).exists()) {
-    int r = KMessageBox::warningContinueCancel (0, i18n("The file %1\nexists. Shall I overwrite that file?").arg(fileName),
+    int r = KMessageBox::warningContinueCancel (nullptr, i18n("The file %1\nexists. Shall I overwrite that file?").arg(fileName),
 				       i18n("Overwrite File"), i18n("Overwrite"));
     if (r == KMessageBox::Cancel)
       return;
@@ -225,7 +225,7 @@ bool KMultiPage::closeURL()
 void KMultiPage::slotIOJobFinished ( TDEIO::Job *job )
 {
   if ( job->error() )
-    job->showErrorDialog( 0L );
+    job->showErrorDialog( nullptr );
 }
 
 void KMultiPage::slotShowScrollbars(bool status)
@@ -430,7 +430,7 @@ void KMultiPage::generateDocumentWidgets(const PageNumber& _startPage)
   DocumentWidget *documentWidget;
   for(TQ_UINT16 i=0; i<widgetList.size(); i++) {
     documentWidget = widgetList[i];
-    if (documentWidget == 0) {
+    if (!documentWidget) {
       documentWidget = createDocumentWidget();
 
       widgetList.insert(i, documentWidget);
@@ -448,7 +448,7 @@ void KMultiPage::generateDocumentWidgets(const PageNumber& _startPage)
     // number of pages is acceptable. If an acceptable value is found,
     // nothing is done, and otherwise '1' is set as a default.
     documentWidget = widgetList[0];
-    if (documentWidget != 0) { // Paranoia safety check
+    if (documentWidget) { // Paranoia safety check
       documentWidget->setPageNumber(startPage);
       documentWidget->update();
     } else
@@ -458,7 +458,7 @@ void KMultiPage::generateDocumentWidgets(const PageNumber& _startPage)
     // starting from firstShownPage.
     for(TQ_UINT16 i=0; i<widgetList.size(); i++) {
       documentWidget = widgetList[i];
-      if (documentWidget != 0) // Paranoia safety check
+      if (documentWidget) // Paranoia safety check
       {
         if (KVSPrefs::viewMode() == KVSPrefs::EnumViewMode::Overview)
           documentWidget->setPageNumber(i+tableauStartPage);
@@ -533,7 +533,7 @@ bool KMultiPage::gotoPage(const PageNumber& page, int y, bool isLink)
         for (unsigned int i = 0; i < widgetList.size(); i++)
         {
           pageWidget = (DocumentWidget*)(widgetList[i]);
-          if (pageWidget != 0)
+          if (pageWidget)
             pageWidget->setPageNumber(tableauStartPage + i);
         }
         scrollView()->layoutPages();
@@ -561,7 +561,7 @@ bool KMultiPage::gotoPage(const PageNumber& page, int y, bool isLink)
     pageWidget = (DocumentWidget*)(widgetList[0]);
 
     // Paranoia security check
-    if (pageWidget == 0) {
+    if (!pageWidget) {
       kdError(4300) << "KMultiPage::goto_Page() called with widgetList.size() == 1, but widgetList[0] == 0" << endl;
       return false;
     }
@@ -589,7 +589,7 @@ bool KMultiPage::gotoPage(const PageNumber& page, int y, bool isLink)
       return false;
     }
     pageWidget = (DocumentWidget*)(widgetList[page-1]);
-    if (pageWidget == 0) {
+    if (!pageWidget) {
       kdError(4300) << "KMultiPage::goto_Page() called with widgetList.size() > 1, but widgetList[page] == 0" << endl;
       return false;
     }
@@ -665,7 +665,7 @@ PageNumber KMultiPage::currentPageNumber()
 void KMultiPage::doGoBack()
 {
   HistoryItem *it = document_history.back();
-  if (it != 0)
+  if (it)
     gotoPage(it->page, it->ypos, false); // Do not add a history item.
   else
     kdDebug(4300) << "Faulty return -- bad history buffer" << endl;
@@ -676,7 +676,7 @@ void KMultiPage::doGoBack()
 void KMultiPage::doGoForward()
 {
   HistoryItem *it = document_history.forward();
-  if (it != 0)
+  if (it)
     gotoPage(it->page, it->ypos, false); // Do not add a history item.
   else
     kdDebug(4300) << "Faulty return -- bad history buffer" << endl;
@@ -694,7 +694,7 @@ void KMultiPage::renderModeChanged()
   for (TQ_UINT16 i=0; i < widgetList.size(); i++)
   {
     DocumentWidget* documentWidget = widgetList[i];
-    if (documentWidget == 0)
+    if (!documentWidget)
       continue;
 
     documentWidget->update();
@@ -716,7 +716,7 @@ void KMultiPage::repaintAllVisibleWidgets()
   for(TQ_UINT16 i=0; i<widgetList.size(); i++)
   {
     DocumentWidget* documentWidget = widgetList[i];
-    if (documentWidget == 0)
+    if (!documentWidget)
       continue;
 
     // Resize, if necessary
@@ -763,7 +763,7 @@ void KMultiPage::print()
 
   // Allocate the printer structure
   KPrinter *printer = getPrinter();
-  if (printer == 0)
+  if (!printer)
     return;
 
   // initialize the printer using the print dialog
@@ -793,7 +793,7 @@ void KMultiPage::print()
 	tqApp->processEvents();
 	
 	TQPainter *paint = rdpp.getPainter();
-	if (paint != 0) {
+	if (paint) {
 	  // Before drawing the page, we figure out the zoom-value,
 	  // taking the "page sizes and placement" options from the
 	  // printer dialog into account
@@ -881,7 +881,7 @@ void KMultiPage::updateWidgetSize(const PageNumber& pageNumber)
   for(TQ_UINT16 i=0; i<widgetList.size(); i++)
   {
     DocumentWidget* documentWidget = widgetList[i];
-    if (documentWidget == 0)
+    if (!documentWidget)
       continue;
 
     if (documentWidget->getPageNumber() == pageNumber)
@@ -1120,7 +1120,7 @@ void KMultiPage::lastPage()
 void KMultiPage::scroll(TQ_INT32 deltaInPixel)
 {
   TQScrollBar* scrollBar = scrollView()->verticalScrollBar();
-  if (scrollBar == 0) {
+  if (!scrollBar) {
     kdError(4300) << "KMultiPage::scroll called without scrollBar" << endl;
     return;
   }
@@ -1169,7 +1169,7 @@ void KMultiPage::scroll(TQ_INT32 deltaInPixel)
 void KMultiPage::scrollUp()
 {
   TQScrollBar* scrollBar = scrollView()->verticalScrollBar();
-  if (scrollBar == 0)
+  if (!scrollBar)
     return;
 
   scroll(-scrollBar->lineStep());
@@ -1179,7 +1179,7 @@ void KMultiPage::scrollUp()
 void KMultiPage::scrollDown()
 {
   TQScrollBar* scrollBar = scrollView()->verticalScrollBar();
-  if (scrollBar == 0)
+  if (!scrollBar)
     return;
 
   scroll(scrollBar->lineStep());
@@ -1301,7 +1301,7 @@ void KMultiPage::gotoPage(const TextSelection& selection)
 
   RenderedDocumentPage* pageData = pageCache->getPage(selection.getPageNumber());
 
-  if (pageData == 0) {
+  if (!pageData) {
 #ifdef DEBUG_DOCUMENTWIDGET
     kdDebug(4300) << "DocumentWidget::paintEvent: no documentPage generated" << endl;
 #endif
@@ -1410,7 +1410,7 @@ void KMultiPage::findNextText()
 
   TextSelection foundSelection;
 
-  RenderedDocumentPagePixmap* searchPage = 0;
+  RenderedDocumentPagePixmap* searchPage = nullptr;
 
   for(unsigned int i = 0; i < numberOfPages(); i++)
   {
@@ -1550,7 +1550,7 @@ void KMultiPage::findPrevText()
 
   TextSelection foundSelection;
 
-  RenderedDocumentPagePixmap* searchPage = 0;
+  RenderedDocumentPagePixmap* searchPage = nullptr;
 
   for(unsigned int i = 0; i < numberOfPages(); i++)
   {
@@ -1797,7 +1797,7 @@ void KMultiPage::enableActions(bool fileLoaded)
 void KMultiPage::wheelEvent(TQWheelEvent *e)
 {
   TQScrollBar *sb = scrollView()->verticalScrollBar();
-  if (sb == 0)
+  if (!sb)
     return;
 
   // Zoom in/out
@@ -1831,19 +1831,19 @@ KPrinter *KMultiPage::getPrinter(bool enablePageSizeFeatures)
 {
     // Allocate a new KPrinter structure, if necessary
   KPrinter *printer = new KPrinter(true);
-  if (printer == 0) {
+  if (!printer) {
     kdError(1223) << "KMultiPage::getPrinter(..): Cannot allocate new KPrinter structure" << endl;
-    return 0;
+    return nullptr;
   }
   
   // Allocate a new KPrintDialogPage structure and add it to the
   // printer, if the tdemultipage implementation requests that
   if (enablePageSizeFeatures == true) {
     KPrintDialogPage_PageOptions *pageOptions = new KPrintDialogPage_PageOptions();
-    if (pageOptions == 0) {
+    if (!pageOptions) {
       kdError(1223) << "KMultiPage::getPrinter(..): Cannot allocate new KPrintDialogPage_PageOptions structure" << endl;
       delete printer;
-      return 0;
+      return nullptr;
     }
     printer->addDialogPage( pageOptions );
   }
diff --git a/kviewshell/units.cpp b/kviewshell/units.cpp
index bfc8b3b6..62b0302f 100644
--- a/kviewshell/units.cpp
+++ b/kviewshell/units.cpp
@@ -47,7 +47,7 @@ unitOfDistance distanceUnitTable[] = {
   {25.4*0.178, "cc"},     // cicero points = 0.178 inches
   {25.4*0.178, "cicero"},
 
-  {0.0, 0},
+  {0.0, nullptr},
 };
 
 
@@ -63,7 +63,7 @@ float distance::convertToMM(const TQString &distance, bool *ok)
   // Check for various known units, and store the beginning position
   // of the unit in 'unitPos', so that distance[0..unitPos] will hold
   // the value. Store the number of mm per unit in 'MMperUnit'.
-  for(int i=0; MMperUnit==0.0 && distanceUnitTable[i].name != 0; i++) {
+  for(int i=0; MMperUnit==0.0 && distanceUnitTable[i].name; i++) {
     unitPos = distance.findRev(distanceUnitTable[i].name);
     if (unitPos != -1)
       MMperUnit = distanceUnitTable[i].mmPerUnit;
diff --git a/kviewshell/units.h b/kviewshell/units.h
index db83d675..ed870849 100644
--- a/kviewshell/units.h
+++ b/kviewshell/units.h
@@ -28,7 +28,7 @@ class distance {
   // although the string is malformed.
   //
   // It is fine to set ok to 0.
-  static float convertToMM(const TQString &distance, bool *ok=0);
+  static float convertToMM(const TQString &distance, bool *ok=nullptr);
 };
 
 #endif
-- 
cgit v1.2.3

