[poppler] 2 commits - poppler/CairoOutputDev.cc poppler/CairoOutputDev.h poppler/Gfx.cc poppler/Gfx.h poppler/OutputDev.h poppler/PSOutputDev.cc poppler/PSOutputDev.h poppler/TextOutputDev.cc poppler/TextOutputDev.h utils/HtmlOutputDev.cc utils/HtmlOutputDev.h

Albert Astals Cid aacid at kemper.freedesktop.org
Fri Apr 6 11:04:08 UTC 2018


 poppler/CairoOutputDev.cc |    5 +++--
 poppler/CairoOutputDev.h  |    5 +++--
 poppler/Gfx.cc            |    8 ++++----
 poppler/Gfx.h             |    4 ++--
 poppler/OutputDev.h       |    7 ++++---
 poppler/PSOutputDev.cc    |    4 ++--
 poppler/PSOutputDev.h     |    2 +-
 poppler/TextOutputDev.cc  |    7 ++++---
 poppler/TextOutputDev.h   |    7 ++++---
 utils/HtmlOutputDev.cc    |    5 +++--
 utils/HtmlOutputDev.h     |    5 +++--
 11 files changed, 33 insertions(+), 26 deletions(-)

New commits:
commit 07180b86786cce95df4e2433a7cf3e006749a0f5
Author: Albert Astals Cid <albert.astals.cid at kdab.com>
Date:   Fri Apr 6 13:03:16 2018 +0200

    Gfx: Make two functions take const GooString *

diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 14600732..a5cb7d1a 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -38,7 +38,7 @@
 // Copyright (C) 2012, 2013 Fabio D'Urso <fabiodurso at hotmail.it>
 // Copyright (C) 2012 Lu Wang <coolwanglu at gmail.com>
 // Copyright (C) 2014 Jason Crain <jason at aquaticape.us>
-// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
+// Copyright (C) 2017, 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
 //
 // 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
@@ -3879,7 +3879,7 @@ void Gfx::opShowSpaceText(Object args[], int numArgs) {
   }
 }
 
