Fixed the comparison of log levels

This commit is contained in:
Zane U. Ji 2013-12-21 00:33:02 +08:00
parent 9d1b206863
commit 8e524983d1
2 changed files with 3 additions and 1 deletions

View File

@ -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();

View File

@ -64,6 +64,7 @@ class MySAX2Handler : public DefaultHandler
{
mErrors.clear();
mErrorPosition = std::make_pair ( 1, 1 );
mLevel = wxLOG_Max;
}
const wxString &getErrors() const
{