diff options
author | Albert Astals Cid <aacid@kde.org> | 2019-10-20 19:11:15 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2019-10-20 19:12:02 +0200 |
commit | f197ca2dc7b5f70392e99e18917fb39f20cfc585 (patch) | |
tree | 20a92e81c17d98e99dc5f6831775a05e9687b5fd /poppler | |
parent | 3d6e70f763285f4e72188309164099e2dc06559c (diff) |
CharCodeToUnicode::mapToUnicode: Make clear the data is const
Diffstat (limited to 'poppler')
-rw-r--r-- | poppler/Annot.cc | 5 | ||||
-rw-r--r-- | poppler/CairoFontEngine.cc | 2 | ||||
-rw-r--r-- | poppler/CairoFontEngine.h | 4 | ||||
-rw-r--r-- | poppler/CairoOutputDev.cc | 4 | ||||
-rw-r--r-- | poppler/CairoOutputDev.h | 4 | ||||
-rw-r--r-- | poppler/CharCodeToUnicode.cc | 2 | ||||
-rw-r--r-- | poppler/CharCodeToUnicode.h | 2 | ||||
-rw-r--r-- | poppler/Gfx.cc | 2 | ||||
-rw-r--r-- | poppler/GfxFont.cc | 10 | ||||
-rw-r--r-- | poppler/GfxFont.h | 6 | ||||
-rw-r--r-- | poppler/MarkedContentOutputDev.cc | 2 | ||||
-rw-r--r-- | poppler/MarkedContentOutputDev.h | 4 | ||||
-rw-r--r-- | poppler/OutputDev.cc | 2 | ||||
-rw-r--r-- | poppler/OutputDev.h | 4 | ||||
-rw-r--r-- | poppler/PSOutputDev.cc | 2 | ||||
-rw-r--r-- | poppler/PreScanOutputDev.cc | 2 | ||||
-rw-r--r-- | poppler/PreScanOutputDev.h | 2 | ||||
-rw-r--r-- | poppler/SplashOutputDev.cc | 4 | ||||
-rw-r--r-- | poppler/SplashOutputDev.h | 4 | ||||
-rw-r--r-- | poppler/TextOutputDev.cc | 6 | ||||
-rw-r--r-- | poppler/TextOutputDev.h | 8 |
21 files changed, 41 insertions, 40 deletions
diff --git a/poppler/Annot.cc b/poppler/Annot.cc index 9899c880..8b718d97 100644 --- a/poppler/Annot.cc +++ b/poppler/Annot.cc @@ -3860,7 +3860,8 @@ void Annot::layoutText(const GooString *text, GooString *outBuf, int *i, int *charCount, bool noReencode) { CharCode c; - Unicode uChar, *uAux; + Unicode uChar; + const Unicode *uAux; double w = 0.0; int uLen, n; double dx, dy, ox, oy; @@ -4382,7 +4383,7 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da xPrev = w; // so that first character is placed properly while (i < comb && len > 0) { CharCode code; - Unicode *uAux; + const Unicode *uAux; int uLen, n; double char_dx, char_dy, ox, oy; diff --git a/poppler/CairoFontEngine.cc b/poppler/CairoFontEngine.cc index bf6bd88d..bcfa0954 100644 --- a/poppler/CairoFontEngine.cc +++ b/poppler/CairoFontEngine.cc @@ -91,7 +91,7 @@ CairoFont::getFontFace(void) { unsigned long CairoFont::getGlyph(CharCode code, - Unicode *u, int uLen) { + const Unicode *u, int uLen) { FT_UInt gid; if (codeToGID && code < codeToGIDLen) { diff --git a/poppler/CairoFontEngine.h b/poppler/CairoFontEngine.h index 2a55af15..34802c1f 100644 --- a/poppler/CairoFontEngine.h +++ b/poppler/CairoFontEngine.h @@ -15,7 +15,7 @@ // under GPL version 2 or later // // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005, 2018 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2018, 2019 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2006, 2007 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2006, 2010 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008, 2017 Adrian Johnson <ajohnson@redneon.com> @@ -54,7 +54,7 @@ public: virtual bool matches(Ref &other, bool printing); cairo_font_face_t *getFontFace(void); - unsigned long getGlyph(CharCode code, Unicode *u, int uLen); + unsigned long getGlyph(CharCode code, const Unicode *u, int uLen); double getSubstitutionCorrection(GfxFont *gfxFont); bool isSubstitute() { return substitute; } diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index 25710410..cbfd0bdd 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -1395,7 +1395,7 @@ void CairoOutputDev::beginString(GfxState *state, const GooString *s) void CairoOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, - CharCode code, int nBytes, Unicode *u, int uLen) + CharCode code, int nBytes, const Unicode *u, int uLen) { if (currentFont) { glyphs[glyphCount].index = currentFont->getGlyph (code, u, uLen); @@ -1512,7 +1512,7 @@ finish: bool CairoOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, - CharCode code, Unicode *u, int uLen) { + CharCode code, const Unicode *u, int uLen) { cairo_save (cairo); cairo_matrix_t matrix; diff --git a/poppler/CairoOutputDev.h b/poppler/CairoOutputDev.h index b6ff8394..4bef6df7 100644 --- a/poppler/CairoOutputDev.h +++ b/poppler/CairoOutputDev.h @@ -192,13 +192,13 @@ public: 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; + CharCode code, int nBytes, const Unicode *u, int uLen) override; void beginActualText(GfxState *state, const GooString *text) override; void endActualText(GfxState *state) override; bool beginType3Char(GfxState *state, double x, double y, double dx, double dy, - CharCode code, Unicode *u, int uLen) override; + CharCode code, const Unicode *u, int uLen) override; void endType3Char(GfxState *state) override; void beginTextObject(GfxState *state) override; void endTextObject(GfxState *state) override; diff --git a/poppler/CharCodeToUnicode.cc b/poppler/CharCodeToUnicode.cc index 0695ccce..db7d9781 100644 --- a/poppler/CharCodeToUnicode.cc +++ b/poppler/CharCodeToUnicode.cc @@ -579,7 +579,7 @@ void CharCodeToUnicode::setMapping(CharCode c, Unicode *u, int len) { } } -int CharCodeToUnicode::mapToUnicode(CharCode c, Unicode **u) const { +int CharCodeToUnicode::mapToUnicode(CharCode c, Unicode const **u) const { int i; if (isIdentity) { diff --git a/poppler/CharCodeToUnicode.h b/poppler/CharCodeToUnicode.h index c50aaf06..7ddfc995 100644 --- a/poppler/CharCodeToUnicode.h +++ b/poppler/CharCodeToUnicode.h @@ -88,7 +88,7 @@ public: // Map a CharCode to Unicode. Returns a pointer in u to internal storage // so never store the pointers it returns, just the data, otherwise // your pointed values might get changed by future calls - int mapToUnicode(CharCode c, Unicode **u) const; + int mapToUnicode(CharCode c, Unicode const **u) const; // Map a Unicode to CharCode. int mapToCharCode(const Unicode* u, CharCode *c, int usize) const; diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc index 84296e61..ec2b4b35 100644 --- a/poppler/Gfx.cc +++ b/poppler/Gfx.cc @@ -3874,7 +3874,7 @@ void Gfx::doShowText(const GooString *s) { int wMode; double riseX, riseY; CharCode code; - Unicode *u = nullptr; + const Unicode *u = nullptr; double x, y, dx, dy, dx2, dy2, curX, curY, tdx, tdy, ddx, ddy; double originX, originY, tOriginX, tOriginY; double x0, y0, x1, y1; diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc index 863fe5d7..392341de 100644 --- a/poppler/GfxFont.cc +++ b/poppler/GfxFont.cc @@ -1530,7 +1530,7 @@ static int parseCharName(char *charName, Unicode *uBuf, int uLen, } int Gfx8BitFont::getNextChar(const char *s, int len, CharCode *code, - Unicode **u, int *uLen, + Unicode const **u, int *uLen, double *dx, double *dy, double *ox, double *oy) const { CharCode c; @@ -1638,7 +1638,7 @@ int *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType *ff) { // map Unicode through the cmap } else if (useUnicode) { - Unicode *uAux; + const Unicode *uAux; for (i = 0; i < 256; ++i) { if (((charName = enc[i]) && (u = globalParams->mapNameToUnicodeAll(charName)))) map[i] = ff->mapCodeToGID(cmap, u); @@ -2006,7 +2006,7 @@ GfxCIDFont::~GfxCIDFont() { } int GfxCIDFont::getNextChar(const char *s, int len, CharCode *code, - Unicode **u, int *uLen, + Unicode const **u, int *uLen, double *dx, double *dy, double *ox, double *oy) const { CID cid; CharCode dummy; @@ -2242,7 +2242,7 @@ int *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) { CharCode cid; for (cid = 0;cid < n ;cid++) { int len; - Unicode *ucodes; + const Unicode *ucodes; len = tctu->mapToUnicode(cid,&ucodes); if (len == 1) { @@ -2277,7 +2277,7 @@ int *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) { if (ctu) { CharCode cid; for (cid = 0;cid < n ;cid++) { - Unicode *ucode; + const Unicode *ucode; if (ctu->mapToUnicode(cid, &ucode)) humap[cid*N_UCS_CANDIDATES] = ucode[0]; diff --git a/poppler/GfxFont.h b/poppler/GfxFont.h index 54ab128a..1eb17a6e 100644 --- a/poppler/GfxFont.h +++ b/poppler/GfxFont.h @@ -270,7 +270,7 @@ public: // the number actually used. Returns the number of bytes used by // the char code. virtual int getNextChar(const char *s, int len, CharCode *code, - Unicode **u, int *uLen, + Unicode const **u, int *uLen, double *dx, double *dy, double *ox, double *oy) const = 0; // Does this font have a toUnicode map? @@ -326,7 +326,7 @@ public: GfxFontType typeA, Ref embFontIDA, Dict *fontDict); int getNextChar(const char *s, int len, CharCode *code, - Unicode **u, int *uLen, + Unicode const **u, int *uLen, double *dx, double *dy, double *ox, double *oy) const override; // Return the encoding. @@ -391,7 +391,7 @@ public: bool isCIDFont() const override { return true; } int getNextChar(const char *s, int len, CharCode *code, - Unicode **u, int *uLen, + Unicode const **u, int *uLen, double *dx, double *dy, double *ox, double *oy) const override; // Return the writing mode (0=horizontal, 1=vertical). diff --git a/poppler/MarkedContentOutputDev.cc b/poppler/MarkedContentOutputDev.cc index bf00d40d..02135156 100644 --- a/poppler/MarkedContentOutputDev.cc +++ b/poppler/MarkedContentOutputDev.cc @@ -121,7 +121,7 @@ void MarkedContentOutputDev::drawChar(GfxState *state, double dx, double dy, double ox, double oy, CharCode c, int nBytes, - Unicode *u, int uLen) + const Unicode *u, int uLen) { if (!inMarkedContent() || !uLen) return; diff --git a/poppler/MarkedContentOutputDev.h b/poppler/MarkedContentOutputDev.h index 0e1d9ce2..43edccad 100644 --- a/poppler/MarkedContentOutputDev.h +++ b/poppler/MarkedContentOutputDev.h @@ -5,7 +5,7 @@ // This file is licensed under the GPLv2 or later // // Copyright 2013 Igalia S.L. -// Copyright 2018 Albert Astals Cid <aacid@kde.org> +// Copyright 2018, 2019 Albert Astals Cid <aacid@kde.org> // //======================================================================== @@ -106,7 +106,7 @@ public: double dx, double dy, double ox, double oy, CharCode c, int nBytes, - Unicode *u, int uLen) override; + const Unicode *u, int uLen) override; void beginMarkedContent(const char *name, Dict *properties) override; void endMarkedContent(GfxState *state) override; diff --git a/poppler/OutputDev.cc b/poppler/OutputDev.cc index be29c5eb..633c69e6 100644 --- a/poppler/OutputDev.cc +++ b/poppler/OutputDev.cc @@ -95,7 +95,7 @@ void OutputDev::updateAll(GfxState *state) { bool OutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, - CharCode code, Unicode *u, int uLen) { + CharCode code, const Unicode *u, int uLen) { return false; } diff --git a/poppler/OutputDev.h b/poppler/OutputDev.h index 69fb535f..edc66a23 100644 --- a/poppler/OutputDev.h +++ b/poppler/OutputDev.h @@ -271,11 +271,11 @@ public: virtual void drawChar(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, - CharCode /*code*/, int /*nBytes*/, Unicode * /*u*/, int /*uLen*/) {} + CharCode /*code*/, int /*nBytes*/, const Unicode * /*u*/, int /*uLen*/) {} virtual void drawString(GfxState * /*state*/, const GooString * /*s*/) {} virtual bool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, - CharCode /*code*/, Unicode * /*u*/, int /*uLen*/); + CharCode /*code*/, const Unicode * /*u*/, int /*uLen*/); virtual void endType3Char(GfxState * /*state*/) {} virtual void beginTextObject(GfxState * /*state*/) {} virtual void endTextObject(GfxState * /*state*/) {} diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc index 1302e4ee..04418a4b 100644 --- a/poppler/PSOutputDev.cc +++ b/poppler/PSOutputDev.cc @@ -5043,7 +5043,7 @@ void PSOutputDev::drawString(GfxState *state, const GooString *s) { const char *p; UnicodeMap *uMap; CharCode code; - Unicode *u; + const Unicode *u; char buf[8]; double *dxdy; int dxdySize, len, nChars, uLen, n, m, i, j; diff --git a/poppler/PreScanOutputDev.cc b/poppler/PreScanOutputDev.cc index b24b0e74..2d042760 100644 --- a/poppler/PreScanOutputDev.cc +++ b/poppler/PreScanOutputDev.cc @@ -185,7 +185,7 @@ void PreScanOutputDev::endStringOp(GfxState * /*state*/) { bool PreScanOutputDev::beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, - CharCode /*code*/, Unicode * /*u*/, int /*uLen*/) { + CharCode /*code*/, const Unicode * /*u*/, int /*uLen*/) { // return false so all Type 3 chars get rendered (no caching) return false; } diff --git a/poppler/PreScanOutputDev.h b/poppler/PreScanOutputDev.h index 74ed4991..d65ddf91 100644 --- a/poppler/PreScanOutputDev.h +++ b/poppler/PreScanOutputDev.h @@ -99,7 +99,7 @@ public: void endStringOp(GfxState *state) override; bool beginType3Char(GfxState *state, double x, double y, double dx, double dy, - CharCode code, Unicode *u, int uLen) override; + CharCode code, const Unicode *u, int uLen) override; void endType3Char(GfxState *state) override; //----- image drawing diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc index e89e8e85..140be47a 100644 --- a/poppler/SplashOutputDev.cc +++ b/poppler/SplashOutputDev.cc @@ -2233,7 +2233,7 @@ void SplashOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, - Unicode *u, int uLen) { + const Unicode *u, int uLen) { SplashPath *path; int render; bool doFill, doStroke, doClip, strokeAdjust; @@ -2343,7 +2343,7 @@ void SplashOutputDev::drawChar(GfxState *state, double x, double y, bool SplashOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, - CharCode code, Unicode *u, int uLen) { + CharCode code, const Unicode *u, int uLen) { GfxFont *gfxFont; const Ref *fontID; const double *ctm, *bbox; diff --git a/poppler/SplashOutputDev.h b/poppler/SplashOutputDev.h index c6bf373c..fc2d787f 100644 --- a/poppler/SplashOutputDev.h +++ b/poppler/SplashOutputDev.h @@ -287,10 +287,10 @@ public: 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; + CharCode code, int nBytes, const Unicode *u, int uLen) override; bool beginType3Char(GfxState *state, double x, double y, double dx, double dy, - CharCode code, Unicode *u, int uLen) override; + CharCode code, const Unicode *u, int uLen) override; void endType3Char(GfxState *state) override; void beginTextObject(GfxState *state) override; void endTextObject(GfxState *state) override; diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc index 65ded8cb..719ee194 100644 --- a/poppler/TextOutputDev.cc +++ b/poppler/TextOutputDev.cc @@ -2616,7 +2616,7 @@ void TextPage::beginWord(GfxState *state) { void TextPage::addChar(GfxState *state, double x, double y, double dx, double dy, - CharCode c, int nBytes, Unicode *u, int uLen) { + CharCode c, int nBytes, const Unicode *u, int uLen) { double x1, y1, w1, h1, dx2, dy2, base, sp, delta; bool overlap; int i; @@ -5617,7 +5617,7 @@ ActualText::~ActualText() { void ActualText::addChar(GfxState *state, double x, double y, double dx, double dy, - CharCode c, int nBytes, Unicode *u, int uLen) { + CharCode c, int nBytes, const Unicode *u, int uLen) { if (!actualText) { text->addChar(state, x, y, dx, dy, c, nBytes, u, uLen); return; @@ -5764,7 +5764,7 @@ void TextOutputDev::endString(GfxState *state) { void TextOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, - CharCode c, int nBytes, Unicode *u, int uLen) { + CharCode c, int nBytes, const Unicode *u, int uLen) { actualText->addChar(state, x, y, dx, dy, c, nBytes, u, uLen); } diff --git a/poppler/TextOutputDev.h b/poppler/TextOutputDev.h index bb20b857..7e0064ac 100644 --- a/poppler/TextOutputDev.h +++ b/poppler/TextOutputDev.h @@ -17,7 +17,7 @@ // Copyright (C) 2006 Ed Catmur <ed@catmur.co.uk> // Copyright (C) 2007, 2008, 2011, 2013 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2007, 2017 Adrian Johnson <ajohnson@redneon.com> -// Copyright (C) 2008, 2010, 2015, 2016, 2018 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2008, 2010, 2015, 2016, 2018, 2019 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2010 Brian Ewins <brian.ewins@gmail.com> // Copyright (C) 2012, 2013, 2015, 2016 Jason Crain <jason@aquaticape.us> // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de> @@ -577,7 +577,7 @@ public: // Add a character to the current word. void addChar(GfxState *state, double x, double y, double dx, double dy, - CharCode c, int nBytes, Unicode *u, int uLen); + CharCode c, int nBytes, const Unicode *u, int uLen); // Add <nChars> invisible characters. void incCharCount(int nChars); @@ -748,7 +748,7 @@ public: void addChar(GfxState *state, double x, double y, double dx, double dy, - CharCode c, int nBytes, Unicode *u, int uLen); + CharCode c, int nBytes, const Unicode *u, int uLen); void begin(GfxState *state, const GooString *text); void end(GfxState *state); @@ -836,7 +836,7 @@ public: 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; + CharCode c, int nBytes, const Unicode *u, int uLen) override; void incCharCount(int nChars) override; void beginActualText(GfxState *state, const GooString *text) override; void endActualText(GfxState *state) override; |