From d309f6b515b637179aeb0585b04f8da3889d0d45 Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Mon, 16 Nov 2026 06:38:23 -0300
Subject: Use nullptr in DjVuLibre
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Keep the imported DjVuLibre source and its existing attribution in a separate vendor-maintenance change.

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 kviewshell/plugins/djvu/libdjvu/Arrays.cpp         | 12 ++--
 kviewshell/plugins/djvu/libdjvu/Arrays.h           |  8 +--
 kviewshell/plugins/djvu/libdjvu/ByteStream.cpp     | 28 ++++----
 kviewshell/plugins/djvu/libdjvu/ByteStream.h       |  8 +--
 kviewshell/plugins/djvu/libdjvu/DataPool.cpp       | 16 ++---
 kviewshell/plugins/djvu/libdjvu/DataPool.h         |  2 +-
 kviewshell/plugins/djvu/libdjvu/DjVmDir.cpp        | 12 ++--
 kviewshell/plugins/djvu/libdjvu/DjVmDir.h          |  2 +-
 kviewshell/plugins/djvu/libdjvu/DjVmDir0.cpp       |  4 +-
 kviewshell/plugins/djvu/libdjvu/DjVmDoc.cpp        |  4 +-
 kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp        |  4 +-
 kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp       |  8 +--
 kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp  | 38 +++++------
 kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.h    | 20 +++---
 kviewshell/plugins/djvu/libdjvu/DjVuDocument.cpp   | 58 ++++++++---------
 kviewshell/plugins/djvu/libdjvu/DjVuDocument.h     | 26 ++++----
 kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.cpp |  2 +-
 kviewshell/plugins/djvu/libdjvu/DjVuErrorList.cpp  |  2 +-
 kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp       | 68 +++++++++----------
 kviewshell/plugins/djvu/libdjvu/DjVuFile.h         |  8 +--
 kviewshell/plugins/djvu/libdjvu/DjVuFileCache.h    |  6 +-
 kviewshell/plugins/djvu/libdjvu/DjVuGlobal.cpp     |  2 +-
 kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp      | 76 +++++++++++-----------
 kviewshell/plugins/djvu/libdjvu/DjVuImage.h        |  2 +-
 kviewshell/plugins/djvu/libdjvu/DjVuMessage.cpp    | 10 +--
 kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp    | 10 +--
 kviewshell/plugins/djvu/libdjvu/DjVuPalette.h      |  2 +-
 kviewshell/plugins/djvu/libdjvu/DjVuPort.cpp       | 18 ++---
 kviewshell/plugins/djvu/libdjvu/DjVuText.cpp       | 10 +--
 kviewshell/plugins/djvu/libdjvu/DjVuText.h         |  4 +-
 kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp       | 54 +++++++--------
 kviewshell/plugins/djvu/libdjvu/GBitmap.cpp        | 38 +++++------
 kviewshell/plugins/djvu/libdjvu/GBitmap.h          |  2 +-
 kviewshell/plugins/djvu/libdjvu/GContainer.cpp     | 34 +++++-----
 kviewshell/plugins/djvu/libdjvu/GContainer.h       |  8 +--
 kviewshell/plugins/djvu/libdjvu/GException.cpp     |  8 +--
 kviewshell/plugins/djvu/libdjvu/GException.h       | 10 +--
 kviewshell/plugins/djvu/libdjvu/GIFFManager.h      |  4 +-
 kviewshell/plugins/djvu/libdjvu/GOS.cpp            |  6 +-
 kviewshell/plugins/djvu/libdjvu/GOS.h              |  2 +-
 kviewshell/plugins/djvu/libdjvu/GPixmap.cpp        | 50 +++++++-------
 kviewshell/plugins/djvu/libdjvu/GPixmap.h          | 24 +++----
 kviewshell/plugins/djvu/libdjvu/GSmartPointer.cpp  |  4 +-
 kviewshell/plugins/djvu/libdjvu/GSmartPointer.h    |  6 +-
 kviewshell/plugins/djvu/libdjvu/GString.cpp        | 52 +++++++--------
 kviewshell/plugins/djvu/libdjvu/GString.h          |  6 +-
 kviewshell/plugins/djvu/libdjvu/GThreads.cpp       | 14 ++--
 kviewshell/plugins/djvu/libdjvu/GThreads.h         |  2 +-
 kviewshell/plugins/djvu/libdjvu/GURL.cpp           |  8 +--
 kviewshell/plugins/djvu/libdjvu/GURL.h             |  4 +-
 kviewshell/plugins/djvu/libdjvu/GUnicode.cpp       | 12 ++--
 kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp  |  8 +--
 kviewshell/plugins/djvu/libdjvu/IFFByteStream.h    |  2 +-
 .../plugins/djvu/libdjvu/IW44EncodeCodec.cpp       | 28 ++++----
 kviewshell/plugins/djvu/libdjvu/IW44Image.cpp      | 44 ++++++-------
 kviewshell/plugins/djvu/libdjvu/IW44Image.h        | 14 ++--
 kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp | 30 ++++-----
 kviewshell/plugins/djvu/libdjvu/JB2Image.cpp       |  4 +-
 kviewshell/plugins/djvu/libdjvu/JB2Image.h         |  4 +-
 kviewshell/plugins/djvu/libdjvu/JPEGDecoder.cpp    |  4 +-
 kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp     |  6 +-
 kviewshell/plugins/djvu/libdjvu/MMRDecoder.h       |  4 +-
 .../plugins/djvu/libdjvu/UnicodeByteStream.cpp     | 18 ++---
 kviewshell/plugins/djvu/libdjvu/XMLParser.cpp      |  8 +--
 64 files changed, 496 insertions(+), 496 deletions(-)

diff --git a/kviewshell/plugins/djvu/libdjvu/Arrays.cpp b/kviewshell/plugins/djvu/libdjvu/Arrays.cpp
index 5a877dd6..1609945d 100644
--- a/kviewshell/plugins/djvu/libdjvu/Arrays.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/Arrays.cpp
@@ -77,7 +77,7 @@ ArrayRep::ArrayRep(int xelsize,
 		   void (* xinit2)(void *, int, int, const void *, int, int),
 		   void (* xcopy)(void *, int, int, const void *, int, int),
 		   void (* xinsert)(void *, int, int, const void *, int)) :
-      data(0), minlo(0), maxhi(-1), lobound(0), hibound(-1),
+      data(nullptr), minlo(0), maxhi(-1), lobound(0), hibound(-1),
       elsize(xelsize), destroy(xdestroy), init1(xinit1),
       init2(xinit2), copy(xcopy), insert(xinsert)
 {
@@ -89,7 +89,7 @@ ArrayRep::ArrayRep(int xelsize,
 		   void (* xinit2)(void *, int, int, const void *, int, int),
 		   void (* xcopy)(void *, int, int, const void *, int, int),
 		   void (* xinsert)(void *, int, int, const void *, int),
-		   int hi) : data(0), minlo(0), maxhi(-1),
+		   int hi) : data(nullptr), minlo(0), maxhi(-1),
    lobound(0), hibound(-1), elsize(xelsize), destroy(xdestroy), init1(xinit1),
    init2(xinit2), copy(xcopy), insert(xinsert)
 {
@@ -102,14 +102,14 @@ ArrayRep::ArrayRep(int xelsize,
 		   void (* xinit2)(void *, int, int, const void *, int, int),
 		   void (* xcopy)(void *, int, int, const void *, int, int),
 		   void (* xinsert)(void *, int, int, const void *, int),
-		   int lo, int hi) : data(0), minlo(0), maxhi(-1),
+		   int lo, int hi) : data(nullptr), minlo(0), maxhi(-1),
    lobound(0), hibound(-1), elsize(xelsize), destroy(xdestroy), init1(xinit1),
    init2(xinit2), copy(xcopy), insert(xinsert)
 {
    resize(lo,hi);
 }
 
-ArrayRep::ArrayRep(const ArrayRep & arr) : data(0), minlo(0), maxhi(-1),
+ArrayRep::ArrayRep(const ArrayRep & arr) : data(nullptr), minlo(0), maxhi(-1),
    lobound(0), hibound(-1), elsize(arr.elsize), destroy(arr.destroy),
    init1(arr.init1), init2(arr.init2), copy(arr.copy), insert(arr.insert)
 {
@@ -122,7 +122,7 @@ ArrayRep::~ArrayRep()
 {
    destroy(data, lobound-minlo, hibound-minlo);
    operator delete(data);
-   data=0;
+   data=nullptr;
 }
 
 ArrayRep & 
@@ -148,7 +148,7 @@ ArrayRep::resize(int lo, int hi)
     {
       destroy(data, lobound-minlo, hibound-minlo);
       operator delete(data);
-      data = 0;
+      data = nullptr;
       lobound = minlo = lo; 
       hibound = maxhi = hi; 
       return;
diff --git a/kviewshell/plugins/djvu/libdjvu/Arrays.h b/kviewshell/plugins/djvu/libdjvu/Arrays.h
index ca0b1771..c969aaaf 100644
--- a/kviewshell/plugins/djvu/libdjvu/Arrays.h
+++ b/kviewshell/plugins/djvu/libdjvu/Arrays.h
@@ -147,20 +147,20 @@ private:
 class _ArrayBase
 {
 public:
-   _ArrayBase(void) : rep(0) {}
-   _ArrayBase(const _ArrayBase & ab) : rep(0)
+   _ArrayBase(void) : rep(nullptr) {}
+   _ArrayBase(const _ArrayBase & ab) : rep(nullptr)
    {
       if (ab.rep) ab.rep->ref();
       rep=ab.rep;
    }
-   _ArrayBase(_ArrayRep * ar) : rep(0)
+   _ArrayBase(_ArrayRep * ar) : rep(nullptr)
    {
       if (ar) ar->ref();
       rep=ar;
    }
    virtual ~_ArrayBase(void)
    {
-      if (rep) { rep->unref(); rep=0; }
+      if (rep) { rep->unref(); rep=nullptr; }
    }
 
    _ArrayRep *	get(void) const { return rep; }
diff --git a/kviewshell/plugins/djvu/libdjvu/ByteStream.cpp b/kviewshell/plugins/djvu/libdjvu/ByteStream.cpp
index ff04da3e..098fb81d 100644
--- a/kviewshell/plugins/djvu/libdjvu/ByteStream.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/ByteStream.cpp
@@ -285,7 +285,7 @@ protected:
   char *buf;
   GPBuffer<char> gbuf;
 public:
-  Allocate(const size_t size) : Static(0,size), gbuf(buf,size) { data=buf; }
+  Allocate(const size_t size) : Static(nullptr,size), gbuf(buf,size) { data=buf; }
   virtual ~Allocate();
 };
 
@@ -307,7 +307,7 @@ public:
 
 ByteStream::Static::Duplicate::Duplicate(
   const ByteStream::Static &bs, const size_t xsize)
-: ByteStream::Static(0,0)
+: ByteStream::Static(nullptr,0)
 {
   if(xsize&&(bs.bsize<bs.where))
   {
@@ -616,7 +616,7 @@ ByteStream::read32()
 //// CLASS ByteStream::Stdio
 
 ByteStream::Stdio::Stdio(void)
-: can_read(false),can_write(false),must_close(true),fp(0),pos(0)
+: can_read(false),can_write(false),must_close(true),fp(nullptr),pos(0)
 {}
 
 ByteStream::Stdio::~Stdio()
@@ -628,7 +628,7 @@ ByteStream::Stdio::~Stdio()
 GUTF8String
 ByteStream::Stdio::init(const char mode[])
 {
-  char const *mesg=0;
+  char const *mesg=nullptr;
   bool binary=false;
   if(!fp)
     must_close=false;
@@ -673,7 +673,7 @@ ByteStream::Stdio::init(const char mode[])
   if(mesg &&(fp && must_close))
   {
     fclose(fp);
-    fp=0;
+    fp=nullptr;
     must_close=false;
   }
   return retval;
@@ -848,7 +848,7 @@ ByteStream::Memory::empty()
   for (int b=0; b<nblocks; b++)
   {
     delete [] blocks[b];
-    blocks[b]=0;
+    blocks[b]=nullptr;
   }
   bsize = 0;
   where = 0;
@@ -879,7 +879,7 @@ ByteStream::Memory::write(const void *buffer, size_t sz)
           for(char const * const * const new_eblocks=blocks+nblocks;
             eblocks <new_eblocks; eblocks++) 
           {
-            *eblocks = 0;
+            *eblocks = nullptr;
           }
         }
       // allocate blocks
@@ -1052,7 +1052,7 @@ ByteStream::create(const GURL &url,char const * const xmode)
               retval = rb;
               GUTF8String errmessage = rb->init(fd,true);
               if(errmessage.length())
-                retval=0;
+                retval=nullptr;
             }
 #endif
           if (! retval)
@@ -1064,7 +1064,7 @@ ByteStream::create(const GURL &url,char const * const xmode)
                   retval=sbs;
                   GUTF8String errmessage=sbs->init(f, mode, true);
                   if(errmessage.length())
-                    retval=0;
+                    retval=nullptr;
                 }
             }
           if (! retval)
@@ -1111,14 +1111,14 @@ ByteStream::create(const int fd,char const * const mode,const bool closeme)
     GUTF8String errmessage=rb->init(fd,closeme);
     if(errmessage.length())
     {
-      retval=0;
+      retval=nullptr;
     }
   }
   if(!retval)
 #endif
   {
     int fd2 = fd;
-    FILE *f = 0;
+    FILE *f = nullptr;
     if (fd == 0 && !closeme 
         && (!mode || mode[0]=='r') )
       {
@@ -1174,7 +1174,7 @@ ByteStream::create(FILE * const f,char const * const mode,const bool closeme)
     GUTF8String errmessage=rb->init(fileno(f),false);
     if(errmessage.length())
     {
-      retval=0;
+      retval=nullptr;
     }else
     {
       fclose(f);
@@ -1227,7 +1227,7 @@ ByteStream::duplicate(const size_t xsize) const
 
 #if HAS_MEMMAP
 MemoryMapByteStream::MemoryMapByteStream(void)
-: ByteStream::Static(0,0)
+: ByteStream::Static(nullptr,0)
 {}
 
 GUTF8String
@@ -1253,7 +1253,7 @@ MemoryMapByteStream::init(const int fd,const bool closeme)
     if(statbuf.st_size)
     {
       bsize=statbuf.st_size;
-      data=(char *)mmap(0,statbuf.st_size,PROT_READ,MAP_SHARED,fd,0);
+      data=(char *)mmap(nullptr,statbuf.st_size,PROT_READ,MAP_SHARED,fd,0);
     }
   }else
   {
diff --git a/kviewshell/plugins/djvu/libdjvu/ByteStream.h b/kviewshell/plugins/djvu/libdjvu/ByteStream.h
index 29874faf..556b7621 100644
--- a/kviewshell/plugins/djvu/libdjvu/ByteStream.h
+++ b/kviewshell/plugins/djvu/libdjvu/ByteStream.h
@@ -337,9 +337,9 @@ public:
     void const * const buffer, const size_t size);
   
   /** Easy access to preallocated stdin/stdout/stderr bytestreams */
-  static GP<ByteStream> get_stdin(char const * const mode=0);
-  static GP<ByteStream> get_stdout(char const * const mode=0);  
-  static GP<ByteStream> get_stderr(char const * const mode=0);
+  static GP<ByteStream> get_stdin(char const * const mode=nullptr);
+  static GP<ByteStream> get_stdout(char const * const mode=nullptr);
+  static GP<ByteStream> get_stderr(char const * const mode=nullptr);
 
   /** This is the conventional name for EOF exceptions */
   static const char *EndOfFile;
@@ -382,7 +382,7 @@ class ByteStream::Wrapper : public ByteStream
 protected:
   GP<ByteStream> gbs;
   ByteStream *bs;
-  Wrapper(void) : bs(0) {}
+  Wrapper(void) : bs(nullptr) {}
   Wrapper(const GP<ByteStream> &xbs) : gbs(xbs), bs(xbs) {}
 public:
   ~Wrapper();
diff --git a/kviewshell/plugins/djvu/libdjvu/DataPool.cpp b/kviewshell/plugins/djvu/libdjvu/DataPool.cpp
index 5766e67e..3de9e084 100644
--- a/kviewshell/plugins/djvu/libdjvu/DataPool.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DataPool.cpp
@@ -685,7 +685,7 @@ public:
 //   GP<GPEnabled> cl_data;
    void *cl_data;
 
-   Trigger() : start(0), length(-1), callback(0), cl_data(0) {};
+   Trigger() : start(0), length(-1), callback(nullptr), cl_data(nullptr) {};
    Trigger(int xstart, int xlength,
 //   void (* xcallback)(GP<GPEnabled> &), GP<GPEnabled> xcl_data) :
    void (* xcallback)(void *), void *xcl_data) :
@@ -720,7 +720,7 @@ DataPool::init(void)
   stop_blocked_flag=false;
 
   active_readers=new Counter;
-  block_list=0;
+  block_list=nullptr;
   G_TRY
   {   
     block_list=new BlockList;
@@ -729,9 +729,9 @@ DataPool::init(void)
   G_CATCH_ALL
   {
     delete block_list;
-    block_list=0;
+    block_list=nullptr;
     delete active_readers;
-    active_readers=0;
+    active_readers=nullptr;
     G_RETHROW;
   }
   G_ENDCATCH;
@@ -819,7 +819,7 @@ DataPool::clear_stream(const bool release)
     if(f)
     {
       GCriticalSectionLock lock2(&(f->stream_lock));
-      fstream=0;
+      fstream=nullptr;
       if(release)
         OpenFiles::get()->stream_released(f->stream, this);
     }
@@ -878,7 +878,7 @@ DataPool::connect(const GP<DataPool> & pool_in, int start_in, int length_in)
    else
      pool->add_trigger(start, length, static_trigger_cb, this);
 
-   data=0;
+   data=nullptr;
 
    wake_up_all_readers();
    
@@ -944,7 +944,7 @@ DataPool::connect(const GURL &furl_in, int start_in, int length_in)
         added_data(0,length);
       }else 
       {
-        data=0;
+        data=nullptr;
       }
 
       FCPools::get()->add_pool(furl, this);
@@ -1436,7 +1436,7 @@ DataPool::load_file(void)
 	      // No need to set EOF. It should already be set.
         OpenFiles::get()->stream_released(f->stream, this);
       }
-      fstream=0;
+      fstream=nullptr;
    } else { DEBUG_MSG("Not connected\n"); }
 }
 
diff --git a/kviewshell/plugins/djvu/libdjvu/DataPool.h b/kviewshell/plugins/djvu/libdjvu/DataPool.h
index c6a4e672..3cde388b 100644
--- a/kviewshell/plugins/djvu/libdjvu/DataPool.h
+++ b/kviewshell/plugins/djvu/libdjvu/DataPool.h
@@ -611,7 +611,7 @@ DataPool::simple_compare(DataPool &pool) const
 inline bool
 DataPool::is_connected(void) const
 {
-   return furl.is_local_file_url() || pool!=0;
+   return furl.is_local_file_url() || pool!=nullptr;
 }
 
 //@}
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmDir.cpp b/kviewshell/plugins/djvu/libdjvu/DjVmDir.cpp
index 5b78d6fd..0571ecff 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVmDir.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVmDir.cpp
@@ -532,7 +532,7 @@ DjVmDir::page_to_file(int page_num) const
 {
    GCriticalSectionLock lock((GCriticalSection *) &class_lock);
 
-   return (page_num<page2file.size())?page2file[page_num]:(GP<DjVmDir::File>(0));
+   return (page_num<page2file.size())?page2file[page_num]:(GP<DjVmDir::File>(nullptr));
 }
 
 GP<DjVmDir::File>
@@ -541,7 +541,7 @@ DjVmDir::name_to_file(const GUTF8String & name) const
    GCriticalSectionLock lock((GCriticalSection *) &class_lock);
 
    GPosition pos;
-   return (name2file.contains(name, pos))?name2file[pos]:(GP<DjVmDir::File>(0));
+   return (name2file.contains(name, pos))?name2file[pos]:(GP<DjVmDir::File>(nullptr));
 }
 
 GP<DjVmDir::File>
@@ -550,7 +550,7 @@ DjVmDir::id_to_file(const GUTF8String &id) const
    GCriticalSectionLock lock((GCriticalSection *) &class_lock);
 
    GPosition pos;
-   return (id2file.contains(id, pos))?id2file[pos]:(GP<DjVmDir::File>(0));
+   return (id2file.contains(id, pos))?id2file[pos]:(GP<DjVmDir::File>(nullptr));
 }
 
 GP<DjVmDir::File>
@@ -559,7 +559,7 @@ DjVmDir::title_to_file(const GUTF8String &title) const
    GCriticalSectionLock lock((GCriticalSection *) &class_lock);
 
    GPosition pos;
-   return (title2file.contains(title, pos))?title2file[pos]:(GP<DjVmDir::File>(0));
+   return (title2file.contains(title, pos))?title2file[pos]:(GP<DjVmDir::File>(nullptr));
 }
 
 GPList<DjVmDir::File>
@@ -799,7 +799,7 @@ DjVmDir::resolve_duplicates(const bool save_as_bundled)
       conflicts[save_name].append(files_list[pos]);
     }else
     {
-      save_map[save_name]=0;
+      save_map[save_name]=nullptr;
     }
   }
   for(pos=conflicts;pos;++pos)
@@ -823,7 +823,7 @@ DjVmDir::resolve_duplicates(const bool save_as_bundled)
         } while(save_map.contains(new_name.downcase()));
       }
       cfiles[qpos]->set_save_name(new_name);
