From ffad70694935c230baf5eeeef83020386c1896ac Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Tue, 31 Mar 2015 23:59:23 +0200 Subject: Use getFieldDescriptor method with numeric index --- src/core/parser/stack/DocumentHandler.cpp | 9 +++++---- 1 file 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 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 desc = parent->getDescriptor(); // Retrieve the actual FieldDescriptor - Rooted field = desc->getFieldDescriptors()[fieldIdx]; + Rooted field = desc->getFieldDescriptor(fieldIdx); + // If it is a primitive field directly, try to parse the content. if (field->isPrimitive()) { // Add it as primitive content. -- cgit v1.2.3