From bc25012753704943808bb8f71d75f27f68c13da9 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Thu, 9 Apr 2015 14:56:28 +0200 Subject: fixed a bug in the DocumentHandler which lead to problems in case of empty explicit fields. --- src/core/parser/stack/DocumentHandler.cpp | 9 +++++---- src/core/parser/stack/Stack.cpp | 3 --- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src/core/parser/stack') diff --git a/src/core/parser/stack/DocumentHandler.cpp b/src/core/parser/stack/DocumentHandler.cpp index ce6267f..04f79fb 100644 --- a/src/core/parser/stack/DocumentHandler.cpp +++ b/src/core/parser/stack/DocumentHandler.cpp @@ -634,11 +634,12 @@ void DocumentChildHandler::end() case HandlerType::COMMAND: case HandlerType::ANNOTATION_START: case HandlerType::TOKEN: - // In case of explicit fields we do not want to pop something from - // the stack. - if (!isExplicitField) { + if(!isExplicitField){ // pop the "main" element. scope().pop(logger()); + } else{ + // in case of explicit fields, roll back. + rollbackPath(); } break; case HandlerType::ANNOTATION_END: @@ -692,8 +693,8 @@ void DocumentChildHandler::fieldEnd() { if (!isExplicitField) { popTokens(); + rollbackPath(); } - rollbackPath(); } bool DocumentChildHandler::convertData(Handle field, diff --git a/src/core/parser/stack/Stack.cpp b/src/core/parser/stack/Stack.cpp index 88ddeee..41ced2a 100644 --- a/src/core/parser/stack/Stack.cpp +++ b/src/core/parser/stack/Stack.cpp @@ -35,9 +35,6 @@ #include #endif -// TODO: Remove -#include - namespace ousia { namespace parser_stack { namespace { -- cgit v1.2.3