[poppler] 9 commits - fofi/FoFiBase.cc fofi/FoFiBase.h fofi/FoFiTrueType.cc fofi/FoFiTrueType.h fofi/FoFiType1.cc fofi/FoFiType1C.cc fofi/FoFiType1C.h fofi/FoFiType1.h poppler/Annot.cc poppler/CharCodeToUnicode.cc poppler/Decrypt.cc poppler/Form.cc poppler/Form.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Sep 22 23:23:04 UTC 2018


 fofi/FoFiBase.cc             |    8 ++++----
 fofi/FoFiBase.h              |    7 +++----
 fofi/FoFiTrueType.cc         |   20 ++++++++++----------
 fofi/FoFiTrueType.h          |   20 ++++++++++----------
 fofi/FoFiType1.cc            |    8 ++++----
 fofi/FoFiType1.h             |   16 +++++++++++++++-
 fofi/FoFiType1C.cc           |    6 +++---
 fofi/FoFiType1C.h            |    6 +++---
 poppler/Annot.cc             |    4 ++--
 poppler/CharCodeToUnicode.cc |   11 ++++-------
 poppler/Decrypt.cc           |    4 ++--
 poppler/Form.cc              |   12 ++++++------
 poppler/Form.h               |    8 ++++----
 13 files changed, 70 insertions(+), 60 deletions(-)

New commits:
commit e67e88b393778d81a0ab50aa1faf2b598db98749
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Sep 23 01:22:32 2018 +0200

    FoFiTrueType: some more const

diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc
index 0501615f..9b25bb60 100644
--- a/fofi/FoFiTrueType.cc
+++ b/fofi/FoFiTrueType.cc
@@ -518,7 +518,7 @@ void FoFiTrueType::getFontMatrix(double *mat) {
   delete ff;
 }
 
