diff options
author | Albert Astals Cid <aacid@kde.org> | 2019-02-27 15:44:01 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2019-02-27 17:59:49 +0100 |
commit | 49ecbd5933e5b182ffc211d281cdfdc499d0357e (patch) | |
tree | c1e3e87aa9a708a63c34970c14be35489d391b24 /utils | |
parent | 099a09c57224a8072d1591c193815e6434178f25 (diff) |
Change Dict::lookupNF return a const &
Saves some copy()
Diffstat (limited to 'utils')
-rw-r--r-- | utils/pdfunite.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/pdfunite.cc b/utils/pdfunite.cc index 4505f875..b0142116 100644 --- a/utils/pdfunite.cc +++ b/utils/pdfunite.cc @@ -204,12 +204,12 @@ int main (int argc, char *argv[]) Object catObj = docs[0]->getXRef()->getCatalog(); Dict *catDict = catObj.getDict(); intents = catDict->lookup("OutputIntents"); - afObj = catDict->lookupNF("AcroForm"); + afObj = catDict->lookupNF("AcroForm").copy(); Ref *refPage = docs[0]->getCatalog()->getPageRef(1); if (!afObj.isNull() && refPage) { docs[0]->markAcroForm(&afObj, yRef, countRef, 0, refPage->num, refPage->num); } - ocObj = catDict->lookupNF("OCProperties"); + ocObj = catDict->lookupNF("OCProperties").copy(); if (!ocObj.isNull() && ocObj.isDict() && refPage) { docs[0]->markPageObjects(ocObj.getDict(), yRef, countRef, 0, refPage->num, refPage->num); } @@ -296,7 +296,7 @@ int main (int argc, char *argv[]) pages.push_back(std::move(page)); offsets.push_back(numOffset); docs[i]->markPageObjects(pageDict, yRef, countRef, numOffset, refPage->num, refPage->num); - Object annotsObj = pageDict->lookupNF("Annots"); + Object annotsObj = pageDict->lookupNF("Annots").copy(); if (!annotsObj.isNull()) { docs[i]->markAnnotations(&annotsObj, yRef, countRef, numOffset, refPage->num, refPage->num); } @@ -313,7 +313,7 @@ int main (int argc, char *argv[]) Object pageForm = pageCatDict->lookup("AcroForm"); if (i > 0 && !pageForm.isNull() && pageForm.isDict()) { if (afObj.isNull()) { - afObj = pageCatDict->lookupNF("AcroForm"); + afObj = pageCatDict->lookupNF("AcroForm").copy(); } else if (afObj.isDict()) { doMergeFormDict(afObj.getDict(), pageForm.getDict(), numOffset); } |