-      save_map[new_name]=0;
+      save_map[new_name]=nullptr;
     }
   }
   return files_list;
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmDir.h b/kviewshell/plugins/djvu/libdjvu/DjVmDir.h
index 216ded79..0155f0e9 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVmDir.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVmDir.h
@@ -433,7 +433,7 @@ inline bool
 DjVmDir::is_indirect(void) const
 {
   GCriticalSectionLock lock((GCriticalSection *) &class_lock);
-  return ( files_list.size() && files_list[files_list] != 0 &&
+  return ( files_list.size() && files_list[files_list] != nullptr &&
            files_list[files_list]->offset==0 );
 }
 
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmDir0.cpp b/kviewshell/plugins/djvu/libdjvu/DjVmDir0.cpp
index 4994d5e7..cdbfdda1 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVmDir0.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVmDir0.cpp
@@ -133,14 +133,14 @@ DjVmDir0::get_file(const GUTF8String &name)
 {
    if (name2file.contains(name))
      return name2file[name];
-   return 0;
+   return nullptr;
 }
 
 GP<DjVmDir0::FileRec>
 DjVmDir0::get_file(int file_num)
 {
    if (file_num<num2file.size()) return num2file[file_num];
-   return 0;
+   return nullptr;
 }
 
 void
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmDoc.cpp b/kviewshell/plugins/djvu/libdjvu/DjVmDoc.cpp
index e6ba4a30..df066762 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVmDoc.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVmDoc.cpp
@@ -314,7 +314,7 @@ DjVmDoc::write(const GP<ByteStream> &gstr,
         for(pos=files_list;pos;++pos)
         {
           GP<DjVmDir::File> file=files_list[pos];
-          this_doc[::get_name(*file)]=0;
+          this_doc[::get_name(*file)]=nullptr;
         }
         bool need_new_list=false;
         for(pos=files_list;pos;++pos)
@@ -584,7 +584,7 @@ void
 DjVmDoc::save_file(
   const GURL &codebase, const DjVmDir::File &file) const
 {
-  save_file(codebase,file,0);
+  save_file(codebase,file,nullptr);
 }
 
 GUTF8String 
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp b/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp
index cab46992..dc73ea9e 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp
@@ -111,7 +111,7 @@ void
 DjVmNav::DjVuBookMark::decode(const GP<ByteStream> &gstr)
 {
   int textsize=0, readsize=0;
-  char *buffer=0;
+  char *buffer=nullptr;
   ByteStream &bs=*gstr;
   count = bs.read8();
   displayname.empty();
@@ -244,7 +244,7 @@ DjVmNav::getBookMark(GP<DjVuBookMark> &gpBookMark, int iPos)
   if (pos)
     gpBookMark = bookmark_list[pos];
   else
-    gpBookMark = 0;
+    gpBookMark = nullptr;
   return (gpBookMark?true:false);
 }
 
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp
index 1d42b737..98e1d9a4 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp
@@ -109,7 +109,7 @@ public:
    
    GLObjectType	get_type(void) const;
    GUTF8String	get_name(void) const;
-   void		print(ByteStream & str, int compact=1, int indent=0, int * cur_pos=0) const;
+   void		print(ByteStream & str, int compact=1, int indent=0, int * cur_pos=nullptr) const;
 private:
    GLObjectType	type;
    GUTF8String	name;
@@ -214,7 +214,7 @@ GLObject::print(ByteStream & str, int compact, int indent, int * cur_pos) const
   if (!cur_pos) { cur_pos = &local_cur_pos; }
   
   GUTF8String buffer;
-  const char * to_print=0;
+  const char * to_print=nullptr;
   switch(type)
   {
   case NUMBER:
@@ -411,12 +411,12 @@ GLParser::get_token(const char * & start)
    if (c == '(')
      {
        start++;
-       return GLToken(GLToken::OPEN_PAR, 0);
+       return GLToken(GLToken::OPEN_PAR, nullptr);
      }
    else if (c == ')')
      {
        start++;
-       return GLToken(GLToken::CLOSE_PAR, 0);
+       return GLToken(GLToken::CLOSE_PAR, nullptr);
      }
    else if (c=='-' || (c>='0' && c<='9'))
      {
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp
index 25eac90c..e5d222ed 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp
@@ -125,8 +125,8 @@ DjVuDocEditor::check(void)
 DjVuDocEditor::DjVuDocEditor(void)
 {
    initialized=false;
-   refresh_cb=0;
-   refresh_cl_data=0;
+   refresh_cb=nullptr;
+   refresh_cl_data=nullptr;
 }
 
 DjVuDocEditor::~DjVuDocEditor(void)
@@ -191,7 +191,7 @@ DjVuDocEditor::init(const GURL &url)
    {
          // Suxx. I need to convert it NOW.
          // We will unlink this file in the destructor
-      tmp_doc_url=GURL::Filename::Native(tmpnam(0));
+      tmp_doc_url=GURL::Filename::Native(tmpnam(nullptr));
       const GP<ByteStream> gstr(ByteStream::create(tmp_doc_url, "wb"));
       tmp_doc->write(gstr, true);        // Force DJVM format
       gstr->flush();
@@ -287,7 +287,7 @@ DjVuDocEditor::clean_files_map(void)
          DEBUG_MSG("ZEROing file '" << f->file->get_url() << "'\n");
          if (f->file->is_modified())
             f->pool=f->file->get_djvu_data(false);
-         f->file=0;
+         f->file=nullptr;
       }
       if (!f->file && !f->pool)
       {
@@ -633,7 +633,7 @@ DjVuDocEditor::insert_file(const GP<DataPool> &file_pool,
               }
               const GP<IFFByteStream> giff_old(IFFByteStream::create(pool->get_stream()));
               const GP<IFFByteStream> giff_new(IFFByteStream::create(file_pool->get_stream()));
-              file=0;
+              file=nullptr;
               if(giff_old->compare(*giff_new))
               {
                 // The files are the same, so just store the alias.
@@ -841,7 +841,7 @@ DjVuDocEditor::insert_group(const GList<GURL> & file_urls, int page_num,
           doc->set_recover_errors(recover_errors);
           doc->wait_for_complete_init();
           get_portcaster()->add_route(doc,this);
-          gbs=0;
+          gbs=nullptr;
           DEBUG_MSG("Inserting pages\n");
           int pages_num=doc->get_pages_num();
           for(int page_num=0;page_num<pages_num;page_num++)
@@ -870,12 +870,12 @@ DjVuDocEditor::insert_group(const GList<GURL> & file_urls, int page_num,
     }
   } G_CATCH_ALL
   {
-    refresh_cb=0;
-    refresh_cl_data=0;
+    refresh_cb=nullptr;
+    refresh_cl_data=nullptr;
     G_RETHROW;
   } G_ENDCATCH;
-  refresh_cb=0;
-  refresh_cl_data=0;
+  refresh_cb=nullptr;
+  refresh_cl_data=nullptr;
 }
 
 void
@@ -937,7 +937,7 @@ DjVuDocEditor::generate_ref_map(const GP<DjVuFile> & file,
    const GUTF8String id(djvm_dir->name_to_file(url.fname())->get_load_name());
    if (!visit_map.contains(url))
    {
-      visit_map[url]=0;
+      visit_map[url]=nullptr;
 
       GPList<DjVuFile> files_list=file->get_included_files(false);
       for(GPosition pos=files_list;pos;++pos)
@@ -948,12 +948,12 @@ DjVuDocEditor::generate_ref_map(const GP<DjVuFile> & file,
          GURL child_url=child_file->get_url();
          const GUTF8String child_id(
            djvm_dir->name_to_file(child_url.fname())->get_load_name());
-         GMap<GUTF8String, void *> * parents=0;
+         GMap<GUTF8String, void *> * parents=nullptr;
          if (ref_map.contains(child_id))
             parents=(GMap<GUTF8String, void *> *) ref_map[child_id];
          else
             ref_map[child_id]=parents=new GMap<GUTF8String, void *>();
-         (*parents)[id]=0;
+         (*parents)[id]=nullptr;
             // Second: go recursively
          generate_ref_map(child_file, ref_map, visit_map);
       }
@@ -986,7 +986,7 @@ DjVuDocEditor::remove_file(const GUTF8String &id, bool remove_unref,
            parent->unlink_file(id);
       }
       delete parents;
-      parents=0;
+      parents=nullptr;
       ref_map.del(id);
    }
 
@@ -1115,7 +1115,7 @@ DjVuDocEditor::move_file(const GUTF8String &id, int & file_pos,
 {
    if (!map.contains(id))
    {
-      map[id]=0;
+      map[id]=nullptr;
 
       GP<DjVmDir::File> file_rec=djvm_dir->id_to_file(id);
       if (file_rec)
@@ -1390,7 +1390,7 @@ DjVuDocEditor::simplify_anno(void (* progress_cb)(float progress, void *),
          if ((file_flags & (DjVuFile::DECODE_OK |
                             DjVuFile::DECODE_FAILED |
                             DjVuFile::DECODE_STOPPED))==0)
-            djvu_file->anno=0;
+            djvu_file->anno=nullptr;
       }
       if (progress_cb)
     progress_cb((float)(page_num/2.0/pages_num), cl_data);
@@ -1748,7 +1748,7 @@ store_file(const GP<DjVmDir> & src_djvm_dir, const GP<DjVmDoc> & djvm_doc,
    GURL url=djvu_file->get_url();
    if (!map.contains(url))
    {
-      map[url]=0;
+      map[url]=nullptr;
 
          // Store included files first
       GPList<DjVuFile> djvu_files_list=djvu_file->get_included_files(false);
@@ -2093,8 +2093,8 @@ DjVuDocEditor::save_as(const GURL &where, bool bundled)
      for(GPosition pos=files_map;pos;)
      {
         const GP<File> file_rec(files_map[pos]);
-        file_rec->pool=0;
-        if (file_rec->file==0)
+        file_rec->pool=nullptr;
+        if (!file_rec->file)
         {
          GPosition this_pos=pos;
          ++pos;
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.h b/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.h
index 0d5cd14c..0fd7f908 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.h
@@ -199,7 +199,7 @@ public:
    GUTF8String	page_to_id(int page_num) const;
    
    GUTF8String	insert_file(const GURL &url, const GUTF8String &parent_id,
-			    int chunk_num=1, DjVuPort *source=0);
+			    int chunk_num=1, DjVuPort *source=nullptr);
       /** Inserts the referenced file into this DjVu document.
 
 	  @param fname Name of the top-level file containing the image of
@@ -255,7 +255,7 @@ public:
 	  @param page_num Position where the new pages should be inserted at.
 	  	 Negative value means "append" */
    void		insert_group(const GList<GURL> & furl_list, int page_num=-1,
-			     void (* refresh_cb)(void *)=0, void * cl_data=0);
+			     void (* refresh_cb)(void *)=nullptr, void * cl_data=nullptr);
       /** Removes the specified page from the document. If #remove_unref#
 	  is #true#, the function will also remove from the document any file,
 	  which became unreferenced due to the page's removal */
@@ -354,16 +354,16 @@ public:
 		 The callback should return #false# if thumbnails generating
 		 should proceed. #true# will stop it. */
    void	generate_thumbnails(int thumb_size,
-                            bool (* cb)(int page_num, void *)=0,
-                            void * cl_data=0);
+                            bool (* cb)(int page_num, void *)=nullptr,
+                            void * cl_data=nullptr);
       //@}
       /** Use this function to simplify annotations in the document.
         The "simplified" format is when annotations are only allowed
         either in top-level page files or in a special file with
         #SHARED_ANNO# flag on. This file is supposed to be included into
         every page. */
-   void simplify_anno(void (* progress_cb)(float progress, void *)=0,
-                      void * cl_data=0);
+   void simplify_anno(void (* progress_cb)(float progress, void *)=nullptr,
+                      void * cl_data=nullptr);
 
       /** Will create a file that will be included into every page and
         marked with the #SHARED_ANNO# flag. This file can be used
@@ -371,8 +371,8 @@ public:
 
         {\bf Note:} There may be only one #SHARED_ANNO# file in any
         DjVu multipage document. */
-   void create_shared_anno_file(void (* progress_cb)(float progress, void *)=0,
-                                void * cl_data=0);
+   void create_shared_anno_file(void (* progress_cb)(float progress, void *)=nullptr,
+                                void * cl_data=nullptr);
 
       /** Sets bookmark data */
    void set_djvm_nav(GP<DjVmNav> nav);
@@ -425,12 +425,12 @@ private:
                   const GURL &file_url, bool is_page,
 		  int & file_pos,
                   GMap<GUTF8String,GUTF8String> & name2id,
-                  DjVuPort *source=0 );
+                  DjVuPort *source=nullptr );
    bool		insert_file(
                   const GURL &file_url, bool is_page,
 		  int & file_pos,
                   GMap<GUTF8String,GUTF8String> & name2id,
-                  DjVuPort *source=0 );
+                  DjVuPort *source=nullptr );
    void		remove_file(const GUTF8String &id, bool remove_unref,
 			    GMap<GUTF8String, void *> & ref_map);
    void		generate_ref_map(const GP<DjVuFile> & file,
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuDocument.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuDocument.cpp
index c7effd99..2d5547ca 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuDocument.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuDocument.cpp
@@ -89,10 +89,10 @@ const float	DjVuDocument::thumb_gamma=(float)2.20;
 
 void (* DjVuDocument::djvu_import_codec)(
   GP<DataPool> &pool, const GURL &url, bool &needs_compression,
-  bool &needs_rename )=0;
+  bool &needs_rename )=nullptr;
 
 void (* DjVuDocument::djvu_compress_codec)(
-  GP<ByteStream> &doc,const GURL &where,bool bundled)=0;
+  GP<ByteStream> &doc,const GURL &where,bool bundled)=nullptr;
 
 void
 DjVuDocument::set_import_codec(
@@ -119,7 +119,7 @@ DjVuDocument::DjVuDocument(void)
     recover_errors(ABORT),
     verbose_eof(false),
     init_started(false),
-    cache(0) 
+    cache(nullptr)
 {
 }
 
@@ -278,7 +278,7 @@ DjVuDocument::static_init_thread(void * cl_data)
 {
   DjVuDocument * th=(DjVuDocument *) cl_data;
   GP<DjVuDocument> life_saver=th;
-  th->init_life_saver=0;
+  th->init_life_saver=nullptr;
   G_TRY {
     th->init_thread();
   } G_CATCH(exc) {
@@ -423,7 +423,7 @@ DjVuDocument::init_thread(void)
        DEBUG_MSG("Searching for NDIR chunks...\n");
        ndir_file=get_djvu_file(-1);
        if (ndir_file) ndir=ndir_file->decode_ndir();
-       ndir_file=0;	// Otherwise ~DjVuDocument() will stop (=kill) it
+       ndir_file=nullptr;	// Otherwise ~DjVuDocument() will stop (=kill) it
        if (!ndir)
          {
            // Seems to be 1-page old-style document. Create dummy NDIR
@@ -896,7 +896,7 @@ DjVuDocument::get_djvu_file(int page_num, bool dont_create) const
 	    // If init is complete and url is empty, we know for sure, that
 	    // smth is wrong with the page_num. So we can return ZERO.
 	    // Otherwise we create a temporary file and wait for init to finish
-	 if (is_init_complete()) return 0;
+	 if (is_init_complete()) return nullptr;
 	 
 	 DEBUG_MSG("Structure is not known => check <doc_url>#<page_num> alias...\n");
 	 GP<DjVuPort> port;
@@ -921,7 +921,7 @@ DjVuDocument::get_djvu_file(int page_num, bool dont_create) const
 	       if (f->url==url) return f->file;
 	    }
 	    GP<UnnamedFile> ufile=new UnnamedFile(UnnamedFile::PAGE_NUM, 0,
-						  page_num, url, 0);
+						  page_num, url, nullptr);
 
 	       // We're adding the record to the list before creating the DjVuFile
 	       // because DjVuFile::init() will call request_data(), and the
@@ -980,7 +980,7 @@ DjVuDocument::get_djvu_file(const GUTF8String& id, bool dont_create)
       // file with ID 'id' in the document. Otherwise we have to
       // create a temporary file and wait for the init to finish
       if (is_init_complete())
-        return 0;
+        return nullptr;
       // Invent some dummy temporary URL. I don't care what it will
       // be. I'll remember the ID and will generate the correct URL
       // after I learn what the document is
@@ -994,7 +994,7 @@ DjVuDocument::get_djvu_file(const GUTF8String& id, bool dont_create)
         if (f->url==url)
           return f->file;
       }
-      GP<UnnamedFile> ufile=new UnnamedFile(UnnamedFile::ID, id, 0, url, 0);
+      GP<UnnamedFile> ufile=new UnnamedFile(UnnamedFile::ID, id, 0, url, nullptr);
 
       // We're adding the record to the list before creating the DjVuFile
       // because DjVuFile::init() will call request_data(), and the
@@ -1021,7 +1021,7 @@ DjVuDocument::get_djvu_file(const GURL& url, bool dont_create)
    DEBUG_MAKE_INDENT(3);
 
    if (url.is_empty())
-     return 0;
+     return nullptr;
 
    const GP<DjVuFile> file(url_to_file(url, dont_create));
 
@@ -1118,8 +1118,8 @@ DjVuDocument::process_threqs(void)
           // to download it next time
           add_to_cache(req->thumb_file);
           
-          req->thumb_file=0;
-          req->image_file=0;
+          req->thumb_file=nullptr;
+          req->image_file=nullptr;
           remove=true;
         }
       } G_CATCH(exc) {
@@ -1128,7 +1128,7 @@ DjVuDocument::process_threqs(void)
         get_portcaster()->notify_error(this, msg);
 	       // Switch this request to the "decoding" mode
         req->image_file=get_djvu_file(req->page_num);
-        req->thumb_file=0;
+        req->thumb_file=nullptr;
         req->data_pool->set_eof();
         remove=true;
       } G_ENDCATCH;
@@ -1183,14 +1183,14 @@ DjVuDocument::process_threqs(void)
               req->data_pool->add_data((const char *) data, data.size());
               req->data_pool->set_eof();
               
-              req->thumb_file=0;
-              req->image_file=0;
+              req->thumb_file=nullptr;
+              req->image_file=nullptr;
               remove=true;
             } else if (req->image_file->is_decode_failed())
             {
               // Unfortunately we cannot decode it
-              req->thumb_file=0;
-              req->image_file=0;
+              req->thumb_file=nullptr;
+              req->image_file=nullptr;
               req->data_pool->set_eof();
               remove=true;
             } else
@@ -1205,8 +1205,8 @@ DjVuDocument::process_threqs(void)
         get_portcaster()->notify_error(this, msg);
         
 	       // Get rid of this request
-        req->image_file=0;
-        req->thumb_file=0;
+        req->image_file=nullptr;
+        req->thumb_file=nullptr;
         req->data_pool->set_eof();
         remove=true;
       } G_ENDCATCH;
@@ -1269,7 +1269,7 @@ DjVuDocument::map_ids(GMap<GUTF8String,void *> &map)
   GList<GUTF8String> ids=get_id_list();
   for(GPosition pos=ids;pos;++pos)
   {
-    map[ids[pos]]=0;
+    map[ids[pos]]=nullptr;
   }
 }
 
@@ -1279,7 +1279,7 @@ DjVuDocument::get_thumbnail(int page_num, bool dont_decode)
    DEBUG_MSG("DjVuDocument::get_thumbnail(): page_num=" << page_num << "\n");
    DEBUG_MAKE_INDENT(3);
 
-   if (!is_init_complete()) return 0;
+   if (!is_init_complete()) return nullptr;
    
    {
 	 // See if we already have request for this thumbnail pending
@@ -1350,13 +1350,13 @@ DjVuDocument::get_thumbnail(int page_num, bool dont_decode)
 	 } else
 	 {
 	       // Nothing can be done return ZERO
-	    thumb_req=0;
+	    thumb_req=nullptr;
 	 }
       }
-   } else thumb_req=0;
+   } else thumb_req=nullptr;
    
    if (thumb_req) return thumb_req->data_pool;
-   else return 0;
+   else return nullptr;
 }
 
 static void
