Ignore:
Timestamp:
Jan 17, 2009, 11:24:41 AM (13 years ago)
Author:
Eugene Romanenko
Message:

PDF plugin: Poppler library updated to version 0.10.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/poppler/mypoppler/poppler/Annot.cc

    r261 r263  
    1616// Copyright (C) 2006 Scott Turner <scotty1024@mac.com>
    1717// Copyright (C) 2007, 2008 Julien Rebetez <julienr@svn.gnome.org>
    18 // Copyright (C) 2007, 2008 Albert Astals Cid <aacid@kde.org>
     18// Copyright (C) 2007-2009 Albert Astals Cid <aacid@kde.org>
    1919// Copyright (C) 2007, 2008 Carlos Garcia Campos <carlosgc@gnome.org>
    2020// Copyright (C) 2007, 2008 Iñigo Martínez <inigomartinez@gmail.com>
     
    2323// Copyright (C) 2008 Michael Vrable <mvrable@cs.ucsd.edu>
    2424// Copyright (C) 2008 Hugo Mercier <hmercier31@gmail.com>
     25// Copyright (C) 2009 Ilya Gorenbein <igorenbein@finjan.com>
    2526//
    2627// To see a description of the changes please see the Changelog file that
     
    21402141  int tfPos, tmPos, i, j;
    21412142  GBool freeText = gFalse;      // true if text should be freed before return
     2143  GBool freeFont = gFalse;
    21422144
    21432145  //~ if there is no MK entry, this should use the existing content stream,
     
    21742176
    21752177  // force ZapfDingbats
    2176   //~ this should create the font if needed (?)
    21772178  if (forceZapfDingbats) {
    21782179    if (tfPos >= 0) {
     
    21912192    if (tok->getLength() >= 1 && tok->getChar(0) == '/') {
    21922193      if (!fontDict || !(font = fontDict->lookup(tok->getCString() + 1))) {
    2193         error(-1, "Unknown font in field's DA string");
     2194        if (forceZapfDingbats) {
     2195          // We are forcing ZaDb but the font does not exist
     2196          // so create a fake one
     2197          Ref r; // dummy Ref, it's not used at all in this codepath
     2198          r.num = 0;
     2199          r.gen = 0;
     2200          Dict *d = new Dict(xref);
     2201          font = new Gfx8BitFont(xref, "ZaDb", r, new GooString("ZapfDingbats"), fontType1, d);
     2202          delete d;
     2203          freeFont = gTrue;
     2204          addDingbatsResource = gTrue;
     2205        } else {
     2206          error(-1, "Unknown font in field's DA string");
     2207        }
    21942208      }
    21952209    } else {
     
    24962510  }
    24972511  delete convertedText;
     2512  if (freeFont) {
     2513    font->decRefCnt();
     2514  }
    24982515}
    24992516
     
    30573074    }
    30583075
     3076    obj2.free();
     3077    obj1.free();
     3078
    30593079    // this annot doesn't have an AP yet, create one
    30603080    if (appRef.num == 0)
     
    30993119  }
    31003120
     3121  addDingbatsResource = gFalse;
    31013122  generateFieldAppearance ();
    31023123
    31033124  // draw the appearance stream
    31043125  appearance.fetch(xref, &obj);
     3126  if (addDingbatsResource) {
     3127    // We are forcing ZaDb but the font does not exist
     3128    // so create a fake one
     3129    Object baseFontObj, subtypeObj;
     3130    baseFontObj.initName("ZapfDingbats");
     3131    subtypeObj.initName("Type1");
     3132
     3133    Object fontDictObj;
     3134    Dict *fontDict = new Dict(xref);
     3135    fontDict->decRef();
     3136    fontDict->add(copyString("BaseFont"), &baseFontObj);
     3137    fontDict->add(copyString("Subtype"), &subtypeObj);
     3138    fontDictObj.initDict(fontDict);
     3139
     3140    Object fontsDictObj;
     3141    Dict *fontsDict = new Dict(xref);
     3142    fontsDict->decRef();
     3143    fontsDict->add(copyString("ZaDb"), &fontDictObj);
     3144    fontsDictObj.initDict(fontsDict);
     3145
     3146    Dict *dict = new Dict(xref);
     3147    dict->add(copyString("Font"), &fontsDictObj);
     3148    gfx->pushResources(dict);
     3149    delete dict;
     3150  }
    31053151  gfx->drawAnnot(&obj, (AnnotBorder *)NULL, color,
    31063152                 rect->x1, rect->y1, rect->x2, rect->y2);
     3153  if (addDingbatsResource) {
     3154    gfx->popResources();
     3155  }
    31073156  obj.free();
    31083157}
     
    33893438  if (appearCharacs)
    33903439    delete appearCharacs;
     3440
     3441  action.free();
     3442  additionAction.free();
    33913443}
    33923444
Note: See TracChangeset for help on using the changeset viewer.