Commit d2ccd7f9 authored by Albert Astals Cid's avatar Albert Astals Cid

Form: Save unneeded copy() calls

parent c4c8b5be
...@@ -648,9 +648,9 @@ FormField::FormField(PDFDoc *docA, Object &&aobj, const Ref aref, FormField *par ...@@ -648,9 +648,9 @@ FormField::FormField(PDFDoc *docA, Object &&aobj, const Ref aref, FormField *par
const Ref ref = childRef.getRef(); const Ref ref = childRef.getRef();
if (usedParents->find(ref.num) == usedParents->end()) { if (usedParents->find(ref.num) == usedParents->end()) {
// Field child: it could be a form field or a widget or composed dict // Field child: it could be a form field or a widget or composed dict
Object obj2 = childObj.dictLookupNF("Parent").copy(); const Object &objParent = childObj.dictLookupNF("Parent");
Object obj3 = childObj.dictLookup("Parent"); Object obj3 = childObj.dictLookup("Parent");
if (obj2.isRef() || obj3.isDict()) { if (objParent.isRef() || obj3.isDict()) {
// Child is a form field or composed dict // Child is a form field or composed dict
// We create the field, if it's composed // We create the field, if it's composed
// it will create the widget as a child // it will create the widget as a child
...@@ -666,7 +666,7 @@ FormField::FormField(PDFDoc *docA, Object &&aobj, const Ref aref, FormField *par ...@@ -666,7 +666,7 @@ FormField::FormField(PDFDoc *docA, Object &&aobj, const Ref aref, FormField *par
children = (FormField**)greallocn(children, numChildren, sizeof(FormField*)); children = (FormField**)greallocn(children, numChildren, sizeof(FormField*));
children[numChildren - 1] = Form::createFieldFromDict(std::move(childObj), doc, ref, this, &usedParentsAux); children[numChildren - 1] = Form::createFieldFromDict(std::move(childObj), doc, ref, this, &usedParentsAux);
} else { } else {
obj2 = childObj.dictLookup("Subtype"); Object obj2 = childObj.dictLookup("Subtype");
if (obj2.isName("Widget")) { if (obj2.isName("Widget")) {
// Child is a widget annotation // Child is a widget annotation
if (!terminal && numChildren > 0) { if (!terminal && numChildren > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment