X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fxpdf%2FObject.cc;h=71c632a1a3759dd7cce004bf712e6e41c429dba8;hb=85c46a8011c7fd5e4bda282266006c972ea7606b;hp=f9c10674d8957aede9507c7aaefeace4afd71c98;hpb=fc554a43712b76d16b41ec77dd311b4a78b1ef6b;p=swftools.git diff --git a/pdf2swf/xpdf/Object.cc b/pdf2swf/xpdf/Object.cc index f9c1067..71c632a 100644 --- a/pdf2swf/xpdf/Object.cc +++ b/pdf2swf/xpdf/Object.cc @@ -2,11 +2,13 @@ // // Object.cc // -// Copyright 1996 Derek B. Noonburg +// Copyright 1996-2003 Glyph & Cog, LLC // //======================================================================== -#ifdef __GNUC__ +#include + +#ifdef USE_GCC_PRAGMAS #pragma implementation #endif @@ -44,21 +46,28 @@ int Object::numAlloc[numObjTypes] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; #endif -Object *Object::initArray() { +Object *Object::initArray(XRef *xref) { initObj(objArray); - array = new Array(); + array = new Array(xref); + return this; +} + +Object *Object::initDict(XRef *xref) { + initObj(objDict); + dict = new Dict(xref); return this; } -Object *Object::initDict() { +Object *Object::initDict(Dict *dictA) { initObj(objDict); - dict = new Dict(); + dict = dictA; + dict->incRef(); return this; } -Object *Object::initStream(Stream *stream1) { +Object *Object::initStream(Stream *streamA) { initObj(objStream); - stream = stream1; + stream = streamA; return this; } @@ -92,7 +101,7 @@ Object *Object::copy(Object *obj) { return obj; } -Object *Object::fetch(Object *obj) { +Object *Object::fetch(XRef *xref, Object *obj) { return (type == objRef && xref) ? xref->fetch(ref.num, ref.gen, obj) : copy(obj); } @@ -151,7 +160,9 @@ void Object::print(FILE *f) { fprintf(f, "%g", real); break; case objString: - fprintf(f, "(%s)", string->getCString()); + fprintf(f, "("); + fwrite(string->getCString(), 1, string->getLength(), f); + fprintf(f, ")"); break; case objName: fprintf(f, "/%s", name);