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

Keep the PDF viewer core and its FoFi Type1C handling in one consumer-focused change.

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 kpdf/core/document.cpp                    | 28 +++++++++++-----------
 kpdf/core/generator.h                     |  6 ++---
 kpdf/core/generator_pdf/generator_pdf.cpp | 40 +++++++++++++++----------------
 kpdf/core/generator_pdf/gp_outputdev.cpp  | 18 +++++++-------
 kpdf/core/page.cpp                        | 12 +++++-----
 kpdf/core/page.h                          |  2 +-
 kpdf/part.cpp                             | 12 +++++-----
 kpdf/shell/main.cpp                       | 16 ++++++-------
 kpdf/shell/shell.cpp                      |  4 ++--
 kpdf/ui/minibar.cpp                       |  4 ++--
 kpdf/ui/pagepainter.cpp                   |  4 ++--
 kpdf/ui/pageview.cpp                      | 30 +++++++++++------------
 kpdf/ui/pageviewutils.cpp                 |  2 +-
 kpdf/ui/presentationwidget.cpp            | 14 +++++------
 kpdf/ui/presentationwidget.h              |  2 +-
 kpdf/ui/propertiesdialog.cpp              |  4 ++--
 kpdf/ui/thumbnaillist.cpp                 | 14 +++++------
 kpdf/ui/toc.cpp                           |  4 ++--
 kpdf/ui/toc.h                             |  2 +-
 kpdf/xpdf/fofi/FoFiType1C.cpp             | 24 +++++++++----------
 20 files changed, 121 insertions(+), 121 deletions(-)

diff --git a/kpdf/core/document.cpp b/kpdf/core/document.cpp
index 0a81af68..9cd2b796 100644
--- a/kpdf/core/document.cpp
+++ b/kpdf/core/document.cpp
@@ -107,11 +107,11 @@ struct RunningSearch
 /** KPDFDocument **/
 
 KPDFDocument::KPDFDocument(TQWidget *widget)