@@ -1369,7 +1369,7 @@ add_to_cache(const GP<DjVuFile> & f, GMap<GURL, void *> & map,
    
    if (!map.contains(url))
    {
-      map[url]=0;
+      map[url]=nullptr;
       cache->add_file(f);
       
       GPList<DjVuFile> list;
@@ -1531,7 +1531,7 @@ add_file_to_djvm(const GP<DjVuFile> & file, bool page,
 
    if (!map.contains(url))
    {
-      map[url]=0;
+      map[url]=nullptr;
 
       if (file->get_chunks_number()>0 && !file->contains_chunk("NDIR"))
       {
@@ -1587,7 +1587,7 @@ local_get_url_names(DjVuFile * f,const GMap<GURL, void *> & map,GMap<GURL,void *
    GURL url=f->get_url();
    if (!map.contains(url) && !tmpmap.contains(url))
    {
-      tmpmap[url]=0;
+      tmpmap[url]=nullptr;
       f->process_incl_chunks();
       GPList<DjVuFile> files_list=f->get_included_files(false);
       for(GPosition pos=files_list;pos;++pos)
@@ -1601,7 +1601,7 @@ local_get_url_names(DjVuFile * f, GMap<GURL, void *> & map)
    GMap<GURL,void *> tmpmap;
    local_get_url_names(f,map,tmpmap);
    for(GPosition pos=tmpmap;pos;++pos)
-     map[tmpmap.key(pos)]=0;
+     map[tmpmap.key(pos)]=nullptr;
 }
 
 GList<GURL>
@@ -1621,7 +1621,7 @@ DjVuDocument::get_url_names(void)
     for(GPosition pos=files_list;pos;++pos)
     {
       GURL url=id_to_url(files_list[pos]->get_load_name());
-      map[url]=0;
+      map[url]=nullptr;
     }
   }else
   {
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuDocument.h b/kviewshell/plugins/djvu/libdjvu/DjVuDocument.h
index 9730d5b8..79f76c39 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuDocument.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuDocument.h
@@ -335,28 +335,28 @@ public:
 		 because #DjVuDocument# can access such files itself.
 	  @param cache It's used to cache decoded \Ref{DjVuFile}s and
 	         is actually useful in the plugin only.  */
-   void		start_init(const GURL & url, GP<DjVuPort> port=0,
-			   DjVuFileCache * cache=0);
+   void		start_init(const GURL & url, GP<DjVuPort> port=nullptr,
+			   DjVuFileCache * cache=nullptr);
 
    /** This creates a DjVuDocument without initializing it. */
    static GP<DjVuDocument> create_noinit(void) {return new DjVuDocument;}
 
    /** Create a version of DjVuDocument which has finished initializing. */
    static GP<DjVuDocument> create_wait(
-     const GURL &url, GP<DjVuPort> xport=0, DjVuFileCache * const xcache=0);
+     const GURL &url, GP<DjVuPort> xport=nullptr, DjVuFileCache * const xcache=nullptr);
 
    /** Create a version of DjVuDocument which has begun initializing. */
    static GP<DjVuDocument> create(
-     const GURL &url, GP<DjVuPort> xport=0, DjVuFileCache * const xcache=0);
+     const GURL &url, GP<DjVuPort> xport=nullptr, DjVuFileCache * const xcache=nullptr);
 
    /** Create a version of DjVuDocument which has begun initializing. */
    static GP<DjVuDocument> create(
-     GP<DataPool> pool, GP<DjVuPort> xport=0, DjVuFileCache * const xcache=0);
+     GP<DataPool> pool, GP<DjVuPort> xport=nullptr, DjVuFileCache * const xcache=nullptr);
 
    /** Create a version of DjVuDocument which has begun initializing. */
    static GP<DjVuDocument> create(
-     const GP<ByteStream> &bs, GP<DjVuPort> xport=0,
-     DjVuFileCache * const xcache=0);
+     const GP<ByteStream> &bs, GP<DjVuPort> xport=nullptr,
+     DjVuFileCache * const xcache=nullptr);
 
       /** Call this function when you don't need the #DjVuDocument# any more.
 	  In a multi-threaded environment it will stop initialization
@@ -373,8 +373,8 @@ public:
 	  not). Basically, it calls \Ref{start_init}() and then
 	  \Ref{wait_for_complete_init}().
 	  */
-   void		init(const GURL & url, GP<DjVuPort> port=0,
-		     DjVuFileCache * cache=0);
+   void		init(const GURL & url, GP<DjVuPort> port=nullptr,
+		     DjVuFileCache * cache=nullptr);
 
       /** Returns #true# if the initialization thread finished (does not
 	  matter successfully or not). As soon as it happens, the document
@@ -601,8 +601,8 @@ public:
 		      \Ref{DjVuFile::is_decode_ok}().
 	  @param port A pointer to \Ref{DjVuPort}, that the created image
 	  	      will be connected to. */
-   GP<DjVuImage> get_page(int page_num, bool sync=true, DjVuPort * port=0) const;
-   GP<DjVuImage> get_page(int page_num, bool sync=true, DjVuPort * port=0)
+   GP<DjVuImage> get_page(int page_num, bool sync=true, DjVuPort * port=nullptr) const;
+   GP<DjVuImage> get_page(int page_num, bool sync=true, DjVuPort * port=nullptr)
    { return const_cast<const DjVuDocument *>(this)->get_page(page_num,sync,port); }
 
       /** Returns \Ref{GP} pointer to \Ref{DjVuImage} corresponding to the
@@ -614,7 +614,7 @@ public:
 	  If so, it just calls the #get_page()# function above. If ID is
 	  #ZERO# or just empty, page number #-1# is assumed. Otherwise
 	  the ID is translated to the URL using \Ref{id_to_url}(). */
-   GP<DjVuImage> get_page(const GUTF8String &id, bool sync=true, DjVuPort * port=0);
+   GP<DjVuImage> get_page(const GUTF8String &id, bool sync=true, DjVuPort * port=nullptr);
    
       /** Returns \Ref{DjVuFile} corresponding to the specified page.
 	  Normally it translates the page number to the URL using
@@ -1029,7 +1029,7 @@ DjVuDocument::get_djvm_nav(void) const
 {
   if (doc_type==BUNDLED || doc_type==INDIRECT)
     return djvm_nav;
-  return 0;
+  return nullptr;
 }
 
 inline GP<DjVmDir0>
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.cpp
index 6bc43ce7..27c57da4 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.cpp
@@ -274,7 +274,7 @@ static displaysubr disproutines[] =
   { "ANTz", display_anno },
   { "TXTa", display_text },
   { "TXTz", display_text },
-  { 0, 0 },
+  { nullptr, nullptr },
 };
 
 // ---------- ROUTINES FOR DISPLAYING CHUNK STRUCTURE
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.cpp
index 302c6a91..556e0766 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.cpp
@@ -159,7 +159,7 @@ DjVuErrorList::request_data(const DjVuPort * source, const GURL & url)
    }
    G_CATCH_ALL
    {
-     retval=0;
+     retval=nullptr;
    } G_ENDCATCH;
    return retval;
 }
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp
index 21a33450..568c3cf6 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp
@@ -95,7 +95,7 @@ namespace DJVU {
 #define REPORT_EOF(x) \
   {G_TRY{G_THROW( ByteStream::EndOfFile );}G_CATCH(ex){report_error(ex,(x));}G_ENDCATCH;}
 
-static GP<GPixmap> (*djvu_decode_codec)(ByteStream &bs)=0;
+static GP<GPixmap> (*djvu_decode_codec)(ByteStream &bs)=nullptr;
 
 class ProgressByteStream : public ByteStream
 {
@@ -186,7 +186,7 @@ DjVuFile::init(const GP<ByteStream> & str)
     G_THROW( ERR_MSG("DjVuFile.not_secured") );
   
   file_size=0;
-  decode_thread=0;
+  decode_thread=nullptr;
   
   // Read the data from the stream
   data_pool=DataPool::create(str);
@@ -233,7 +233,7 @@ DjVuFile::init(const GURL & xurl, GP<DjVuPort> port)
   url = xurl;
   DEBUG_MSG("DjVuFile::DjVuFile(): url is "<<(const char *)url<<"\n");
   file_size=0;
-  decode_thread=0;
+  decode_thread=nullptr;
   
   DjVuPortcaster * pcaster=get_portcaster();
   
@@ -268,23 +268,23 @@ DjVuFile::~DjVuFile(void)
   // We don't have to wait for decoding to finish here. It's already
   // finished (we know it because there is a "life saver" in the
   // thread function)  -- but we need to delete it
-  delete decode_thread; decode_thread=0;
+  delete decode_thread; decode_thread=nullptr;
 }
 
 void
 DjVuFile::reset(void)
 {
    flags.enter();
-   info = 0; 
-   anno = 0; 
-   text = 0; 
-   meta = 0; 
-   bg44 = 0; 
-   fgbc = 0;
-   fgjb = 0; 
-   fgjd = 0;
-   fgpm = 0;
-   dir  = 0; 
+   info = nullptr;
+   anno = nullptr;
+   text = nullptr;
+   meta = nullptr;
+   bg44 = nullptr;
+   fgbc = nullptr;
+   fgjb = nullptr;
+   fgjd = nullptr;
+   fgpm = nullptr;
+   dir  = nullptr;
    description = ""; 
    mimetype = "";
    flags=(flags&(ALL_DATA_PRESENT|DECODE_STOPPED|DECODE_FAILED));
@@ -459,7 +459,7 @@ DjVuFile::static_decode_func(void * cl_data)
   for the termination of the decoding from the ~DjVuFile() called
   from the decoding thread) or coredump. */
   GP<DjVuFile> life_saver=th;
-  th->decode_life_saver=0;
+  th->decode_life_saver=nullptr;
   G_TRY {
     th->decode_func();
   } G_CATCH_ALL {
@@ -609,7 +609,7 @@ DjVuFile::process_incl_chunk(ByteStream & str, int file_num)
       // G_EXTHROW(ex); /* commented out */
       
       get_portcaster()->notify_error(this,ex.get_cause());
-      return 0;
+      return nullptr;
     }
     G_ENDCATCH;
     if (!file)
@@ -651,7 +651,7 @@ DjVuFile::process_incl_chunk(ByteStream & str, int file_num)
     }
     return file;
   }
-  return 0;
+  return nullptr;
 }
 
 
@@ -801,7 +801,7 @@ DjVuFile::get_fgjd(int block)
   } G_ENDCATCH;
   chunk_mon.leave();
   if (is_decode_stopped()) G_THROW( DataPool::Stop );
-  return 0;
+  return nullptr;
 }
 
 int
@@ -1327,7 +1327,7 @@ DjVuFile::start_decode(void)
   DEBUG_MSG("DjVuFile::start_decode(), url='" << url << "'\n");
   DEBUG_MAKE_INDENT(3);
   
-  GThread * thread_to_delete=0;
+  GThread * thread_to_delete=nullptr;
   flags.enter();
   G_TRY {
     if (!(flags & DONT_START_DECODE) && !is_decoding())
@@ -1338,7 +1338,7 @@ DjVuFile::start_decode(void)
       
       // Don't delete the thread while you're owning the flags lock
       // Beware of deadlock!
-      thread_to_delete=decode_thread; decode_thread=0;
+      thread_to_delete=decode_thread; decode_thread=nullptr;
       
       // We want to create it right here to be able to stop the
       // decoding thread even before its function is called (it starts)
@@ -1466,7 +1466,7 @@ DjVuFile::find_ndir(GMap<GURL, void *> & map)
   
   if (!map.contains(url))
   {
-    map[url]=0;
+    map[url]=nullptr;
     
     GPList<DjVuFile> list=get_included_files(false);
     for(GPosition pos=list;pos;++pos)
@@ -1475,7 +1475,7 @@ DjVuFile::find_ndir(GMap<GURL, void *> & map)
       if (d) return d;
     }
   }
-  return 0;
+  return nullptr;
 }
 
 GP<DjVuNavDir>
@@ -1497,7 +1497,7 @@ DjVuFile::decode_ndir(GMap<GURL, void *> & map)
   
   if (!map.contains(url))
   {
-    map[url]=0;
+    map[url]=nullptr;
     
     const GP<ByteStream> str(data_pool->get_stream());
     
@@ -1552,7 +1552,7 @@ DjVuFile::decode_ndir(GMap<GURL, void *> & map)
     }
     data_pool->clear_stream();
   }
-  return 0;
+  return nullptr;
 }
 
 GP<DjVuNavDir>
