[poppler] poppler/Form.cc poppler/Form.h poppler/Gfx.cc poppler/GfxFont.cc poppler/Gfx.h poppler/Link.cc poppler/Link.h poppler/MarkedContentOutputDev.cc poppler/MarkedContentOutputDev.h poppler/Movie.cc poppler/Object.h poppler/OutputDev.cc poppler/OutputDev.h poppler/Rendition.cc poppler/Stream.cc poppler/Stream.h

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Apr 17 14:13:21 UTC 2018


 poppler/Form.cc                   |    2 +-
 poppler/Form.h                    |    2 +-
 poppler/Gfx.cc                    |   20 ++++++++++----------
 poppler/Gfx.h                     |   14 +++++++-------
 poppler/GfxFont.cc                |    4 ++--
 poppler/Link.cc                   |    6 +++---
 poppler/Link.h                    |    2 +-
 poppler/MarkedContentOutputDev.cc |    2 +-
 poppler/MarkedContentOutputDev.h  |    2 +-
 poppler/Movie.cc                  |    2 +-
 poppler/Object.h                  |    2 +-
 poppler/OutputDev.cc              |    6 +++---
 poppler/OutputDev.h               |    6 +++---
 poppler/Rendition.cc              |    2 +-
 poppler/Stream.cc                 |    2 +-
 poppler/Stream.h                  |    2 +-
 16 files changed, 38 insertions(+), 38 deletions(-)

New commits:
commit 281d5cbd33521c823f1602f3d0c1e2ad9a4ab1d2
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Apr 6 15:34:57 2018 +0200

    Object::getName return const char instead of char

diff --git a/poppler/Form.cc b/poppler/Form.cc
index 85045b8e..2f5a48e1 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -1089,7 +1089,7 @@ GBool FormFieldButton::setState(char *state)
   if (!isOn && noAllOff)
     return gFalse; // Don't allow to set all radio to off
 
