Commit f75c0f5c authored by Albert Astals Cid's avatar Albert Astals Cid Committed by Albert Astals Cid

Make GfxFont::getName const

parent a669ad5c
......@@ -930,7 +930,7 @@ text_span_poppler_text_span (const TextSpan& span)
{
// GfxFont sometimes does not have a family name but there
// is always a font name that can be used as fallback.
GooString *font_name = span.getFont ()->getFamily ();
const GooString *font_name = span.getFont ()->getFamily ();
if (font_name == nullptr)
font_name = span.getFont ()->getName ();
......
......@@ -12,6 +12,7 @@
// Copyright (C) 2010, 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2011 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
// 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
......@@ -153,7 +154,7 @@ void FontInfoScanner::scanFonts(XRef *xrefA, Dict *resDict, GooList *fontsList)
}
FontInfo::FontInfo(GfxFont *font, XRef *xref) {
GooString *origName;
const GooString *origName;
fontRef = *font->getID();
......
......@@ -209,7 +209,7 @@ public:
// Get the original font name (ignornig any munging that might have
// been done to map to a canonical Base-14 font name).
GooString *getName() { return name; }
const GooString *getName() const { return name; }
// Get font type.
GfxFontType getType() { return type; }
......
......@@ -263,7 +263,7 @@ public:
~SysFontList();
SysFontList(const SysFontList &) = delete;
SysFontList& operator=(const SysFontList &) = delete;
SysFontInfo *find(GooString *name, GBool isFixedWidth, GBool exact);
SysFontInfo *find(const GooString *name, GBool isFixedWidth, GBool exact);
#ifdef _WIN32
void scanWindowsFonts(GooString *winFontDir);
......@@ -289,7 +289,7 @@ SysFontList::~SysFontList() {
deleteGooList(fonts, SysFontInfo);
}
SysFontInfo *SysFontList::find(GooString *name, GBool fixedWidth, GBool exact) {
SysFontInfo *SysFontList::find(const GooString *name, GBool fixedWidth, GBool exact) {
GooString *name2;
GBool bold, italic, oblique;
SysFontInfo *fi;
......@@ -1108,7 +1108,7 @@ GooString *GlobalParams::findSystemFontFile(GfxFont *font,
SysFontInfo *fi = nullptr;
FcPattern *p=nullptr;
GooString *path = nullptr;
GooString *fontName = font->getName();
const GooString *fontName = font->getName();
GooString substituteName;
if (!fontName) return nullptr;
lockGlobalParams;
......
......@@ -31,6 +31,7 @@
// Copyright (C) 2014 Till Kamppeter <till.kamppeter@gmail.com>
// Copyright (C) 2015 Marek Kasik <mkasik@redhat.com>
// Copyright (C) 2016 Caolán McNamara <caolanm@redhat.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
......@@ -2866,7 +2867,8 @@ 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 *psName, *s;
GooString *psName;
const GooString *s;
if ((s = font->getEmbeddedFontName())) {
psName = filterPSName(s);
......@@ -7478,7 +7480,7 @@ void PSOutputDev::writePSName(const char *s) {
}
}
GooString *PSOutputDev::filterPSName(GooString *name) {
GooString *PSOutputDev::filterPSName(const GooString *name) {
GooString *name2;
char buf[8];
int i;
......
......@@ -24,6 +24,7 @@
// Copyright (C) 2010 Hib Eris <hib@hiberis.nl>
// Copyright (C) 2011, 2014, 2017 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
// 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
......@@ -422,7 +423,7 @@ private:
double *x1, double *y1);
#endif
void cvtFunction(Function *func, GBool invertPSFunction = gFalse);
GooString *filterPSName(GooString *name);
GooString *filterPSName(const GooString *name);
// Write the document-level setup.
void writeDocSetup(PDFDoc *doc, Catalog *catalog, const std::vector<int> &pages, GBool duplexA);
......
......@@ -27,6 +27,7 @@
// Copyright (C) 2012 Luis Parravicini <lparravi@gmail.com>
// Copyright (C) 2013 Julien Nabet <serval2412@yahoo.fr>
// Copyright (C) 2017 Jason Crain <jason@inspiresomeone.us>
// 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
......@@ -111,7 +112,7 @@ HtmlFont::HtmlFont(GfxFont *font, int _size, GfxRGB rgb){
//if (col) color=HtmlFontColor(col);
//else color=HtmlFontColor();
color=HtmlFontColor(rgb);
GooString* ftname=font->getName();
const GooString* ftname=font->getName();
if (!ftname) ftname = getDefaultFont();
GooString *fontname = nullptr;
......
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