-void Gfx::doShowText(GooString *s) {
+void Gfx::doShowText(const GooString *s) {
   GfxFont *font;
   int wMode;
   double riseX, riseY;
@@ -3893,7 +3893,7 @@ void Gfx::doShowText(GooString *s) {
   Dict *resDict;
   Parser *oldParser;
   GfxState *savedState;
-  char *p;
+  const char *p;
   int render;
   GBool patternFill;
   int len, n, uLen, nChars, nSpaces, i;
@@ -4132,7 +4132,7 @@ void Gfx::doShowText(GooString *s) {
 }
 
 // NB: this is only called when ocState is false.
-void Gfx::doIncCharCount(GooString *s) {
+void Gfx::doIncCharCount(const GooString *s) {
   if (out->needCharCount()) {
     out->incCharCount(s->getLength());
   }
diff --git a/poppler/Gfx.h b/poppler/Gfx.h
index fb24dbac..e15af406 100644
--- a/poppler/Gfx.h
+++ b/poppler/Gfx.h
@@ -361,8 +361,8 @@ private:
   void opMoveShowText(Object args[], int numArgs);
   void opMoveSetShowText(Object args[], int numArgs);
   void opShowSpaceText(Object args[], int numArgs);
-  void doShowText(GooString *s);
-  void doIncCharCount(GooString *s);
+  void doShowText(const GooString *s);
+  void doIncCharCount(const GooString *s);
 
   // XObject operators
   void opXObject(Object args[], int numArgs);
commit c4af5981ab2a5f42a9a1194bb5929c2151fc2674
Author: Albert Astals Cid <albert.astals.cid at kdab.com>
Date:   Fri Apr 6 13:00:12 2018 +0200

    OutputDev: change functions taking GooString * to make it const
    
    People that use poppler core, beware of the signature change!

diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index f0c4b040..18124b8f 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -29,6 +29,7 @@
 // Copyright (C) 2012 Patrick Pfeifer <p2000 at mailinator.com>
 // Copyright (C) 2012, 2015, 2016 Jason Crain <jason at aquaticape.us>
 // Copyright (C) 2015 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
+// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
 //
 // 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
@@ -1379,7 +1380,7 @@ void CairoOutputDev::fillToStrokePathClip(GfxState *state) {
   cairo_restore (cairo);
 }
 
-void CairoOutputDev::beginString(GfxState *state, GooString *s)
+void CairoOutputDev::beginString(GfxState *state, const GooString *s)
 {
   int len = s->getLength();
 
@@ -1588,7 +1589,7 @@ void CairoOutputDev::endTextObject(GfxState *state) {
   }
 }
 
-void CairoOutputDev::beginActualText(GfxState *state, GooString *text)
+void CairoOutputDev::beginActualText(GfxState *state, const GooString *text)
 {
   if (this->text)
     actualText->begin(state, text);
diff --git a/poppler/CairoOutputDev.h b/poppler/CairoOutputDev.h
index ffcb5151..6ee6f9e8 100644
--- a/poppler/CairoOutputDev.h
+++ b/poppler/CairoOutputDev.h
@@ -24,6 +24,7 @@
 // Copyright (C) 2015 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
 // Copyright (C) 2016 Jason Crain <jason at aquaticape.us>
 // Copyright (C) 2018 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
 //
 // 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
@@ -191,13 +192,13 @@ public:
   void eoClip(GfxState *state) override;
 
   //----- text drawing
-  void beginString(GfxState *state, GooString *s) override;
+  void beginString(GfxState *state, const GooString *s) override;
   void endString(GfxState *state) override;
   void drawChar(GfxState *state, double x, double y,
 		double dx, double dy,
 		double originX, double originY,
 		CharCode code, int nBytes, Unicode *u, int uLen) override;
-  void beginActualText(GfxState *state, GooString *text) override;
+  void beginActualText(GfxState *state, const GooString *text) override;
   void endActualText(GfxState *state) override;
 
   GBool beginType3Char(GfxState *state, double x, double y,
diff --git a/poppler/OutputDev.h b/poppler/OutputDev.h
index aca84cda..da9cf0a8 100644
--- a/poppler/OutputDev.h
+++ b/poppler/OutputDev.h
@@ -24,6 +24,7 @@
 // Copyright (C) 2012 Fabio D'Urso <fabiodurso at hotmail.it>
 // Copyright (C) 2012 William Bader <williambader at hotmail.com>
 // Copyright (C) 2017 Oliver Sander <oliver.sander at tu-dresden.de>
+// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
 //
 // 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
@@ -247,7 +248,7 @@ public:
   //----- text drawing
   virtual void beginStringOp(GfxState * /*state*/) {}
   virtual void endStringOp(GfxState * /*state*/) {}
-  virtual void beginString(GfxState * /*state*/, GooString * /*s*/) {}
+  virtual void beginString(GfxState * /*state*/, const GooString * /*s*/) {}
   virtual void endString(GfxState * /*state*/) {}
 
   // Draw one glyph at a specified position
@@ -263,7 +264,7 @@ public:
 			double /*dx*/, double /*dy*/,
 			double /*originX*/, double /*originY*/,
 			CharCode /*code*/, int /*nBytes*/, Unicode * /*u*/, int /*uLen*/) {}
-  virtual void drawString(GfxState * /*state*/, GooString * /*s*/) {}
+  virtual void drawString(GfxState * /*state*/, const GooString * /*s*/) {}
   virtual GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/,
 			       double /*dx*/, double /*dy*/,
 			       CharCode /*code*/, Unicode * /*u*/, int /*uLen*/);
@@ -271,7 +272,7 @@ public:
   virtual void beginTextObject(GfxState * /*state*/) {}
   virtual void endTextObject(GfxState * /*state*/) {}
   virtual void incCharCount(int /*nChars*/) {}
-  virtual void beginActualText(GfxState * /*state*/, GooString * /*text*/ ) {}
+  virtual void beginActualText(GfxState * /*state*/, const GooString * /*text*/ ) {}
   virtual void endActualText(GfxState * /*state*/) {}
 
   //----- image drawing
diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc
index cf940561..c755caa4 100644
--- a/poppler/PSOutputDev.cc
+++ b/poppler/PSOutputDev.cc
@@ -5008,13 +5008,13 @@ void PSOutputDev::doPath(GfxPath *path) {
   }
 }
 
-void PSOutputDev::drawString(GfxState *state, GooString *s) {
+void PSOutputDev::drawString(GfxState *state, const GooString *s) {
   GfxFont *font;
   int wMode;
   int *codeToGID;
   GooString *s2;
   double dx, dy, originX, originY;
-  char *p;
+  const char *p;
   UnicodeMap *uMap;
   CharCode code;
   Unicode *u;
diff --git a/poppler/PSOutputDev.h b/poppler/PSOutputDev.h
index 10616d45..e0d6910a 100644
--- a/poppler/PSOutputDev.h
+++ b/poppler/PSOutputDev.h
@@ -253,7 +253,7 @@ public:
   void clipToStrokePath(GfxState *state) override;
 
   //----- text drawing
-  void drawString(GfxState *state, GooString *s) override;
+  void drawString(GfxState *state, const GooString *s) override;
   void beginTextObject(GfxState *state) override;
   void endTextObject(GfxState *state) override;
 
diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index 4397e497..4a3070af 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -36,6 +36,7 @@
 // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag at alfa.de>
 // Copyright (C) 2013 Ed Catmur <ed at catmur.co.uk>
 // Copyright (C) 2016 Khaled Hosny <khaledhosny at eglug.org>
+// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
 //
 // 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
@@ -5518,7 +5519,7 @@ void ActualText::addChar(GfxState *state, double x, double y,
   actualTextNBytes += nBytes;
 }
 
-void ActualText::begin(GfxState *state, GooString *text) {
+void ActualText::begin(GfxState *state, const GooString *text) {
   if (actualText)
     delete actualText;
   actualText = new GooString(text);
@@ -5641,7 +5642,7 @@ void TextOutputDev::updateFont(GfxState *state) {
   text->updateFont(state);
 }
 
-void TextOutputDev::beginString(GfxState *state, GooString *s) {
+void TextOutputDev::beginString(GfxState *state, const GooString *s) {
 }
 
 void TextOutputDev::endString(GfxState *state) {
@@ -5658,7 +5659,7 @@ void TextOutputDev::incCharCount(int nChars) {
   text->incCharCount(nChars);
 }
 
-void TextOutputDev::beginActualText(GfxState *state, GooString *text)
+void TextOutputDev::beginActualText(GfxState *state, const GooString *text)
 {
   actualText->begin(state, text);
 }
diff --git a/poppler/TextOutputDev.h b/poppler/TextOutputDev.h
index b5a6088c..092acd67 100644
--- a/poppler/TextOutputDev.h
+++ b/poppler/TextOutputDev.h
@@ -21,6 +21,7 @@
 // Copyright (C) 2010 Brian Ewins <brian.ewins at gmail.com>
 // Copyright (C) 2012, 2013, 2015, 2016 Jason Crain <jason at aquaticape.us>
 // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag at alfa.de>
+// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
 //
 // 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
@@ -732,7 +733,7 @@ public:
   void addChar(GfxState *state, double x, double y,
 	       double dx, double dy,
 	       CharCode c, int nBytes, Unicode *u, int uLen);
-  void begin(GfxState *state, GooString *text);
+  void begin(GfxState *state, const GooString *text);
   void end(GfxState *state);
 
 private:
@@ -812,14 +813,14 @@ public:
   void updateFont(GfxState *state) override;
 
   //----- text drawing
-  void beginString(GfxState *state, GooString *s) override;
+  void beginString(GfxState *state, const GooString *s) override;
   void endString(GfxState *state) override;
   void drawChar(GfxState *state, double x, double y,
 		double dx, double dy,
 		double originX, double originY,
 		CharCode c, int nBytes, Unicode *u, int uLen) override;
   void incCharCount(int nChars) override;
-  void beginActualText(GfxState *state, GooString *text) override;
+  void beginActualText(GfxState *state, const GooString *text) override;
   void endActualText(GfxState *state) override;
 
   //----- path painting
diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index f386740a..f4d17c65 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -40,6 +40,7 @@
 // Copyright (C) 2014 Fabio D'Urso <fabiodurso at hotmail.it>
 // Copyright (C) 2016 Vincent Le Garrec <legarrec.vincent at gmail.com>
 // Copyright (C) 2017 Caolán McNamara <caolanm at redhat.com>
+// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
 //
 // 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
@@ -338,7 +339,7 @@ void HtmlPage::updateFont(GfxState *state) {
   }
 }
 
-void HtmlPage::beginString(GfxState *state, GooString *s) {
+void HtmlPage::beginString(GfxState *state, const GooString *s) {
   curStr = new HtmlString(state, fontSize, fonts);
 }
 
@@ -1305,7 +1306,7 @@ void HtmlOutputDev::updateFont(GfxState *state) {
   pages->updateFont(state);
 }
 
-void HtmlOutputDev::beginString(GfxState *state, GooString *s) {
+void HtmlOutputDev::beginString(GfxState *state, const GooString *s) {
   pages->beginString(state, s);
 }
 
diff --git a/utils/HtmlOutputDev.h b/utils/HtmlOutputDev.h
index 794d725e..b47e40f9 100644
--- a/utils/HtmlOutputDev.h
+++ b/utils/HtmlOutputDev.h
@@ -24,6 +24,7 @@
 // Copyright (C) 2012 Igor Slepchin <igor.redhat at gmail.com>
 // Copyright (C) 2012 Fabio D'Urso <fabiodurso at hotmail.it>
 // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag at alfa.de>
+// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
 //
 // 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
@@ -136,7 +137,7 @@ public:
   HtmlPage& operator=(const HtmlPage &) = delete;
 
   // Begin a new string.
-  void beginString(GfxState *state, GooString *s);
+  void beginString(GfxState *state, const GooString *s);
 
   // Add a character to the current string.
   void addChar(GfxState *state, double x, double y,
@@ -298,7 +299,7 @@ public:
   void updateFont(GfxState *state) override;
 
   //----- text drawing
-  void beginString(GfxState *state, GooString *s) override;
+  void beginString(GfxState *state, const GooString *s) override;
   void endString(GfxState *state) override;
   void drawChar(GfxState *state, double x, double y,
 		double dx, double dy,


More information about the poppler mailing list