diff options
-rw-r--r-- | poppler/Array.cc | 4 | ||||
-rw-r--r-- | poppler/Array.h | 2 | ||||
-rw-r--r-- | poppler/Page.cc | 10 |
3 files changed, 7 insertions, 9 deletions
diff --git a/poppler/Array.cc b/poppler/Array.cc index a6cf4bcc..f32dc38a 100644 --- a/poppler/Array.cc +++ b/poppler/Array.cc @@ -46,14 +46,14 @@ Array::Array(XRef *xrefA) { Array::~Array() { } -Object Array::copy(XRef *xrefA) const { +Array *Array::copy(XRef *xrefA) const { arrayLocker(); Array *a = new Array(xrefA); a->elems.reserve(elems.size()); for (const auto& elem : elems) { a->elems.push_back(elem.copy()); } - return Object(a); + return a; } void Array::add(Object &&elem) { diff --git a/poppler/Array.h b/poppler/Array.h index be1123cf..9232423a 100644 --- a/poppler/Array.h +++ b/poppler/Array.h @@ -57,7 +57,7 @@ public: int getLength() const { return elems.size(); } // Copy array with new xref - Object copy(XRef *xrefA) const; + Array *copy(XRef *xrefA) const; // Add an element // elem becomes a dead object after this call diff --git a/poppler/Page.cc b/poppler/Page.cc index 26537eb9..f642018a 100644 --- a/poppler/Page.cc +++ b/poppler/Page.cc @@ -337,21 +337,19 @@ Dict *Page::getResourceDictCopy(XRef *xrefA) { } void Page::replaceXRef(XRef *xrefA) { - Object obj1; Dict *pageDict = pageObj.getDict()->copy(xrefA); xref = xrefA; trans = pageDict->lookupNF("Trans").copy(); annotsObj = pageDict->lookupNF("Annots").copy(); contents = pageDict->lookupNF("Contents").copy(); if (contents.isArray()) { - obj1 = pageDict->lookupNF("Contents").copy(); - contents = obj1.getArray()->copy(xrefA); + contents = Object(contents.getArray()->copy(xrefA)); } thumb = pageDict->lookupNF("Thumb").copy(); actions = pageDict->lookupNF("AA").copy(); - obj1 = pageDict->lookup("Resources"); - if (obj1.isDict()) { - attrs->replaceResource(std::move(obj1)); + Object resources = pageDict->lookup("Resources"); + if (resources.isDict()) { + attrs->replaceResource(std::move(resources)); } delete pageDict; } |