diff --git a/src/wrapxerces.cpp b/src/wrapxerces.cpp index 363eb0b..78f65cb 100644 --- a/src/wrapxerces.cpp +++ b/src/wrapxerces.cpp @@ -215,7 +215,8 @@ void MySAX2Handler::logError ( const wxString &type, wxLogLevel level, WrapXerces::toString ( e.getMessage() ).c_str(), mEOL.c_str() ); // Only save the first error position - if ( level > mLevel || ( level == mLevel && mErrorPosition.first == 1 + BOOST_STATIC_ASSERT ( wxLOG_Error < wxLOG_Warning ); + if ( level < mLevel || ( level == mLevel && mErrorPosition.first == 1 && mErrorPosition.second == 1 ) ) { mErrorPosition.first = e.getLineNumber(); diff --git a/src/wrapxerces.h b/src/wrapxerces.h index 8d38fd8..db324fd 100644 --- a/src/wrapxerces.h +++ b/src/wrapxerces.h @@ -64,6 +64,7 @@ class MySAX2Handler : public DefaultHandler { mErrors.clear(); mErrorPosition = std::make_pair ( 1, 1 ); + mLevel = wxLOG_Max; } const wxString &getErrors() const {