wxHtmlWindow doesn't render HTML text when used only inside our .kiface dll. (Windows and Linux)
* When a wxHtmlWindow is used *only* in a dll/so module, the Html text is displayed * as plain text. * this patch forces wxHtmlWinParser initialization to avoid this issue *see https://groups.google.com/forum/#!topic/wx-users/FF0zv5qGAT0 Fixes: lp:1783544 https://bugs.launchpad.net/kicad/+bug/1783544
This commit is contained in:
parent
46f5d81d6e
commit
361366bbbc
|
@ -40,6 +40,7 @@
|
|||
#include <wx/filename.h>
|
||||
#include <wx/stdpaths.h>
|
||||
#include <wx/snglinst.h>
|
||||
#include <wx/html/htmlwin.h>
|
||||
|
||||
#include <kiway.h>
|
||||
#include <pgm_base.h>
|
||||
|
@ -99,6 +100,21 @@ PGM_BASE& Pgm()
|
|||
return program;
|
||||
}
|
||||
|
||||
// A module to allow Html modules initialization/cleanup
|
||||
// When a wxHtmlWindow is used *only* in a dll/so module, the Html text is displayed
|
||||
// as plain text.
|
||||
// This helper class is just used to force wxHtmlWinParser initialization
|
||||
// see https://groups.google.com/forum/#!topic/wx-users/FF0zv5qGAT0
|
||||
class HtmlModule: public wxModule
|
||||
{
|
||||
public:
|
||||
HtmlModule() { }
|
||||
virtual bool OnInit() override { AddDependency( CLASSINFO( wxHtmlWinParser ) ); return true; };
|
||||
virtual void OnExit() override {};
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS( HtmlModule );
|
||||
};
|
||||
wxIMPLEMENT_DYNAMIC_CLASS(HtmlModule, wxModule);
|
||||
|
||||
/**
|
||||
* Struct APP_SINGLE_TOP
|
||||
|
@ -123,6 +139,11 @@ struct APP_SINGLE_TOP : public wxApp
|
|||
|
||||
bool OnInit() override
|
||||
{
|
||||
// Force wxHtmlWinParser initialization when a wxHtmlWindow is used only
|
||||
// in a shared modules (.so or .dll file)
|
||||
// Otherwise the Html text is displayed as plain text.
|
||||
HtmlModule html_init;
|
||||
|
||||
try
|
||||
{
|
||||
return program.OnPgmInit();
|
||||
|
|
Loading…
Reference in New Issue