Don't leak wx/debug everywhere via tool_event

This commit is contained in:
Marek Roszko 2021-06-03 01:36:12 -04:00
parent 29783f125b
commit 8ea180c6b7
2 changed files with 19 additions and 17 deletions

View File

@ -30,6 +30,12 @@
#include <tool/tool_manager.h>
#include <tool/actions.h>
#ifdef WX_COMPATIBILITY
#include <wx/debug.h>
#else
#include <cassert>
#endif
struct FlagString
{
int flag;
@ -67,6 +73,18 @@ void TOOL_EVENT::init()
}
VECTOR2D TOOL_EVENT::returnCheckedPosition( const VECTOR2D& aPos ) const
{
#ifdef WX_COMPATIBILITY
wxCHECK_MSG( HasPosition(), VECTOR2D(), "Attempted to get position from non-position event" );
#else
assert( HasPosition() );
#endif
return aPos;
}
bool TOOL_EVENT::IsAction( const TOOL_ACTION* aAction ) const
{
return Matches( aAction->MakeEvent() );

View File

@ -34,12 +34,6 @@
#include <math/vector2d.h>
#include <core/optional.h>
#ifdef WX_COMPATIBILITY
#include <wx/debug.h>
#else
#include <cassert>
#endif
class TOOL_ACTION;
class TOOL_MANAGER;
@ -520,17 +514,7 @@ private:
* @param aPos the position to return if the event is valid
* @return the checked position
*/
VECTOR2D returnCheckedPosition( const VECTOR2D& aPos ) const
{
#ifdef WX_COMPATIBILITY
wxCHECK_MSG( HasPosition(), VECTOR2D(),
"Attempted to get position from non-position event" );
#else
assert( HasPosition() );
#endif
return aPos;
}
VECTOR2D returnCheckedPosition( const VECTOR2D& aPos ) const;
TOOL_EVENT_CATEGORY m_category;
TOOL_ACTIONS m_actions;