diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-10-27 16:46:08 +0100 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-10-27 21:19:47 +0100 |
commit | 181f19995d7c2c9759365ab664732504b2496063 (patch) | |
tree | 2ee7bc31faf9ec16086f6ca7d75ad80084ce0bc6 /vcl/qt5 | |
parent | 749c84a7eac613dee8a9253da3c4b140bc0f63c1 (diff) |
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 <glogow@fbihome.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/Qt5Painter.cxx | 8 |
1 files 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); |