From 5fabf7e60dd320a381f132e77c19f00be6612fac Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 13 Jul 2015 13:59:55 +0200 Subject: [PATCH] Add a debug check for HTML tag handlers being available. This helps to detect the situation when HTML tag handlers are not linked in at all, as it can happen with MSVC when using static libraries, as this doesn't prevent wxHTML from parsing HTML, it just doesn't render it correctly at all and it can be difficult to understand why exactly does this happen, so try to detect this situation and provide a hint. --- src/html/htmlpars.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index 3b7e355c52..becee84ef4 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -316,6 +316,13 @@ void wxHtmlParser::AddTag(const wxHtmlTag& tag) if (m_stopParsing) return; } +#if wxDEBUG_LEVEL + else if (m_HandlersHash.empty()) + { + wxFAIL_MSG( "No HTML tag handlers registered, is your program linked " + "correctly (you might need to use FORCE_WXHTML_MODULES)?" ); + } +#endif // wxDEBUG_LEVEL if (!inner) { if (tag.HasEnding())