@@ -1572,7 +1572,7 @@ DjVuFile::get_merged_anno(const GP<DjVuFile> & file,
   if (!map.contains(url))
   {
     ByteStream &str_out=*gstr_out;
-    map[url]=0;
+    map[url]=nullptr;
     
     // Do the included files first (To make sure that they have
     // less precedence)
@@ -1659,7 +1659,7 @@ DjVuFile::get_merged_anno(const GList<GURL> & ignore_list,
   ByteStream &str=*gstr;
   if (!str.tell()) 
   {
-    gstr=0;
+    gstr=nullptr;
   }else
   {
     str.seek(0);
@@ -1851,7 +1851,7 @@ DjVuFile::get_anno(void)
   ByteStream &str=*gstr;
   if (!str.tell())
   { 
-    gstr=0;
+    gstr=nullptr;
   }else
   {
     str.seek(0);
@@ -1868,7 +1868,7 @@ DjVuFile::get_text(void)
   ByteStream &str=*gstr;
   if (!str.tell())
   { 
-    gstr=0;
+    gstr=nullptr;
   }else
   {
     str.seek(0);
@@ -1885,7 +1885,7 @@ DjVuFile::get_meta(void)
   ByteStream &str=*gstr;
   if (!str.tell())
   { 
-    gstr=0;
+    gstr=nullptr;
   }else
   {
     str.seek(0);
@@ -1967,7 +1967,7 @@ DjVuFile::move(GMap<GURL, void *> & map, const GURL & dir_url)
 {
   if (!map.contains(url))
   {
-    map[url]=0;
+    map[url]=nullptr;
     
     url=GURL::UTF8(url.name(),dir_url);
     
@@ -2226,7 +2226,7 @@ DjVuFile::add_djvu_data(IFFByteStream & ostr, GMap<GURL, void *> & map,
   check();
   if (map.contains(url)) return;
   bool top_level = !map.size();
-  map[url]=0;
+  map[url]=nullptr;
   bool processed_annotation = false;
   bool processed_text = false;
   bool processed_meta = false;
@@ -2461,7 +2461,7 @@ DjVuFile::remove_anno(void)
   data_pool=DataPool::create(gstr_out);
   chunks_number=-1;
   
-  anno=0;
+  anno=nullptr;
   
   flags|=MODIFIED;
   data_pool->clear_stream();
@@ -2501,7 +2501,7 @@ DjVuFile::remove_text(void)
   data_pool=DataPool::create(gstr_out);
   chunks_number=-1;
   
-  text=0;
+  text=nullptr;
   
   flags|=MODIFIED;
   data_pool->clear_stream();
@@ -2541,7 +2541,7 @@ DjVuFile::remove_meta(void)
   data_pool=DataPool::create(gstr_out);
   chunks_number=-1;
   
-  meta=0;
+  meta=nullptr;
   
   flags|=MODIFIED;
   data_pool->clear_stream();
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuFile.h b/kviewshell/plugins/djvu/libdjvu/DjVuFile.h
index e8ec6298..a7c2ceb8 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuFile.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuFile.h
@@ -293,11 +293,11 @@ public:
 		 of \Ref{DjVuSimplePort} for accessing local files and
 		 reporting errors. It can later be disabled by means
 		 of \Ref{disable_standard_port}() function. */
-   void init(const GURL & url, GP<DjVuPort> port=0);
+   void init(const GURL & url, GP<DjVuPort> port=nullptr);
 
       /** Creator, does the init(const GURL &url, GP<DjVuPort> port=0) */
    static GP<DjVuFile> create(
-     const GURL & url, GP<DjVuPort> port=0,
+     const GURL & url, GP<DjVuPort> port=nullptr,
      const ErrorRecoveryAction recover_action=ABORT,
      const bool verbose_eof=true);
 
@@ -486,7 +486,7 @@ public:
 
 	  {\bf Summary:} This function will return complete annotations only
 	  when the \Ref{is_all_data_present}() returns #true#. */
-   GP<ByteStream>	get_merged_anno(int * max_level_ptr=0);
+   GP<ByteStream>	get_merged_anno(int * max_level_ptr=nullptr);
 
       /** Returns the annotation chunks (#"ANTa"# and #"ANTz"#).  This
           function may be used even when the #DjVuFile# has not been decoded
@@ -795,7 +795,7 @@ DjVuFile::set_can_compress(bool m)
 inline void
 DjVuFile::disable_standard_port(void)
 {
-   simple_port=0;
+   simple_port=nullptr;
 }
 
 inline bool
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuFileCache.h b/kviewshell/plugins/djvu/libdjvu/DjVuFileCache.h
index c1151c2d..69e97741 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuFileCache.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuFileCache.h
@@ -218,11 +218,11 @@ private:
 //@}
    
 inline
-DjVuFileCache::Item::Item(void) : time(::time(0)) {}
+DjVuFileCache::Item::Item(void) : time(::time(nullptr)) {}
 
 inline
 DjVuFileCache::Item::Item(const GP<DjVuFile> & xfile) :
-      file(xfile), time(::time(0)) {}
+      file(xfile), time(::time(nullptr)) {}
 
 inline
 DjVuFileCache::Item::~Item(void) {}
@@ -248,7 +248,7 @@ DjVuFileCache::Item::get_time(void) const
 inline void
 DjVuFileCache::Item::refresh(void)
 {
-   time=::time(0);
+   time=::time(nullptr);
 }
 
 inline
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuGlobal.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuGlobal.cpp
index 4caf68ba..0c1c8c97 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuGlobal.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuGlobal.cpp
@@ -242,7 +242,7 @@ extern "C"
   void *djvu_set_progress_callback(void *);
   int djvu_supports_progress_callback(void);
 }
-void *djvu_set_progress_callback(void *) { return 0; }
+void *djvu_set_progress_callback(void *) { return nullptr; }
 int djvu_supports_progress_callback(void) {return 0;}
 #else
 int djvu_supports_progress_callback(void) {return 0;}
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp
index 28d01b8c..1e7b842e 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp
@@ -130,7 +130,7 @@ DjVuImage::get_info(const GP<DjVuFile> & file) const
         return info;
       }
    }
-   return 0;
+   return nullptr;
 }
 
 GP<IW44Image>
@@ -145,7 +145,7 @@ DjVuImage::get_bg44(const GP<DjVuFile> & file) const
       if (bg44)
         return bg44;
    }
-   return 0;
+   return nullptr;
 }
 
 GP<GPixmap>
@@ -159,7 +159,7 @@ DjVuImage::get_bgpm(const GP<DjVuFile> & file) const
       GP<GPixmap> bgpm=get_bgpm(list[pos]);
       if (bgpm) return bgpm;
    }
-   return 0;
+   return nullptr;
 }
 
 GP<JB2Image>
@@ -174,7 +174,7 @@ DjVuImage::get_fgjb(const GP<DjVuFile> & file) const
       if (fgjb)
         return fgjb;
    }
-   return 0;
+   return nullptr;
 }
 
 GP<GPixmap>
@@ -189,7 +189,7 @@ DjVuImage::get_fgpm(const GP<DjVuFile> & file) const
       if (fgpm)
         return fgpm;
    }
-   return 0;
+   return nullptr;
 }
 
 GP<DjVuPalette>
@@ -203,7 +203,7 @@ DjVuImage::get_fgbc(const GP<DjVuFile> & file) const
       GP<DjVuPalette> fgbc=get_fgbc(list[pos]);
       if (fgbc) return fgbc;
    }
-   return 0;
+   return nullptr;
 }
 
 GP<DjVuInfo>   
@@ -214,7 +214,7 @@ DjVuImage::get_info() const
      return get_info(file);
    }else
    {
-     return 0;
+     return nullptr;
    }
 }
 
@@ -230,7 +230,7 @@ DjVuImage::get_anno() const
    mbs.seek(0);
    if(!mbs.size())
    {
-     out=0;
+     out=nullptr;
    }
    return out;
 }
@@ -247,7 +247,7 @@ DjVuImage::get_text() const
    mbs.seek(0);
    if(!mbs.size())
    {
-     out=0;
+     out=nullptr;
    }
    return out;
 }
@@ -264,7 +264,7 @@ DjVuImage::get_meta() const
    mbs.seek(0);
    if(!mbs.size())
    {
-     out=0;
+     out=nullptr;
    }
    return out;
 }
@@ -275,7 +275,7 @@ DjVuImage::get_bg44() const
    if (file)
      return get_bg44(file);
    else
-     return 0;
+     return nullptr;
 }
 
 GP<GPixmap>   
@@ -284,7 +284,7 @@ DjVuImage::get_bgpm() const
    if (file)
      return get_bgpm(file);
    else
-     return 0;
+     return nullptr;
 }
 
 GP<JB2Image>   
@@ -293,7 +293,7 @@ DjVuImage::get_fgjb() const
    if (file)
      return get_fgjb(file);
    else
-     return 0;
+     return nullptr;
 }
 
 GP<GPixmap>    
@@ -302,7 +302,7 @@ DjVuImage::get_fgpm() const
    if (file)
      return get_fgpm(file);
    else
-     return 0;
+     return nullptr;
 }
 
 GP<DjVuPalette>    
@@ -311,7 +311,7 @@ DjVuImage::get_fgbc() const
    if (file)
      return get_fgbc(file);
    else
-     return 0;
+     return nullptr;
 }
 
 int
@@ -657,14 +657,14 @@ DjVuImage::get_bitmap(const GRect &rect,
     {
       return fgjb->get_bitmap(rect, subsample, align);
     }
-  return 0;
+  return nullptr;
 }
 
 GP<GPixmap>
 DjVuImage::get_bg_pixmap(const GRect &rect, 
                          int subsample, double gamma) const
 {
-  GP<GPixmap> pm = 0;
+  GP<GPixmap> pm = nullptr;
   // Access image size
   
   GP<DjVuInfo> info = get_info();
@@ -672,7 +672,7 @@ DjVuImage::get_bg_pixmap(const GRect &rect,
   int height = get_real_height();
 
 
-  if (width<=0 || height<=0 || !info) return 0;
+  if (width<=0 || height<=0 || !info) return nullptr;
   // Compute gamma_correction
   double gamma_correction = 1.0;
   if (gamma > 0)
@@ -690,11 +690,11 @@ DjVuImage::get_bg_pixmap(const GRect &rect,
       int h = bg44->get_height();
       // Avoid silly cases
       if (w==0 || h==0 || width==0 || height==0)
-        return 0;
+        return nullptr;
       // Determine how much bg44 is reduced
       int red = compute_red(width,height,w,h);
       if (red<1 || red>12)
-        return 0;
+        return nullptr;
       // Handle pure downsampling cases
       if (subsample == red)
         pm = bg44->get_pixmap(1,rect);
@@ -759,11 +759,11 @@ DjVuImage::get_bg_pixmap(const GRect &rect,
       int h = bgpm->rows();
       // Avoid silly cases
       if (w==0 || h==0 || width==0 || height==0)
-        return 0;
+        return nullptr;
       // Determine how much bgpm is reduced
       int red = compute_red(width,height,w,h);
       if (red<1 || red>12)
-        return 0;
+        return nullptr;
       // Handle pure downsampling cases
       int ratio = subsample/red;
       if (subsample==ratio*red && ratio>=1)
@@ -796,7 +796,7 @@ DjVuImage::get_bg_pixmap(const GRect &rect,
     }
 
   // FAILURE
-  return 0;
+  return nullptr;
 }
 
 
@@ -917,7 +917,7 @@ DjVuImage::stencil(GPixmap *pm, const GRect &rect,
           comprect.ymax = (comprect.ymax+subsample-1) / subsample;
           comprect.intersect(comprect, rect);
           // Compute alpha map for that color
-          bm = 0;
+          bm = nullptr;
           bm = GBitmap::create(comprect.height(), comprect.width());
           bm->set_grays(1+subsample*subsample);
           int rxmin = comprect.xmin * subsample;
@@ -992,9 +992,9 @@ DjVuImage::stencil(GPixmap *pm, const GRect &rect,
           int desw = (w*red+wantedred-1)/wantedred;
           int desh = (h*red+wantedred-1)/wantedred;
           // Cache rescaled fgpm for speed
-          static const DjVuImage *tagimage  = 0;
-          static const GPixmap *tagfgpm   = 0;
-          static GP<GPixmap> cachednfg = 0;
+          static const DjVuImage *tagimage  = nullptr;
+          static const GPixmap *tagfgpm   = nullptr;
+          static GP<GPixmap> cachednfg = nullptr;
           // Check whether cached fgpm applies.
           if ( cachednfg && this==tagimage && fgpm==tagfgpm
                && desw==(int)cachednfg->columns()
@@ -1042,7 +1042,7 @@ DjVuImage::get_fg_pixmap(const GRect &rect,
   {
     pm = GPixmap::create(rect.height(),rect.width(), &GPixel::WHITE);
     if (!stencil(pm, rect, subsample, gamma))
-      pm=0;
+      pm=nullptr;
   }
   return pm;
 }
@@ -1056,7 +1056,7 @@ DjVuImage::get_pixmap(const GRect &rect, int subsample, double gamma) const
   // Superpose foreground
   if (! stencil(pm, rect, subsample, gamma))
     // Avoid ugly progressive display (hack)
-    if (get_fgjb()) return 0;
+    if (get_fgjb()) return nullptr;
   // Return
   return pm;
 }
@@ -1103,7 +1103,7 @@ do_bitmap(const DjVuImage &dimg, BImager get,
         if(bm)
             return bm->rotate((4-dimg.get_rotate())%4);
         else
-	        return NULL;
+	        return nullptr;
     }
   // Find best reduction
   for (red=15; red>1; red--)
@@ -1111,7 +1111,7 @@ do_bitmap(const DjVuImage &dimg, BImager get,
          (rw*red*3 < w || rh*red*3 < h) )
       break;
   // Setup bitmap scaler
-  if (! (w && h)) return 0;
+  if (! (w && h)) return nullptr;
   GP<GBitmapScaler> gbs=GBitmapScaler::create();
   GBitmapScaler &bs=*gbs;
   bs.set_input_size( (w+red-1)/red, (h+red-1)/red );
@@ -1122,14 +1122,14 @@ do_bitmap(const DjVuImage &dimg, BImager get,
   GRect srect;
   bs.get_input_rect(zrect, srect);
   GP<GBitmap> sbm = (dimg.*get)(srect, red, 1);
-  if (!sbm) return 0;
+  if (!sbm) return nullptr;
   int border = ((zrect.width() + align - 1) & ~(align - 1)) - zrect.width();
   GP<GBitmap> bm = GBitmap::create(zrect.height(), zrect.width(), border);
   bs.scale(srect, *sbm, zrect, *bm);
   if( bm )
       return bm->rotate((4-dimg.get_rotate())%4);
   else
-      return NULL;
+      return nullptr;
 }
 
 static GP<GPixmap>
@@ -1170,7 +1170,7 @@ do_pixmap(const DjVuImage &dimg, PImager get,
         if( pm ) 
             return pm->rotate((4-dimg.get_rotate())%4);
         else
-            return NULL;
+            return nullptr;
     }
   // These reductions usually go faster (improve!)
   static int fastred[] = { 12,6,4,3,2,1 };
@@ -1180,7 +1180,7 @@ do_pixmap(const DjVuImage &dimg, PImager get,
          (rw*red*3 < w || rh*red*3 < h) )
       break;
   // Setup pixmap scaler
-  if (w<0 || h<0) return 0;
+  if (w<0 || h<0) return nullptr;
   GP<GPixmapScaler> gps=GPixmapScaler::create();
   GPixmapScaler &ps=*gps;
   ps.set_input_size( (w+red-1)/red, (h+red-1)/red );
@@ -1191,13 +1191,13 @@ do_pixmap(const DjVuImage &dimg, PImager get,
   GRect srect;
   ps.get_input_rect(zrect, srect);
   GP<GPixmap> spm = (dimg.*get)(srect, red, gamma);
-  if (!spm) return 0;
+  if (!spm) return nullptr;
   GP<GPixmap> pm = GPixmap::create();
   ps.scale(srect, *spm, zrect, *pm);
   if(pm)
       return pm->rotate((4-dimg.get_rotate())%4);
   else
-      return NULL;
+      return nullptr;
 }
 
 GP<GPixmap>  
@@ -1273,7 +1273,7 @@ DjVuImage::get_decoded_anno()
         return djvuanno;
     }
     else
-        return NULL;
+        return nullptr;
 }
 
 
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuImage.h b/kviewshell/plugins/djvu/libdjvu/DjVuImage.h
index 696fe4ff..e42b913f 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuImage.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuImage.h
@@ -228,7 +228,7 @@ public:
       introduction of multipage DjVu documents, the decoding is handled
       by \Ref{DjVuFile} and \Ref{DjVuDocument} classes. For single page
       documents though, we still have this wrapper. */
-  void decode(ByteStream & str, DjVuInterface *notifier=0);
+  void decode(ByteStream & str, DjVuInterface *notifier=nullptr);
   //@}
   
   // UTILITIES
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuMessage.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuMessage.cpp
index 9bcf3011..2fcb86e4 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuMessage.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuMessage.cpp
@@ -164,7 +164,7 @@ RegOpenReadConfig ( HKEY hParentKey )
     DWORD dwCount = (sizeof(path)/sizeof(TCHAR))-1;
     DWORD dwType;
 
-    LONG lResult = RegQueryValueEx(hKey, lpszEntry, NULL,
+    LONG lResult = RegQueryValueEx(hKey, lpszEntry, nullptr,
              &dwType, (LPBYTE) szPathValue, &dwCount);
 
     RegCloseKey(hKey);
@@ -243,7 +243,7 @@ GetModulePath( void )
        {
          if(retval.is_file())
            break;
-         pathMAP[path]=0;
+         pathMAP[path]=nullptr;
        }
      }
    }
@@ -264,7 +264,7 @@ appendPath(const GURL &url,
   if( !url.is_empty() 
       && !map.contains(url.get_string()) && url.is_dir() )
     {
-      map[url.get_string()]=0;
+      map[url.get_string()]=nullptr;
       list.append(url);
     }
 }
@@ -355,7 +355,7 @@ DjVuMessage::GetProfilePaths(void)
     GUTF8String defaultlocale = getenv("LANGUAGE");
     if (! defaultlocale) 
       {
-        const GUTF8String oldlocale(setlocale(LC_MESSAGES,0));
+        const GUTF8String oldlocale(setlocale(LC_MESSAGES,nullptr));
         defaultlocale = setlocale(LC_MESSAGES,"");
         setlocale(LC_MESSAGES,(const char *)oldlocale);
       }
@@ -452,7 +452,7 @@ getbodies(
     const GURL::UTF8 url(MessageFileName,paths[pathpos]);
     if(url.is_file())
     {
-      map[MessageFileName]=0;
+      map[MessageFileName]=nullptr;
       GP<lt_XMLTags> gtags;
       {
         GP<ByteStream> bs=ByteStream::create(url,"rb");
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp
index 06e6e911..6bf16598 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp
@@ -107,7 +107,7 @@ fmin(float a, float b)
 
 
 DjVuPalette::DjVuPalette()
-  : mask(0), hist(0), pmap(0)
+  : mask(0), hist(nullptr), pmap(nullptr)
 {
 }
 
@@ -132,7 +132,7 @@ DjVuPalette::operator=(const DjVuPalette &ref)
 }
 
 DjVuPalette::DjVuPalette(const DjVuPalette &ref)
-  : mask(0), hist(0), pmap(0)
+  : mask(0), hist(nullptr), pmap(nullptr)
 {
   this->operator=(ref);
 }
@@ -343,7 +343,7 @@ DjVuPalette::compute_palette(int maxcolors, int minboxsize)
   // Clear invalid data
   colordata.empty();
   delete pmap;
-  pmap = 0;
+  pmap = nullptr;
   // Return dominant color
   return color_to_index_slow(dcolor.p);
 }
@@ -538,8 +538,8 @@ DjVuPalette::decode(GP<ByteStream> gbs)
   // Make sure that everything is clear
   delete hist;
   delete pmap;
-  hist = 0;
-  pmap = 0;
+  hist = nullptr;
+  pmap = nullptr;
   mask = 0;
   // Code version
   int version = bs.read8();
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuPalette.h b/kviewshell/plugins/djvu/libdjvu/DjVuPalette.h
index 93b7661e..f4b6e182 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuPalette.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuPalette.h
@@ -238,7 +238,7 @@ inline void
 DjVuPalette::histogram_clear()
 {
   delete hist;
-  hist = 0;
+  hist = nullptr;
   mask = 0;
 }
 
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuPort.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuPort.cpp
index 97723221..df4893c6 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuPort.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuPort.cpp
@@ -96,7 +96,7 @@ public:
    DjVuPort		* port;
    DjVuPortCorpse	* next;
 
-   DjVuPortCorpse(DjVuPort * _port) : port(_port), next(0) {}
+   DjVuPortCorpse(DjVuPort * _port) : port(_port), next(nullptr) {}
 };
 
 //****************************************************************************
@@ -125,7 +125,7 @@ DjVuPort::operator new (size_t sz)
   // the 'corpse' list. Thus we will avoid allocating a new DjVuPort
   // on place of a dead one. Not *absolutely* secure (only 64 items
   // in the list) but is still better than nothing.
-  void * addr=0;
+  void * addr=nullptr;
   {
     GCriticalSectionLock lock(corpse_lock);
     
@@ -169,7 +169,7 @@ DjVuPort::operator new (size_t sz)
   
   DjVuPortcaster * pcaster=get_portcaster();
   GCriticalSectionLock lock(&pcaster->map_lock);
-  pcaster->cont_map[addr]=0;
+  pcaster->cont_map[addr]=nullptr;
   return addr;
 }
 
@@ -185,11 +185,11 @@ DjVuPort::operator delete(void * addr)
     {
       corpse_tail->next=new DjVuPortCorpse((DjVuPort *) addr);
       corpse_tail=corpse_tail->next;
-      corpse_tail->next=0;
+      corpse_tail->next=nullptr;
     } else
     {
       corpse_head=corpse_tail=new DjVuPortCorpse((DjVuPort *) addr);
-      corpse_tail->next=0;
+      corpse_tail->next=nullptr;
     }
     corpse_num++;
     if (corpse_num>=MAX_CORPSE_NUM)
@@ -308,7 +308,7 @@ DjVuPortcaster::alias_to_port(const GUTF8String &alias)
       if (gp_port) return gp_port;
       else a2p_map.del(pos);
    }
-   return 0;
+   return nullptr;
 }
 
 GPList<DjVuPort>
@@ -610,10 +610,10 @@ GURL
 DjVuPort::id_to_url(const DjVuPort *, const GUTF8String &) { return GURL(); }
 
 GP<DjVuFile>
-DjVuPort::id_to_file(const DjVuPort *, const GUTF8String &) { return 0; }
+DjVuPort::id_to_file(const DjVuPort *, const GUTF8String &) { return nullptr; }
 
 GP<DataPool>
-DjVuPort::request_data(const DjVuPort *, const GURL &) { return 0; }
+DjVuPort::request_data(const DjVuPort *, const GURL &) { return nullptr; }
 
 bool
 DjVuPort::notify_error(const DjVuPort *, const GUTF8String &) { return 0; }
@@ -654,7 +654,7 @@ DjVuSimplePort::request_data(const DjVuPort * source, const GURL & url)
       return DataPool::create(url);
     }
   } G_CATCH_ALL {} G_ENDCATCH;
-  return 0;
+  return nullptr;
 }
 
 bool
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp
index fc69e154..c7ce605f 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp
@@ -95,7 +95,7 @@ const char DjVuTXT::end_of_line      = 012;      // LF: Line Feed
 const int DjVuTXT::Zone::version  = 1;
 
 DjVuTXT::Zone::Zone()
-  : ztype(DjVuTXT::PAGE), text_start(0), text_length(0), zone_parent(0)
+  : ztype(DjVuTXT::PAGE), text_start(0), text_length(0), zone_parent(nullptr)
 {
 }
 
@@ -230,7 +230,7 @@ DjVuTXT::Zone::encode(
   // Encode number of children
   bs.write24(children.size());
   
-  const Zone * prev_child=0;
+  const Zone * prev_child=nullptr;
   // Encode all children
   for (GPosition i=children; i; ++i)
   {
@@ -287,7 +287,7 @@ DjVuTXT::Zone::decode(const GP<ByteStream> &gbs, int maxtext,
     G_THROW( ERR_MSG("DjVuText.corrupt_text") );
 
   // Process children
-  const Zone * prev_child=0;
+  const Zone * prev_child=nullptr;
   children.empty();
   while (size-- > 0) 
   {
@@ -580,7 +580,7 @@ DjVuTXT::find_text_in_rect(GRect target_rect, GUTF8String &text) const
 	    }
 	 }
       }
-      Zone *parag = 0;
+      Zone *parag = nullptr;
       if ( ar>0 ) parag=zone_list[pos_sel];
       zone_list.empty();
       if ( ar>0 ) 
@@ -749,7 +749,7 @@ indent ( int spaces)
 }
 
 static const char *tags[8]=
-{ 0,
+{ nullptr,
   "HIDDENTEXT",
   "PAGECOLUMN",
   "REGION",
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuText.h b/kviewshell/plugins/djvu/libdjvu/DjVuText.h
index 6f23c3b3..fe3f40dd 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuText.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuText.h
@@ -160,9 +160,9 @@ public:
     unsigned int memuse() const;
     static const int version;
     void encode(const GP<ByteStream> &bs, 
-                const Zone * parent=0, const Zone * prev=0) const;
+                const Zone * parent=nullptr, const Zone * prev=nullptr) const;
     void decode(const GP<ByteStream> &bs, int maxtext,
-                const Zone * parent=0, const Zone * prev=0);
+                const Zone * parent=nullptr, const Zone * prev=nullptr);
   };
   /** Textual data for this page.  
       The content of this string is encoded using the UTF8 code.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp
index 78490777..c37f70e3 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp
@@ -273,14 +273,14 @@ DjVuToPS::DjVuToPS(void)
       bin2hex[i][0]=dig2hex[i/16];
       bin2hex[i][1]=dig2hex[i%16];
     }
-  refresh_cb=0;
-  refresh_cl_data=0;
-  prn_progress_cb=0;
-  prn_progress_cl_data=0;
-  dec_progress_cb=0;
-  dec_progress_cl_data=0;
-  info_cb=0;
-  info_cl_data=0;
+  refresh_cb=nullptr;
+  refresh_cl_data=nullptr;
+  prn_progress_cb=nullptr;
+  prn_progress_cl_data=nullptr;
+  dec_progress_cb=nullptr;
+  dec_progress_cl_data=nullptr;
+  info_cb=nullptr;
+  info_cl_data=nullptr;
 }
 
 #ifdef __GNUC__
@@ -329,7 +329,7 @@ store_doc_prolog(ByteStream &str, int pages, int dpi, GRect *grect)
         "%%%%Creator: DjVu (code by Andrei Erofeev)\n"
         "%%%%DocumentData: Clean7Bit\n");
   // Date
-  time_t tm=time(0);
+  time_t tm=time(nullptr);
   write(str, "%%%%CreationDate: %s", ctime(&tm));
   // For
 #ifdef UNIX
@@ -339,7 +339,7 @@ store_doc_prolog(ByteStream &str, int pages, int dpi, GRect *grect)
       char *s = strchr(pswd->pw_gecos, ',');
       if (s) 
         *s = 0;
-      s = 0;
+      s = nullptr;
       if (pswd->pw_gecos && strlen(pswd->pw_gecos))
         s = pswd->pw_gecos;
       else if (pswd->pw_name && strlen(pswd->pw_name))
@@ -830,7 +830,7 @@ compute_red(int w, int h, int rw, int rh)
 static int
 get_bg_red(GP<DjVuImage> dimg) 
 {
-  GP<GPixmap> pm = 0;
+  GP<GPixmap> pm = nullptr;
   // Access image size
   int width = dimg->get_width();
   int height = dimg->get_height();
@@ -863,12 +863,12 @@ get_bg_red(GP<DjVuImage> dimg)
 static GP<GPixmap>
 get_bg_pixmap(GP<DjVuImage> dimg, const GRect &rect)
 {
-  GP<GPixmap> pm = 0;
+  GP<GPixmap> pm = nullptr;
   // Access image size
   int width = dimg->get_width();
   int height = dimg->get_height();
   GP<DjVuInfo> info = dimg->get_info();
-  if (width<=0 || height<=0 || !info) return 0;
+  if (width<=0 || height<=0 || !info) return nullptr;
   // CASE1: Incremental BG IW44Image
   GP<IW44Image> bg44 = dimg->get_bg44();
   if (bg44)
@@ -877,7 +877,7 @@ get_bg_pixmap(GP<DjVuImage> dimg, const GRect &rect)
       int h = bg44->get_height();
       // Avoid silly cases
       if (w==0 || h==0 || width==0 || height==0)
-        return 0;
+        return nullptr;
       pm = bg44->get_pixmap(1,rect);
       return pm;
     }
@@ -889,12 +889,12 @@ get_bg_pixmap(GP<DjVuImage> dimg, const GRect &rect)
       int h = bgpm->rows();
       // Avoid silly cases
       if (w==0 || h==0 || width==0 || height==0)
-        return 0;
+        return nullptr;
       pm->init(*bgpm, rect);
       return pm;
     }
   // FAILURE
-  return 0;
+  return nullptr;
 }
 
 void 
@@ -1113,8 +1113,8 @@ print_fg(ByteStream &str,
   if (! jb2) return;
   int num_blits = jb2->get_blit_count();
   int num_shapes = jb2->get_shape_count();
-  unsigned char *dict_shapes = 0;
-  unsigned char *blit_list = 0;
+  unsigned char *dict_shapes = nullptr;
+  unsigned char *blit_list = nullptr;
   GPBuffer<unsigned char> gdict_shapes(dict_shapes,num_shapes);
   GPBuffer<unsigned char> gblit_list(blit_list,num_blits);
   for(int i=0; i<num_shapes; i++)
@@ -1327,7 +1327,7 @@ print_bg(ByteStream &str,
     grectBand.ymax = grectBand.ymin;
     while(grectBand.ymax < prn_rect.ymax)
       {
-        GP<GPixmap> pm = 0;
+        GP<GPixmap> pm = nullptr;
         // Compute next band
         grectBand.ymin=grectBand.ymax;
         grectBand.ymax=grectBand.ymin+band_bytes/grectBand.width();
@@ -1525,8 +1525,8 @@ print_image_lev1(ByteStream &str,
           if (grectBand.ymax > prn_rect.ymax)
             grectBand.ymax = prn_rect.ymax;
           GRect all(0,0, dimg->get_width(),dimg->get_height());
-          pm = 0;
-          bm = 0;
+          pm = nullptr;
+          bm = nullptr;
           if (do_color_or_gray)
             {
               if (options.get_mode() == Options::FORE)
@@ -1718,7 +1718,7 @@ print_image_lev2(ByteStream &str,
           if (grectBand.ymax > prn_rect.ymax)
             grectBand.ymax = prn_rect.ymax;
           GRect all(0,0, dimg->get_width(),dimg->get_height());
-          pm = 0;
+          pm = nullptr;
           if (options.get_mode() == Options::FORE)
             pm = dimg->get_fg_pixmap(grectBand, all);
           else if (options.get_mode() == Options::BACK)
@@ -1891,7 +1891,7 @@ get_text(GP<DjVuFile> file)
         }
       iff->close_chunk();
     }
-  return 0;
+  return nullptr;
 }
 
 static void
@@ -2102,7 +2102,7 @@ print(ByteStream &str,
   store_doc_setup(str);
   write(str,"%%%%Page: 1 1\n");
   store_page_setup(str, (int)(image_dpi), prn_rect);
-  print_image(str, dimg, prn_rect, 0);
+  print_image(str, dimg, prn_rect, nullptr);
   store_page_trailer(str);
   write(str,"showpage\n");
   store_doc_trailer(str);
@@ -2315,7 +2315,7 @@ decode_page(GP<DjVuDocument> doc,
   if (page_num >= 0 && page_num < doc->get_pages_num())
     djvu_file = doc->get_djvu_file(page_num);
   if (! djvu_file )
-    return 0;
+    return nullptr;
   if (djvu_file->is_decode_ok())
     return doc->get_page(page_num, false);
   // This is the best place to call info_cb(). Note, that
@@ -2515,7 +2515,7 @@ print(ByteStream &str,
     {
       /* Normal mode */
       int cnt = 0;
-      store_doc_prolog(str, todo, 0, 0);
+      store_doc_prolog(str, todo, 0, nullptr);
       store_doc_setup(str);
       for(GPosition pos = pages_todo; pos; ++pos)
         process_single_page(str,doc,pages_todo[pos],cnt++,todo,0);
@@ -2536,7 +2536,7 @@ print(ByteStream &str,
       // -- print
       int sides = 0;
       int sheetpos = sheets_max;
-      store_doc_prolog(str, sides_todo, 0, 0);
+      store_doc_prolog(str, sides_todo, 0, nullptr);
       store_doc_setup(str);
       for (GPosition p=pages_todo; p; ++p)
         {
diff --git a/kviewshell/plugins/djvu/libdjvu/GBitmap.cpp b/kviewshell/plugins/djvu/libdjvu/GBitmap.cpp
index 8af09e7c..77bc5e2d 100644
--- a/kviewshell/plugins/djvu/libdjvu/GBitmap.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GBitmap.cpp
@@ -89,7 +89,7 @@ void
 GBitmap::destroy(void)
 {
   gbytes_data.resize(0);
-  bytes = 0;
+  bytes = nullptr;
   grle.resize(0);
   grlerows.resize(0);
   rlelength = 0;
@@ -97,17 +97,17 @@ GBitmap::destroy(void)
 
 GBitmap::GBitmap()
   : nrows(0), ncolumns(0), border(0), 
-    bytes_per_row(0), grays(0), bytes(0), gbytes_data(bytes_data), 
+    bytes_per_row(0), grays(0), bytes(nullptr), gbytes_data(bytes_data),
     grle(rle), grlerows(rlerows), rlelength(0),
-    monitorptr(0)
+    monitorptr(nullptr)
 {
 }
 
 GBitmap::GBitmap(int nrows, int ncolumns, int border)
   : nrows(0), ncolumns(0), border(0), 
-    bytes_per_row(0), grays(0), bytes(0), gbytes_data(bytes_data), 
+    bytes_per_row(0), grays(0), bytes(nullptr), gbytes_data(bytes_data),
     grle(rle), grlerows(rlerows), rlelength(0),
-    monitorptr(0)
+    monitorptr(nullptr)
 {
   G_TRY
   { 
@@ -123,9 +123,9 @@ GBitmap::GBitmap(int nrows, int ncolumns, int border)
 
 GBitmap::GBitmap(ByteStream &ref, int border)
   : nrows(0), ncolumns(0), border(0), 
-    bytes_per_row(0), grays(0), bytes(0), gbytes_data(bytes_data),
+    bytes_per_row(0), grays(0), bytes(nullptr), gbytes_data(bytes_data),
     grle(rle), grlerows(rlerows), rlelength(0),
-    monitorptr(0)
+    monitorptr(nullptr)
 {
   G_TRY
   { 
@@ -141,9 +141,9 @@ GBitmap::GBitmap(ByteStream &ref, int border)
 
 GBitmap::GBitmap(const GBitmap &ref)
   : nrows(0), ncolumns(0), border(0), 
-    bytes_per_row(0), grays(0), bytes(0), gbytes_data(bytes_data), 
+    bytes_per_row(0), grays(0), bytes(nullptr), gbytes_data(bytes_data),
     grle(rle), grlerows(rlerows), rlelength(0),
-    monitorptr(0)
+    monitorptr(nullptr)
 {
   G_TRY
   { 
@@ -159,9 +159,9 @@ GBitmap::GBitmap(const GBitmap &ref)
 
 GBitmap::GBitmap(const GBitmap &ref, int border)
   : nrows(0), ncolumns(0), border(0), 
-    bytes_per_row(0), grays(0), bytes(0), gbytes_data(bytes_data),
+    bytes_per_row(0), grays(0), bytes(nullptr), gbytes_data(bytes_data),
     grle(rle), grlerows(rlerows), rlelength(0),
-    monitorptr(0)
+    monitorptr(nullptr)
 {
   G_TRY
   { 
@@ -178,9 +178,9 @@ GBitmap::GBitmap(const GBitmap &ref, int border)
 
 GBitmap::GBitmap(const GBitmap &ref, const GRect &rect, int border)
   : nrows(0), ncolumns(0), border(0), 
-    bytes_per_row(0), grays(0), bytes(0), gbytes_data(bytes_data),
+    bytes_per_row(0), grays(0), bytes(nullptr), gbytes_data(bytes_data),
     grle(rle), grlerows(rlerows), rlelength(0),
-    monitorptr(0)
+    monitorptr(nullptr)
 {
   G_TRY
   { 
@@ -258,7 +258,7 @@ GBitmap::init(const GBitmap &ref, const GRect &rect, int border)
       tmp.bytes = bytes;
       tmp.gbytes_data.swap(gbytes_data);
       tmp.grle.swap(grle);
-      bytes = 0 ;
+      bytes = nullptr ;
       init(tmp, rect, border);
     }
   else
@@ -373,7 +373,7 @@ GBitmap::take_data(size_t &offset)
   GMonitorLock lock(monitor());
   unsigned char *ret = bytes_data;
   if (ret) offset = (size_t)border;
-  bytes_data=0;
+  bytes_data=nullptr;
   return ret;
 }
 
@@ -403,7 +403,7 @@ GBitmap::compress()
       if (rlelength)
         {
           gbytes_data.resize(0);
-          bytes = 0;
+          bytes = nullptr;
         }
     }
 }
@@ -444,7 +444,7 @@ GBitmap::minborder(int minimum)
               bytes_per_row = tmp.bytes_per_row;
               tmp.gbytes_data.swap(gbytes_data);
               bytes = bytes_data;
-              tmp.bytes = 0;
+              tmp.bytes = nullptr;
             }
           border = minimum;
           gzerobuffer=zeroes(border + ncolumns + border);
@@ -1000,7 +1000,7 @@ GBitmap::save_rle(ByteStream &bs)
     }
   else
     {
-      unsigned char *runs = 0;
+      unsigned char *runs = nullptr;
       GPBuffer<unsigned char> gruns(runs);
       int size = encode(runs,gruns);
       bs.writall((void*)runs, size);
@@ -1253,7 +1253,7 @@ GBitmap::decode(unsigned char *runs)
   if (nrows==0 || ncolumns==0)
     G_THROW( ERR_MSG("GBitmap.not_init") );
   bytes_per_row = ncolumns + border;
-  if (runs==0)
+  if (!runs)
     G_THROW( ERR_MSG("GBitmap.null_arg") );
   int npixels = nrows * bytes_per_row + border;
   if (!bytes_data)
diff --git a/kviewshell/plugins/djvu/libdjvu/GBitmap.h b/kviewshell/plugins/djvu/libdjvu/GBitmap.h
index fb255d44..8605945f 100644
--- a/kviewshell/plugins/djvu/libdjvu/GBitmap.h
+++ b/kviewshell/plugins/djvu/libdjvu/GBitmap.h
@@ -658,7 +658,7 @@ inline void
 GBitmap::borrow_data(unsigned char &data,int w,int h)
 {
   donate_data(&data,w,h);
-  bytes_data=0;
+  bytes_data=nullptr;
 }
 
 // ---------------- THE END
diff --git a/kviewshell/plugins/djvu/libdjvu/GContainer.cpp b/kviewshell/plugins/djvu/libdjvu/GContainer.cpp
index feeedd99..46ae6f83 100644
--- a/kviewshell/plugins/djvu/libdjvu/GContainer.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GContainer.cpp
@@ -144,7 +144,7 @@ GArrayBase::steal(GArrayBase &ga)
       minlo = ga.minlo;
       maxhi = ga.maxhi;
       data = ga.data;
-      ga.data = 0;
+      ga.data = nullptr;
       ga.lobound = ga.minlo = 0;
       ga.hibound = ga.maxhi = -1;
     }
@@ -374,7 +374,7 @@ GListBase::GListBase(const Traits& traits)
   : traits(traits)
 {
   nelem = 0;
-  head.next = head.prev = 0;
+  head.next = head.prev = nullptr;
 }
 
 
@@ -382,7 +382,7 @@ GListBase::GListBase(const GListBase &ref)
   : traits(ref.traits)
 {
   nelem = 0;
-  head.next = head.prev = 0;
+  head.next = head.prev = nullptr;
   GListBase::operator= (ref);
 }
 
@@ -404,7 +404,7 @@ void
 GListBase::append(Node *n)
 {
   // Link
-  n->next = 0;
+  n->next = nullptr;
   n->prev = head.prev;
   head.prev = n;
   if (n->prev)
@@ -421,7 +421,7 @@ GListBase::prepend(Node *n)
 {
   // Link
   n->next = head.next;
-  n->prev = 0;
+  n->prev = nullptr;
   head.next = n;
   if (n->next)
     n->next->prev = n;
@@ -446,7 +446,7 @@ GListBase::insert_after(GPosition pos, Node *n)
     }
   else
     {
-      n->prev = 0;
+      n->prev = nullptr;
       n->next = head.next;
     }
   // Link
@@ -478,7 +478,7 @@ GListBase::insert_before(GPosition pos, Node *n)
   else
     {
       n->prev = head.prev;
-      n->next = 0;
+      n->next = nullptr;
     }
   // Link
   if (n->prev)
@@ -526,7 +526,7 @@ GListBase::insert_before(GPosition pos, GListBase &fromlist, GPosition &frompos)
   else
     {
       n->prev = head.prev;
-      n->next = 0;
+      n->next = nullptr;
     }
   // Link
   if (n->prev)
@@ -560,14 +560,14 @@ GListBase::del(GPosition &pos)
   nelem -= 1;
   traits.fini( (void*)n, 1);
   operator delete ( (void*)n );
-  pos.ptr = 0;
+  pos.ptr = nullptr;
 }
 
 
 GPosition 
 GListBase::nth(unsigned int n) const
 {
-  Node *p = 0;
+  Node *p = nullptr;
   if ((int)n < nelem)
     for (p=head.next; p; p=p->next)
       if ( n-- == 0)
@@ -587,7 +587,7 @@ GListBase::empty()
       operator delete ( (void*)n );
       n = p;
     }
-  head.next = head.prev = 0;
+  head.next = head.prev = nullptr;
   nelem = 0;
 }
 
@@ -620,7 +620,7 @@ GListBase::operator= (const GListBase & ref)
 
 GSetBase::GSetBase(const Traits &traits)
   : traits(traits), nelems(0), nbuckets(0), 
-    gtable(table), first(0)
+    gtable(table), first(nullptr)
 {
   rehash(17);
 }
@@ -628,7 +628,7 @@ GSetBase::GSetBase(const Traits &traits)
 
 GSetBase::GSetBase(const GSetBase &ref)
   : traits(ref.traits), 
-    nelems(0), nbuckets(0), gtable(table), first(0)
+    nelems(0), nbuckets(0), gtable(table), first(nullptr)
 {
   GSetBase::operator= (ref);
 }
@@ -689,7 +689,7 @@ GSetBase::insertnode(HNode *n)
 void   
 GSetBase::deletenode(GCONT HNode *n)
 {
-  if (n == 0) 
+  if (!n)
     return;
   int bucket = n->hashcode % nbuckets;
   // Regular links
@@ -718,7 +718,7 @@ GSetBase::rehash(int newbuckets)
   Node *n = first;
   // Simulate an empty map
   nelems = 0;
-  first = 0;
+  first = nullptr;
   // Allocate a new empty bucket table
 // delete [] table;
   gtable.resize(0);
@@ -769,7 +769,7 @@ GSetBase::del(GPosition &pos)
   if (pos.ptr && pos.cont==(void*)this)
     {
       deletenode((HNode*)pos.ptr);
-      pos.ptr = 0;
+      pos.ptr = nullptr;
     }
 }
 
@@ -784,7 +784,7 @@ GSetBase::empty()
       operator delete ( (void*)n );
       n = p;
     }
-  first = 0;
+  first = nullptr;
   nelems = 0;
   gtable.clear();
 //  for (int i=0; i<nbuckets; i++)
diff --git a/kviewshell/plugins/djvu/libdjvu/GContainer.h b/kviewshell/plugins/djvu/libdjvu/GContainer.h
index 5b55b15d..6986dd10 100644
--- a/kviewshell/plugins/djvu/libdjvu/GContainer.h
+++ b/kviewshell/plugins/djvu/libdjvu/GContainer.h
@@ -776,7 +776,7 @@ class GPosition : protected GCont
 {
 public:
   /** Creates a null GPosition object. */
-  GPosition() : ptr(0), cont(0) {}
+  GPosition() : ptr(nullptr), cont(nullptr) {}
   /** Creates a copy of a GPosition object. */
   GPosition(const GPosition &ref) : ptr(ref.ptr), cont(ref.cont) {}
   /** Tests whether this GPosition object is non null. */
@@ -874,7 +874,7 @@ GListImpl<TI>::operator==(const GListImpl<TI> &l2) const
   for (p=head.next, q=l2.head.next; p && q; p=p->next, q=q->next )
     if (((LNode*)p)->val != ((LNode*)q)->val)
       return 0;
-  return p==0 && q==0;
+  return !p && !q;
 }
 
 template<class TI> int
@@ -885,7 +885,7 @@ GListImpl<TI>::search(const TI &elt, GPosition &pos) const
     if ( ((LNode *)n)->val == elt ) 
       break;
   if (n) pos = GPosition(n, (void*)this);
-  return (n != 0);
+  return (n != nullptr);
 }
 
 
@@ -1144,7 +1144,7 @@ GSetImpl<K>::get(const K &key) const
   unsigned int hashcode = hash(key);
   for (SNode *s=(SNode*)hashnode(hashcode); s; s=(SNode*)(s->hprev))
     if (s->hashcode == hashcode && s->key == key) return s;
-  return 0;
+  return nullptr;
 }
 
 #if GCONTAINER_BOUNDS_CHECK
diff --git a/kviewshell/plugins/djvu/libdjvu/GException.cpp b/kviewshell/plugins/djvu/libdjvu/GException.cpp
index a04ef1b2..8068f7f3 100644
--- a/kviewshell/plugins/djvu/libdjvu/GException.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GException.cpp
@@ -79,7 +79,7 @@ namespace DJVU {
 // - Author: Leon Bottou, 05/1997
 
 GException::GException() 
-  : cause(0), file(0), func(0), line(0), source(GException::GINTERNAL)
+  : cause(nullptr), file(nullptr), func(nullptr), line(0), source(GException::GINTERNAL)
 {
 }
 
@@ -126,7 +126,7 @@ GException::~GException(void)
 {
   if (cause && cause!=outofmemory ) 
     delete [] const_cast<char*>(cause); 
-  cause=file=func=0;
+  cause=file=func=nullptr;
 }
 
 GException & 
@@ -134,7 +134,7 @@ GException::operator=(const GException & exc)
 {
   if (cause && cause!=outofmemory) 
     delete [] const_cast<char*>(cause);
-  cause = 0;
+  cause = nullptr;
   file = exc.file;
   func = exc.func;
   line = exc.line;
@@ -155,7 +155,7 @@ GException::operator=(const GException & exc)
 void
 GException::perror(void) const
 {
-  fflush(0);
+  fflush(nullptr);
   DjVuPrintErrorUTF8("*** ");
   DjVuMessageLite::perror(get_cause());
   if (file && line>0)
diff --git a/kviewshell/plugins/djvu/libdjvu/GException.h b/kviewshell/plugins/djvu/libdjvu/GException.h
index 41a8b9a8..91b714d6 100644
--- a/kviewshell/plugins/djvu/libdjvu/GException.h
+++ b/kviewshell/plugins/djvu/libdjvu/GException.h
@@ -144,8 +144,8 @@ public:
       interrupts the execution. The remaining arguments are usually provided
       by the predefined macros #__FILE__#, #__LINE__#, and (G++ and EGCS only)
       #__PRETTY_FUNCTION__#.  */
-  GException (const char *cause, const char *file=0, int line=0, 
-              const char *func=0, const source_type source=GINTERNAL);
+  GException (const char *cause, const char *file=nullptr, int line=0,
+              const char *func=nullptr, const source_type source=GINTERNAL);
 
   /** Copy Constructor. */
   GException (const GException & exc);
@@ -315,8 +315,8 @@ public:
 
 inline void
 G_EXTHROW
-(const GException &ex,const char *msg=0,const char *file=0,int line=0,
-  const char *func=0, const GException::source_type source=GException::GINTERNAL)
+(const GException &ex,const char *msg=nullptr,const char *file=nullptr,int line=0,
+  const char *func=nullptr, const GException::source_type source=GException::GINTERNAL)
 {
   G_EMTHROW( (msg||file||line||func)?
       GException(msg?msg:ex.get_cause(),
@@ -329,7 +329,7 @@ G_EXTHROW
 
 inline void
 G_EXTHROW
-(const char msg[],const char *file=0,int line=0,const char *func=0,
+(const char msg[],const char *file=nullptr,int line=0,const char *func=nullptr,
   const GException::source_type source=GException::GINTERNAL )
 {
   G_EMTHROW(GException(msg,file,line,func,source));
diff --git a/kviewshell/plugins/djvu/libdjvu/GIFFManager.h b/kviewshell/plugins/djvu/libdjvu/GIFFManager.h
index b379e556..3210a62d 100644
--- a/kviewshell/plugins/djvu/libdjvu/GIFFManager.h
+++ b/kviewshell/plugins/djvu/libdjvu/GIFFManager.h
@@ -149,7 +149,7 @@ public:
 	  contain dots, but MAY contain colons and brackets (the latter -
 	  for specifying the chunk number). If {\em position} is not zero
 	  then the chunk position in its parent will be put into #*position# */
-   GP<GIFFChunk>get_chunk(const GUTF8String &name, int * position=0);
+   GP<GIFFChunk>get_chunk(const GUTF8String &name, int * position=nullptr);
       /** Returns the number of chunks with given {\em name}. The {\em name}
 	  may not contain dots and brackets. If {\em name} is ZERO, the
 	  total number of chunks will be returned. */
@@ -340,7 +340,7 @@ public:
 	     ;; To get chunk corresponding to 2nd DJVU form
 	     m.getChunk(".DJVU[1]");
 	  \end{verbatim} */
-   GP<GIFFChunk>get_chunk(GUTF8String name, int * position=0);
+   GP<GIFFChunk>get_chunk(GUTF8String name, int * position=nullptr);
 
       /** Loads the composite {\em chunk}'s contents from stream {\em istr}. */
    void		load_chunk(IFFByteStream & istr, GP<GIFFChunk> chunk);
diff --git a/kviewshell/plugins/djvu/libdjvu/GOS.cpp b/kviewshell/plugins/djvu/libdjvu/GOS.cpp
index 223e63ac..c5be227b 100644
--- a/kviewshell/plugins/djvu/libdjvu/GOS.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GOS.cpp
@@ -256,7 +256,7 @@ GOS::ticks()
 {
 #if defined(UNIX)
   struct timeval tv;
-  if (gettimeofday(&tv, NULL) < 0)
+  if (gettimeofday(&tv, nullptr) < 0)
     G_THROW(errmsg());
   return (unsigned long)( ((tv.tv_sec & 0xfffff)*1000) 
                           + (tv.tv_usec/1000) );
@@ -284,9 +284,9 @@ GOS::sleep(int milliseconds)
   tv.tv_sec = milliseconds / 1000;
   tv.tv_usec = (milliseconds - (tv.tv_sec * 1000)) * 1000;
 # if defined(THREADMODEL) && (THREADMODEL==COTHREADS)
-  GThread::select(0, NULL, NULL, NULL, &tv);
+  GThread::select(0, nullptr, nullptr, nullptr, &tv);
 # else
-  select(0, NULL, NULL, NULL, &tv);
+  select(0, nullptr, nullptr, nullptr, &tv);
 # endif
 #elif defined(WIN32)
   Sleep(milliseconds);
diff --git a/kviewshell/plugins/djvu/libdjvu/GOS.h b/kviewshell/plugins/djvu/libdjvu/GOS.h
index 1201e564..5e510c24 100644
--- a/kviewshell/plugins/djvu/libdjvu/GOS.h
+++ b/kviewshell/plugins/djvu/libdjvu/GOS.h
@@ -108,7 +108,7 @@ class GOS
       suffix matches argument #suffix#, the filename suffix is removed.  This
       function works like the unix command #/bin/basename#, but also supports
       the naming conventions of other operating systems. */
-  static GUTF8String basename(const GUTF8String &filename, const char *suffix=0);
+  static GUTF8String basename(const GUTF8String &filename, const char *suffix=nullptr);
 
   /** Sets and returns the current working directory.
       When argument #dirname# is specified, the current directory is changed
diff --git a/kviewshell/plugins/djvu/libdjvu/GPixmap.cpp b/kviewshell/plugins/djvu/libdjvu/GPixmap.cpp
index b9c15c72..9ffabb0e 100644
--- a/kviewshell/plugins/djvu/libdjvu/GPixmap.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GPixmap.cpp
@@ -174,16 +174,16 @@ void
 GPixmap::destroy(void)
 {
   delete [] pixels_data;
-  pixels = pixels_data = 0;
+  pixels = pixels_data = nullptr;
 }
 
 GPixmap::GPixmap()
-: nrows(0), ncolumns(0), pixels(0), pixels_data(0)
+: nrows(0), ncolumns(0), pixels(nullptr), pixels_data(nullptr)
 {
 }
 
 GPixmap::GPixmap(int nrows, int ncolumns, const GPixel *filler)
-: nrows(0), ncolumns(0), pixels(0), pixels_data(0)
+: nrows(0), ncolumns(0), pixels(nullptr), pixels_data(nullptr)
 {
   G_TRY
   {
@@ -198,7 +198,7 @@ GPixmap::GPixmap(int nrows, int ncolumns, const GPixel *filler)
 }
 
 GPixmap::GPixmap(ByteStream &bs)
-: nrows(0), ncolumns(0), pixels(0), pixels_data(0)
+: nrows(0), ncolumns(0), pixels(nullptr), pixels_data(nullptr)
 {
   G_TRY
   {
@@ -213,11 +213,11 @@ GPixmap::GPixmap(ByteStream &bs)
 }
 
 GPixmap::GPixmap(const GBitmap &ref)
-: nrows(0), ncolumns(0), pixels(0), pixels_data(0)
+: nrows(0), ncolumns(0), pixels(nullptr), pixels_data(nullptr)
 {
   G_TRY
   {
-	init(ref, 0);
+	init(ref, nullptr);
   }
   G_CATCH_ALL
   {
@@ -228,11 +228,11 @@ GPixmap::GPixmap(const GBitmap &ref)
 }
 
 GPixmap::GPixmap(const GBitmap &ref, const GRect &rect)
-: nrows(0), ncolumns(0), pixels(0), pixels_data(0)
+: nrows(0), ncolumns(0), pixels(nullptr), pixels_data(nullptr)
 {
   G_TRY
   {
-    init(ref, rect, 0);
+    init(ref, rect, nullptr);
   }
   G_CATCH_ALL
   {
@@ -243,7 +243,7 @@ GPixmap::GPixmap(const GBitmap &ref, const GRect &rect)
 }
 
 GPixmap::GPixmap(const GPixmap &ref)
-: nrows(0), ncolumns(0), pixels(0), pixels_data(0)
+: nrows(0), ncolumns(0), pixels(nullptr), pixels_data(nullptr)
 {
   G_TRY
   {
@@ -258,7 +258,7 @@ GPixmap::GPixmap(const GPixmap &ref)
 }
 
 GPixmap::GPixmap(const GPixmap &ref, const GRect &rect)
-: nrows(0), ncolumns(0), pixels(0), pixels_data(0)
+: nrows(0), ncolumns(0), pixels(nullptr), pixels_data(nullptr)
 {
   G_TRY
   {
@@ -302,7 +302,7 @@ GPixmap::init(int arows, int acolumns, const GPixel *filler)
 void 
 GPixmap::init(const GBitmap &ref, const GPixel *userramp)
 {
-  init(ref.rows(), ref.columns(), 0);
+  init(ref.rows(), ref.columns(), nullptr);
   GPixel *xramp;
   GPBuffer<GPixel> gxramp(xramp);
   if (nrows>0 && ncolumns>0)
@@ -333,7 +333,7 @@ GPixmap::init(const GBitmap &ref, const GPixel *userramp)
 void 
 GPixmap::init(const GBitmap &ref, const GRect &rect, const GPixel *userramp)
 {
-  init(rect.height(), rect.width(), 0);
+  init(rect.height(), rect.width(), nullptr);
   // compute destination rectangle
   GRect rect2(0, 0, ref.columns(), ref.rows() );
   rect2.intersect(rect2, rect);
@@ -369,7 +369,7 @@ GPixmap::init(const GBitmap &ref, const GRect &rect, const GPixel *userramp)
 void 
 GPixmap::init(const GPixmap &ref)
 {
-  init(ref.rows(), ref.columns(), 0);
+  init(ref.rows(), ref.columns(), nullptr);
   if (nrows>0 && ncolumns>0)
   {
     for (int y=0; y<nrows; y++)
@@ -386,7 +386,7 @@ GPixmap::init(const GPixmap &ref)
 void 
 GPixmap::init(const GPixmap &ref, const GRect &rect)
 {
-  init(rect.height(), rect.width(), 0);
+  init(rect.height(), rect.width(), nullptr);
   // compute destination rectangle
   GRect rect2(0, 0, ref.columns(), ref.rows() );
   rect2.intersect(rect2, rect);
@@ -420,7 +420,7 @@ GPixel *
 GPixmap::take_data(size_t &offset)
 {
   GPixel *ret = pixels_data;
-  pixels_data = 0;
+  pixels_data = nullptr;
   offset = 0;
   return ret;
 }
@@ -490,7 +490,7 @@ GPixmap::init(ByteStream &bs)
   int maxval = read_integer(lookahead, bs);
   if (maxval > 255)
     G_THROW("Cannot read PPM with depth greater than 24 bits.");
-  init(arows, acolumns, 0);
+  init(arows, acolumns, nullptr);
   // Read image data
   if (raw)
   {
@@ -812,7 +812,7 @@ GPixmap::downsample(const GPixmap *src, int factor, const GRect *pdr)
 {
   // check arguments
   GRect rect(0, 0, (src->columns()+factor-1)/factor, (src->rows()+factor-1)/factor);
-  if (pdr != 0)
+  if (pdr)
   {
     if (pdr->xmin < rect.xmin || 
         pdr->ymin < rect.ymin || 
@@ -833,7 +833,7 @@ GPixmap::downsample(const GPixmap *src, int factor, const GRect *pdr)
   }
   
   // initialise pixmap
-  init(rect.height(), rect.width(), 0);
+  init(rect.height(), rect.width(), nullptr);
 
   // determine starting and ending points in source rectangle
   int sy = rect.ymin * factor;
@@ -898,7 +898,7 @@ GPixmap::upsample(const GPixmap *src, int factor, const GRect *pdr)
 {
   // check arguments
   GRect rect(0, 0, src->columns()*factor, src->rows()*factor);
-  if (pdr != 0)
+  if (pdr)
   {
     if (pdr->xmin < rect.xmin || 
         pdr->ymin < rect.ymin || 
@@ -908,7 +908,7 @@ GPixmap::upsample(const GPixmap *src, int factor, const GRect *pdr)
     rect = *pdr;
   }
   // initialise pixmap
-  init(rect.height(), rect.width(), 0);
+  init(rect.height(), rect.width(), nullptr);
   // compute starting point in source rectangle
   int sy, sy1, sxz, sx1z;
   euclidian_ratio(rect.ymin, factor, sy, sy1);
@@ -1102,7 +1102,7 @@ GPixmap::downsample43(const GPixmap *src, const GRect *pdr)
   int destwidth = (srcwidth * 3 + 3 ) / 4;
   int destheight = (srcheight * 3 + 3) / 4;
   GRect rect(0, 0, destwidth, destheight);
-  if (pdr != 0)
+  if (pdr)
   {
     if (pdr->xmin < rect.xmin || 
         pdr->ymin < rect.ymin || 
@@ -1114,7 +1114,7 @@ GPixmap::downsample43(const GPixmap *src, const GRect *pdr)
     destheight = rect.height();
   }
   // initialize pixmap
-  init(destheight, destwidth, 0);
+  init(destheight, destwidth, nullptr);
 
   // compute bounds
   int dxz, dy;   // location of bottomleft block in destination image
@@ -1192,7 +1192,7 @@ GPixmap::upsample23(const GPixmap *src, const GRect *pdr)
   int destwidth = (srcwidth * 3 + 1 ) / 2;
   int destheight = (srcheight * 3 + 1) / 2;
   GRect rect(0, 0, destwidth, destheight);
-  if (pdr != 0)
+  if (pdr)
   {
     if (pdr->xmin < rect.xmin || 
         pdr->ymin < rect.ymin || 
@@ -1204,7 +1204,7 @@ GPixmap::upsample23(const GPixmap *src, const GRect *pdr)
     destheight = rect.height();
   }
   // initialize pixmap
-  init(destheight, destwidth, 0);
+  init(destheight, destwidth, nullptr);
 
   // compute bounds
   int dxz, dy;   // location of bottomleft block in destination image
@@ -1520,7 +1520,7 @@ GPixmap::stencil(const GBitmap *bm,
 {
   // Check arguments
   GRect rect(0, 0, pm->columns()*pms, pm->rows()*pms);
-  if (pmr != 0)
+  if (pmr)
     {
       if (pmr->xmin < rect.xmin || 
           pmr->ymin < rect.ymin || 
diff --git a/kviewshell/plugins/djvu/libdjvu/GPixmap.h b/kviewshell/plugins/djvu/libdjvu/GPixmap.h
index 023fc411..ab825858 100644
--- a/kviewshell/plugins/djvu/libdjvu/GPixmap.h
+++ b/kviewshell/plugins/djvu/libdjvu/GPixmap.h
@@ -148,7 +148,7 @@ class GPixmap : public GPEnabled
 {
 protected:
   GPixmap(void);
-  GPixmap(int nrows, int ncolumns, const GPixel *filler=0);
+  GPixmap(int nrows, int ncolumns, const GPixel *filler=nullptr);
   GPixmap(const GBitmap &ref);
   GPixmap(const GBitmap &ref, const GRect &rect);
   GPixmap(const GPixmap &ref);
@@ -171,7 +171,7 @@ public:
       optional argument #filler# is specified, all pixels are initialized 
       with the corresponding color. */
   static GP<GPixmap> create(
-    const int nrows, const int ncolumns, const GPixel *filler=0)
+    const int nrows, const int ncolumns, const GPixel *filler=nullptr)
   { return new GPixmap(nrows,ncolumns,filler); }
 
   /** Creates a GPixmap by copying the gray level image #ref#.
@@ -211,7 +211,7 @@ public:
   /** Resets the GPixmap to #nrows# rows and #ncolumns# columns.  When the
       optional argument #filler# is specified, all pixels are initialized with
       the corresponding color.  The previous content of the GPixmap is discarded. */
-  void init(int nrows, int ncolumns,  const GPixel *filler=0);
+  void init(int nrows, int ncolumns,  const GPixel *filler=nullptr);
   /** Resets the GPixmap by copying the size and the contents of the color
       image #ref#.  The previous content of the GPixmap is discarded. */
   void init(const GPixmap &ref);
@@ -222,13 +222,13 @@ public:
       level image #ref#.  The optional argument #ramp# is an array of 256 
       pixel values used for mapping the gray levels to color values. 
       Setting #ramp# to zero selects a linear ramp of shades of gray. */
-  void init(const GBitmap &ref, const GPixel *ramp=0);
+  void init(const GBitmap &ref, const GPixel *ramp=nullptr);
   /** Resets the GPixmap by copying the rectangle #rect# of the gray level
       image #ref#.  The optional argument #ramp# is an array of 256 pixel
       values used for mapping the gray levels to color values.  Setting #ramp#
       to zero selects a linear ramp computed according to the maximal number
       of gray levels in #ref#. */
-  void init(const GBitmap &ref, const GRect &rect, const GPixel *ramp=0);
+  void init(const GBitmap &ref, const GRect &rect, const GPixel *ramp=nullptr);
   /** Resets the GPixmap by reading PPM data from ByteStream #ref#.  See
       \Ref{PNM and RLE file formats} for more information. */
   void init(ByteStream &ref);
@@ -269,7 +269,7 @@ public:
       Both operations are however performed together for efficiency reasons.
       Subsampling works by averaging the colors of the source pixels located
       in small squares of size #factor# times #factor#. */
-  void downsample(const GPixmap *src, int factor, const GRect *rect=0);
+  void downsample(const GPixmap *src, int factor, const GRect *rect=nullptr);
   /** Resets this GPixmap with a oversampled segment of color image #src#.
       This function conceptually rescales image #src# by a factor #factor:1#,
       and copies rectangle #rect# of the oversampled image into the current
@@ -277,21 +277,21 @@ public:
       pointer.  Both operations are however performed together for efficiency
       reasons.  Oversampling works by replicating the color of the source
       pixels into squares of size #factor# times #factor#. */
-  void upsample(const GPixmap *src, int factor, const GRect *rect=0);
+  void upsample(const GPixmap *src, int factor, const GRect *rect=nullptr);
   /** Resets this GPixmap with a rescaled segment of #src# (zoom 75%).  This
       function conceptually rescales image #src# by a factor #3:4#, and copies
       rectangle #rect# of the rescaled image into the current GPixmap.  The
       full rescaled image is copied if #rect# is a null pointer.  Both
       operations are however performed together for efficiency reasons.  This
       function has been superseded by class \Ref{GPixmapScaler}. */
-  void downsample43(const GPixmap *src, const GRect *rect=0); 
+  void downsample43(const GPixmap *src, const GRect *rect=nullptr);
   /** Resets this GPixmap with a rescaled segment of #src# (zoom 150%).  This
       function conceptually rescales image #src# by a factor #3:2# and copies
       rectangle #rect# of the rescaled image into the current GPixmap.  The
       full rescaled image is copied if #rect# is a null pointer.  Both
       operations are however performed together for efficiency reasons.  This
       function has been superseded by class \Ref{GPixmapScaler}. */
-  void upsample23(const GPixmap *src, const GRect *rect=0);
+  void upsample23(const GPixmap *src, const GRect *rect=nullptr);
   //@}
 
   /** @name Blitting and applying stencils.  
@@ -474,14 +474,14 @@ GPixmap::rowsize() const
 inline GPixel *
 GPixmap::operator[](int row)
 {
-  if (row<0 || row>=nrows || !pixels) return 0;
+  if (row<0 || row>=nrows || !pixels) return nullptr;
   return &pixels[row * nrowsize];
 }
 
 inline const GPixel *
 GPixmap::operator[](int row) const
 {
-  if (row<0 || row>=nrows) return 0;
+  if (row<0 || row>=nrows) return nullptr;
   return &pixels[row * nrowsize];
 }
 
@@ -503,7 +503,7 @@ inline void
 GPixmap::borrow_data(GPixel &data, int w, int h)
 {
   donate_data(&data,w,h);
-  pixels_data=0;
+  pixels_data=nullptr;
 }
 
 //////////////////////////////////////////////////
diff --git a/kviewshell/plugins/djvu/libdjvu/GSmartPointer.cpp b/kviewshell/plugins/djvu/libdjvu/GSmartPointer.cpp
index 92608c16..d774adc8 100644
--- a/kviewshell/plugins/djvu/libdjvu/GSmartPointer.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GSmartPointer.cpp
@@ -135,7 +135,7 @@ GPBase::assign (GPEnabled *nptr)
       if (nptr->count >= 0)  
         nptr->count++;
       else
-        nptr = 0;
+        nptr = nullptr;
     }
   if (ptr)
     {
@@ -199,7 +199,7 @@ GPBufferBase::GPBufferBase(void *&xptr,const size_t n,const size_t t)
   if (n)
     xptr = ::operator new(n*t);
   else
-    xptr = 0;
+    xptr = nullptr;
 }
 
 GPBufferBase::~GPBufferBase()
diff --git a/kviewshell/plugins/djvu/libdjvu/GSmartPointer.h b/kviewshell/plugins/djvu/libdjvu/GSmartPointer.h
index 422b6569..4561476d 100644
--- a/kviewshell/plugins/djvu/libdjvu/GSmartPointer.h
+++ b/kviewshell/plugins/djvu/libdjvu/GSmartPointer.h
@@ -363,13 +363,13 @@ GPEnabled::operator=(const GPEnabled & obj)
 
 inline
 GPBase::GPBase()
-  : ptr(0)
+  : ptr(nullptr)
 {
 }
 
 inline
 GPBase::GPBase(GPEnabled *nptr)
-  : ptr(0)
+  : ptr(nullptr)
 {
   assign(nptr);
 }
@@ -386,7 +386,7 @@ inline
 GPBase::~GPBase()
 {
   GPEnabled *old = ptr;
-  ptr = 0;
+  ptr = nullptr;
   if (old)
     old->unref();
 }
diff --git a/kviewshell/plugins/djvu/libdjvu/GString.cpp b/kviewshell/plugins/djvu/libdjvu/GString.cpp
index 1b0deeae..781034b2 100644
--- a/kviewshell/plugins/djvu/libdjvu/GString.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GString.cpp
@@ -342,7 +342,7 @@ public:
   static GP<GStringRep> create(const char fmt[],va_list &args);
 
   virtual unsigned char *UCS4toString(
-    const unsigned long w,unsigned char *ptr, mbstate_t *ps=0) const;
+    const unsigned long w,unsigned char *ptr, mbstate_t *ps=nullptr) const;
 
   // Tests if a string is legally encoded in the current character set.
   virtual bool is_valid(void) const;
@@ -462,7 +462,7 @@ GStringRep::ChangeLocale::ChangeLocale(const int xcategory, const char xlocale[]
   // it does not play nice with MT.
   if(xlocale)
     {
-      locale=setlocale(xcategory,0);
+      locale=setlocale(xcategory,nullptr);
       if(locale.length() &&(locale!=xlocale))
         {
           if(locale == setlocale(category,xlocale))
@@ -644,7 +644,7 @@ GBaseString::UTF8ToNative(
   if(source && source[0]) 
   {
 #if DO_CHANGELOCALE
-    GUTF8String lc_ctype(setlocale(LC_CTYPE,0));
+    GUTF8String lc_ctype(setlocale(LC_CTYPE,nullptr));
 #endif
     bool repeat;
     for(repeat=!currentlocale;;repeat=false)
@@ -695,7 +695,7 @@ GBaseString::NativeToUTF8(void) const
   {
     const char *source=(*this);
 #if DO_CHANGELOCALE
-    GUTF8String lc_ctype=setlocale(LC_CTYPE,0);
+    GUTF8String lc_ctype=setlocale(LC_CTYPE,nullptr);
 #endif
     bool repeat;
     for(repeat=true;;repeat=false)
@@ -765,7 +765,7 @@ GStringRep::Native::cmp(const GP<GStringRep> &s2,const int len) const
     }
   }else
   {
-    retval=GStringRep::cmp(data,0,len);
+    retval=GStringRep::cmp(data,nullptr,len);
   }
   return retval;
 }
@@ -780,7 +780,7 @@ long
 GStringRep::Native::toLong(
   const int pos, int &endpos, const int base) const
 {
-   char *edata=0;
+   char *edata=nullptr;
    const long retval=strtol(data+pos, &edata, base);
    if(edata)
    {
@@ -796,7 +796,7 @@ unsigned long
 GStringRep::Native::toULong(
   const int pos, int &endpos, const int base) const
 {
-   char *edata=0;
+   char *edata=nullptr;
    const unsigned long retval=strtoul(data+pos, &edata, base);
    if(edata)
    {
@@ -812,7 +812,7 @@ double
 GStringRep::Native::toDouble(
   const int pos, int &endpos) const
 {
-   char *edata=0;
+   char *edata=nullptr;
    const double retval=strtod(data+pos, &edata);
    if(edata)
    {
@@ -918,7 +918,7 @@ GStringRep::set_remainder( const GP<GStringRep::Unicode> &) {}
 GP<GStringRep::Unicode>
 GStringRep::get_remainder( void ) const
 {
-  return 0;
+  return nullptr;
 }
 
 GNativeString::GNativeString(const char dat)
@@ -1222,7 +1222,7 @@ const char *GBaseString::nullstr = "";
 void
 GBaseString::empty( void )
 {
-  init(0);
+  init(nullptr);
 }
 
 GP<GStringRep>
@@ -1419,7 +1419,7 @@ GStringRep::toEscaped( const bool tosevenbit ) const
   GP<GStringRep> special;
   for(unsigned long w;(w=getValidUCS4(s));last=s)
   {
-    char const *ss=0;
+    char const *ss=nullptr;
     switch(w)
     {
     case '<':
@@ -1518,7 +1518,7 @@ GUTF8String::fromEscaped( const GMap<GUTF8String,GUTF8String> ConvMap ) const
       if( s[0] == '#')
       {
         unsigned long value;
-        char *ptr=0;
+        char *ptr=nullptr;
         if(s[1] == 'x' || s[1] == 'X')
         {
           value=strtoul((char const *)(s+2),&ptr,16);
@@ -1701,7 +1701,7 @@ GStringRep::vformat(va_list args) const
       char *buffer;
       GPBuffer<char> gbuffer(buffer,buflen);
 
-      ChangeLocale locale(LC_NUMERIC,(isNative()?0:"C"));
+      ChangeLocale locale(LC_NUMERIC,(isNative()?nullptr:"C"));
 
       // Format string
 #ifdef USE_VSNPRINTF
@@ -2242,7 +2242,7 @@ GStringRep::GStringRep(void)
   static const char *locale=setlocale_win32();
 #endif
   size=0;
-  data=0;
+  data=nullptr;
 }
 
 GStringRep::~GStringRep()
@@ -2252,7 +2252,7 @@ GStringRep::~GStringRep()
     data[0]=0;
     ::operator delete(data);
   }
-  data=0;
+  data=nullptr;
 }
 
 GStringRep::UTF8::UTF8(void) {}
@@ -2283,21 +2283,21 @@ int
 GStringRep::cmp(const GP<GStringRep> &s1, const GP<GStringRep> &s2,
   const int len )
 {
-  return (s1?(s1->cmp(s2,len)):cmp(0,(s2?(s2->data):0),len));
+  return (s1?(s1->cmp(s2,len)):cmp(nullptr,(s2?(s2->data):nullptr),len));
 }
 
 int 
 GStringRep::cmp(const GP<GStringRep> &s1, const char *s2, 
   const int len )
 {
-  return cmp((s1?s1->data:0),s2,len);
+  return cmp((s1?s1->data:nullptr),s2,len);
 }
 
 int 
 GStringRep::cmp(const char *s1, const GP<GStringRep> &s2,
   const int len )
 {
-  return cmp(s1,(s2?(s2->data):0),len);
+  return cmp(s1,(s2?(s2->data):nullptr),len);
 }
 
 int
@@ -2322,7 +2322,7 @@ GStringRep::UTF8::cmp(const GP<GStringRep> &s2,const int len) const
     }
   }else
   { 
-    retval=GStringRep::cmp(data,0,len);
+    retval=GStringRep::cmp(data,nullptr,len);
   }
   return retval;
 } 
@@ -2346,7 +2346,7 @@ long
 GStringRep::UTF8::toLong(
   const int pos, int &endpos, const int base) const
 {
-  char *edata=0;
+  char *edata=nullptr;
   long retval=Cstrtol(data+pos,&edata, base);
   if(edata)
   {
@@ -2391,7 +2391,7 @@ unsigned long
 GStringRep::UTF8::toULong(
   const int pos, int &endpos, const int base) const
 {
-  char *edata=0;
+  char *edata=nullptr;
   unsigned long retval=Cstrtoul(data+pos,&edata, base);
   if(edata)
   {
@@ -2435,7 +2435,7 @@ Cstrtod(char *data,char **edata)
 double
 GStringRep::UTF8::toDouble(const int pos, int &endpos) const
 {
-  char *edata=0;
+  char *edata=nullptr;
   double retval=Cstrtod(data+pos,&edata);
   if(edata)
   {
@@ -2643,8 +2643,8 @@ GUTF8String::getbuf(int n)
   else if(n>0)
     init(GStringRep::UTF8::create(n));
   else
-    init(0);
-  return ptr?((*this)->data):0;
+    init(nullptr);
+  return ptr?((*this)->data):nullptr;
 }
 
 void 
@@ -2783,8 +2783,8 @@ GNativeString::getbuf(int n)
   else if(n>0)
     init(GStringRep::Native::create(n));
   else
-    init(0);
-  return ptr?((*this)->data):0;
+    init(nullptr);
+  return ptr?((*this)->data):nullptr;
 }
 
 void
diff --git a/kviewshell/plugins/djvu/libdjvu/GString.h b/kviewshell/plugins/djvu/libdjvu/GString.h
index 96634c29..c4b06372 100644
--- a/kviewshell/plugins/djvu/libdjvu/GString.h
+++ b/kviewshell/plugins/djvu/libdjvu/GString.h
@@ -189,7 +189,7 @@ public:
   virtual GP<GStringRep> toUTF8(const bool nothrow=false) const = 0;
       // Convert to same as current class.
   virtual GP<GStringRep> toThis(
-    const GP<GStringRep> &rep,const GP<GStringRep> &locale=0) const = 0;
+    const GP<GStringRep> &rep,const GP<GStringRep> &locale=nullptr) const = 0;
       // Compare with #s2#.
   virtual int cmp(const GP<GStringRep> &s2,const int len=(-1)) const = 0;
 
@@ -289,7 +289,7 @@ public:
   int getUCS4(unsigned long &w, const int from) const;
 
   virtual unsigned char *UCS4toString(
-    const unsigned long w, unsigned char *ptr, mbstate_t *ps=0) const = 0;
+    const unsigned long w, unsigned char *ptr, mbstate_t *ps=nullptr) const = 0;
 
   static unsigned char *UCS4toUTF8(
     const unsigned long w,unsigned char *ptr);
@@ -420,7 +420,7 @@ public:
   static GP<GStringRep> create(const char fmt[],va_list& args);
 
   virtual unsigned char *UCS4toString(
-    const unsigned long w,unsigned char *ptr, mbstate_t *ps=0) const;
+    const unsigned long w,unsigned char *ptr, mbstate_t *ps=nullptr) const;
 
   // Tests if a string is legally encoded in the current character set.
   virtual bool is_valid(void) const;
diff --git a/kviewshell/plugins/djvu/libdjvu/GThreads.cpp b/kviewshell/plugins/djvu/libdjvu/GThreads.cpp
index 2e96d887..269cf8c1 100644
--- a/kviewshell/plugins/djvu/libdjvu/GThreads.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GThreads.cpp
@@ -188,7 +188,7 @@ GThread::create(void (*entry)(void*), void *arg)
   xentry = entry;
   xarg = arg;
   unsigned uthread = 0;
-  hthr = (HANDLE)_beginthreadex(NULL, 0, start, (void*)this, 0, &uthread);
+  hthr = (HANDLE)_beginthreadex(nullptr, 0, start, (void*)this, 0, &uthread);
   thrid = (DWORD) uthread;
   if (hthr)
     return 0;
@@ -318,7 +318,7 @@ GMonitor::wait()
       // Prepare wait record
       struct thr_waiting waitrec;
       waitrec.waiting = TRUE;
-      waitrec.gwait = CreateEvent(NULL,FALSE,FALSE,NULL);
+      waitrec.gwait = CreateEvent(nullptr,FALSE,FALSE,nullptr);
       waitrec.next = 0;
       waitrec.prev = tail;
       // Link wait record (protected by critical section)
@@ -353,7 +353,7 @@ GMonitor::wait(unsigned long timeout)
       // Prepare wait record
       struct thr_waiting waitrec;
       waitrec.waiting = TRUE;
-      waitrec.gwait = CreateEvent(NULL,FALSE,FALSE,NULL);
+      waitrec.gwait = CreateEvent(nullptr,FALSE,FALSE,nullptr);
       waitrec.next = 0;
       waitrec.prev = tail;
       // Link wait record (protected by critical section)
@@ -497,7 +497,7 @@ void
 GThread::terminate()
 {
   if (thid != kNoThreadID) {
-    DisposeThread( thid, NULL, false );
+    DisposeThread( thid, nullptr, false );
     thid = kNoThreadID;
   }
 }
@@ -877,7 +877,7 @@ GMonitor::wait(unsigned long timeout)
       // Wait
       struct timeval  abstv;
       struct timespec absts;
-      gettimeofday(&abstv, NULL); // grrr
+      gettimeofday(&abstv, nullptr); // grrr
       absts.tv_sec = abstv.tv_sec + timeout/1000;
       absts.tv_nsec = abstv.tv_usec*1000  + (timeout%1000)*1000000;
       if (absts.tv_nsec > 1000000000) {
@@ -1158,7 +1158,7 @@ static unsigned long
 time_elapsed(int reset=1)
 {
   timeval tm;
-  gettimeofday(&tm, NULL);
+  gettimeofday(&tm, nullptr);
   long msec = (tm.tv_usec-time_base.tv_usec)/1000;
   unsigned long elapsed = (long)(tm.tv_sec-time_base.tv_sec)*1000 + msec;
   if (reset && elapsed>0)
@@ -1510,7 +1510,7 @@ GThread::GThread(int stacksize)
 //      memset(maintask, 0, sizeof(GThread::cotask));
       maintask->next = maintask;
       maintask->prev = maintask;
-      gettimeofday(&time_base,NULL);
+      gettimeofday(&time_base,nullptr);
       curtask = maintask;
     }
   // allocation
diff --git a/kviewshell/plugins/djvu/libdjvu/GThreads.h b/kviewshell/plugins/djvu/libdjvu/GThreads.h
index ac83d8f8..19779323 100644
--- a/kviewshell/plugins/djvu/libdjvu/GThreads.h
+++ b/kviewshell/plugins/djvu/libdjvu/GThreads.h
@@ -440,7 +440,7 @@ inline GThread::GThread(int) {}
 inline GThread::~GThread(void) {}
 inline void GThread::terminate() {}
 inline int GThread::yield() { return 0; }
-inline void* GThread::current() { return 0; }
+inline void* GThread::current() { return nullptr; }
 inline GMonitor::GMonitor() {}
 inline GMonitor::~GMonitor() {}
 inline void GMonitor::enter() {}
diff --git a/kviewshell/plugins/djvu/libdjvu/GURL.cpp b/kviewshell/plugins/djvu/libdjvu/GURL.cpp
index 07853b55..0bdfac98 100644
--- a/kviewshell/plugins/djvu/libdjvu/GURL.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GURL.cpp
@@ -1535,7 +1535,7 @@ GURL::mkdir() const
       if (is_dir())
         retval = 0;
       else 
-        retval = CreateDirectory(A2CT(NativeFilename()), NULL);
+        retval = CreateDirectory(A2CT(NativeFilename()), nullptr);
 #else
 # error "Define something here for your operating system"
 #endif
@@ -1669,7 +1669,7 @@ GURL::expand_name(const GUTF8String &xfname, const char *from)
     int n;
     for(n=1;fname[n] && fname[n]!= slash;n++) 
       EMPTY_LOOP;
-    struct passwd *pw=0;
+    struct passwd *pw=nullptr;
     if (n!=1)
     {
       GUTF8String user(fname+1, n-1);
@@ -1845,7 +1845,7 @@ GURL::expand_name(const GUTF8String &xfname, const char *from)
           EMPTY_LOOP;
         char* back = _tcsrchr(s2,backslash);//MBCS DBCS
         if ((s>string_buffer)&&(*(s-1)!= slash)&&
-            (back == NULL || (back!=NULL && s-1 != back) ))//MBCS DBCS
+            (!back || s-1 != back))//MBCS DBCS
         {
           *s = backslash;
           s++;
@@ -1863,7 +1863,7 @@ GURL::expand_name(const GUTF8String &xfname, const char *from)
         EMPTY_LOOP;
       char* back = _tcsrchr(s2,backslash);//MBCS DBCS
       if ((s>string_buffer)&&(*(s-1)!= slash)
-          &&(back == NULL || (back!=NULL && s-1 != back) ))//MBCS DBCS
+          &&(!back || s-1 != back))//MBCS DBCS
       {
         *s = backslash;
         s++;
diff --git a/kviewshell/plugins/djvu/libdjvu/GURL.h b/kviewshell/plugins/djvu/libdjvu/GURL.h
index d353c4d1..498605bb 100644
--- a/kviewshell/plugins/djvu/libdjvu/GURL.h
+++ b/kviewshell/plugins/djvu/libdjvu/GURL.h
@@ -234,7 +234,7 @@ public:
 
       /** Appends the specified CGI argument. Will insert "#DJVUOPTS#" if
 	  necessary */
-   void		add_djvu_cgi_argument(const GUTF8String &name, const char * value=0);
+   void		add_djvu_cgi_argument(const GUTF8String &name, const char * value=nullptr);
    
       /** Returns the URL corresponding to the directory containing
 	  the document with this URL. The function basically takes the
@@ -364,7 +364,7 @@ public:
       #expand_name# is very useful for logically concatenating file names.  It
       knows which separators should be used for each operating system and it
       knows which syntactical rules apply. */
-  static GUTF8String expand_name(const GUTF8String &filename, const char *fromdirname=0);
+  static GUTF8String expand_name(const GUTF8String &filename, const char *fromdirname=nullptr);
 };
 
 class GURL::UTF8 : public GURL
diff --git a/kviewshell/plugins/djvu/libdjvu/GUnicode.cpp b/kviewshell/plugins/djvu/libdjvu/GUnicode.cpp
index ea3aba52..5bffafe5 100644
--- a/kviewshell/plugins/djvu/libdjvu/GUnicode.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GUnicode.cpp
@@ -265,8 +265,8 @@ GStringRep::Unicode::create(
 	}else
     {
       retval=((r->encoding)
-        ?create(0,0,r->encoding)
-        :create(0,0,r->encodetype));
+        ?create(nullptr,0,r->encoding)
+        :create(nullptr,0,r->encodetype));
     }
   }else
   {
@@ -377,7 +377,7 @@ GStringRep::Unicode::create(
   EncodeType t)
 {
   GP<GStringRep> gretval;
-  GStringRep *retval=0;
+  GStringRep *retval=nullptr;
   void const * const buf=checkmarks(xbuf,bufsize,t); 
   if(buf && bufsize)
   {
@@ -425,7 +425,7 @@ GStringRep::Unicode::create(
       default:
         break;
     }
-    unsigned char *utf8buf=0;
+    unsigned char *utf8buf=nullptr;
     GPBuffer<unsigned char> gutf8buf(utf8buf,maxutf8size+1);
     utf8buf[0]=0;
     if (maxutf8size)
@@ -524,7 +524,7 @@ GStringRep::Unicode::create(
     retval=(gretval=GStringRep::Unicode::create(1));
     retval->data[0]=0;
     retval->size=0;
-    retval->set_remainder(0,0,t);
+    retval->set_remainder(nullptr,0,t);
   }
   return gretval;
 }
@@ -707,7 +707,7 @@ GStringRep::Unicode::set_remainder( void const * const buf,
   if(size)
     memcpy(remainder,buf,size);
   encodetype=xencodetype;
-  encoding=0;
+  encoding=nullptr;
 }
 
 void
diff --git a/kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp b/kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp
index 51a491ab..c40e1bf0 100644
--- a/kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp
@@ -81,7 +81,7 @@ namespace DJVU {
 
 // Constructor
 IFFByteStream::IFFByteStream(const GP<ByteStream> &xbs,const int xpos)
-: ByteStream::Wrapper(xbs), has_magic(false), ctx(0), dir(0)
+: ByteStream::Wrapper(xbs), has_magic(false), ctx(nullptr), dir(0)
 {
   offset = seekto = xpos;
 }
@@ -144,12 +144,12 @@ IFFByteStream::check_id(const char *id)
     if (id[i]<0x20 || id[i]>0x7e)
       return -1;
   // check composite chunks
-  static const char *szComposite[] = { "FORM", "LIST", "PROP", "CAT ", 0 };
+  static const char *szComposite[] = { "FORM", "LIST", "PROP", "CAT ", nullptr };
   for (i=0; szComposite[i]; i++) 
     if (!memcmp(id, szComposite[i], 4))
       return 1;
   // check reserved chunks
-  static const char *szReserved[] = { "FOR", "LIS", "CAT", 0 };
+  static const char *szReserved[] = { "FOR", "LIS", "CAT", nullptr };
   for (i=0; szReserved[i]; i++) 
     if (!memcmp(id, szReserved[i], 3) && id[3]>='1' && id[3]<='9')
       return -1;
@@ -400,7 +400,7 @@ IFFByteStream::close_chunk()
   // Remove ctx record
   IFFContext *octx = ctx;
   ctx = octx->next;
-  assert(ctx==0 || ctx->bComposite);
+  assert(ctx==nullptr || ctx->bComposite);
   delete octx;
 }
 
diff --git a/kviewshell/plugins/djvu/libdjvu/IFFByteStream.h b/kviewshell/plugins/djvu/libdjvu/IFFByteStream.h
index 291e86fe..8cb15bb4 100644
--- a/kviewshell/plugins/djvu/libdjvu/IFFByteStream.h
+++ b/kviewshell/plugins/djvu/libdjvu/IFFByteStream.h
@@ -203,7 +203,7 @@ public:
       and #rawsizeptr#. These variables will be overwritten with the offset
       and the length of the file segment containing both the chunk header and
       the chunk data. */
-  int get_chunk(GUTF8String &chkid, int *rawoffsetptr=0, int *rawsizeptr=0);
+  int get_chunk(GUTF8String &chkid, int *rawoffsetptr=nullptr, int *rawsizeptr=nullptr);
   /** Enters a chunk for writing.  Function #put_chunk# prepares a chunk
       header and positions the IFFByteStream at the beginning of the chunk
       data.  Argument #chkid# defines a extended chunk identifier for this
diff --git a/kviewshell/plugins/djvu/libdjvu/IW44EncodeCodec.cpp b/kviewshell/plugins/djvu/libdjvu/IW44EncodeCodec.cpp
index 57b2a10a..b92241d8 100644
--- a/kviewshell/plugins/djvu/libdjvu/IW44EncodeCodec.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/IW44EncodeCodec.cpp
@@ -161,7 +161,7 @@ public:
       performs the wavelet decomposition of image #bm# and records the
       corresponding wavelet coefficient.  Argument #mask# is an optional
       bilevel image specifying the masked pixels (see \Ref{IW44Image.h}). */
-  void init(const GBitmap &bm, const GP<GBitmap> mask=0);
+  void init(const GBitmap &bm, const GP<GBitmap> mask=nullptr);
   // CODER
   /** Encodes one data chunk into ByteStream #bs#.  Parameter #parms# controls
       how much data is generated.  The chunk data is written to ByteStream
@@ -214,7 +214,7 @@ public:
       bilevel image specifying the masked pixels (see \Ref{IW44Image.h}).
       Argument #crcbmode# specifies how the chrominance information should be
       encoded (see \Ref{CRCBMode}). */
-  void init(const GPixmap &bm, const GP<GBitmap> mask=0, CRCBMode crcbmode=CRCBnormal);
+  void init(const GPixmap &bm, const GP<GBitmap> mask=nullptr, CRCBMode crcbmode=CRCBnormal);
   // CODER
   /** Encodes one data chunk into ByteStream #bs#.  Parameter #parms# controls
       how much data is generated.  The chunk data is written to ByteStream
@@ -242,7 +242,7 @@ public:
   Encode(const int w, const int h) : Map(w,h) {}
   // creation (from image)
   void create(const signed char *img8, int imgrowsize, 
-              const signed char *msk8=0, int mskrowsize=0);
+              const signed char *msk8=nullptr, int mskrowsize=0);
   // slash resolution
   void slashres(int res);
 };
@@ -463,8 +463,8 @@ filter_fv(short *p, int w, int h, int rowsize, int scale)
         else if (y>=3)
           {
             // Special cases
-            short *q1 = (y-2<h ? q+s : 0);
-            short *q3 = (y<h ? q+s3 : 0);
+            short *q1 = (y-2<h ? q+s : nullptr);
+            short *q3 = (y<h ? q+s3 : nullptr);
             if (y>=6)
               {
                 while (q<e)
@@ -1387,7 +1387,7 @@ IW44Image::create_encode(const ImageType itype)
   case GRAY:
     return new IWBitmap::Encode();
   default:
-    return 0;
+    return nullptr;
   }
 }
 
@@ -1402,7 +1402,7 @@ IW44Image::create_encode(const GBitmap &bm, const GP<GBitmap> mask)
 
 
 IWBitmap::Encode::Encode(void)
-: IWBitmap(), ycodec_enc(0)
+: IWBitmap(), ycodec_enc(nullptr)
 {}
 
 IWBitmap::Encode::~Encode()
@@ -1416,7 +1416,7 @@ IWBitmap::Encode::init(const GBitmap &bm, const GP<GBitmap> gmask)
   // Free
   close_codec();
   delete ymap;
-  ymap = 0;
+  ymap = nullptr;
   // Init
   int i, j;
   int w = bm.columns();
@@ -1430,7 +1430,7 @@ IWBitmap::Encode::init(const GBitmap &bm, const GP<GBitmap> gmask)
     bconv[i] = max(0,min(255,i*255/g)) - 128;
   // Perform decomposition
   // Prepare mask information
-  const signed char *msk8 = 0;
+  const signed char *msk8 = nullptr;
   int mskrowsize = 0;
   GBitmap *mask=gmask;
   if (gmask)
@@ -1456,7 +1456,7 @@ void
 IWBitmap::Encode::close_codec(void)
 {
   delete ycodec_enc;
-  ycodec_enc = 0;
+  ycodec_enc = nullptr;
   IWBitmap::close_codec();
 }
 
@@ -1564,7 +1564,7 @@ IW44Image::create_encode(
 }
 
 IWPixmap::Encode::Encode(void)
-: IWPixmap(), ycodec_enc(0), cbcodec_enc(0), crcodec_enc(0)
+: IWPixmap(), ycodec_enc(nullptr), cbcodec_enc(nullptr), crcodec_enc(nullptr)
 {}
 
 IWPixmap::Encode::~Encode()
@@ -1580,7 +1580,7 @@ IWPixmap::Encode::init(const GPixmap &pm, const GP<GBitmap> gmask, CRCBMode crcb
   delete ymap;
   delete cbmap;
   delete crmap;
-  ymap = cbmap = crmap = 0;
+  ymap = cbmap = crmap = nullptr;
   /* Create */
   int w = pm.columns();
   int h = pm.rows();
@@ -1598,7 +1598,7 @@ IWPixmap::Encode::init(const GPixmap &pm, const GP<GBitmap> gmask, CRCBMode crcb
     case CRCBfull:   crcb_half=0; crcb_delay= 0; break;
     }
   // Prepare mask information
-  const signed char *msk8 = 0;
+  const signed char *msk8 = nullptr;
   int mskrowsize = 0;
   GBitmap *mask=gmask;
   if (mask)
@@ -1668,7 +1668,7 @@ IWPixmap::Encode::close_codec(void)
   delete ycodec_enc;
   delete cbcodec_enc;
   delete crcodec_enc;
-  ycodec_enc = crcodec_enc = cbcodec_enc = 0;
+  ycodec_enc = crcodec_enc = cbcodec_enc = nullptr;
   IWPixmap::close_codec();
 }
 
diff --git a/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp b/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp
index d2e94a1f..2b1c791b 100644
--- a/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp
@@ -282,8 +282,8 @@ filter_bv(short *p, int w, int h, int rowsize, int scale)
         else if (y<h)
           {
             // Special cases
-            short *q1 = (y+1<h ? q+s : 0);
-            short *q3 = (y+3<h ? q+s3 : 0);
+            short *q1 = (y+1<h ? q+s : nullptr);
+            short *q3 = (y+3<h ? q+s3 : nullptr);
             if (y>=3)
               {
                 while (q<e)
@@ -555,14 +555,14 @@ struct IW44Image::Alloc // DJVU_CLASS
 
 IW44Image::Block::Block(void)
 {
-  pdata[0] = pdata[1] = pdata[2] = pdata[3] = 0;
+  pdata[0] = pdata[1] = pdata[2] = pdata[3] = nullptr;
 }
 
 void 
 IW44Image::Block::zero(int n)
 {
   if (pdata[n>>4])
-    pdata[n>>4][n&15] = 0;
+    pdata[n>>4][n&15] = nullptr;
 }
 
 void  
@@ -585,7 +585,7 @@ IW44Image::Block::write_liftblock(short *coeff, int bmin, int bmax) const
   for (int n1=bmin; n1<bmax; n1++)
     {
       const short *d = data(n1);
-      if (d == 0)
+      if (!d)
         n += 16;
       else
         for (int n2=0; n2<16; n2++,n++)
@@ -598,7 +598,7 @@ IW44Image::Block::write_liftblock(short *coeff, int bmin, int bmax) const
 
 
 IW44Image::Map::Map(int w, int h)
-  :  blocks(0), iw(w), ih(h), chain(0)
+  :  blocks(nullptr), iw(w), ih(h), chain(nullptr)
 {
   bw = (w+0x20-1) & ~0x1f;
   bh = (h+0x20-1) & ~0x1f;
@@ -1325,7 +1325,7 @@ IW44Image::TertiaryHeader::decode(GP<ByteStream> gbs, int major, int minor)
 
 IW44Image::IW44Image(void)
   : db_frac(1.0),
-    ymap(0), cbmap(0), crmap(0),
+    ymap(nullptr), cbmap(nullptr), crmap(nullptr),
     cslice(0), cserial(0), cbytes(0)
 {}
 
@@ -1346,7 +1346,7 @@ IW44Image::create_decode(const ImageType itype)
   case GRAY:
     return new IWBitmap();
   default:
-    return 0;
+    return nullptr;
   }
 }
 
@@ -1368,7 +1368,7 @@ void
 IWBitmap::close_codec(void)
 {
   delete ycodec;
-  ycodec = 0;
+  ycodec = nullptr;
   cslice = cbytes = cserial = 0;
 }
 
@@ -1378,7 +1378,7 @@ IWPixmap::close_codec(void)
   delete ycodec;
   delete cbcodec;
   delete crcodec;
-  ycodec = crcodec = cbcodec = 0;
+  ycodec = crcodec = cbcodec = nullptr;
   cslice = cbytes = cserial = 0;
 }
 
@@ -1400,7 +1400,7 @@ IW44Image::get_height(void) const
 //////////////////////////////////////////////////////
 
 IWBitmap::IWBitmap(void )
-: IW44Image(), ycodec(0)
+: IW44Image(), ycodec(nullptr)
 {}
 
 IWBitmap::~IWBitmap()
@@ -1435,8 +1435,8 @@ GP<GBitmap>
 IWBitmap::get_bitmap(void)
 {
   // Check presence of data
-  if (ymap == 0)
-    return 0;
+  if (!ymap)
+    return nullptr;
   // Perform wavelet reconstruction
   int w = ymap->iw;
   int h = ymap->ih;
@@ -1458,8 +1458,8 @@ IWBitmap::get_bitmap(void)
 GP<GBitmap>
 IWBitmap::get_bitmap(int subsample, const GRect &rect)
 {
-  if (ymap == 0)
-    return 0;
+  if (!ymap)
+    return nullptr;
   // Allocate bitmap
   int w = rect.width();
   int h = rect.height();
@@ -1486,7 +1486,7 @@ IWBitmap::decode_chunk(GP<ByteStream> gbs)
   {
     cslice = cserial = 0;
     delete ymap;
-    ymap = 0;
+    ymap = nullptr;
   }
   // Read primary header
   struct IW44Image::PrimaryHeader primary;
@@ -1591,7 +1591,7 @@ IWEncoderParms::IWEncoderParms(void)
 
 
 IWPixmap::IWPixmap(void)
-: IW44Image(), crcb_delay(10), crcb_half(0), ycodec(0), cbcodec(0), crcodec(0)
+: IW44Image(), crcb_delay(10), crcb_half(0), ycodec(nullptr), cbcodec(nullptr), crcodec(nullptr)
 {}
 
 IWPixmap::~IWPixmap()
@@ -1640,8 +1640,8 @@ GP<GPixmap>
 IWPixmap::get_pixmap(void)
 {
   // Check presence of data
-  if (ymap == 0)
-    return 0;
+  if (!ymap)
+    return nullptr;
   // Allocate pixmap
   int w = ymap->iw;
   int h = ymap->ih;
@@ -1680,8 +1680,8 @@ IWPixmap::get_pixmap(void)
 GP<GPixmap>
 IWPixmap::get_pixmap(int subsample, const GRect &rect)
 {
-  if (ymap == 0)
-    return 0;
+  if (!ymap)
+    return nullptr;
   // Allocate
   int w = rect.width();
   int h = rect.height();
@@ -1724,7 +1724,7 @@ IWPixmap::decode_chunk(GP<ByteStream> gbs)
   {
       cslice = cserial = 0;
       delete ymap;
-      ymap = 0;
+      ymap = nullptr;
   }
 
   // Read primary header
diff --git a/kviewshell/plugins/djvu/libdjvu/IW44Image.h b/kviewshell/plugins/djvu/libdjvu/IW44Image.h
index 817c1e5d..980d37ef 100644
--- a/kviewshell/plugins/djvu/libdjvu/IW44Image.h
+++ b/kviewshell/plugins/djvu/libdjvu/IW44Image.h
@@ -278,14 +278,14 @@ public:
       performs the wavelet decomposition of image #bm# and records the
       corresponding wavelet coefficient.  Argument #mask# is an optional
       bilevel image specifying the masked pixels (see \Ref{IW44Image.h}). */
-  static GP<IW44Image> create_encode(const GBitmap &bm, const GP<GBitmap> mask=0);
+  static GP<IW44Image> create_encode(const GBitmap &bm, const GP<GBitmap> mask=nullptr);
   /** Initializes an IWPixmap with color image #bm#.  This constructor
       performs the wavelet decomposition of image #bm# and records the
       corresponding wavelet coefficient.  Argument #mask# is an optional
       bilevel image specifying the masked pixels (see \Ref{IW44Image.h}).
       Argument #crcbmode# specifies how the chrominance information should be
       encoded (see \Ref{CRCBMode}). */
-  static GP<IW44Image> create_encode(const GPixmap &bm, const GP<GBitmap> mask=0, CRCBMode crcbmode=CRCBnormal);
+  static GP<IW44Image> create_encode(const GPixmap &bm, const GP<GBitmap> mask=nullptr, CRCBMode crcbmode=CRCBnormal);
   // ACCESS
   /** Returns the width of the IWBitmap image. */
   int get_width(void) const;
@@ -293,22 +293,22 @@ public:
   int get_height(void) const;
   /** Reconstructs the complete image.  The reconstructed image
       is then returned as a GBitmap object. */
-  virtual GP<GBitmap> get_bitmap(void) {return 0;}
+  virtual GP<GBitmap> get_bitmap(void) {return nullptr;}
   /** Reconstructs a segment of the image at a given scale.  The subsampling
       ratio #subsample# must be a power of two between #1# and #32#.  Argument
       #rect# specifies which segment of the subsampled image should be
       reconstructed.  The reconstructed image is returned as a GBitmap object
       whose size is equal to the size of the rectangle #rect#. */
-  virtual GP<GBitmap> get_bitmap(int subsample, const GRect &rect) {return 0;}
+  virtual GP<GBitmap> get_bitmap(int subsample, const GRect &rect) {return nullptr;}
   /** Reconstructs the complete image.  The reconstructed image
       is then returned as a GPixmap object. */
-  virtual GP<GPixmap> get_pixmap(void) {return 0;}
+  virtual GP<GPixmap> get_pixmap(void) {return nullptr;}
   /** Reconstructs a segment of the image at a given scale.  The subsampling
       ratio #subsample# must be a power of two between #1# and #32#.  Argument
       #rect# specifies which segment of the subsampled image should be
       reconstructed.  The reconstructed image is returned as a GPixmap object
       whose size is equal to the size of the rectangle #rect#. */
-  virtual GP<GPixmap> get_pixmap(int subsample, const GRect &rect) {return 0;}
+  virtual GP<GPixmap> get_pixmap(int subsample, const GRect &rect) {return nullptr;}
   /** Returns the amount of memory used by the wavelet coefficients.  This
       amount of memory is expressed in bytes. */
   virtual unsigned int get_memory_usage(void) const = 0;
@@ -713,7 +713,7 @@ inline const short*
 IW44Image::Block::data(int n) const
 {
   if (! pdata[n>>4])
-    return 0;
+    return nullptr;
   return pdata[n>>4][n&15];
 }
 
diff --git a/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp b/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp
index 8491e760..d504d223 100644
--- a/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp
@@ -365,13 +365,13 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Dict> &gjim)
       // Code headers.
       int rectype = REQUIRED_DICT_OR_RESET;
       if (jim.get_inherited_shape_count() > 0)
-        code_record(rectype, gjim, 0);
+        code_record(rectype, gjim, nullptr);
       rectype = START_OF_DATA;
-      code_record(rectype, gjim, 0);
+      code_record(rectype, gjim, nullptr);
       // Code Comment.
       rectype = PRESERVED_COMMENT;
       if (!! jim.comment)
-        code_record(rectype, gjim, 0);
+        code_record(rectype, gjim, nullptr);
       // Encode every shape
       int shapeno;
       DJVU_PROGRESS_TASK(jb2code,"jb2 encode", nshape-firstshape);
@@ -388,13 +388,13 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Dict> &gjim)
 	  if (cur_ncell > CELLCHUNK) 
 	    {
 	      rectype = REQUIRED_DICT_OR_RESET;
-	      code_record(rectype, 0, 0);	      
+	      code_record(rectype, nullptr, nullptr);
 	    }
         }
       // Code end of data record
       rectype = END_OF_DATA;
-      code_record(rectype, gjim, 0); 
-      gzp=0;
+      code_record(rectype, gjim, nullptr);
+      gzp=nullptr;
 }
 
 // CODE JB2IMAGE
@@ -441,13 +441,13 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Image> &gjim)
       // Code headers.
       int rectype = REQUIRED_DICT_OR_RESET;
       if (jim.get_inherited_shape_count() > 0)
-        code_record(rectype, gjim, 0, 0);
+        code_record(rectype, gjim, nullptr, nullptr);
       rectype = START_OF_DATA;
-      code_record(rectype, gjim, 0, 0);
+      code_record(rectype, gjim, nullptr, nullptr);
       // Code Comment.
       rectype = PRESERVED_COMMENT;
       if (!! jim.comment)
-        code_record(rectype, gjim, 0, 0);
+        code_record(rectype, gjim, nullptr, nullptr);
       // Encode every blit
       int blitno;
       DJVU_PROGRESS_TASK(jb2code,"jb2 encode", nblit);
@@ -461,7 +461,7 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Image> &gjim)
           if (shape2lib[shapeno] >= 0)
             {
               int rectype = MATCHED_COPY;
-              code_record(rectype, gjim, 0, jblt);
+              code_record(rectype, gjim, nullptr, jblt);
             }
           // Avoid coding null shapes/blits
           else if (jshp.bits) 
@@ -507,13 +507,13 @@ JB2Dict::JB2Codec::Encode::code(const GP<JB2Image> &gjim)
 	  if (cur_ncell > CELLCHUNK) 
 	    {
 	      rectype = REQUIRED_DICT_OR_RESET;
-	      code_record(rectype, 0, 0);
+	      code_record(rectype, nullptr, nullptr);
 	    }
         }
       // Code end of data record
       rectype = END_OF_DATA;
-      code_record(rectype, gjim, 0, 0); 
-      gzp=0;
+      code_record(rectype, gjim, nullptr, nullptr);
+      gzp=nullptr;
 }
 
 ////////////////////////////////////////
@@ -539,14 +539,14 @@ JB2Dict::JB2Codec::Encode::encode_libonly_shape(
       // Code library entry
       int rectype=(jshp.parent >= 0)
             ?NEW_MARK_LIBRARY_ONLY:MATCHED_REFINE_LIBRARY_ONLY;
-      code_record(rectype, gjim, &jshp, 0);      
+      code_record(rectype, gjim, &jshp, nullptr);
       // Add shape to library
       add_library(shapeno, jshp);
       // Check numcoder status
       if (cur_ncell > CELLCHUNK) 
 	{
 	  rectype = REQUIRED_DICT_OR_RESET;
-	  code_record(rectype, 0, 0);
+	  code_record(rectype, nullptr, nullptr);
 	}
     }
 }
diff --git a/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp b/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp
index 2d1bd218..fec0155c 100644
--- a/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp
@@ -143,7 +143,7 @@ void
 JB2Dict::init()
 {
   inherited_shapes = 0;
-  inherited_dict = 0;
+  inherited_dict = nullptr;
   shapes.empty();
 }
 
@@ -370,7 +370,7 @@ static const int CELLEXTRA =   500;
 // CONSTRUCTOR
 
 JB2Dict::JB2Codec::Decode::Decode(void)
-: JB2Dict::JB2Codec(0), cbfunc(0), cbarg(0) {}
+: JB2Dict::JB2Codec(0), cbfunc(nullptr), cbarg(nullptr) {}
 
 void
 JB2Dict::JB2Codec::Decode::init(const GP<ByteStream> &gbs)
diff --git a/kviewshell/plugins/djvu/libdjvu/JB2Image.h b/kviewshell/plugins/djvu/libdjvu/JB2Image.h
index 4619445e..f6e545ca 100644
--- a/kviewshell/plugins/djvu/libdjvu/JB2Image.h
+++ b/kviewshell/plugins/djvu/libdjvu/JB2Image.h
@@ -313,7 +313,7 @@ public:
       and must return a suitable dictionary which will be installed as the
       inherited dictionary.  The callback should return null if no such
       dictionary is found. */
-  void decode(const GP<ByteStream> &gbs, JB2DecoderCallback *cb=0, void *arg=0);
+  void decode(const GP<ByteStream> &gbs, JB2DecoderCallback *cb=nullptr, void *arg=nullptr);
 
   
 public:
@@ -418,7 +418,7 @@ public:
       and must return a suitable dictionary which will be installed as the
       inherited dictionary.  The callback should return null if no such
       dictionary is found. */
-  void decode(const GP<ByteStream> &gbs, JB2DecoderCallback *cb=0, void *arg=0);
+  void decode(const GP<ByteStream> &gbs, JB2DecoderCallback *cb=nullptr, void *arg=nullptr);
   
 private:
   // Implementation
diff --git a/kviewshell/plugins/djvu/libdjvu/JPEGDecoder.cpp b/kviewshell/plugins/djvu/libdjvu/JPEGDecoder.cpp
index 82ec93f0..9bbb2e73 100644
--- a/kviewshell/plugins/djvu/libdjvu/JPEGDecoder.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/JPEGDecoder.cpp
@@ -309,7 +309,7 @@ JPEGDecoder::Impl::jpeg_byte_stream_src(j_decompress_ptr cinfo,ByteStream &bs)
 {
   byte_stream_src_ptr src;
 
-  if (cinfo->src == NULL)
+  if (!cinfo->src)
   { /* first time for this JPEG object? */
     cinfo->src = (struct jpeg_source_mgr *)      
       (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
@@ -328,7 +328,7 @@ JPEGDecoder::Impl::jpeg_byte_stream_src(j_decompress_ptr cinfo,ByteStream &bs)
   src->pub.term_source = term_source;
   src->byteStream = &bs;
   src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
-  src->pub.next_input_byte = NULL; /* until buffer loaded */
+  src->pub.next_input_byte = nullptr; /* until buffer loaded */
 }
 
 #ifdef LIBJPEGNAME
diff --git a/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp b/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp
index 3dced77a..dcbb2ef2 100644
--- a/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp
@@ -571,7 +571,7 @@ MMRDecoder::scanruns(const unsigned short **endptr)
 {
   // Check if all lines have been returned
   if (lineno >= height)
-    return 0;
+    return nullptr;
   // Check end of stripe
   if ( striplineno == rowsperstrip )
     {
@@ -674,7 +674,7 @@ MMRDecoder::scanruns(const unsigned short **endptr)
             if ((m & 0xffffff00) == 0x00100100)
               {
                 lineno = height;
-                return 0;
+                return nullptr;
               }
             // -- Could be UNCOMPRESSED ``0000001111''
             //    TIFF6 says people should not do this.
@@ -793,7 +793,7 @@ MMRDecoder::scanrle(const bool invert, const unsigned char **endptr)
 {
   // Obtain run lengths
   const unsigned short *xr = scanruns();
-  if (!xr) return 0;
+  if (!xr) return nullptr;
   unsigned char *p=line;
   // Process inversion
   if (invert)
diff --git a/kviewshell/plugins/djvu/libdjvu/MMRDecoder.h b/kviewshell/plugins/djvu/libdjvu/MMRDecoder.h
index 633c1258..209bc298 100644
--- a/kviewshell/plugins/djvu/libdjvu/MMRDecoder.h
+++ b/kviewshell/plugins/djvu/libdjvu/MMRDecoder.h
@@ -180,7 +180,7 @@ public:
       two zeroes.  The position of these two zeroes is stored in the pointer
       specified by the optional argument #endptr#.  The buffer data should be
       processed before calling this function again. */
-  const unsigned short *scanruns(const unsigned short **endptr=0);
+  const unsigned short *scanruns(const unsigned short **endptr=nullptr);
   /** Decodes a scanline and returns a pointer to RLE encoded data.  The
       buffer contains the length of the runs for the current line encoded as
       described in \Ref{PNM and RLE file formats}.)  The flag #invert# can be
@@ -190,7 +190,7 @@ public:
       buffer data should be processed before calling this function again. This
       is implemented by calling \Ref{MMRDecoder::scanruns}. */
   const unsigned char  *scanrle(const bool invert, 
-                                const unsigned char **endptr=0);
+                                const unsigned char **endptr=nullptr);
 #if 0
   /** Decodes a scanline and returns a pointer to an array of #0# or #1# bytes.
       Returns a pointer to the scanline buffer containing one byte per pixel. 
diff --git a/kviewshell/plugins/djvu/libdjvu/UnicodeByteStream.cpp b/kviewshell/plugins/djvu/libdjvu/UnicodeByteStream.cpp
index a2affc02..5658ae36 100644
--- a/kviewshell/plugins/djvu/libdjvu/UnicodeByteStream.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/UnicodeByteStream.cpp
@@ -81,7 +81,7 @@ UnicodeByteStream::UnicodeByteStream(
   GP<ByteStream> ibs,const GStringRep::EncodeType et)
 : bs(ibs), bufferpos(0), linesread(0)
 {
-  buffer=GUTF8String::create(0,0,et);
+  buffer=GUTF8String::create(nullptr,0,et);
   startpos=bs->tell();
 }
 
@@ -103,7 +103,7 @@ UnicodeByteStream::set_encodetype(const GStringRep::EncodeType et)
 {
   seek(startpos,SEEK_SET);
   bufferpos=0;
-  buffer=GUTF8String::create(0,0,et);
+  buffer=GUTF8String::create(nullptr,0,et);
 }
 
 void
@@ -111,7 +111,7 @@ UnicodeByteStream::set_encoding(const GUTF8String &xencoding)
 {
   seek(startpos,SEEK_SET);
   bufferpos=0;
-  buffer=GUTF8String::create(0,0,xencoding);
+  buffer=GUTF8String::create(nullptr,0,xencoding);
 }
 
 size_t
@@ -125,7 +125,7 @@ UnicodeByteStream::read(void *buf, size_t size)
       (unsigned char const *)buf,retval,buffer.get_remainder());
   }else
   {
-    buffer=GUTF8String::create(0,0,buffer.get_remainder());
+    buffer=GUTF8String::create(nullptr,0,buffer.get_remainder());
   }
   return retval;
 }
@@ -134,7 +134,7 @@ size_t
 UnicodeByteStream::write(const void *buf, size_t size)
 {
   bufferpos=0;
-  buffer=GUTF8String::create(0,0,buffer.get_remainder());
+  buffer=GUTF8String::create(nullptr,0,buffer.get_remainder());
   return bs->write(buf,size);
 }
 
@@ -159,7 +159,7 @@ UnicodeByteStream::seek
 {
   int retval=bs->seek(offset,whence,nothrow);
   bufferpos=0;
-  buffer=GUTF8String::create(0,0,buffer.get_remainder());
+  buffer=GUTF8String::create(nullptr,0,buffer.get_remainder());
   return retval;
 }
 
@@ -168,7 +168,7 @@ UnicodeByteStream::flush(void)
 {
   bs->flush();
   bufferpos=0;
-  buffer=GUTF8String::create(0,0,buffer.get_remainder());
+  buffer=GUTF8String::create(nullptr,0,buffer.get_remainder());
 }
 
 
@@ -264,13 +264,13 @@ XMLByteStream::init(void)
         }
         case 0xFEFF:
         {
-          buffer=GUTF8String::create(0,0,GStringRep::XUCS4BE);
+          buffer=GUTF8String::create(nullptr,0,GStringRep::XUCS4BE);
           startpos+=sizeof(buf);
           break;
         }
         case 0xFFFE:
         {
-          buffer=GUTF8String::create(0,0,GStringRep::XUCS4_2143);
+          buffer=GUTF8String::create(nullptr,0,GStringRep::XUCS4_2143);
           startpos+=sizeof(buf);
           break;
         }
diff --git a/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp b/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp
index 26910f34..b4f75ade 100644
--- a/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp
@@ -153,12 +153,12 @@ OCRcallback(
   void * const xarg,
   lt_XMLParser::mapOCRcallback * const xcallback,
   const GUTF8String &value=GUTF8String(),
-  const GP<DjVuImage> &image=0 );
+  const GP<DjVuImage> &image=nullptr );
 
 static inline GP<ByteStream>
 OCRcallback(const GUTF8String &value, const GP<DjVuImage> &image)
 {
-  return OCRcallback(0,0,value,image);
+  return OCRcallback(nullptr,nullptr,value,image);
 }
 
 lt_XMLParser::lt_XMLParser() {}
@@ -1096,8 +1096,8 @@ OCRcallback(
   const GP<DjVuImage> &image )
 {
   GP<ByteStream> retval;
-  static void *arg=0;
-  static lt_XMLParser::mapOCRcallback *callback=0;
+  static void *arg=nullptr;
+  static lt_XMLParser::mapOCRcallback *callback=nullptr;
   if(image)
   {
     if(callback)
-- 
cgit v1.2.3

