[poppler] poppler/GlobalParamsWin.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Thu Jul 16 15:30:34 PDT 2015
poppler/GlobalParamsWin.cc | 57 +++++++++++++++++++++++++--------------------
1 file changed, 32 insertions(+), 25 deletions(-)
New commits:
commit 885b23bfd16a3e4970a52956493e92a160b2d0a8
Author: Dmytro Morgun <lztoad at gmail.com>
Date: Fri Jul 17 00:30:08 2015 +0200
GlobalParamsWin bug/fixes
Bug #91053
diff --git a/poppler/GlobalParamsWin.cc b/poppler/GlobalParamsWin.cc
index 084b49b..f9f40ef 100644
--- a/poppler/GlobalParamsWin.cc
+++ b/poppler/GlobalParamsWin.cc
@@ -7,6 +7,7 @@
// Copyright (C) 2012 Adrian Johnson <ajohnson at redneon.com>
// Copyright (C) 2012 Mark Brand <mabrand at mabrand.nl>
// Copyright (C) 2013 Adam Reichold <adamreichold at myopera.com>
+ // Copyright (C) 2013 Dmytro Morgun <lztoad at gmail.com>
TODO: instead of a fixed mapping defined in displayFontTab, it could
scan the whole fonts directory, parse TTF files and build font
@@ -443,11 +444,14 @@ void GlobalParams::setupBaseFonts(char * dir)
delete fontPath;
}
- if (displayFontTab[i].warnIfMissing)
- error(errSyntaxError, -1, "No display font for '{0:s}'", fontName);
+ if (displayFontTab[i].warnIfMissing) {
+ error(errSyntaxError, -1, "No display font for '{0:s}'", displayFontTab[i].name);
+ delete fontName;
+ }
}
if (winFontDir[0]) {
- sysFonts->scanWindowsFonts(new GooString(winFontDir));
+ GooString gooWinFontsDir(winFontDir);
+ sysFonts->scanWindowsFonts(&gooWinFontsDir);
}
fileName = new GooString(dataRoot);
@@ -468,32 +472,35 @@ void GlobalParams::setupBaseFonts(char * dir)
obj1.free();
parser->getObj(&obj1);
while (!obj1.isEOF()) {
- parser->getObj(&obj2);
- if (obj1.isName()) {
- // Substitutions
- if (obj2.isDict()) {
- Object obj3;
- obj2.getDict()->lookup("Path", &obj3);
- if (obj3.isString())
- addFontFile(new GooString(obj1.getName()), obj3.getString()->copy());
- obj3.free();
- // Aliases
- } else if (obj2.isName()) {
- substFiles->add(new GooString(obj1.getName()), new GooString(obj2.getName()));
- }
- }
- obj2.free();
- obj1.free();
- parser->getObj(&obj1);
- // skip trailing ';'
- while (obj1.isCmd(";")) {
- obj1.free();
- parser->getObj(&obj1);
- }
+ parser->getObj(&obj2);
+ if (obj1.isName()) {
+ // Substitutions
+ if (obj2.isDict()) {
+ Object obj3;
+ obj2.getDict()->lookup("Path", &obj3);
+ if (obj3.isString())
+ addFontFile(new GooString(obj1.getName()), obj3.getString()->copy());
+ obj3.free();
+ // Aliases
+ } else if (obj2.isName()) {
+ substFiles->add(new GooString(obj1.getName()), new GooString(obj2.getName()));
+ }
+ }
+ obj2.free();
+ obj1.free();
+ parser->getObj(&obj1);
+ // skip trailing ';'
+ while (obj1.isCmd(";")) {
+ obj1.free();
+ parser->getObj(&obj1);
+ }
}
delete file;
delete parser;
}
+ else {
+ delete fileName;
+ }
}
static const char *findSubstituteName(GfxFont *font, GooHash *fontFiles,
More information about the poppler
mailing list