-void FoFiTrueType::convertToType42(char *psName, char **encoding,
+void FoFiTrueType::convertToType42(const char *psName, char **encoding,
 				   int *codeToGID,
 				   FoFiOutputFunc outputFunc,
 				   void *outputStream) {
@@ -559,7 +559,7 @@ void FoFiTrueType::convertToType42(char *psName, char **encoding,
   (*outputFunc)(outputStream, "FontName currentdict end definefont pop\n", 40);
 }
 
-void FoFiTrueType::convertToType1(char *psName, const char **newEncoding,
+void FoFiTrueType::convertToType1(const char *psName, const char **newEncoding,
 				  GBool ascii, FoFiOutputFunc outputFunc,
 				  void *outputStream) {
   char *start;
@@ -576,7 +576,7 @@ void FoFiTrueType::convertToType1(char *psName, const char **newEncoding,
   delete ff;
 }
 
-void FoFiTrueType::convertToCIDType2(char *psName,
+void FoFiTrueType::convertToCIDType2(const char *psName,
 				     int *cidMap, int nCIDs,
 				     GBool needVerticalMetrics,
 				     FoFiOutputFunc outputFunc,
@@ -706,7 +706,7 @@ void FoFiTrueType::convertToCIDType2(char *psName,
 		56);
 }
 
-void FoFiTrueType::convertToCIDType0(char *psName, int *cidMap, int nCIDs,
+void FoFiTrueType::convertToCIDType0(const char *psName, int *cidMap, int nCIDs,
 				     FoFiOutputFunc outputFunc,
 				     void *outputStream) {
   char *start;
@@ -723,7 +723,7 @@ void FoFiTrueType::convertToCIDType0(char *psName, int *cidMap, int nCIDs,
   delete ff;
 }
 
-void FoFiTrueType::convertToType0(char *psName, int *cidMap, int nCIDs,
+void FoFiTrueType::convertToType0(const char *psName, int *cidMap, int nCIDs,
 				  GBool needVerticalMetrics,
 				  int *maxValidGlyph,
 				  FoFiOutputFunc outputFunc,
@@ -838,7 +838,7 @@ void FoFiTrueType::convertToType0(char *psName, int *cidMap, int nCIDs,
   (*outputFunc)(outputStream, "FontName currentdict end definefont pop\n", 40);
 }
 
-void FoFiTrueType::convertToType0(char *psName, int *cidMap, int nCIDs,
+void FoFiTrueType::convertToType0(const char *psName, int *cidMap, int nCIDs,
 				  FoFiOutputFunc outputFunc,
 				  void *outputStream) {
   char *start;
diff --git a/fofi/FoFiTrueType.h b/fofi/FoFiTrueType.h
index 02d611d2..269880da 100644
--- a/fofi/FoFiTrueType.h
+++ b/fofi/FoFiTrueType.h
@@ -111,7 +111,7 @@ public:
   // If <encoding> is NULL, the encoding is unknown or undefined.  The
   // <codeToGID> array specifies the mapping from char codes to GIDs.
   // (Not useful for OpenType CFF fonts.)
-  void convertToType42(char *psName, char **encoding,
+  void convertToType42(const char *psName, char **encoding,
 		       int *codeToGID,
 		       FoFiOutputFunc outputFunc, void *outputStream);
 
@@ -122,7 +122,7 @@ public:
   // otherwise it will be left as binary data.  If <psName> is
   // non-NULL, it will be used as the PostScript font name.  (Only
   // useful for OpenType CFF fonts.)
-  void convertToType1(char *psName, const char **newEncoding, GBool ascii,
+  void convertToType1(const char *psName, const char **newEncoding, GBool ascii,
 		      FoFiOutputFunc outputFunc, void *outputStream);
 
   // Convert to a Type 2 CIDFont, suitable for embedding in a
@@ -130,14 +130,14 @@ public:
   // name (so we don't need to depend on the 'name' table in the
   // font).  The <cidMap> array maps CIDs to GIDs; it has <nCIDs>
   // entries.  (Not useful for OpenType CFF fonts.)
-  void convertToCIDType2(char *psName, int *cidMap, int nCIDs,
+  void convertToCIDType2(const char *psName, int *cidMap, int nCIDs,
 			 GBool needVerticalMetrics,
 			 FoFiOutputFunc outputFunc, void *outputStream);
 
   // Convert to a Type 0 CIDFont, suitable for embedding in a
   // PostScript file.  <psName> will be used as the PostScript font
   // name.  (Only useful for OpenType CFF fonts.)
-  void convertToCIDType0(char *psName, int *cidMap, int nCIDs,
+  void convertToCIDType0(const char *psName, int *cidMap, int nCIDs,
 			 FoFiOutputFunc outputFunc, void *outputStream);
 
   // Convert to a Type 0 (but non-CID) composite font, suitable for
@@ -145,7 +145,7 @@ public:
   // PostScript font name (so we don't need to depend on the 'name'
   // table in the font).  The <cidMap> array maps CIDs to GIDs; it has
   // <nCIDs> entries.  (Not useful for OpenType CFF fonts.)
-  void convertToType0(char *psName, int *cidMap, int nCIDs,
+  void convertToType0(const char *psName, int *cidMap, int nCIDs,
 		      GBool needVerticalMetrics,
 		      int *maxValidGlyph,
 		      FoFiOutputFunc outputFunc, void *outputStream);
@@ -153,7 +153,7 @@ public:
   // Convert to a Type 0 (but non-CID) composite font, suitable for
   // embedding in a PostScript file.  <psName> will be used as the
   // PostScript font name.  (Only useful for OpenType CFF fonts.)
-  void convertToType0(char *psName, int *cidMap, int nCIDs,
+  void convertToType0(const char *psName, int *cidMap, int nCIDs,
 		      FoFiOutputFunc outputFunc, void *outputStream);
 
   // Returns a pointer to the CFF font embedded in this OpenType font.
commit f4800bffe2756a64cba03cb1a017bfacad63fdb0
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Sep 23 01:21:55 2018 +0200

    FoFiType1C: Some more const

diff --git a/fofi/FoFiType1C.cc b/fofi/FoFiType1C.cc
index 1cfc4746..8b632c44 100644
--- a/fofi/FoFiType1C.cc
+++ b/fofi/FoFiType1C.cc
@@ -492,7 +492,7 @@ void FoFiType1C::convertToType1(const char *psName, const char **newEncoding, GB
   (*outputFunc)(outputStream, "cleartomark\n", 12);
 }
 
-void FoFiType1C::convertToCIDType0(char *psName, int *codeMap, int nCodes,
+void FoFiType1C::convertToCIDType0(const char *psName, int *codeMap, int nCodes,
 				   FoFiOutputFunc outputFunc,
 				   void *outputStream) {
   int *cidMap;
@@ -837,7 +837,7 @@ void FoFiType1C::convertToCIDType0(char *psName, int *codeMap, int nCodes,
   gfree(cidMap);
 }
 
-void FoFiType1C::convertToType0(char *psName, int *codeMap, int nCodes,
+void FoFiType1C::convertToType0(const char *psName, int *codeMap, int nCodes,
 				FoFiOutputFunc outputFunc,
 				void *outputStream) {
   int *cidMap;
diff --git a/fofi/FoFiType1C.h b/fofi/FoFiType1C.h
index e2c5076d..58e2b9a2 100644
--- a/fofi/FoFiType1C.h
+++ b/fofi/FoFiType1C.h
@@ -191,7 +191,7 @@ public:
   //     font's internal CID-to-GID mapping is used
   // (3) is <codeMap> is NULL and this is an 8-bit CFF font, then
   //     the identity CID-to-GID mapping is used
-  void convertToCIDType0(char *psName, int *codeMap, int nCodes,
+  void convertToCIDType0(const char *psName, int *codeMap, int nCodes,
 			 FoFiOutputFunc outputFunc, void *outputStream);
 
   // Convert to a Type 0 (but non-CID) composite font, suitable for
@@ -203,7 +203,7 @@ public:
   //     font's internal CID-to-GID mapping is used
   // (3) is <codeMap> is NULL and this is an 8-bit CFF font, then
   //     the identity CID-to-GID mapping is used
-  void convertToType0(char *psName, int *codeMap, int nCodes,
+  void convertToType0(const char *psName, int *codeMap, int nCodes,
 		      FoFiOutputFunc outputFunc, void *outputStream);
 
 private:
commit 735d234d76b31c7d2061f70d0cf88cc122613a80
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Sep 23 01:16:43 2018 +0200

    FoFiBase: No need to store two pointers
    
    that point to the same place
    
    And also make the data const (until the moment we have to free it)

diff --git a/fofi/FoFiBase.cc b/fofi/FoFiBase.cc
index abd0d5db..8ca381b3 100644
--- a/fofi/FoFiBase.cc
+++ b/fofi/FoFiBase.cc
@@ -38,15 +38,15 @@
 // FoFiBase
 //------------------------------------------------------------------------
 
-FoFiBase::FoFiBase(char *fileA, int lenA, GBool freeFileDataA) {
-  fileData = file = (Guchar *)fileA;
+FoFiBase::FoFiBase(const char *fileA, int lenA, GBool freeFileDataA) {
+  file = (const Guchar *)fileA;
   len = lenA;
   freeFileData = freeFileDataA;
 }
 
 FoFiBase::~FoFiBase() {
   if (freeFileData) {
-    gfree(fileData);
+    gfree((char*)file);
   }
 }
 
diff --git a/fofi/FoFiBase.h b/fofi/FoFiBase.h
index a34acc7e..e3413b10 100644
--- a/fofi/FoFiBase.h
+++ b/fofi/FoFiBase.h
@@ -46,7 +46,7 @@ public:
 
 protected:
 
-  FoFiBase(char *fileA, int lenA, GBool freeFileDataA);
+  FoFiBase(const char *fileA, int lenA, GBool freeFileDataA);
   static char *readFile(const char *fileName, int *fileLen);
 
   // S = signed / U = unsigned
@@ -63,8 +63,7 @@ protected:
 
   GBool checkRegion(int pos, int size) const;
 
-  Guchar *fileData;
-  Guchar *file;
+  const Guchar *file;
   int len;
   GBool freeFileData;
 };
diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc
index 14fd5109..a5d73e0e 100644
--- a/fofi/FoFiType1.cc
+++ b/fofi/FoFiType1.cc
@@ -395,9 +395,9 @@ void FoFiType1::undoPFB() {
     pos2 += segLen;
   }
   if (freeFileData) {
-    gfree(fileData);
+    gfree((char*)file);
   }
-  file = fileData = file2;
+  file = file2;
   freeFileData = gTrue;
   len = pos2;
 }
commit bddcc771de9e7d0a7a077732f15a958a44794f94
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Sep 23 01:15:23 2018 +0200

    FoFiTrueType: Some more const

diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc
index 1fa860d5..0501615f 100644
--- a/fofi/FoFiTrueType.cc
+++ b/fofi/FoFiTrueType.cc
@@ -1258,7 +1258,7 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
   }
 }
 
-void FoFiTrueType::dumpString(Guchar *s, int length,
+void FoFiTrueType::dumpString(const Guchar *s, int length,
 			      FoFiOutputFunc outputFunc,
 			      void *outputStream) {
   GooString *buf;
@@ -1287,7 +1287,7 @@ void FoFiTrueType::dumpString(Guchar *s, int length,
   (*outputFunc)(outputStream, "00>\n", 4);
 }
 
-Guint FoFiTrueType::computeTableChecksum(Guchar *data, int length) {
+Guint FoFiTrueType::computeTableChecksum(const Guchar *data, int length) {
   Guint checksum, word;
   int i;
 
diff --git a/fofi/FoFiTrueType.h b/fofi/FoFiTrueType.h
index 9ac364f9..02d611d2 100644
--- a/fofi/FoFiTrueType.h
+++ b/fofi/FoFiTrueType.h
@@ -181,10 +181,10 @@ private:
 		void *outputStream, GooString *name,
 		GBool needVerticalMetrics,
                 int *maxUsedGlyph);
-  void dumpString(Guchar *s, int length,
+  void dumpString(const Guchar *s, int length,
 		  FoFiOutputFunc outputFunc,
 		  void *outputStream);
-  Guint computeTableChecksum(Guchar *data, int length);
+  Guint computeTableChecksum(const Guchar *data, int length);
   void parse();
   void readPostTable();
   int seekTable(const char *tag);
commit 367a0c6ec6b25b706b9cf181d69abd5f32ffbcea
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Sep 23 01:12:11 2018 +0200

    FoFiXXX: Make the filenames const char *

diff --git a/fofi/FoFiBase.cc b/fofi/FoFiBase.cc
index 6d7697c2..abd0d5db 100644
--- a/fofi/FoFiBase.cc
+++ b/fofi/FoFiBase.cc
@@ -50,7 +50,7 @@ FoFiBase::~FoFiBase() {
   }
 }
 
-char *FoFiBase::readFile(char *fileName, int *fileLen) {
+char *FoFiBase::readFile(const char *fileName, int *fileLen) {
   FILE *f;
   char *buf;
   int n;
diff --git a/fofi/FoFiBase.h b/fofi/FoFiBase.h
index d7e77b0f..a34acc7e 100644
--- a/fofi/FoFiBase.h
+++ b/fofi/FoFiBase.h
@@ -47,7 +47,7 @@ public:
 protected:
 
   FoFiBase(char *fileA, int lenA, GBool freeFileDataA);
-  static char *readFile(char *fileName, int *fileLen);
+  static char *readFile(const char *fileName, int *fileLen);
 
   // S = signed / U = unsigned
   // 8/16/32/Var = word length, in bytes
diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc
index caf84f8d..1fa860d5 100644
--- a/fofi/FoFiTrueType.cc
+++ b/fofi/FoFiTrueType.cc
@@ -16,7 +16,7 @@
 // Copyright (C) 2006 Takashi Iwai <tiwai at suse.de>
 // Copyright (C) 2007 Koji Otani <sho at bbr.jp>
 // Copyright (C) 2007 Carlos Garcia Campos <carlosgc at gnome.org>
-// Copyright (C) 2008, 2009, 2012, 2014-2017 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2008, 2009, 2012, 2014-2018 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2008 Tomas Are Haavet <tomasare at gmail.com>
 // Copyright (C) 2012 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
 // Copyright (C) 2012, 2017 Adrian Johnson <ajohnson at redneon.com>
@@ -282,7 +282,7 @@ FoFiTrueType *FoFiTrueType::make(char *fileA, int lenA, int faceIndexA) {
   return ff;
 }
 
-FoFiTrueType *FoFiTrueType::load(char *fileName, int faceIndexA) {
+FoFiTrueType *FoFiTrueType::load(const char *fileName, int faceIndexA) {
   FoFiTrueType *ff;
   char *fileA;
   int lenA;
diff --git a/fofi/FoFiTrueType.h b/fofi/FoFiTrueType.h
index 6bc4022f..9ac364f9 100644
--- a/fofi/FoFiTrueType.h
+++ b/fofi/FoFiTrueType.h
@@ -15,7 +15,7 @@
 //
 // Copyright (C) 2006 Takashi Iwai <tiwai at suse.de>
 // Copyright (C) 2007 Koji Otani <sho at bbr.jp>
-// Copyright (C) 2011, 2012 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2011, 2012, 2018 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2012 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
 // Copyright (C) 2016 William Bader <williambader at hotmail.com>
 // Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
@@ -53,7 +53,7 @@ public:
   static FoFiTrueType *make(char *fileA, int lenA, int faceIndexA=0);
 
   // Create a FoFiTrueType object from a file on disk.
-  static FoFiTrueType *load(char *fileName, int faceIndexA=0);
+  static FoFiTrueType *load(const char *fileName, int faceIndexA=0);
 
   ~FoFiTrueType();
 
diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc
index 2806d92f..14fd5109 100644
--- a/fofi/FoFiType1.cc
+++ b/fofi/FoFiType1.cc
@@ -13,7 +13,7 @@
 // All changes made under the Poppler project to this file are licensed
 // under GPL version 2 or later
 //
-// Copyright (C) 2005, 2008, 2010 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2005, 2008, 2010, 2018 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2005 Kristian Høgsberg <krh at redhat.com>
 // Copyright (C) 2010 Jakub Wilk <jwilk at jwilk.net>
 // Copyright (C) 2014 Carlos Garcia Campos <carlosgc at gnome.org>
@@ -49,7 +49,7 @@ FoFiType1 *FoFiType1::make(char *fileA, int lenA) {
   return new FoFiType1(fileA, lenA, gFalse);
 }
 
-FoFiType1 *FoFiType1::load(char *fileName) {
+FoFiType1 *FoFiType1::load(const char *fileName) {
   char *fileA;
   int lenA;
 
diff --git a/fofi/FoFiType1.h b/fofi/FoFiType1.h
index ac0b9c97..167a5e43 100644
--- a/fofi/FoFiType1.h
+++ b/fofi/FoFiType1.h
@@ -6,6 +6,20 @@
 //
 //========================================================================
 
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2018 Albert Astals Cid <aacid at kde.org>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
 #ifndef FOFITYPE1_H
 #define FOFITYPE1_H
 
@@ -27,7 +41,7 @@ public:
   static FoFiType1 *make(char *fileA, int lenA);
 
   // Create a FoFiType1 object from a file on disk.
-  static FoFiType1 *load(char *fileName);
+  static FoFiType1 *load(const char *fileName);
 
   ~FoFiType1();
 
diff --git a/fofi/FoFiType1C.cc b/fofi/FoFiType1C.cc
index db7b98c6..1cfc4746 100644
--- a/fofi/FoFiType1C.cc
+++ b/fofi/FoFiType1C.cc
@@ -58,7 +58,7 @@ FoFiType1C *FoFiType1C::make(char *fileA, int lenA) {
   return ff;
 }
 
-FoFiType1C *FoFiType1C::load(char *fileName) {
+FoFiType1C *FoFiType1C::load(const char *fileName) {
   FoFiType1C *ff;
   char *fileA;
   int lenA;
diff --git a/fofi/FoFiType1C.h b/fofi/FoFiType1C.h
index 541c193d..e2c5076d 100644
--- a/fofi/FoFiType1C.h
+++ b/fofi/FoFiType1C.h
@@ -152,7 +152,7 @@ public:
   static FoFiType1C *make(char *fileA, int lenA);
 
   // Create a FoFiType1C object from a file on disk.
-  static FoFiType1C *load(char *fileName);
+  static FoFiType1C *load(const char *fileName);
 
   virtual ~FoFiType1C();
 
commit b4c61b1f9149e6f0a7533cb03eeee13f9e6d1811
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Sep 23 00:57:25 2018 +0200

    Form: add some const

diff --git a/poppler/Form.cc b/poppler/Form.cc
index 2ff4aafa..98d1e0ff 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -204,13 +204,13 @@ FormWidgetButton::FormWidgetButton (PDFDoc *docA, Object *aobj, unsigned num, Re
   }
 }
 
-char *FormWidgetButton::getOnStr() {
+const char *FormWidgetButton::getOnStr() const {
   if (onStr)
     return onStr->getCString();
 
   // 12.7.4.2.3 Check Boxes
   //  Yes should be used as the name for the on state
-  return parent()->getButtonType() == formButtonCheck ? (char *)"Yes" : nullptr;
+  return parent()->getButtonType() == formButtonCheck ? "Yes" : nullptr;
 }
 
 FormWidgetButton::~FormWidgetButton ()
@@ -248,7 +248,7 @@ void FormWidgetButton::setState (GBool astate)
   // Parent will call setAppearanceState()
 }
 
-GBool FormWidgetButton::getState ()
+GBool FormWidgetButton::getState () const
 {
   return onStr ? parent()->getState(onStr->getCString()) : gFalse;
 }
@@ -1061,7 +1061,7 @@ void FormFieldButton::fillChildrenSiblingsID()
   }
 }
 
-GBool FormFieldButton::setState(char *state)
+GBool FormFieldButton::setState(const char *state)
 {
   // A check button could behave as a radio button
   // when it's in a set of more than 1 buttons
@@ -1098,7 +1098,7 @@ GBool FormFieldButton::setState(char *state)
     if (!widget->getOnStr())
       continue;
 
-    char *onStr = widget->getOnStr();
+    const char *onStr = widget->getOnStr();
     if (current && strcmp(current, onStr) == 0) {
       widget->setAppearanceState("Off");
       if (!isOn)
@@ -1127,7 +1127,7 @@ GBool FormFieldButton::getState(const char *state) const {
   return (parent && parent->getType() == formButton) ? static_cast<FormFieldButton*>(parent)->getState(state) : gFalse;
 }
 
-void FormFieldButton::updateState(char *state) {
+void FormFieldButton::updateState(const char *state) {
   appearanceState = Object(objName, state);
   obj.getDict()->set("V", appearanceState.copy());
   xref->setModifiedObject(&obj, ref);
diff --git a/poppler/Form.h b/poppler/Form.h
index 3e58a80a..0dd86dfc 100644
--- a/poppler/Form.h
+++ b/poppler/Form.h
@@ -175,9 +175,9 @@ public:
   FormButtonType getButtonType() const;
   
   void setState (GBool state);
-  GBool getState ();
+  GBool getState () const;
 
-  char* getOnStr();
+  const char* getOnStr() const;
   void setAppearanceState(const char *state);
   void updateWidgetAppearance() override;
 
@@ -375,7 +375,7 @@ public:
   bool noToggleToOff () const { return noAllOff; }
 
   // returns gTrue if the state modification is accepted
-  GBool setState (char *state);
+  GBool setState (const char *state);
   GBool getState(const char *state) const;
 
   const char *getAppearanceState() const { return appearanceState.isName() ? appearanceState.getName() : nullptr; }
@@ -395,7 +395,7 @@ public:
 
   ~FormFieldButton();
 protected:
-  void updateState(char *state);
+  void updateState(const char *state);
 
   FormFieldButton** siblings; // IDs of dependent buttons (each button of a radio field has all the others buttons
                                // of the same field in this array)
commit 1f9f3ddc015a26611e1eff178570f7a7d81fcecc
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Sep 23 00:54:33 2018 +0200

    Decrypt: Make one char * be const

diff --git a/poppler/Decrypt.cc b/poppler/Decrypt.cc
index 9577b655..ddec68dd 100644
--- a/poppler/Decrypt.cc
+++ b/poppler/Decrypt.cc
@@ -57,7 +57,7 @@ static void sha256(Guchar *msg, int msgLen, Guchar *hash);
 static void sha384(Guchar *msg, int msgLen, Guchar *hash);
 static void sha512(Guchar *msg, int msgLen, Guchar *hash);
 
-static void revision6Hash(GooString *inputPassword, Guchar *K, char *userKey);
+static void revision6Hash(GooString *inputPassword, Guchar *K, const char *userKey);
 
 static const Guchar passwordPad[32] = {
   0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41,
@@ -1702,7 +1702,7 @@ static void sha384(Guchar *msg, int msgLen, Guchar *hash) {
 // Section 7.6.3.3 (Encryption Key algorithm) of ISO/DIS 32000-2
 // Algorithm 2.B:Computing a hash (for revision 6).
 //------------------------------------------------------------------------
-static void revision6Hash(GooString *inputPassword, Guchar *K, char *userKey) {
+static void revision6Hash(GooString *inputPassword, Guchar *K, const char *userKey) {
   Guchar K1[64*(127+64+48)];
   Guchar  E[64*(127+64+48)];
   DecryptAESState state;
commit 47e1342d788c40d225eb0aebded160dea454bf60
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Sep 23 00:52:14 2018 +0200

    CharCodeToUnicode: Make three char * be const

diff --git a/poppler/CharCodeToUnicode.cc b/poppler/CharCodeToUnicode.cc
index c40ee48f..5b84c2e1 100644
--- a/poppler/CharCodeToUnicode.cc
+++ b/poppler/CharCodeToUnicode.cc
@@ -13,7 +13,7 @@
 // All changes made under the Poppler project to this file are licensed
 // under GPL version 2 or later
 //
-// Copyright (C) 2006, 2008-2010, 2012 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2006, 2008-2010, 2012, 2018 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2007 Julien Rebetez <julienr at svn.gnome.org>
 // Copyright (C) 2007 Koji Otani <sho at bbr.jp>
 // Copyright (C) 2008 Michael Vrable <mvrable at cs.ucsd.edu>
@@ -103,7 +103,7 @@ static int hexCharVals[256] = {
 
 // Parse a <len>-byte hex string <s> into *<val>.  Returns false on
 // error.
-static GBool parseHex(char *s, int len, Guint *val) {
+static GBool parseHex(const char *s, int len, Guint *val) {
   int i, x;
 
   *val = 0;
@@ -269,10 +269,9 @@ CharCodeToUnicode *CharCodeToUnicode::make8BitToUnicode(Unicode *toUnicode) {
 
 CharCodeToUnicode *CharCodeToUnicode::parseCMap(GooString *buf, int nBits) {
   CharCodeToUnicode *ctu;
-  char *p;
 
   ctu = new CharCodeToUnicode(nullptr);
-  p = buf->getCString();
+  const char *p = buf->getCString();
   ctu->parseCMap1(&getCharFromString, &p, nBits);
   return ctu;
 }
@@ -294,9 +293,7 @@ CharCodeToUnicode *CharCodeToUnicode::parseCMapFromFile(GooString *fileName,
 }
 
 void CharCodeToUnicode::mergeCMap(GooString *buf, int nBits) {
-  char *p;
-
-  p = buf->getCString();
+  const char *p = buf->getCString();
   parseCMap1(&getCharFromString, &p, nBits);
 }
 
commit 0e0d0ca632e0770605e8e7bce58191f8fa4c05d5
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Sep 23 00:50:42 2018 +0200

    Annot: make two char * be const

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index a58ad36c..90c12737 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -4001,7 +4001,7 @@ void Annot::layoutText(const GooString *text, GooString *outBuf, int *i,
   // Compute the actual width and character count of the final string, based on
   // breakpoint, if this information is requested by the caller.
   if (width != nullptr || charCount != nullptr) {
-    char *s = outBuf->getCString();
+    const char *s = outBuf->getCString();
     int len = outBuf->getLength();
 
     if (width != nullptr)
@@ -4356,7 +4356,7 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
       }
 
       // write the text string
-      char *s = convertedText->getCString();
+      const char *s = convertedText->getCString();
       int len = convertedText->getLength();
       i = 0;
       xPrev = w;                // so that first character is placed properly


More information about the poppler mailing list