Commit 6b099768 authored by Albert Astals Cid's avatar Albert Astals Cid

StructElement::parseChild: Save copy() call

parent 2c26b40b
......@@ -1177,7 +1177,7 @@ void StructElement::parse(Dict *element)
}
}
StructElement *StructElement::parseChild(Object *ref,
StructElement *StructElement::parseChild(const Object *ref,
Object *childObj,
std::set<int> &seen)
{
......@@ -1255,7 +1255,7 @@ void StructElement::parseChildren(Dict *element, std::set<int> &seen)
if (kids.isArray()) {
for (int i = 0; i < kids.arrayGetLength(); i++) {
Object obj = kids.arrayGet(i);
Object ref = kids.arrayGetNF(i).copy();
const Object &ref = kids.arrayGetNF(i);
parseChild(&ref, &obj, seen);
}
} else if (kids.isDict() || kids.isInt()) {
......
......@@ -6,7 +6,7 @@
//
// Copyright 2013, 2014 Igalia S.L.
// Copyright 2014 Luigi Scarso <luigi.scarso@gmail.com>
// Copyright 2014, 2018 Albert Astals Cid <aacid@kde.org>
// Copyright 2014, 2018, 2019 Albert Astals Cid <aacid@kde.org>
// Copyright 2018 Adam Reichold <adam.reichold@t-online.de>
//
//========================================================================
......@@ -298,7 +298,7 @@ private:
StructElement(const Ref ref, StructTreeRoot *treeRootA, StructElement *parentA);
void parse(Dict* elementDict);
StructElement* parseChild(Object *ref, Object* childObj, std::set<int> &seen);
StructElement* parseChild(const Object *ref, Object* childObj, std::set<int> &seen);
void parseChildren(Dict* element, std::set<int> &seen);
void parseAttributes(Dict *element, bool keepExisting = false);
......
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