-  char *current = getAppearanceState();
+  const char *current = getAppearanceState();
   GBool currentFound = gFalse, newFound = gFalse;
 
   for (int i = 0; i < numChildren; i++) {
diff --git a/poppler/Form.h b/poppler/Form.h
index 681d1db4..62e8a205 100644
--- a/poppler/Form.h
+++ b/poppler/Form.h
@@ -382,7 +382,7 @@ public:
   GBool setState (char *state);
   GBool getState(const char *state) const;
 
-  char *getAppearanceState() { return appearanceState.isName() ? appearanceState.getName() : NULL; }
+  const char *getAppearanceState() const { return appearanceState.isName() ? appearanceState.getName() : nullptr; }
 
   void fillChildrenSiblingsID () override;
   
diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index a5cb7d1a..08132072 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -398,7 +398,7 @@ const GfxFont *GfxResources::lookupFont(const char *name) const {
   return doLookupFont(name);
 }
 
-Object GfxResources::lookupXObject(char *name) {
+Object GfxResources::lookupXObject(const char *name) {
   GfxResources *resPtr;
 
   for (resPtr = this; resPtr; resPtr = resPtr->next) {
@@ -412,7 +412,7 @@ Object GfxResources::lookupXObject(char *name) {
   return Object(objNull);
 }
 
-Object GfxResources::lookupXObjectNF(char *name) {
+Object GfxResources::lookupXObjectNF(const char *name) {
   GfxResources *resPtr;
 
   for (resPtr = this; resPtr; resPtr = resPtr->next) {
@@ -426,7 +426,7 @@ Object GfxResources::lookupXObjectNF(char *name) {
   return Object(objNull);
 }
 
-Object GfxResources::lookupMarkedContentNF(char *name) {
+Object GfxResources::lookupMarkedContentNF(const char *name) {
   GfxResources *resPtr;
 
   for (resPtr = this; resPtr; resPtr = resPtr->next) {
@@ -454,7 +454,7 @@ Object GfxResources::lookupColorSpace(const char *name) {
   return Object(objNull);
 }
 
-GfxPattern *GfxResources::lookupPattern(char *name, OutputDev *out, GfxState *state) {
+GfxPattern *GfxResources::lookupPattern(const char *name, OutputDev *out, GfxState *state) {
   GfxResources *resPtr;
   GfxPattern *pattern;
 
@@ -477,7 +477,7 @@ GfxPattern *GfxResources::lookupPattern(char *name, OutputDev *out, GfxState *st
   return nullptr;
 }
 
-GfxShading *GfxResources::lookupShading(char *name, OutputDev *out, GfxState *state) {
+GfxShading *GfxResources::lookupShading(const char *name, OutputDev *out, GfxState *state) {
   GfxResources *resPtr;
   GfxShading *shading;
 
@@ -494,7 +494,7 @@ GfxShading *GfxResources::lookupShading(char *name, OutputDev *out, GfxState *st
   return nullptr;
 }
 
-Object GfxResources::lookupGState(char *name) {
+Object GfxResources::lookupGState(const char *name) {
   Object obj = lookupGStateNF(name);
   if (obj.isNull())
     return Object(objNull);
@@ -511,7 +511,7 @@ Object GfxResources::lookupGState(char *name) {
   return obj;
 }
 
-Object GfxResources::lookupGStateNF(char *name) {
+Object GfxResources::lookupGStateNF(const char *name) {
   GfxResources *resPtr;
 
   for (resPtr = this; resPtr; resPtr = resPtr->next) {
@@ -4143,7 +4143,7 @@ void Gfx::doIncCharCount(const GooString *s) {
 //------------------------------------------------------------------------
 
 void Gfx::opXObject(Object args[], int numArgs) {
-  char *name;
+  const char *name;
 
   if (!ocState && !out->needCharCount()) {
     return;
@@ -5031,11 +5031,11 @@ void Gfx::opBeginMarkedContent(Object args[], int numArgs) {
   pushMarkedContent();
   
   OCGs *contentConfig = catalog->getOptContentConfig();
-  char* name0 = args[0].getName();
+  const char* name0 = args[0].getName();
   if ( strncmp( name0, "OC", 2) == 0 && contentConfig) {
     if ( numArgs >= 2 ) {
       if (args[1].isName()) {
-        char* name1 = args[1].getName();
+        const char* name1 = args[1].getName();
         MarkedContentStack *mc = mcStack;
         mc->kind = gfxMCOptionalContent;
         Object markedContent = res->lookupMarkedContentNF( name1 );
diff --git a/poppler/Gfx.h b/poppler/Gfx.h
index e15af406..2ea0d9fa 100644
--- a/poppler/Gfx.h
+++ b/poppler/Gfx.h
@@ -118,14 +118,14 @@ public:
 
   GfxFont *lookupFont(const char *name);
   const GfxFont *lookupFont(const char *name) const;
-  Object lookupXObject(char *name);
-  Object lookupXObjectNF(char *name);
-  Object lookupMarkedContentNF(char *name);
+  Object lookupXObject(const char *name);
+  Object lookupXObjectNF(const char *name);
+  Object lookupMarkedContentNF(const char *name);
   Object lookupColorSpace(const char *name);
-  GfxPattern *lookupPattern(char *name, OutputDev *out, GfxState *state);
-  GfxShading *lookupShading(char *name, OutputDev *out, GfxState *state);
-  Object lookupGState(char *name);
-  Object lookupGStateNF(char *name);
+  GfxPattern *lookupPattern(const char *name, OutputDev *out, GfxState *state);
+  GfxShading *lookupShading(const char *name, OutputDev *out, GfxState *state);
+  Object lookupGState(const char *name);
+  Object lookupGStateNF(const char *name);
 
   GfxResources *getNext() { return next; }
 
diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
index eb524ec1..0ab78ad5 100644
--- a/poppler/GfxFont.cc
+++ b/poppler/GfxFont.cc
@@ -871,7 +871,7 @@ const char *GfxFont::getAlternateName(const char *name) {
 // Parse character names of the form 'Axx', 'xx', 'Ann', 'ABnn', or
 // 'nn', where 'A' and 'B' are any letters, 'xx' is two hex digits,
 // and 'nn' is decimal digits.
-static GBool parseNumericName(char *s, GBool hex, unsigned int *u) {
+static GBool parseNumericName(const char *s, GBool hex, unsigned int *u) {
   char *endptr;
 
   // Strip leading alpha characters.
@@ -2528,7 +2528,7 @@ int GfxFontDict::hashFontObject(Object *obj) {
 void GfxFontDict::hashFontObject1(Object *obj, FNVHash *h) {
   Object obj2;
   const GooString *s;
-  char *p;
+  const char *p;
   double r;
   int n, i;
 
diff --git a/poppler/Link.cc b/poppler/Link.cc
index 9ebf33ef..4a20752c 100644
--- a/poppler/Link.cc
+++ b/poppler/Link.cc
@@ -654,7 +654,7 @@ LinkMovie::LinkMovie(const Object *obj) {
 
   tmp = obj->dictLookup("Operation");
   if (tmp.isName()) {
-    char *name = tmp.getName();
+    const char *name = tmp.getName();
     
     if (!strcmp(name, "Play")) {
       operation = operationTypePlay;
@@ -834,7 +834,7 @@ LinkOCGState::LinkOCGState(const Object *obj) {
         if (stList)
 	  stateList->append(stList);
 
-	char *name = obj2.getName();
+	const char *name = obj2.getName();
 	stList = new StateList();
 	stList->list = new GooList();
 	if (!strcmp (name, "ON")) {
@@ -915,7 +915,7 @@ LinkHide::~LinkHide() {
 // LinkUnknown
 //------------------------------------------------------------------------
 
-LinkUnknown::LinkUnknown(char *actionA) {
+LinkUnknown::LinkUnknown(const char *actionA) {
   action = new GooString(actionA);
 }
 
diff --git a/poppler/Link.h b/poppler/Link.h
index 1fc013e0..3dbe57fd 100644
--- a/poppler/Link.h
+++ b/poppler/Link.h
@@ -508,7 +508,7 @@ class LinkUnknown: public LinkAction {
 public:
 
   // Build a LinkUnknown with the specified action type.
-  LinkUnknown(char *actionA);
+  LinkUnknown(const char *actionA);
 
   // Destructor.
   ~LinkUnknown();
diff --git a/poppler/MarkedContentOutputDev.cc b/poppler/MarkedContentOutputDev.cc
index 4920ad32..ddaa2d80 100644
--- a/poppler/MarkedContentOutputDev.cc
+++ b/poppler/MarkedContentOutputDev.cc
@@ -69,7 +69,7 @@ void MarkedContentOutputDev::endPage()
 }
 
 
-void MarkedContentOutputDev::beginMarkedContent(char *name, Dict *properties)
+void MarkedContentOutputDev::beginMarkedContent(const char *name, Dict *properties)
 {
   int id = -1;
   if (properties)
diff --git a/poppler/MarkedContentOutputDev.h b/poppler/MarkedContentOutputDev.h
index e2b69aed..a1b1178c 100644
--- a/poppler/MarkedContentOutputDev.h
+++ b/poppler/MarkedContentOutputDev.h
@@ -109,7 +109,7 @@ public:
                         CharCode c, int nBytes,
                         Unicode *u, int uLen) override;
 
-  void beginMarkedContent(char *name, Dict *properties) override;
+  void beginMarkedContent(const char *name, Dict *properties) override;
   void endMarkedContent(GfxState *state) override;
 
   const TextSpanArray& getTextSpans() const;
diff --git a/poppler/Movie.cc b/poppler/Movie.cc
index 2fe05da3..82d7f3f5 100644
--- a/poppler/Movie.cc
+++ b/poppler/Movie.cc
@@ -125,7 +125,7 @@ void MovieActivationParameters::parseMovieActivation(const Object* aDict) {
 
   obj1 = aDict->dictLookup("Mode");
   if (obj1.isName()) {
-    char* name = obj1.getName();
+    const char* name = obj1.getName();
     if (!strcmp(name, "Once")) {
       repeatMode = repeatModeOnce;
     } else if (!strcmp(name, "Open")) {
diff --git a/poppler/Object.h b/poppler/Object.h
index 7538253a..97978f46 100644
--- a/poppler/Object.h
+++ b/poppler/Object.h
@@ -242,7 +242,7 @@ public:
   // because the object it's not expected to have a NULL string.
   GooString *takeString() {
     OBJECT_TYPE_CHECK(objString); GooString *s = string; string = nullptr; return s; }
-  char *getName() const { OBJECT_TYPE_CHECK(objName); return cString; }
+  const char *getName() const { OBJECT_TYPE_CHECK(objName); return cString; }
   Array *getArray() const { OBJECT_TYPE_CHECK(objArray); return array; }
   Dict *getDict() const { OBJECT_TYPE_CHECK(objDict); return dict; }
   Stream *getStream() const { OBJECT_TYPE_CHECK(objStream); return stream; }
diff --git a/poppler/OutputDev.cc b/poppler/OutputDev.cc
index 8afa7052..6d42fd42 100644
--- a/poppler/OutputDev.cc
+++ b/poppler/OutputDev.cc
@@ -160,13 +160,13 @@ void OutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
 void OutputDev::endMarkedContent(GfxState *state) {
 }
 
-void OutputDev::beginMarkedContent(char *name, Dict *properties) {
+void OutputDev::beginMarkedContent(const char *name, Dict *properties) {
 }
 
-void OutputDev::markPoint(char *name) {
+void OutputDev::markPoint(const char *name) {
 }
 
-void OutputDev::markPoint(char *name, Dict *properties) {
+void OutputDev::markPoint(const char *name, Dict *properties) {
 }
 
 
diff --git a/poppler/OutputDev.h b/poppler/OutputDev.h
index 41518db0..9dc4c3e0 100644
--- a/poppler/OutputDev.h
+++ b/poppler/OutputDev.h
@@ -309,9 +309,9 @@ public:
   //----- grouping operators
 
   virtual void endMarkedContent(GfxState *state);
-  virtual void beginMarkedContent(char *name, Dict *properties);
-  virtual void markPoint(char *name);
-  virtual void markPoint(char *name, Dict *properties);
+  virtual void beginMarkedContent(const char *name, Dict *properties);
+  virtual void markPoint(const char *name);
+  virtual void markPoint(const char *name, Dict *properties);
 
 
 
diff --git a/poppler/Rendition.cc b/poppler/Rendition.cc
index 8d30fb06..b74aca49 100644
--- a/poppler/Rendition.cc
+++ b/poppler/Rendition.cc
@@ -177,7 +177,7 @@ void MediaParameters::parseMediaPlayParameters(Object* obj) {
   if (tmp.isDict()) {
     Object oname = tmp.dictLookup("S");
     if (oname.isName()) {
-      char* name = oname.getName();
+      const char* name = oname.getName();
       if (!strcmp(name, "F"))
 	duration = -1; // infinity
       else if (!strcmp(name, "T")) {
diff --git a/poppler/Stream.cc b/poppler/Stream.cc
index 30095a5b..15a6a9f9 100644
--- a/poppler/Stream.cc
+++ b/poppler/Stream.cc
@@ -208,7 +208,7 @@ Stream *Stream::addFilters(Dict *dict, int recursion) {
   return str;
 }
 
-Stream *Stream::makeFilter(char *name, Stream *str, Object *params, int recursion, Dict *dict) {
+Stream *Stream::makeFilter(const char *name, Stream *str, Object *params, int recursion, Dict *dict) {
   int pred;			// parameters
   int colors;
   int bits;
diff --git a/poppler/Stream.h b/poppler/Stream.h
index 3eca7452..a3faccd9 100644
--- a/poppler/Stream.h
+++ b/poppler/Stream.h
@@ -238,7 +238,7 @@ private:
   virtual GBool hasGetChars() { return false; }
   virtual int getChars(int nChars, Guchar *buffer);
 
-  Stream *makeFilter(char *name, Stream *str, Object *params, int recursion = 0, Dict *dict = nullptr);
+  Stream *makeFilter(const char *name, Stream *str, Object *params, int recursion = 0, Dict *dict = nullptr);
 
   int ref;			// reference count
 #ifdef MULTITHREADED


More information about the poppler mailing list