[poppler] glib/poppler-action.cc poppler/Annot.cc poppler/FileSpec.cc poppler/Form.cc poppler/GfxFont.cc poppler/GfxState.cc poppler/Link.cc poppler/Object.h poppler/Outline.cc poppler/Parser.cc poppler/PDFDoc.cc poppler/Stream.cc poppler/StructElement.cc qt5/src qt5/tests test/pdf-fullrewrite.cc utils/pdfinfo.cc utils/pdftohtml.cc utils/pdftotext.cc utils/pdfunite.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Fri Apr 6 11:10:39 UTC 2018
glib/poppler-action.cc | 2 +-
poppler/Annot.cc | 6 +++---
poppler/FileSpec.cc | 4 +++-
poppler/Form.cc | 6 +++---
poppler/GfxFont.cc | 4 ++--
poppler/GfxState.cc | 3 ++-
poppler/Link.cc | 3 ++-
poppler/Object.h | 3 ++-
poppler/Outline.cc | 3 ++-
poppler/PDFDoc.cc | 3 ++-
poppler/Parser.cc | 4 +++-
poppler/Stream.cc | 2 +-
poppler/StructElement.cc | 3 ++-
qt5/src/poppler-document.cc | 6 +++---
qt5/src/poppler-embeddedfile.cc | 5 +++--
qt5/src/poppler-optcontent.cc | 3 ++-
qt5/src/poppler-qt5.h | 2 +-
qt5/tests/check_dateConversion.cpp | 4 ++--
test/pdf-fullrewrite.cc | 4 ++--
utils/pdfinfo.cc | 7 ++++---
utils/pdftohtml.cc | 5 +++--
utils/pdftotext.cc | 5 +++--
utils/pdfunite.cc | 5 +++--
23 files changed, 54 insertions(+), 38 deletions(-)
New commits:
commit a8e93f46df9feb7f7241826307af51befdb25d9e
Author: Albert Astals Cid <albert.astals.cid at kdab.com>
Date: Fri Apr 6 09:02:28 2018 +0200
Make Object return const GooString pointer
This helps making sure noone is changing strings that belong to objects without us realizing.
In fact noone was doing except an ifdef for windows, fixed it to not modify the dict contents anymore
diff --git a/glib/poppler-action.cc b/glib/poppler-action.cc
index ff31e52b..03a63c23 100644
--- a/glib/poppler-action.cc
+++ b/glib/poppler-action.cc
@@ -456,7 +456,7 @@ find_annot_movie_for_action (PopplerDocument *document,
obj1 = annotObj.dictLookup ("T");
if (obj1.isString()) {
- GooString *t = obj1.getString ();
+ const GooString *t = obj1.getString ();
if (title->cmp(t) == 0)
found = gTrue;
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 2752bc7e..c6c2c745 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -114,7 +114,7 @@
// = (4 * (sqrt(2) - 1) / 3) * r
#define bezierCircle 0.55228475
-static AnnotLineEndingStyle parseAnnotLineEndingStyle(GooString *string) {
+static AnnotLineEndingStyle parseAnnotLineEndingStyle(const GooString *string) {
if (string != nullptr) {
if (!string->cmp("Square")) {
return annotLineEndingSquare;
@@ -2097,11 +2097,11 @@ void AnnotText::initialize(PDFDoc *docA, Dict *dict) {
obj1 = dict->lookup("StateModel");
if (obj1.isString()) {
- GooString *modelName = obj1.getString();
+ const GooString *modelName = obj1.getString();
Object obj2 = dict->lookup("State");
if (obj2.isString()) {
- GooString *stateName = obj2.getString();
+ const GooString *stateName = obj2.getString();
if (!stateName->cmp("Marked")) {
state = stateMarked;
diff --git a/poppler/FileSpec.cc b/poppler/FileSpec.cc
index 89894e23..a5cb947a 100644
--- a/poppler/FileSpec.cc
+++ b/poppler/FileSpec.cc
@@ -9,6 +9,7 @@
// Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
// Copyright (C) 2012, 2017 Albert Astals Cid <aacid at kde.org>
// Copyright (C) 2012 Hib Eris <hib at hiberis.nl>
+// 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
@@ -234,7 +235,7 @@ Object getFileSpecNameForPlatform (Object *fileSpec)
// system-dependent path manipulation
#ifdef _WIN32
int i, j;
- GooString *name = fileName.getString();
+ GooString *name = fileName.getString()->copy();
// "//...." --> "\...."
// "/x/...." --> "x:\...."
// "/server/share/...." --> "\\server\share\...."
@@ -274,6 +275,7 @@ Object getFileSpecNameForPlatform (Object *fileSpec)
name->del(i);
}
}
+ fileName = Object(name);
#endif /* _WIN32 */
return fileName;
diff --git a/poppler/Form.cc b/poppler/Form.cc
index c09ce93c..6aff30d1 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -854,7 +854,7 @@ FormWidget* FormField::findWidgetByRef (Ref aref)
GooString* FormField::getFullyQualifiedName() {
Object obj1;
Object parent;
- GooString *parent_name;
+ const GooString *parent_name;
GooString *full_name;
GBool unicode_encoded = gFalse;
@@ -1304,7 +1304,7 @@ int FormFieldText::parseDA(GooList* daToks)
if (obj.isDict()) {
Object objDA(obj.dictLookup("DA"));
if (objDA.isString()) {
- GooString* da = objDA.getString();
+ const GooString* da = objDA.getString();
idx = tokenizeDA(da, daToks, "Tf") - 1;
}
}
@@ -1647,7 +1647,7 @@ void FormFieldSignature::parseInfo()
// retrieve SigningTime
Object time_of_signing = sig_dict.dictLookup("M");
if (time_of_signing.isString()) {
- GooString *time_str = time_of_signing.getString();
+ const GooString *time_str = time_of_signing.getString();
signature_info->setSigningTime(dateStringToTime(time_str)); // Put this information directly in SignatureInfo object
}
diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
index dbe27ee6..eb524ec1 100644
--- a/poppler/GfxFont.cc
+++ b/poppler/GfxFont.cc
@@ -2502,7 +2502,7 @@ public:
h *= 16777619;
}
- void hash(char *p, int n) {
+ void hash(const char *p, int n) {
int i;
for (i = 0; i < n; ++i) {
hash(p[i]);
@@ -2527,7 +2527,7 @@ int GfxFontDict::hashFontObject(Object *obj) {
void GfxFontDict::hashFontObject1(Object *obj, FNVHash *h) {
Object obj2;
- GooString *s;
+ const GooString *s;
char *p;
double r;
int n, i;
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 4cf8d8e3..eaa3ab17 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -30,6 +30,7 @@
// Copyright (C) 2015 Adrian Johnson <ajohnson at redneon.com>
// Copyright (C) 2016 Marek Kasik <mkasik at redhat.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
@@ -2481,7 +2482,7 @@ GfxColorSpace *GfxIndexedColorSpace::parse(GfxResources *res, Array *arr, Output
GfxColorSpace *baseA;
int indexHighA;
Object obj1;
- char *s;
+ const char *s;
int i, j;
if (arr->getLength() != 4) {
diff --git a/poppler/Link.cc b/poppler/Link.cc
index 326cfb97..1abaea2f 100644
--- a/poppler/Link.cc
+++ b/poppler/Link.cc
@@ -20,6 +20,7 @@
// Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
// Copyright (C) 2009 Ilya Gorenbein <igorenbein at finjan.com>
// Copyright (C) 2012 Tobias Koening <tobias.koenig at kdab.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
@@ -490,7 +491,7 @@ LinkLaunch::~LinkLaunch() {
//------------------------------------------------------------------------
LinkURI::LinkURI(Object *uriObj, GooString *baseURI) {
- GooString *uri2;
+ const GooString *uri2;
int n;
char c;
diff --git a/poppler/Object.h b/poppler/Object.h
index 87f1b24a..7538253a 100644
--- a/poppler/Object.h
+++ b/poppler/Object.h
@@ -22,6 +22,7 @@
// Copyright (C) 2013, 2017, 2018 Adrian Johnson <ajohnson at redneon.com>
// Copyright (C) 2013 Adrian Perez de Castro <aperez at igalia.com>
// Copyright (C) 2016 Jakub Alba <jakubalba at gmail.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
@@ -236,7 +237,7 @@ public:
}
return type == objInt ? (double)intg : type == objInt64 ? (double)int64g : real;
}
- GooString *getString() const { OBJECT_TYPE_CHECK(objString); return string; }
+ const GooString *getString() const { OBJECT_TYPE_CHECK(objString); return string; }
// After takeString() the only method that should be called for the object is free()
// because the object it's not expected to have a NULL string.
GooString *takeString() {
diff --git a/poppler/Outline.cc b/poppler/Outline.cc
index bc8768f1..f12d9022 100644
--- a/poppler/Outline.cc
+++ b/poppler/Outline.cc
@@ -18,6 +18,7 @@
// Copyright (C) 2009 Nick Jones <nick.jones at network-box.com>
// Copyright (C) 2016 Jason Crain <jason at aquaticape.us>
// Copyright (C) 2017 Adrian Johnson <ajohnson at redneon.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
@@ -71,7 +72,7 @@ OutlineItem::OutlineItem(Dict *dict, int refNumA, OutlineItem *parentA, XRef *xr
obj1 = dict->lookup("Title");
if (obj1.isString()) {
- GooString *s = obj1.getString();
+ const GooString *s = obj1.getString();
titleLen = TextStringToUCS4(s, &title);
} else {
titleLen = 0;
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index e4320607..631f9a70 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -39,6 +39,7 @@
// Copyright (C) 2017 Fredrik Fornwall <fredrik at fornwall.net>
// Copyright (C) 2018 Ben Timby <btimby at gmail.com>
// Copyright (C) 2018 Evangelos Foutras <evangelos at foutrelis.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
@@ -683,7 +684,7 @@ GooString *PDFDoc::getDocInfoStringEntry(const char *key) {
}
static GBool
-get_id (GooString *encodedidstring, GooString *id) {
+get_id (const GooString *encodedidstring, GooString *id) {
const char *encodedid = encodedidstring->getCString();
char pdfid[pdfIdLength + 1];
int n;
diff --git a/poppler/Parser.cc b/poppler/Parser.cc
index dc777b02..869e94ad 100644
--- a/poppler/Parser.cc
+++ b/poppler/Parser.cc
@@ -19,6 +19,7 @@
// Copyright (C) 2012 Hib Eris <hib at hiberis.nl>
// Copyright (C) 2013 Adrian Johnson <ajohnson at redneon.com>
// 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
@@ -71,7 +72,8 @@ Object Parser::getObj(GBool simpleOnly,
Object obj;
Stream *str;
DecryptStream *decrypt;
- GooString *s, *s2;
+ const GooString *s;
+ GooString *s2;
int c;
// refill buffer after inline image data
diff --git a/poppler/Stream.cc b/poppler/Stream.cc
index dd8bfc1a..30095a5b 100644
--- a/poppler/Stream.cc
+++ b/poppler/Stream.cc
@@ -14,7 +14,7 @@
// under GPL version 2 or later
//
// Copyright (C) 2005 Jeff Muizelaar <jeff at infidigm.net>
-// Copyright (C) 2006-2010, 2012-2014, 2016, 2017 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2006-2010, 2012-2014, 2016, 2017, 2018 Albert Astals Cid <aacid at kde.org>
// Copyright (C) 2007 Krzysztof Kowalczyk <kkowalczyk at gmail.com>
// Copyright (C) 2008 Julien Rebetez <julien at fhtagn.net>
// Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
diff --git a/poppler/StructElement.cc b/poppler/StructElement.cc
index 5bf3a33f..d87cb20c 100644
--- a/poppler/StructElement.cc
+++ b/poppler/StructElement.cc
@@ -9,6 +9,7 @@
// Copyright 2014, 2017, 2018 Albert Astals Cid <aacid at kde.org>
// Copyright 2015 Dmytro Morgun <lztoad at gmail.com>
// Copyright 2018 Adrian Johnson <ajohnson at redneon.com>
+// Copyright 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
//
//========================================================================
@@ -777,7 +778,7 @@ Attribute *Attribute::parseUserProperty(Dict *property)
obj = property->lookup("N");
if (obj.isString()) {
- GooString *s = obj.getString();
+ const GooString *s = obj.getString();
name = s->getCString();
nameLen = s->getLength();
} else if (obj.isName())
diff --git a/qt5/src/poppler-document.cc b/qt5/src/poppler-document.cc
index 121f1206..2d971358 100644
--- a/qt5/src/poppler-document.cc
+++ b/qt5/src/poppler-document.cc
@@ -444,7 +444,7 @@ namespace Poppler {
QScopedPointer<GooString> goo(m_doc->doc->getDocInfoStringEntry(type.toLatin1().constData()));
QString str = UnicodeParsedString(goo.data());
- return Poppler::convertDate(str.toLatin1().data());
+ return Poppler::convertDate(str.toLatin1().constData());
}
bool Document::setDate( const QString & key, const QDateTime & val )
@@ -465,7 +465,7 @@ namespace Poppler {
QScopedPointer<GooString> goo(m_doc->doc->getDocInfoCreatDate());
QString str = UnicodeParsedString(goo.data());
- return Poppler::convertDate(str.toLatin1().data());
+ return Poppler::convertDate(str.toLatin1().constData());
}
bool Document::setCreationDate( const QDateTime & val )
@@ -486,7 +486,7 @@ namespace Poppler {
QScopedPointer<GooString> goo(m_doc->doc->getDocInfoModDate());
QString str = UnicodeParsedString(goo.data());
- return Poppler::convertDate(str.toLatin1().data());
+ return Poppler::convertDate(str.toLatin1().constData());
}
bool Document::setModificationDate( const QDateTime & val )
diff --git a/qt5/src/poppler-embeddedfile.cc b/qt5/src/poppler-embeddedfile.cc
index 3a20d5d6..02058b75 100644
--- a/qt5/src/poppler-embeddedfile.cc
+++ b/qt5/src/poppler-embeddedfile.cc
@@ -2,6 +2,7 @@
* Copyright (C) 2005, 2008, 2009, 2012, 2013, Albert Astals Cid <aacid at kde.org>
* Copyright (C) 2005, Brad Hards <bradh at frogmouth.net>
* Copyright (C) 2008, 2011, Pino Toscano <pino 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
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -85,13 +86,13 @@ int EmbeddedFile::size() const
QDateTime EmbeddedFile::modDate() const
{
- GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->modDate() : nullptr;
+ const GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->modDate() : nullptr;
return goo ? convertDate(goo->getCString()) : QDateTime();
}
QDateTime EmbeddedFile::createDate() const
{
- GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->createDate() : nullptr;
+ const GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->createDate() : nullptr;
return goo ? convertDate(goo->getCString()) : QDateTime();
}
diff --git a/qt5/src/poppler-optcontent.cc b/qt5/src/poppler-optcontent.cc
index f9eb8b79..36b7d6da 100644
--- a/qt5/src/poppler-optcontent.cc
+++ b/qt5/src/poppler-optcontent.cc
@@ -5,6 +5,7 @@
* Copyright (C) 2008, Carlos Garcia Campos <carlosgc at gnome.org>
* Copyright (C) 2015-2017, Albert Astals Cid <aacid at kde.org>
* Copyright (C) 2017, Hubert Figuière <hub at figuiere.net>
+ * 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
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -213,7 +214,7 @@ namespace Poppler
} else if ( (orderItem.isArray()) && (orderItem.arrayGetLength() > 0) ) {
parseOrderArray(lastItem, orderItem.getArray());
} else if ( orderItem.isString() ) {
- GooString *label = orderItem.getString();
+ const GooString *label = orderItem.getString();
OptContentItem *header = new OptContentItem ( UnicodeParsedString ( label ) );
m_headerOptContentItems.append( header );
addChild( parentNode, header );
diff --git a/qt5/src/poppler-qt5.h b/qt5/src/poppler-qt5.h
index 34339d15..b70644f7 100644
--- a/qt5/src/poppler-qt5.h
+++ b/qt5/src/poppler-qt5.h
@@ -1962,7 +1962,7 @@ height = dummy.height();
/**
Conversion from PDF date string format to QDateTime
*/
- POPPLER_QT5_EXPORT QDateTime convertDate( char *dateString );
+ POPPLER_QT5_EXPORT Q_DECL_DEPRECATED QDateTime convertDate( char *dateString );
/**
Conversion from PDF date string format to QDateTime
diff --git a/qt5/tests/check_dateConversion.cpp b/qt5/tests/check_dateConversion.cpp
index e336f394..44316a2e 100644
--- a/qt5/tests/check_dateConversion.cpp
+++ b/qt5/tests/check_dateConversion.cpp
@@ -102,7 +102,7 @@ void TestDateConv::checkDates()
QFETCH(QDate, day);
QFETCH(QTime, time);
- QCOMPARE( Poppler::convertDate(input.data()), QDateTime(day, time, Qt::UTC) );
+ QCOMPARE( Poppler::convertDate(input.constData()), QDateTime(day, time, Qt::UTC) );
}
void TestDateConv::checkInvalidDates_data()
@@ -134,7 +134,7 @@ void TestDateConv::checkInvalidDates()
{
QFETCH(QByteArray, input);
- QCOMPARE(Poppler::convertDate(input.data()), QDateTime());
+ QCOMPARE(Poppler::convertDate(input.constData()), QDateTime());
}
QTEST_GUILESS_MAIN(TestDateConv)
diff --git a/test/pdf-fullrewrite.cc b/test/pdf-fullrewrite.cc
index eb5e1900..420a690d 100644
--- a/test/pdf-fullrewrite.cc
+++ b/test/pdf-fullrewrite.cc
@@ -162,8 +162,8 @@ static GBool compareObjects(Object *objA, Object *objB)
if (objB->getType() != objString) {
return gFalse;
} else {
- GooString *strA = objA->getString();
- GooString *strB = objB->getString();
+ const GooString *strA = objA->getString();
+ const GooString *strB = objB->getString();
return (strA->cmp(strB) == 0);
}
}
diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc
index 873c4c9f..4542580b 100644
--- a/utils/pdfinfo.cc
+++ b/utils/pdfinfo.cc
@@ -22,6 +22,7 @@
// Copyright (C) 2012 Fabio D'Urso <fabiodurso at hotmail.it>
// Copyright (C) 2013 Adrian Perez de Castro <aperez at igalia.com>
// Copyright (C) 2013 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
@@ -125,7 +126,7 @@ static const ArgDesc argDesc[] = {
static void printInfoString(Dict *infoDict, const char *key, const char *text,
UnicodeMap *uMap) {
- GooString *s1;
+ const GooString *s1;
Unicode *u;
char buf[8];
int i, n, len;
@@ -145,7 +146,7 @@ static void printInfoString(Dict *infoDict, const char *key, const char *text,
}
static void printInfoDate(Dict *infoDict, const char *key, const char *text) {
- char *s;
+ const char *s;
int year, mon, day, hour, min, sec, tz_hour, tz_minute;
char tz;
struct tm tmStruct;
@@ -189,7 +190,7 @@ static void printInfoDate(Dict *infoDict, const char *key, const char *text) {
static void printISODate(Dict *infoDict, const char *key, const char *text)
{
- char *s;
+ const char *s;
int year, mon, day, hour, min, sec, tz_hour, tz_minute;
char tz;
diff --git a/utils/pdftohtml.cc b/utils/pdftohtml.cc
index 1dffc08f..04aeb1bc 100644
--- a/utils/pdftohtml.cc
+++ b/utils/pdftohtml.cc
@@ -25,6 +25,7 @@
// Copyright (C) 2014 Pino Toscano <pino at kde.org>
// Copyright (C) 2015 William Bader <williambader at hotmail.com>
// Copyright (C) 2017 Adrian Johnson <ajohnson at redneon.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
@@ -457,7 +458,7 @@ int main(int argc, char *argv[]) {
static GooString* getInfoString(Dict *infoDict, const char *key) {
Object obj;
// Raw value as read from PDF (may be in pdfDocEncoding or UCS2)
- GooString *rawString;
+ const GooString *rawString;
// Value converted to unicode
Unicode *unicodeString;
int unicodeLength;
@@ -499,7 +500,7 @@ static GooString* getInfoString(Dict *infoDict, const char *key) {
static GooString* getInfoDate(Dict *infoDict, const char *key) {
Object obj;
- char *s;
+ const char *s;
int year, mon, day, hour, min, sec, tz_hour, tz_minute;
char tz;
struct tm tmStruct;
diff --git a/utils/pdftotext.cc b/utils/pdftotext.cc
index c28beded..795cf386 100644
--- a/utils/pdftotext.cc
+++ b/utils/pdftotext.cc
@@ -26,6 +26,7 @@
// Copyright (C) 2013 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
// Copyright (C) 2015 Jeremy Echols <jechols at uoregon.edu>
// Copyright (C) 2017 Adrian Johnson <ajohnson at redneon.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
@@ -439,7 +440,7 @@ int main(int argc, char *argv[]) {
static void printInfoString(FILE *f, Dict *infoDict, const char *key,
const char *text1, const char *text2, UnicodeMap *uMap) {
- GooString *s1;
+ const GooString *s1;
GBool isUnicode;
Unicode u;
char buf[9];
@@ -478,7 +479,7 @@ static void printInfoString(FILE *f, Dict *infoDict, const char *key,
static void printInfoDate(FILE *f, Dict *infoDict, const char *key, const char *fmt) {
Object obj = infoDict->lookup(key);
if (obj.isString()) {
- char *s = obj.getString()->getCString();
+ const char *s = obj.getString()->getCString();
if (s[0] == 'D' && s[1] == ':') {
s += 2;
}
diff --git a/utils/pdfunite.cc b/utils/pdfunite.cc
index 1c3ef447..0bdfbdf6 100644
--- a/utils/pdfunite.cc
+++ b/utils/pdfunite.cc
@@ -11,6 +11,7 @@
// Copyright (C) 2013 Adrian Johnson <ajohnson at redneon.com>
// Copyright (C) 2013 Hib Eris <hib at hiberis.nl>
// Copyright (C) 2015 Arthur Stavisky <vovodroid at gmail.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
//
//========================================================================
@@ -226,14 +227,14 @@ int main (int argc, char *argv[])
if (intent.isDict()) {
Object idf = intent.dictLookup("OutputConditionIdentifier");
if (idf.isString()) {
- GooString *gidf = idf.getString();
+ const GooString *gidf = idf.getString();
GBool removeIntent = gTrue;
for (int k = 0; k < pageintents.arrayGetLength(); k++) {
Object pgintent = pageintents.arrayGet(k, 0);
if (pgintent.isDict()) {
Object pgidf = pgintent.dictLookup("OutputConditionIdentifier");
if (pgidf.isString()) {
- GooString *gpgidf = pgidf.getString();
+ const GooString *gpgidf = pgidf.getString();
if (gpgidf->cmp(gidf) == 0) {
removeIntent = gFalse;
break;
More information about the poppler
mailing list