summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-03-31 23:59:23 +0200
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2016-04-25 22:19:28 +0200
commitffad70694935c230baf5eeeef83020386c1896ac (patch)
tree0f7c5911625aac0dba9e0838d555d491f9361847
parent8c85e1c10085d6d634e35a63f0fc7b68a1b28eff (diff)
Use getFieldDescriptor method with numeric index
-rw-r--r--src/core/parser/stack/DocumentHandler.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/parser/stack/DocumentHandler.cpp b/src/core/parser/stack/DocumentHandler.cpp
index a7fbaa8..a322028 100644
--- a/src/core/parser/stack/DocumentHandler.cpp
+++ b/src/core/parser/stack/DocumentHandler.cpp
@@ -292,7 +292,7 @@ bool DocumentChildHandler::startCommand(Variant::mapType &args)
// calculate a path if transparent entities are needed in between.
Rooted<FieldDescriptor> field =
- parent->getDescriptor()->getFieldDescriptors()[fieldIdx];
+ parent->getDescriptor()->getFieldDescriptor(fieldIdx);
size_t lastFieldIdx = fieldIdx;
auto pathRes = field->pathTo(strct, logger());
if (!pathRes.second) {
@@ -356,7 +356,7 @@ bool DocumentChildHandler::startAnnotation(Variant::mapType &args)
preamble(parentNode, fieldIdx, parent);
if (!parent->getDescriptor()
- ->getFieldDescriptors()[fieldIdx]
+ ->getFieldDescriptor(fieldIdx)
->isPrimitive()) {
break;
}
@@ -376,7 +376,7 @@ bool DocumentChildHandler::startAnnotation(Variant::mapType &args)
logger().error(
"Cannot start or end annotation within the primitive field \"" +
parent->getDescriptor()
- ->getFieldDescriptors()[fieldIdx]
+ ->getFieldDescriptor(fieldIdx)
->getNameOrDefaultName() +
"\" of descriptor \"" + parent->getDescriptor()->getName() +
"\".",
@@ -575,7 +575,8 @@ bool DocumentChildHandler::data()
Rooted<Descriptor> desc = parent->getDescriptor();
// Retrieve the actual FieldDescriptor
- Rooted<FieldDescriptor> field = desc->getFieldDescriptors()[fieldIdx];
+ Rooted<FieldDescriptor> field = desc->getFieldDescriptor(fieldIdx);
+
// If it is a primitive field directly, try to parse the content.
if (field->isPrimitive()) {
// Add it as primitive content.