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

StructElement: save unneeded copy() calls

parent 38422a43
......@@ -1045,11 +1045,12 @@ void StructElement::parse(Dict *element)
}
// Parent object reference (required).
s->parentRef = element->lookupNF("P").copy();
if (!s->parentRef.isRef()) {
const Object &objP = element->lookupNF("P");
if (!objP.isRef()) {
error(errSyntaxError, -1, "P object is wrong type ({0:s})", obj.getTypeName());
return;
}
s->parentRef = objP.getRef();
// Check whether the S-type is valid for the top level
// element and create a node of the appropriate type.
......
......@@ -159,7 +159,7 @@ public:
int getMCID() const { return c->mcid; }
Ref getObjectRef() const { return c->ref; }
Ref getParentRef() { return isContent() ? parent->getParentRef() : s->parentRef.getRef(); }
Ref getParentRef() { return isContent() ? parent->getParentRef() : s->parentRef; }
bool hasPageRef() const;
bool getPageRef(Ref& ref) const;
StructTreeRoot *getStructTreeRoot() { return treeRoot; }
......@@ -253,7 +253,7 @@ private:
typedef std::vector<StructElement*> ElemPtrArray;
struct StructData {
Object parentRef;
Ref parentRef;
GooString *altText;
GooString *actualText;
GooString *id;
......
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