include/vcl/customweld.hxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
New commits: commit 514bc435cd9c8f8f7c4fb31f2bbfde80ed667fe6 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu May 14 19:19:26 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri May 15 11:18:33 2020 +0200 allow queue_draw/Invalidate before drawing area is set Change-Id: I6cd58a340ea57ca2b212114d81f2cc5b774a095b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94253 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx index 74792fb266f1..85829f35d6ff 100644 --- a/include/vcl/customweld.hxx +++ b/include/vcl/customweld.hxx @@ -44,10 +44,17 @@ public: void SetOutputSizePixel(const Size& rSize) { m_aSize = rSize; } virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) { m_pDrawingArea = pDrawingArea; } weld::DrawingArea* GetDrawingArea() const { return m_pDrawingArea; } - void Invalidate() { m_pDrawingArea->queue_draw(); } + void Invalidate() + { + if (!m_pDrawingArea) + return; + m_pDrawingArea->queue_draw(); + } static bool IsUpdateMode() { return true; } void Invalidate(const tools::Rectangle& rRect) { + if (!m_pDrawingArea) + return; m_pDrawingArea->queue_draw_area(rRect.Left(), rRect.Top(), rRect.GetWidth(), rRect.GetHeight()); } @@ -87,7 +94,12 @@ public: { m_pDrawingArea->set_size_request(nWidth, nHeight); } - void queue_resize() { m_pDrawingArea->queue_resize(); } + void queue_resize() + { + if (!m_pDrawingArea) + return; + m_pDrawingArea->queue_resize(); + } CustomWidgetController() : m_pDrawingArea(nullptr) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits