Commit 6bb508ac authored by Albert Astals Cid's avatar Albert Astals Cid Committed by Albert Astals Cid
Browse files

More const in GfxFont methods

parent 39010904
......@@ -193,26 +193,26 @@ public:
const GooString *getTag() const { return tag; }
// Get font dictionary ID.
Ref *getID() { return &id; }
const Ref *getID() const { return &id; }
// Does this font match the tag?
GBool matches(char *tagA) { return !tag->cmp(tagA); }
GBool matches(const char *tagA) const { return !tag->cmp(tagA); }
// Get font family name.
GooString *getFamily() { return family; }
// Get font stretch.
Stretch getStretch() { return stretch; }
Stretch getStretch() const { return stretch; }
// Get font weight.
Weight getWeight() { return weight; }
Weight getWeight() const { return weight; }
// Get the original font name (ignornig any munging that might have
// been done to map to a canonical Base-14 font name).
const GooString *getName() const { return name; }
// Get font type.
GfxFontType getType() { return type; }
GfxFontType getType() const { return type; }
virtual GBool isCIDFont() const { return gFalse; }
// Get embedded font ID, i.e., a ref for the font file stream.
......
......@@ -2866,7 +2866,7 @@ void PSOutputDev::setupType3Font(GfxFont *font, GooString *psName,
// Make a unique PS font name, based on the names given in the PDF
// font object, and an object ID (font file object for
GooString *PSOutputDev::makePSFontName(GfxFont *font, Ref *id) {
GooString *PSOutputDev::makePSFontName(GfxFont *font, const Ref *id) {
GooString *psName;
const GooString *s;
......
......@@ -373,7 +373,7 @@ private:
GBool needVerticalMetrics);
void setupEmbeddedOpenTypeCFFFont(GfxFont *font, Ref *id, GooString *psName);
void setupType3Font(GfxFont *font, GooString *psName, Dict *parentResDict);
GooString *makePSFontName(GfxFont *font, Ref *id);
GooString *makePSFontName(GfxFont *font, const Ref *id);
void setupImages(Dict *resDict);
void setupImage(Ref id, Stream *str, GBool mask);
void setupForms(Dict *resDict);
......
......@@ -38,6 +38,7 @@
// Copyright (C) 2015 Kenji Uno <ku@digitaldolphins.jp>
// Copyright (C) 2016 Takahiro Hashimoto <kenya888.en@gmail.com>
// Copyright (C) 2017 Even Rouault <even.rouault@spatialys.com>
// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@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
......@@ -1196,7 +1197,7 @@ static const SplashBlendFunc splashOutBlendFuncs[] = {
class SplashOutFontFileID: public SplashFontFileID {
public:
SplashOutFontFileID(Ref *rA) { r = *rA; }
SplashOutFontFileID(const Ref *rA) { r = *rA; }
~SplashOutFontFileID() {}
......@@ -1222,14 +1223,14 @@ struct T3FontCacheTag {
class T3FontCache {
public:
T3FontCache(Ref *fontID, double m11A, double m12A,
T3FontCache(const Ref *fontID, double m11A, double m12A,
double m21A, double m22A,
int glyphXA, int glyphYA, int glyphWA, int glyphHA,
GBool aa, GBool validBBoxA);
~T3FontCache();
T3FontCache(const T3FontCache &) = delete;
T3FontCache& operator=(const T3FontCache &) = delete;
GBool matches(Ref *idA, double m11A, double m12A,
GBool matches(const Ref *idA, double m11A, double m12A,
double m21A, double m22A)
{ return fontID.num == idA->num && fontID.gen == idA->gen &&
m11 == m11A && m12 == m12A && m21 == m21A && m22 == m22A; }
......@@ -1246,7 +1247,7 @@ public:
T3FontCacheTag *cacheTags; // cache tags, i.e., char codes
};
T3FontCache::T3FontCache(Ref *fontIDA, double m11A, double m12A,
T3FontCache::T3FontCache(const Ref *fontIDA, double m11A, double m12A,
double m21A, double m22A,
int glyphXA, int glyphYA, int glyphWA, int glyphHA,
GBool validBBoxA, GBool aa) {
......@@ -2501,7 +2502,7 @@ GBool SplashOutputDev::beginType3Char(GfxState *state, double x, double y,
double dx, double dy,
CharCode code, Unicode *u, int uLen) {
GfxFont *gfxFont;
Ref *fontID;
const Ref *fontID;
double *ctm, *bbox;
T3FontCache *t3Font;
T3GlyphStack *t3gs;
......
......@@ -25,6 +25,7 @@
// Copyright (C) 2013 Mihai Niculescu <q.quark@gmail.com>
// Copyright (C) 2017, 2018 Oliver Sander <oliver.sander@tu-dresden.de>
// Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@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
......@@ -70,7 +71,7 @@
class SplashOutFontFileID: public SplashFontFileID {
public:
SplashOutFontFileID(Ref *rA) { r = *rA; }
SplashOutFontFileID(const Ref *rA) { r = *rA; }
~SplashOutFontFileID() {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment