git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
optimized memory usage.
[swftools.git]
/
pdf2swf
/
xpdf
/
Dict.cc
diff --git
a/pdf2swf/xpdf/Dict.cc
b/pdf2swf/xpdf/Dict.cc
index
c9f4fec
..
6274590
100644
(file)
--- a/
pdf2swf/xpdf/Dict.cc
+++ b/
pdf2swf/xpdf/Dict.cc
@@
-2,11
+2,13
@@
//
// Dict.cc
//
//
// Dict.cc
//
-// Copyright 1996 Derek B. Noonburg
+// Copyright 1996-2003 Glyph & Cog, LLC
//
//========================================================================
//
//========================================================================
-#ifdef __GNUC__
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
#pragma implementation
#endif
@@
-21,7
+23,8
@@
// Dict
//------------------------------------------------------------------------
// Dict
//------------------------------------------------------------------------
-Dict::Dict() {
+Dict::Dict(XRef *xrefA) {
+ xref = xrefA;
entries = NULL;
size = length = 0;
ref = 1;
entries = NULL;
size = length = 0;
ref = 1;
@@
-38,8
+41,12
@@
Dict::~Dict() {
}
void Dict::add(char *key, Object *val) {
}
void Dict::add(char *key, Object *val) {
- if (length + 1 > size) {
- size += 8;
+ if (length == size) {
+ if (length == 0) {
+ size = 8;
+ } else {
+ size *= 2;
+ }
entries = (DictEntry *)grealloc(entries, size * sizeof(DictEntry));
}
entries[length].key = key;
entries = (DictEntry *)grealloc(entries, size * sizeof(DictEntry));
}
entries[length].key = key;
@@
-66,7
+73,7
@@
GBool Dict::is(char *type) {
Object *Dict::lookup(char *key, Object *obj) {
DictEntry *e;
Object *Dict::lookup(char *key, Object *obj) {
DictEntry *e;
- return (e = find(key)) ? e->val.fetch(obj) : obj->initNull();
+ return (e = find(key)) ? e->val.fetch(xref, obj) : obj->initNull();
}
Object *Dict::lookupNF(char *key, Object *obj) {
}
Object *Dict::lookupNF(char *key, Object *obj) {
@@
-80,7
+87,7
@@
char *Dict::getKey(int i) {
}
Object *Dict::getVal(int i, Object *obj) {
}
Object *Dict::getVal(int i, Object *obj) {
- return entries[i].val.fetch(obj);
+ return entries[i].val.fetch(xref, obj);
}
Object *Dict::getValNF(int i, Object *obj) {
}
Object *Dict::getValNF(int i, Object *obj) {