From 181f19995d7c2c9759365ab664732504b2496063 Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Tue, 27 Oct 2020 16:46:08 +0100 Subject: Qt5 std::abort, if we're unable to paint If this crashes LO too often, we can revert it. It helped me to debug tdf#137804. Then we might need to work with exceptions or some other way to notifiy the creator of the Qt5Painter, that the constructor has failed. Much more work to handle all sites using Qt5Painter... Change-Id: I81cd18770dc93d8dd1542972cd4fc220dd0dce09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104894 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski --- vcl/qt5/Qt5Painter.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vcl/qt5/Qt5Painter.cxx b/vcl/qt5/Qt5Painter.cxx index 06eeb2895214..ce59bbe96d08 100644 --- a/vcl/qt5/Qt5Painter.cxx +++ b/vcl/qt5/Qt5Painter.cxx @@ -25,11 +25,15 @@ Qt5Painter::Qt5Painter(Qt5Graphics& rGraphics, bool bPrepareBrush, sal_uInt8 nTr : m_rGraphics(rGraphics) { if (rGraphics.m_pQImage) - begin(rGraphics.m_pQImage); + { + if (!begin(rGraphics.m_pQImage)) + std::abort(); + } else { assert(rGraphics.m_pFrame); - begin(rGraphics.m_pFrame->GetQWidget()); + if (!begin(rGraphics.m_pFrame->GetQWidget())) + std::abort(); } if (!rGraphics.m_aClipPath.isEmpty()) setClipPath(rGraphics.m_aClipPath); -- cgit