From 31818b9ba8b827fefc8ba30af27b3dc387c27ac4 Mon Sep 17 00:00:00 2001 From: gambas Date: Sun, 14 Nov 2021 22:07:54 +0100 Subject: [PATCH] HtmlView: Mouse events do not crash a void view anymore. [GB.FORM.HTMLVIEW] * BUG: HtmlView: Mouse events do not crash a void view anymore. --- gb.form.htmlview/src/c_htmldocument.cpp | 6 +++++- gb.form.htmlview/src/gb.form.htmlview.component | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) mode change 100644 => 120000 gb.form.htmlview/src/gb.form.htmlview.component diff --git a/gb.form.htmlview/src/c_htmldocument.cpp b/gb.form.htmlview/src/c_htmldocument.cpp index 10714fe6d..1d75b7e03 100644 --- a/gb.form.htmlview/src/c_htmldocument.cpp +++ b/gb.form.htmlview/src/c_htmldocument.cpp @@ -923,6 +923,9 @@ void html_document::on_mouse(int event, int x, int y) litehtml::position::vector redraw_boxes; bool ret; + if (!m_html) + return; + switch (event) { case MOUSE_DOWN: @@ -965,7 +968,8 @@ void html_document::on_mouse(int event, int x, int y) void html_document::on_media_change() { - m_html->media_changed(); + if (m_html) + m_html->media_changed(); } int html_document::find_anchor(const litehtml::tstring& anchor) diff --git a/gb.form.htmlview/src/gb.form.htmlview.component b/gb.form.htmlview/src/gb.form.htmlview.component deleted file mode 100644 index 10e636c3f..000000000 --- a/gb.form.htmlview/src/gb.form.htmlview.component +++ /dev/null @@ -1,3 +0,0 @@ -[Component] -Author= -Alpha=1 diff --git a/gb.form.htmlview/src/gb.form.htmlview.component b/gb.form.htmlview/src/gb.form.htmlview.component new file mode 120000 index 000000000..a3a7af492 --- /dev/null +++ b/gb.form.htmlview/src/gb.form.htmlview.component @@ -0,0 +1 @@ +gb.form.htmlview/.component \ No newline at end of file