From 4a9a0ec3e45c3870771e8dd44c62a05cf0d4d2d1 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Mon, 12 Sep 2011 10:57:41 +0000 Subject: Code shuffle so function has only one exit point. --- source/blender/collada/ErrorHandler.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'source/blender') diff --git a/source/blender/collada/ErrorHandler.cpp b/source/blender/collada/ErrorHandler.cpp index 7108dbad18a..61c03ed673c 100644 --- a/source/blender/collada/ErrorHandler.cpp +++ b/source/blender/collada/ErrorHandler.cpp @@ -49,6 +49,8 @@ ErrorHandler::~ErrorHandler() //-------------------------------------------------------------------- bool ErrorHandler::handleError( const COLLADASaxFWL::IError* error ) { + mError = true; + if ( error->getErrorClass() == COLLADASaxFWL::IError::ERROR_SAXPARSER ) { COLLADASaxFWL::SaxParserError* saxParserError = (COLLADASaxFWL::SaxParserError*) error; @@ -59,32 +61,29 @@ bool ErrorHandler::handleError( const COLLADASaxFWL::IError* error ) { if ( strcmp(parserError.getElement(), "effect") == 0 ) { - return false; + mError = false; } } if ( parserError.getErrorType() == GeneratedSaxParser::ParserError::ERROR_VALIDATION_SEQUENCE_PREVIOUS_SIBLING_NOT_PRESENT) { - if ( (strcmp(parserError.getElement(), "extra") == 0) - && (strcmp(parserError.getAdditionalText().c_str(), "sibling: fx_profile_abstract") == 0)) + if ( !((strcmp(parserError.getElement(), "extra") == 0) + && (strcmp(parserError.getAdditionalText().c_str(), "sibling: fx_profile_abstract") == 0))) { - return false; + mError = false; } } if ( parserError.getErrorType() == GeneratedSaxParser::ParserError::ERROR_COULD_NOT_OPEN_FILE) { std::cout << "Couldn't open file" << std::endl; - mError = true; } std::cout << "Schema validation error: " << parserError.getErrorMessage() << std::endl; - mError = true; } else if ( error->getErrorClass() == COLLADASaxFWL::IError::ERROR_SAXFWL ) { COLLADASaxFWL::SaxFWLError* saxFWLError = (COLLADASaxFWL::SaxFWLError*) error; std::cout << "Sax FWL Error: " << saxFWLError->getErrorMessage() << std::endl; - mError = true; } return false; } -- cgit v1.2.3