-    : TQObject(widget), generator( 0 ), d( new KPDFDocumentPrivate )
+    : TQObject(widget), generator( nullptr ), d( new KPDFDocumentPrivate )
 {
     d->allocatedPixmapsTotalMemory = 0;
-    d->memCheckTimer = 0;
-    d->saveBookmarksTimer = 0;
+    d->memCheckTimer = nullptr;
+    d->saveBookmarksTimer = nullptr;
     d->m_lastSearchID = -1;
     KImageIO::registerFormats();
     TQStringList list = TQImage::inputFormatList();
@@ -182,7 +182,7 @@ bool KPDFDocument::openDocument( const TQString & docFile, const KURL & url, con
     if ( !openOk || pages_vector.size() <= 0 )
     {
         delete generator;
-        generator = 0;
+        generator = nullptr;
         return openOk;
     }
 
@@ -239,7 +239,7 @@ void KPDFDocument::closeDocument()
 
     // delete contents generator
     delete generator;
-    generator = 0;
+    generator = nullptr;
 
     d->url = KURL();
 
@@ -367,17 +367,17 @@ bool KPDFDocument::isOpened() const
 
 const DocumentInfo * KPDFDocument::documentInfo() const
 {
-    return generator ? generator->generateDocumentInfo() : NULL;
+    return generator ? generator->generateDocumentInfo() : nullptr;
 }
 
 const DocumentSynopsis * KPDFDocument::documentSynopsis() const
 {
-    return generator ? generator->generateDocumentSynopsis() : NULL;
+    return generator ? generator->generateDocumentSynopsis() : nullptr;
 }
 
 const KPDFPage * KPDFDocument::page( uint n ) const
 {
-    return ( n < pages_vector.count() ) ? pages_vector[n] : 0;
+    return ( n < pages_vector.count() ) ? pages_vector[n] : nullptr;
 }
 
 const DocumentViewport & KPDFDocument::viewport() const
@@ -686,7 +686,7 @@ bool KPDFDocument::searchText( int searchID, const TQString & text, bool fromSta
 
             // loop on a page adding highlights for all found items
             bool addedHighlights = false;
-            NormalizedRect * lastMatch = 0;
+            NormalizedRect * lastMatch = nullptr;
             while ( 1 )
             {
                 if ( lastMatch )
@@ -725,10 +725,10 @@ bool KPDFDocument::searchText( int searchID, const TQString & text, bool fromSta
         // find out from where to start/resume search from
         int viewportPage = (*d->viewportIterator).pageNumber;
         int currentPage = fromStart ? 0 : ((s->continueOnPage != -1) ? s->continueOnPage : viewportPage);
-        KPDFPage * lastPage = fromStart ? 0 : pages_vector[ currentPage ];
+        KPDFPage * lastPage = fromStart ? nullptr : pages_vector[ currentPage ];
 
         // continue checking last SearchPage first (if it is the current page)
-        NormalizedRect * match = 0;
+        NormalizedRect * match = nullptr;
         if ( lastPage && lastPage->number() == s->continueOnPage )
         {
             if ( newText )
@@ -830,7 +830,7 @@ bool KPDFDocument::searchText( int searchID, const TQString & text, bool fromSta
                 if ( newHue < 0 )
                     newHue += 360;
                 TQColor wordColor = TQColor( newHue, baseSat, baseVal, TQColor::Hsv );
-                NormalizedRect * lastMatch = 0;
+                NormalizedRect * lastMatch = nullptr;
                 // add all highlights for current word
                 bool wordMatched = false;
                 while ( 1 )
@@ -928,7 +928,7 @@ bool KPDFDocument::continueLastSearch()
 
 void KPDFDocument::toggleBookmark( int n )
 {
-    KPDFPage * page = ( n < (int)pages_vector.count() ) ? pages_vector[ n ] : 0;
+    KPDFPage * page = ( n < (int)pages_vector.count() ) ? pages_vector[ n ] : nullptr;
     if ( page )
     {
         page->setBookmark( !page->hasBookmark() );
@@ -1144,7 +1144,7 @@ void KPDFDocument::requestDone( PixmapRequest * req )
 void KPDFDocument::sendGeneratorRequest()
 {
     // find a request
-    PixmapRequest * request = 0;
+    PixmapRequest * request = nullptr;
     while ( !d->pixmapRequestsStack.isEmpty() && !request )
     {
         PixmapRequest * r = d->pixmapRequestsStack.last();
diff --git a/kpdf/core/generator.h b/kpdf/core/generator.h
index 5ed6aa73..de38e446 100644
--- a/kpdf/core/generator.h
+++ b/kpdf/core/generator.h
@@ -48,8 +48,8 @@ class Generator : public TQObject
         virtual bool loadDocument( const TQString & fileName, TQValueVector< KPDFPage * > & pagesVector ) = 0;
 
         // Document description and Table of contents
-        virtual const DocumentInfo * generateDocumentInfo() { return 0L; }
-        virtual const DocumentSynopsis * generateDocumentSynopsis() { return 0L; }
+        virtual const DocumentInfo * generateDocumentInfo() { return nullptr; }
+        virtual const DocumentSynopsis * generateDocumentSynopsis() { return nullptr; }
 
         // DRM handling
         virtual bool isAllowed( int /*Document::Permisison(s)*/ ) { return true; }
@@ -94,7 +94,7 @@ struct PixmapRequest
 {
     PixmapRequest( int rId, int n, int w, int h, int p, bool a = false, int r = 0 )
         : id( rId ), pageNumber( n ), width( w ), height( h ), rotation( r ),
-        priority( p ), async( a ), page( 0 )  {};
+        priority( p ), async( a ), page( nullptr )  {};
 
     // observer id
     int id;
diff --git a/kpdf/core/generator_pdf/generator_pdf.cpp b/kpdf/core/generator_pdf/generator_pdf.cpp
index 6d71ae98..e53fd595 100644
--- a/kpdf/core/generator_pdf/generator_pdf.cpp
+++ b/kpdf/core/generator_pdf/generator_pdf.cpp
@@ -69,8 +69,8 @@
  */
 
 PDFGenerator::PDFGenerator( KPDFDocument * doc )
-    : Generator( doc ), pdfdoc( 0 ), kpdfOutputDev( 0 ), ready( true ),
-    pixmapRequest( 0 ), docInfoDirty( true ), docSynopsisDirty( true )
+    : Generator( doc ), pdfdoc( nullptr ), kpdfOutputDev( nullptr ), ready( true ),
+    pixmapRequest( nullptr ), docInfoDirty( true ), docSynopsisDirty( true )
 {
     // generate kpdfOutputDev and cache page color
     reparseConfig();
@@ -105,12 +105,12 @@ bool PDFGenerator::loadDocument( const TQString & filePath, TQValueVector<KPDFPa
     }
 #endif
     // create PDFDoc for the given file
-    pdfdoc = new PDFDoc( new GString( TQFile::encodeName( filePath ) ), 0, 0 );
+    pdfdoc = new PDFDoc( new GString( TQFile::encodeName( filePath ) ), nullptr, nullptr );
 
     // if the file didn't open correctly it might be encrypted, so ask for a pass
     bool firstInput = true;
     bool triedWallet = false;
-    TDEWallet::Wallet * wallet = 0;
+    TDEWallet::Wallet * wallet = nullptr;
     int keep = 1;
     while ( !pdfdoc->isOk() && pdfdoc->getErrorCode() == errEncrypted )
     {
@@ -147,7 +147,7 @@ bool PDFGenerator::loadDocument( const TQString & filePath, TQValueVector<KPDFPa
             firstInput = false;
 
             // if the user presses cancel, abort opening
-            if ( KPasswordDialog::getPassword( password, prompt, wallet ? &keep : 0 ) != KPasswordDialog::Accepted )
+            if ( KPasswordDialog::getPassword( password, prompt, wallet ? &keep : nullptr ) != KPasswordDialog::Accepted )
             break;
         }
 
@@ -167,7 +167,7 @@ bool PDFGenerator::loadDocument( const TQString & filePath, TQValueVector<KPDFPa
     if ( !pdfdoc->isOk() )
     {
         delete pdfdoc;
-        pdfdoc = 0;
+        pdfdoc = nullptr;
         return false;
     }
 
@@ -237,15 +237,15 @@ const DocumentSynopsis * PDFGenerator::generateDocumentSynopsis()
         return &docSyn;
 
     if ( !pdfdoc )
-        return NULL;
+        return nullptr;
 
     Outline * outline = pdfdoc->getOutline();
     if ( !outline )
-        return NULL;
+        return nullptr;
 
     GList * items = outline->getItems();
     if ( !items || items->getLength() < 1 )
-        return NULL;
+        return nullptr;
 
     docLock.lock();
     docSyn = DocumentSynopsis();
@@ -342,7 +342,7 @@ void PDFGenerator::generatePixmap( PixmapRequest * request )
 void PDFGenerator::generateSyncTextPage( KPDFPage * page )
 {
     // build a TextPage...
-    TextOutputDev td(NULL, gTrue, gFalse, gFalse);
+    TextOutputDev td(nullptr, gTrue, gFalse, gFalse);
     docLock.lock();
     pdfdoc->displayPage( &td, page->number()+1, 72, 72, 0, false, true, false );
     // ..and attach it to the page
@@ -379,7 +379,7 @@ void PDFGenerator::putFontInfo(TDEListView *list)
 
     docLock.lock();
 
-    fonts = NULL;
+    fonts = nullptr;
     fontsLen = fontsSize = 0;
     TQValueVector<Ref> visitedXObjects;
     for (pg = 1; pg <= pdfdoc->getNumPages(); ++pg)
@@ -624,7 +624,7 @@ void PDFGenerator::scanFonts(Dict *resDict, TDEListView *list, Ref **fonts, int
     int i;
 
     // scan the fonts in this resource dictionary
-    gfxFontDict = NULL;
+    gfxFontDict = nullptr;
     resDict->lookupNF("Font", &obj1);
     if (obj1.isRef())
     {
@@ -638,7 +638,7 @@ void PDFGenerator::scanFonts(Dict *resDict, TDEListView *list, Ref **fonts, int
     }
     else if (obj1.isDict())
     {
-        gfxFontDict = new GfxFontDict(pdfdoc->getXRef(), NULL, obj1.getDict());
+        gfxFontDict = new GfxFontDict(pdfdoc->getXRef(), nullptr, obj1.getDict());
     }
     if (gfxFontDict)
     {
@@ -1096,9 +1096,9 @@ PDFPixmapGeneratorThread::PDFPixmapGeneratorThread( PDFGenerator * gen )
     : d( new PPGThreadPrivate() )
 {
     d->generator = gen;
-    d->currentRequest = 0;
-    d->m_image = 0;
-    d->m_textPage = 0;
+    d->currentRequest = nullptr;
+    d->m_image = nullptr;
+    d->m_textPage = nullptr;
     d->m_rectsTaken = true;
 }
 
@@ -1157,20 +1157,20 @@ void PDFPixmapGeneratorThread::endGeneration()
     }
 #endif
     // reset internal members preparing for a new generation
-    d->currentRequest = 0;
+    d->currentRequest = nullptr;
 }
 
 TQImage * PDFPixmapGeneratorThread::takeImage() const
 {
     TQImage * img = d->m_image;
-    d->m_image = 0;
+    d->m_image = nullptr;
     return img;
 }
 
 TextPage * PDFPixmapGeneratorThread::takeTextPage() const
 {
     TextPage * tp = d->m_textPage;
-    d->m_textPage = 0;
+    d->m_textPage = nullptr;
     return tp;
 }
 
@@ -1224,7 +1224,7 @@ void PDFPixmapGeneratorThread::run()
 
     if ( genTextPage )
     {
-        TextOutputDev td(NULL, gTrue, gFalse, gFalse);
+        TextOutputDev td(nullptr, gTrue, gFalse, gFalse);
         d->generator->pdfdoc->displayPage( &td, page->number()+1, 72, 72, 0, false, true, false );
         // ..and attach it to the page
         d->m_textPage = td.takeText();
diff --git a/kpdf/core/generator_pdf/gp_outputdev.cpp b/kpdf/core/generator_pdf/gp_outputdev.cpp
index d8aad33a..d3c7edd4 100644
--- a/kpdf/core/generator_pdf/gp_outputdev.cpp
+++ b/kpdf/core/generator_pdf/gp_outputdev.cpp
@@ -39,7 +39,7 @@
 
 KPDFOutputDev::KPDFOutputDev( SplashColor paperColor )
     : SplashOutputDev( splashModeRGB8, 4, false, paperColor ),
-    m_doc( 0 ), m_pixmap( 0 ), m_image( 0 )
+    m_doc( nullptr ), m_pixmap( nullptr ), m_image( nullptr )
 {
 }
 
@@ -69,14 +69,14 @@ void KPDFOutputDev::setParams( int width, int height, bool genL, bool genI, bool
 TQPixmap * KPDFOutputDev::takePixmap()
 {
     TQPixmap * pix = m_pixmap;
-    m_pixmap = 0;
+    m_pixmap = nullptr;
     return pix;
 }
 
 TQImage * KPDFOutputDev::takeImage()
 {
     TQImage * img = m_image;
-    m_image = 0;
+    m_image = nullptr;
     return img;
 }
 
@@ -138,7 +138,7 @@ void KPDFOutputDev::endPage()
 
     // destroy the shared descriptor and (###) unload underlying xpdf bitmap
     delete img;
-    SplashOutputDev::startPage( 0, NULL );
+    SplashOutputDev::startPage( 0, nullptr );
 }
 
 void KPDFOutputDev::processLink( Link * link, Catalog * catalog )
@@ -202,7 +202,7 @@ void KPDFOutputDev::drawImage( GfxState *state, Object *ref, Stream *str,
                    nr = (double)(left + width) / (double)m_pixmapWidth,
                    nb = (double)(top + height) / (double)m_pixmapHeight;
             // create the rect using normalized coords and set it of KPDFImage type
-            ObjectRect * rect = new ObjectRect( nl, nt, nr, nb, ObjectRect::Image, 0 );
+            ObjectRect * rect = new ObjectRect( nl, nt, nr, nb, ObjectRect::Image, nullptr );
             // add the ObjectRect to the vector container
             m_rects.push_back( rect );
         }
@@ -226,20 +226,20 @@ void KPDFOutputDev::clear()
     if ( m_pixmap )
     {
         delete m_pixmap;
-        m_pixmap = 0;
+        m_pixmap = nullptr;
     }
     // delete image
     if ( m_image )
     {
         delete m_image;
-        m_image = 0;
+        m_image = nullptr;
     }
 }
 
 KPDFLink * KPDFOutputDev::generateLink( LinkAction * a )
 // note: this function is called when processing a page, when the MUTEX is already LOCKED
 {
-    KPDFLink * link = NULL;
+    KPDFLink * link = nullptr;
     if ( a ) switch ( a->getKind() )
     {
         case actionGoTo:
@@ -264,7 +264,7 @@ KPDFLink * KPDFOutputDev::generateLink( LinkAction * a )
             {
             LinkLaunch * e = (LinkLaunch *)a;
             GString * p = e->getParams();
-            link = new KPDFLinkExecute( e->getFileName()->getCString(), p ? p->getCString() : 0 );
+            link = new KPDFLinkExecute( e->getFileName()->getCString(), p ? p->getCString() : nullptr );
             }
             break;
 
diff --git a/kpdf/core/page.cpp b/kpdf/core/page.cpp
index cadaacf3..2be77b5b 100644
--- a/kpdf/core/page.cpp
+++ b/kpdf/core/page.cpp
@@ -25,7 +25,7 @@
 
 KPDFPage::KPDFPage( uint page, float w, float h, int r )
     : m_number( page ), m_rotation( r ), m_width( w ), m_height( h ),
-    m_bookmarked( false ), m_text( 0 ), m_transition( 0 )
+    m_bookmarked( false ), m_text( nullptr ), m_transition( nullptr )
 {
     setRotation( r );
 }
@@ -84,7 +84,7 @@ bool KPDFPage::hasPixmap( int id, int width, int height ) const
 
 bool KPDFPage::hasSearchPage() const
 {
-    return m_text != 0;
+    return m_text != nullptr;
 }
 
 bool KPDFPage::hasBookmark() const
@@ -121,14 +121,14 @@ bool KPDFPage::hasHighlights( int s_id ) const
 
 bool KPDFPage::hasTransition() const
 {
-    return m_transition != 0;
+    return m_transition != nullptr;
 }
 
 
 NormalizedRect * KPDFPage::findText( const TQString & text, bool strictCase, NormalizedRect * lastRect ) const
 {
     if ( text.isEmpty() )
-        return 0;
+        return nullptr;
 
     // create a xpf's Unicode (unsigned int) array for the given text
     const TQChar * str = text.unicode();
@@ -169,7 +169,7 @@ NormalizedRect * KPDFPage::findText( const TQString & text, bool strictCase, Nor
     // if the page was found, return a new normalizedRect
     if ( found )
         return new NormalizedRect( sLeft / m_width, sTop / m_height, sRight / m_width, sBottom / m_height );
-    return 0;
+    return nullptr;
 }
 
 const TQString KPDFPage::getText( const NormalizedRect & rect ) const
@@ -192,7 +192,7 @@ const ObjectRect * KPDFPage::hasObject( ObjectRect::ObjectType type, double x, d
     for ( ; it != end; ++it )
         if ( (*it)->contains( x, y ) )
             if ((*it)->objectType() == type) return *it;
-    return 0;
+    return nullptr;
 }
 
 const KPDFPageTransition * KPDFPage::getTransition() const
diff --git a/kpdf/core/page.h b/kpdf/core/page.h
index 2de7aceb..3dd52418 100644
--- a/kpdf/core/page.h
+++ b/kpdf/core/page.h
@@ -102,7 +102,7 @@ class KPDFPage
         //bool hasAnnotation( double x, double y ) const;
         bool hasTransition() const;
 
-        NormalizedRect * findText( const TQString & text, bool keepCase, NormalizedRect * last = 0 ) const;
+        NormalizedRect * findText( const TQString & text, bool keepCase, NormalizedRect * last = nullptr ) const;
         const TQString getText( const NormalizedRect & rect ) const;
         const ObjectRect * hasObject( ObjectRect::ObjectType type, double x, double y ) const;
         //const Annotation * getAnnotation( double x, double y ) const;
diff --git a/kpdf/part.cpp b/kpdf/part.cpp
index f29e4099..ec8417f8 100644
--- a/kpdf/part.cpp
+++ b/kpdf/part.cpp
@@ -115,7 +115,7 @@ unsigned int Part::m_count = 0;
 Part::Part(TQWidget *parentWidget, const char *widgetName,
            TQObject *parent, const char *name,
            const TQStringList & /*args*/ )
-	: DCOPObject("kpdf"), KParts::ReadOnlyPart(parent, name), m_showMenuBarAction(0), m_showFullScreenAction(0),
+	: DCOPObject("kpdf"), KParts::ReadOnlyPart(parent, name), m_showMenuBarAction(nullptr), m_showFullScreenAction(nullptr),
 	m_actionsSearched(false), m_searchStarted(false), m_printable(false)
 {
 	// connect the started signal to tell the job the mimetypes we like
@@ -135,7 +135,7 @@ Part::Part(TQWidget *parentWidget, const char *widgetName,
 	//if ( m_count ) TODO check if we need to insert these lines..
 	//	delete globalParams;
 	globalParams = new GlobalParams("");
-	globalParams->setupBaseFonts(NULL);
+	globalParams->setupBaseFonts(nullptr);
 	m_count++;
 
 	// we need an instance
@@ -394,7 +394,7 @@ TDEAboutData* Part::createAboutData()
 	// which the part's rc file is installed ('partrcdir' in the
 	// Makefile)
 	TDEAboutData* aboutData = new TDEAboutData("kpdfpart", I18N_NOOP("KPDF::Part"), "0.1");
-	aboutData->addAuthor("Wilco Greven", 0, "greven@kde.org");
+	aboutData->addAuthor("Wilco Greven", nullptr, "greven@kde.org");
 	return aboutData;
 }
 
@@ -622,7 +622,7 @@ void Part::slotDoFileDirty()
   {
     m_viewportDirty = m_document->viewport();
     m_dirtyToolboxIndex = m_toolBox->currentIndex();
-    m_wasPresentationOpen = ((PresentationWidget*)m_presentationWidget != 0);
+    m_wasPresentationOpen = ((PresentationWidget*)m_presentationWidget != nullptr);
     m_pageView->showText(i18n("Reloading the document..."), 0);
   }
 
@@ -724,7 +724,7 @@ void Part::saveSplitterSize()
 class KPDFGotoPageDialog : public KDialogBase
 {
 public:
-	KPDFGotoPageDialog(TQWidget *p, int current, int max) : KDialogBase(p, 0L, true, i18n("Go to Page"), Ok | Cancel, Ok) {
+	KPDFGotoPageDialog(TQWidget *p, int current, int max) : KDialogBase(p, nullptr, true, i18n("Go to Page"), Ok | Cancel, Ok) {
 		TQWidget *w = new TQWidget(this);
 		setMainWidget(w);
 
@@ -839,7 +839,7 @@ void Part::slotSaveFileAs()
         }
 
         if ( !TDEIO::NetAccess::file_copy( m_file, saveURL, -1, true ) )
-            KMessageBox::information( 0, i18n("File could not be saved in '%1'. Try to save it to another location.").arg( saveURL.prettyURL() ) );
+            KMessageBox::information( nullptr, i18n("File could not be saved in '%1'. Try to save it to another location.").arg( saveURL.prettyURL() ) );
     }
 }
 
diff --git a/kpdf/shell/main.cpp b/kpdf/shell/main.cpp
index aa44bca6..79213e55 100644
--- a/kpdf/shell/main.cpp
+++ b/kpdf/shell/main.cpp
@@ -29,8 +29,8 @@ static const char version[] = "0.5.10";
 
 static TDECmdLineOptions options[] =
 {
-    { "new-instance", I18N_NOOP("Don't reuse existing instance"), 0 },
-    { "+[URL]", I18N_NOOP("Document to open"), 0 },
+    { "new-instance", I18N_NOOP("Don't reuse existing instance"), nullptr },
+    { "+[URL]", I18N_NOOP("Document to open"), nullptr },
     TDECmdLineLastOption
 };
 
@@ -44,14 +44,14 @@ int main(int argc, char** argv)
         TDEAboutData::License_GPL,
         "(C) 2002 Wilco Greven, Christophe Devriese\n(C) 2004-2005 Albert Astals Cid, Enrico Ros");
 
-    about.addAuthor("Wilco Greven", 0, "greven@kde.org");
-    about.addAuthor("Christophe Devriese", 0, "oelewapperke@oelewapperke.org");
-    about.addAuthor("Laurent Montel", 0, "montel@kde.org");
+    about.addAuthor("Wilco Greven", nullptr, "greven@kde.org");
+    about.addAuthor("Christophe Devriese", nullptr, "oelewapperke@oelewapperke.org");
+    about.addAuthor("Laurent Montel", nullptr, "montel@kde.org");
     about.addAuthor("Albert Astals Cid", I18N_NOOP("Current mantainer"), "astals11@terra.es");
-    about.addAuthor("Enrico Ros", 0, "eros.kde@email.it");
+    about.addAuthor("Enrico Ros", nullptr, "eros.kde@email.it");
 
-    about.addCredit("Derek Noonburg", I18N_NOOP("Xpdf author"), 0, "http://www.foolabs.com/xpdf/");
-    about.addCredit("Marco Martin", I18N_NOOP("Icon"), 0, "m4rt@libero.it");
+    about.addCredit("Derek Noonburg", I18N_NOOP("Xpdf author"), nullptr, "http://www.foolabs.com/xpdf/");
+    about.addCredit("Marco Martin", I18N_NOOP("Icon"), nullptr, "m4rt@libero.it");
 
     TDECmdLineArgs::init(argc, argv, &about);
     TDECmdLineArgs::addCmdLineOptions( options );
diff --git a/kpdf/shell/shell.cpp b/kpdf/shell/shell.cpp
index ed9403df..594c91f2 100644
--- a/kpdf/shell/shell.cpp
+++ b/kpdf/shell/shell.cpp
@@ -47,7 +47,7 @@
 using namespace KPDF;
 
 Shell::Shell()
-  : DCOPObject("KPDFShellDCOPIface"), KParts::MainWindow(0, "KPDF::Shell"),
+  : DCOPObject("KPDFShellDCOPIface"), KParts::MainWindow(nullptr, "KPDF::Shell"),
     m_menuBarWasShown(true),
     m_toolBarWasShown(true),
     m_shuttingDown(false),
@@ -61,7 +61,7 @@ Shell::Shell()
 }
 
 Shell::Shell(const KURL &url)
-  : DCOPObject("KPDFShellDCOPIface"), KParts::MainWindow(0, "KPDF::Shell"),
+  : DCOPObject("KPDFShellDCOPIface"), KParts::MainWindow(nullptr, "KPDF::Shell"),
     m_menuBarWasShown(true),
     m_toolBarWasShown(true),
     m_shuttingDown(false),
diff --git a/kpdf/ui/minibar.cpp b/kpdf/ui/minibar.cpp
index f71201fc..566cbe4e 100644
--- a/kpdf/ui/minibar.cpp
+++ b/kpdf/ui/minibar.cpp
@@ -87,7 +87,7 @@ MiniBar::MiniBar( TQWidget * parent, KPDFDocument * document )
     horLayout->addItem( spacerL );
 
     // central 2r by 3c grid layout that contains all components
-    TQGridLayout * gridLayout = new TQGridLayout( 0, 3,5, 2,1 );
+    TQGridLayout * gridLayout = new TQGridLayout( nullptr, 3,5, 2,1 );
      // top spacer 6x6 px
 //     TQSpacerItem * spacerTop = new TQSpacerItem( 6, 6, TQSizePolicy::Fixed, TQSizePolicy::Fixed );
 //     gridLayout->addMultiCell( spacerTop, 0, 0, 0, 4 );
@@ -329,7 +329,7 @@ PagesEdit::PagesEdit( MiniBar * parent )
 {
     // customize look
     setFrameShadow( TQFrame::Raised );
-    focusOutEvent( 0 );
+    focusOutEvent( nullptr );
 
     // use an integer validator
     m_validator = new TQIntValidator( 1, 1, this );
diff --git a/kpdf/ui/pagepainter.cpp b/kpdf/ui/pagepainter.cpp
index a4644c16..956d9178 100644
--- a/kpdf/ui/pagepainter.cpp
+++ b/kpdf/ui/pagepainter.cpp
@@ -23,7 +23,7 @@
 void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags,
     TQPainter * destPainter, const TQRect & limits, int width, int height )
 {
-    TQPixmap * pixmap = 0;
+    TQPixmap * pixmap = nullptr;
 
     // if a pixmap is present for given id, use it
     if ( page->m_pixmaps.contains( id ) )
@@ -105,7 +105,7 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags,
 
     // use backBuffer if 'pixmap direct manipulation' is needed
     bool backBuffer = paintAccessibility || paintHighlights;
-    TQPixmap * backPixmap = 0;
+    TQPixmap * backPixmap = nullptr;
     TQPainter * p = destPainter;
     if ( backBuffer )
     {
diff --git a/kpdf/ui/pageview.cpp b/kpdf/ui/pageview.cpp
index 11fb6423..9749fbf9 100644
--- a/kpdf/ui/pageview.cpp
+++ b/kpdf/ui/pageview.cpp
@@ -192,18 +192,18 @@ PageView::PageView( TQWidget *parent, KPDFDocument *document )
     d->mouseMidStartY = -1;
     d->mouseOnRect = false;
     d->typeAheadActive = false;
-    d->findTimeoutTimer = 0;
+    d->findTimeoutTimer = nullptr;
     d->viewportMoveActive = false;
-    d->viewportMoveTimer = 0;
+    d->viewportMoveTimer = nullptr;
     d->scrollIncrement = 0;
-    d->autoScrollTimer = 0;
-    d->delayResizeTimer = 0;
+    d->autoScrollTimer = nullptr;
+    d->delayResizeTimer = nullptr;
     d->dirtyLayout = false;
     d->blockViewport = false;
     d->blockPixmapsRequest = false;
     d->messageWindow = new PageViewMessage(this);
     d->tip = new PageViewTip( this );
-    d->aPrevAction = 0;
+    d->aPrevAction = nullptr;
 
     // widget setup: setup focus, accept drops and track mouse
     viewport()->setFocusProxy( this );
@@ -238,7 +238,7 @@ PageView::~PageView()
     for ( ; dIt != dEnd; ++dIt )
         delete *dIt;
     delete d->tip;
-    d->tip = 0;
+    d->tip = nullptr;
     d->document->removeObserver( this );
     delete d;
 }
@@ -381,7 +381,7 @@ void PageView::notifyViewportChanged( bool smoothMove )
 
     // find PageViewItem matching the viewport description
     const DocumentViewport & vp = d->document->viewport();
-    PageViewItem * item = 0;
+    PageViewItem * item = nullptr;
     TQValueVector< PageViewItem * >::iterator iIt = d->items.begin(), iEnd = d->items.end();
     for ( ; iIt != iEnd; ++iIt )
         if ( (*iIt)->pageNumber() == vp.pageNumber )
@@ -794,7 +794,7 @@ void PageView::keyPressEvent( TQKeyEvent * e )
             if ( d->aPrevAction )
             {
                 d->aPrevAction->activate();
-                d->aPrevAction = 0;
+                d->aPrevAction = nullptr;
             }
             break;
         case Key_Shift:
@@ -978,7 +978,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e )
     {
         // ..except for right Clicks (emitted even it viewport is empty)
         if ( e->button() == TQt::RightButton )
-            emit rightClick( 0, e->globalPos() );
+            emit rightClick( nullptr, e->globalPos() );
         return;
     }
 
@@ -1040,7 +1040,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e )
             {
                 // right click (if not within 5 px of the press point, the mode
                 // had been already changed to 'Selection' instead of 'Normal')
-                emit rightClick( pageItem ? pageItem->page() : 0, e->globalPos() );
+                emit rightClick( pageItem ? pageItem->page() : nullptr, e->globalPos() );
             }
             }break;
 
@@ -1083,7 +1083,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e )
             if (d->mouseSelectionRect.isNull() && rightButton) 
 	    {
 	    	 PageViewItem * pageItem = pickItemOnPoint( e->x(), e->y() );
-	    	 emit rightClick( pageItem ? pageItem->page() : 0, e->globalPos() );
+		 emit rightClick( pageItem ? pageItem->page() : nullptr, e->globalPos() );
 	    }
 	    
             // if a selection is defined, display a popup
@@ -1098,7 +1098,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e )
                 if ( d->aPrevAction )
                 {
                     d->aPrevAction->activate();
-                    d->aPrevAction = 0;
+                    d->aPrevAction = nullptr;
                 }
                 break;
             }
@@ -1232,7 +1232,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e )
             if ( d->aPrevAction )
             {
                 d->aPrevAction->activate();
-                d->aPrevAction = 0;
+                d->aPrevAction = nullptr;
             }
             }break;
 
@@ -1423,7 +1423,7 @@ void PageView::updateItemSize( PageViewItem * item, int colWidth, int rowHeight
 
 PageViewItem * PageView::pickItemOnPoint( int x, int y )
 {
-    PageViewItem * item = 0;
+    PageViewItem * item = nullptr;
     TQValueList< PageViewItem * >::iterator iIt = d->visibleItems.begin(), iEnd = d->visibleItems.end();
     for ( ; iIt != iEnd; ++iIt )
     {
@@ -1512,7 +1512,7 @@ void PageView::updateZoom( ZoomMode newZoomMode )
     }
 
     float newFactor = d->zoomFactor;
-    TDEAction * checkedZoomAction = 0;
+    TDEAction * checkedZoomAction = nullptr;
     switch ( newZoomMode )
     {
         case ZoomFixed:{ //ZoomFixed case
diff --git a/kpdf/ui/pageviewutils.cpp b/kpdf/ui/pageviewutils.cpp
index 9f09ca09..97883ada 100644
--- a/kpdf/ui/pageviewutils.cpp
+++ b/kpdf/ui/pageviewutils.cpp
@@ -22,7 +22,7 @@
 #include "conf/settings.h"
 
 PageViewMessage::PageViewMessage( TQWidget * parent )
-    : TQWidget( parent, "pageViewMessage" ), m_timer( 0 )
+    : TQWidget( parent, "pageViewMessage" ), m_timer( nullptr )
 {
     setFocusPolicy( TQWidget::NoFocus );
     setBackgroundMode( NoBackground );
diff --git a/kpdf/ui/presentationwidget.cpp b/kpdf/ui/presentationwidget.cpp
index 65645400..a3c55ed5 100644
--- a/kpdf/ui/presentationwidget.cpp
+++ b/kpdf/ui/presentationwidget.cpp
@@ -54,7 +54,7 @@ struct PresentationFrame
 
 PresentationWidget::PresentationWidget( TQWidget * parent, KPDFDocument * doc )
     : TQDialog( parent, "presentationWidget", true, WDestructiveClose | WStyle_NoBorder),
-    m_pressedLink( 0 ), m_handCursor( false ), m_document( doc ), m_frameIndex( -1 )
+    m_pressedLink( nullptr ), m_handCursor( false ), m_document( doc ), m_frameIndex( -1 )
 {
     // set look and geometry
     setBackgroundMode( TQt::NoBackground );
@@ -264,7 +264,7 @@ void PresentationWidget::mouseReleaseEvent( TQMouseEvent * e )
         const KPDFLink * link = getLink( e->x(), e->y() );
         if ( link == m_pressedLink )
             m_document->processLink( link );
-        m_pressedLink = 0;
+        m_pressedLink = nullptr;
     }
 }
 
@@ -376,7 +376,7 @@ const KPDFLink * PresentationWidget::getLink( int x, int y, TQRect * geometry )
     if ( geometry && !geometry->isNull() )
         geometry->setRect( 0, 0, -1, -1 );
     if ( m_frameIndex < 0 || m_frameIndex >= (int)m_frames.size() )
-        return 0;
+        return nullptr;
 
     // get frame, page and geometry
     const PresentationFrame * frame = m_frames[ m_frameIndex ];
@@ -389,12 +389,12 @@ const KPDFLink * PresentationWidget::getLink( int x, int y, TQRect * geometry )
 
     // no links outside the pages
     if ( nx < 0 || nx > 1 || ny < 0 || ny > 1 )
-        return 0;
+        return nullptr;
 
     // check if 1) there is an object and 2) it's a link
     const ObjectRect * object = page->hasObject( ObjectRect::Link, nx, ny );
     if ( !object )
-        return 0;
+        return nullptr;
 
     // compute link geometry if destination rect present
     if ( geometry )
@@ -417,7 +417,7 @@ void PresentationWidget::testCursorOnLink( int x, int y )
     if ( (link && !m_handCursor) || (!link && m_handCursor) )
     {
         // change cursor shape
-        m_handCursor = link != 0;
+        m_handCursor = link != nullptr;
         setCursor( m_handCursor ? KCursor::handCursor() : KCursor::arrowCursor());
 
         // set tooltip over link's rect
@@ -521,7 +521,7 @@ void PresentationWidget::generatePage()
 
     // start transition on pages that have one
     const KPDFPageTransition * transition = m_frameIndex != -1 ?
-        m_frames[ m_frameIndex ]->page->getTransition() : 0;
+        m_frames[ m_frameIndex ]->page->getTransition() : nullptr;
     if ( transition )
         initTransition( transition );
     else {
diff --git a/kpdf/ui/presentationwidget.h b/kpdf/ui/presentationwidget.h
index e38332d7..cefc34c3 100644
--- a/kpdf/ui/presentationwidget.h
+++ b/kpdf/ui/presentationwidget.h
@@ -60,7 +60,7 @@ class PresentationWidget : public TQDialog, public DocumentObserver
         void paintEvent( TQPaintEvent * e );
 
     private:
-        const KPDFLink * getLink( int x, int y, TQRect * geometry = 0 ) const;
+        const KPDFLink * getLink( int x, int y, TQRect * geometry = nullptr ) const;
         void testCursorOnLink( int x, int y );
         void overlayClick( const TQPoint & position );
         void changePage( int newPage );
diff --git a/kpdf/ui/propertiesdialog.cpp b/kpdf/ui/propertiesdialog.cpp
index d63f0339..c07e20a9 100644
--- a/kpdf/ui/propertiesdialog.cpp
+++ b/kpdf/ui/propertiesdialog.cpp
@@ -20,7 +20,7 @@
 #include "core/document.h"
 
 PropertiesDialog::PropertiesDialog(TQWidget *parent, KPDFDocument *doc)
-  : KDialogBase( Tabbed, i18n( "Unknown File" ), Ok, Ok, parent, 0, true, true )
+  : KDialogBase( Tabbed, i18n( "Unknown File" ), Ok, Ok, parent, nullptr, true, true )
 {
   // Properties
   TQFrame *page = addPage(i18n("Properties"));
@@ -71,7 +71,7 @@ PropertiesDialog::PropertiesDialog(TQWidget *parent, KPDFDocument *doc)
   }
 
   // Fonts
-  TQVBoxLayout *page2Layout = 0;
+  TQVBoxLayout *page2Layout = nullptr;
   if (doc->hasFonts())
   {
     TQFrame *page2 = addPage(i18n("Fonts"));
diff --git a/kpdf/ui/thumbnaillist.cpp b/kpdf/ui/thumbnaillist.cpp
index 7d66cfb2..d2d16966 100644
--- a/kpdf/ui/thumbnaillist.cpp
+++ b/kpdf/ui/thumbnaillist.cpp
@@ -65,7 +65,7 @@ class ThumbnailWidget : public TQWidget
 
 ThumbnailList::ThumbnailList( TQWidget *parent, KPDFDocument *document )
 	: TQScrollView( parent, "KPDF::Thumbnails", WNoAutoErase | WStaticContents ),
-	m_document( document ), m_selected( 0 ), m_delayTimer( 0 ), m_bookmarkOverlay( 0 )
+	m_document( document ), m_selected( nullptr ), m_delayTimer( nullptr ), m_bookmarkOverlay( nullptr )
 {
 	// set scrollbars
 	setHScrollBarMode( TQScrollView::AlwaysOff );
@@ -111,7 +111,7 @@ void ThumbnailList::notifySetup( const TQValueVector< KPDFPage * > & pages, bool
 		delete *tIt;
 	m_thumbnails.clear();
 	m_visibleThumbnails.clear();
-	m_selected = 0;
+	m_selected = nullptr;
 
 	if ( pages.count() < 1 )
 	{
@@ -171,7 +171,7 @@ void ThumbnailList::notifyViewportChanged( bool /*smoothMove*/ )
 	// deselect previous thumbnail
 	if ( m_selected )
 		m_selected->setSelected( false );
-	m_selected = 0;
+	m_selected = nullptr;
 
 	// select the page with viewport and ensure it's centered in the view
 	m_vectorIndex = 0;
@@ -305,7 +305,7 @@ void ThumbnailList::keyPressEvent( TQKeyEvent * keyEvent )
 	keyEvent->accept();
 	if ( m_selected )
 		m_selected->setSelected( false );
-	m_selected = 0;
+	m_selected = nullptr;
 	m_document->setViewportPage( nextPage );
 }
 
@@ -366,7 +366,7 @@ void ThumbnailList::viewportResizeEvent( TQResizeEvent * e )
 	if ( m_bookmarkOverlay )
 	{
 		delete m_bookmarkOverlay;
-		m_bookmarkOverlay = 0;
+		m_bookmarkOverlay = nullptr;
 	}
 
 	// update Thumbnails since width has changed or height has increased
@@ -432,7 +432,7 @@ void ThumbnailList::slotDelayTimeout()
     if ( expectedWidth > 10 )
         m_bookmarkOverlay = new TQPixmap( DesktopIcon( "attach", expectedWidth ) );
     else
-        m_bookmarkOverlay = 0;
+        m_bookmarkOverlay = nullptr;
 
     // request pixmaps
     slotRequestVisiblePixmaps();
@@ -453,7 +453,7 @@ void ThumbnailList::delayedRequestVisiblePixmaps( int delayMs )
 /** ThumbnailWidget implementation **/
 
 ThumbnailWidget::ThumbnailWidget( TQWidget * parent, const KPDFPage * kp, ThumbnailList * tl )
-    : TQWidget( parent, 0, WNoAutoErase ), m_tl( tl ), m_page( kp ),
+    : TQWidget( parent, nullptr, WNoAutoErase ), m_tl( tl ), m_page( kp ),
     m_selected( false ), m_pixmapWidth( 10 ), m_pixmapHeight( 10 )
 {
     m_labelNumber = m_page->number() + 1;
diff --git a/kpdf/ui/toc.cpp b/kpdf/ui/toc.cpp
index e71f8746..4daceb32 100644
--- a/kpdf/ui/toc.cpp
+++ b/kpdf/ui/toc.cpp
@@ -107,7 +107,7 @@ void TOC::notifySetup( const TQValueVector< KPDFPage * > & /*pages*/, bool docum
 void TOC::addChildren( const TQDomNode & parentNode, TDEListViewItem * parentItem )
 {
     // keep track of the current listViewItem
-    TOCItem * currentItem = 0;
+    TOCItem * currentItem = nullptr;
     TQDomNode n = parentNode.firstChild();
     while( !n.isNull() )
     {
@@ -138,7 +138,7 @@ void TOC::slotExecuted( TQListViewItem *i )
 {
     TOCItem* tocItem = dynamic_cast<TOCItem*>( i );
     // that filters clicks on [+] that for a strange reason don't seem to be TOCItem*
-    if (tocItem == NULL)
+    if (!tocItem)
         return;
     const TQDomElement & e = tocItem->element();
 
diff --git a/kpdf/ui/toc.h b/kpdf/ui/toc.h
index 9ed1d55c..6fbf23ce 100644
--- a/kpdf/ui/toc.h
+++ b/kpdf/ui/toc.h
@@ -36,7 +36,7 @@ TQ_OBJECT
         void slotExecuted(TQListViewItem *i);
 
     private:
-        void addChildren( const TQDomNode & parentNode, TDEListViewItem * parentItem = 0 );
+        void addChildren( const TQDomNode & parentNode, TDEListViewItem * parentItem = nullptr );
         DocumentViewport getViewport( const TQDomElement &e ) const;
         KPDFDocument *m_document;
 };
diff --git a/kpdf/xpdf/fofi/FoFiType1C.cpp b/kpdf/xpdf/fofi/FoFiType1C.cpp
index f46da94b..32fd4dc0 100644
--- a/kpdf/xpdf/fofi/FoFiType1C.cpp
+++ b/kpdf/xpdf/fofi/FoFiType1C.cpp
@@ -34,7 +34,7 @@ FoFiType1C *FoFiType1C::make(char *fileA, int lenA) {
   ff = new FoFiType1C(fileA, lenA, gFalse);
   if (!ff->parse()) {
     delete ff;
-    return NULL;
+    return nullptr;
   }
   return ff;
 }
@@ -45,12 +45,12 @@ FoFiType1C *FoFiType1C::load(char *fileName) {
   int lenA;
 
   if (!(fileA = FoFiBase::readFile(fileName, &lenA))) {
-    return NULL;
+    return nullptr;
   }
   ff = new FoFiType1C(fileA, lenA, gTrue);
   if (!ff->parse()) {
     delete ff;
-    return NULL;
+    return nullptr;
   }
   return ff;
 }
@@ -58,11 +58,11 @@ FoFiType1C *FoFiType1C::load(char *fileName) {
 FoFiType1C::FoFiType1C(char *fileA, int lenA, GBool freeFileDataA):
   FoFiBase(fileA, lenA, freeFileDataA)
 {
-  name = NULL;
-  encoding = NULL;
-  privateDicts = NULL;
-  fdSelect = NULL;
-  charset = NULL;
+  name = nullptr;
+  encoding = nullptr;
+  privateDicts = nullptr;
+  fdSelect = nullptr;
+  charset = nullptr;
 }
 
 FoFiType1C::~FoFiType1C() {
@@ -94,7 +94,7 @@ FoFiType1C::~FoFiType1C() {
 }
 
 char *FoFiType1C::getName() {
-  return name ? name->getCString() : (char *)NULL;
+  return name ? name->getCString() : (char *)nullptr;
 }
 
 char **FoFiType1C::getEncoding() {
@@ -108,7 +108,7 @@ Gushort *FoFiType1C::getCIDToGIDMap(int *nCIDs) {
   // a CID font's top dict has ROS as the first operator
   if (topDict.firstOp != 0x0c1e) {
     *nCIDs = 0;
-    return NULL;
+    return nullptr;
   }
 
   // in a CID font, the charset data is the GID-to-CID mapping, so all
@@ -2310,7 +2310,7 @@ void FoFiType1C::buildEncoding() {
   } else {
     encoding = (char **)gmallocn(256, sizeof(char *));
     for (i = 0; i < 256; ++i) {
-      encoding[i] = NULL;
+      encoding[i] = nullptr;
     }
     pos = topDict.encodingOffset;
     encFormat = getU8(pos++, &parsedOk);
@@ -2439,7 +2439,7 @@ GBool FoFiType1C::readCharset() {
     }
     if (!parsedOk) {
       gfree(charset);
-      charset = NULL;
+      charset = nullptr;
       return gFalse;
     }
   }
-- 
cgit v1.2.3

