From 8e524983d1ebc2513d04b977d1377cddc30a8654 Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Sat, 21 Dec 2013 00:33:02 +0800 Subject: [PATCH] Fixed the comparison of log levels --- src/wrapxerces.cpp | 3 ++- src/wrapxerces.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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 {