diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-09-03 15:15:43 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-11-08 09:14:35 +0100 |
commit | 220dfb3ad11db0ca85ddbbc1c4800f9e65a85721 (patch) | |
tree | e2f942d40922a5f45bf5db9c0ea31f677db038c3 /vcl | |
parent | 4fe5abbe2a5a71885b343c1399cca0fdd875e7ac (diff) |
custom widgets: return early when the widget lib is not available
Change-Id: I1d740b4a3840f73015f34bd2143663a919db2956
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/headless/CustomWidgetDraw.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/headless/CustomWidgetDraw.cxx b/vcl/headless/CustomWidgetDraw.cxx index ef1a0a053033..22d2678b57a1 100644 --- a/vcl/headless/CustomWidgetDraw.cxx +++ b/vcl/headless/CustomWidgetDraw.cxx @@ -44,6 +44,8 @@ CustomWidgetDraw::~CustomWidgetDraw() {} bool CustomWidgetDraw::isNativeControlSupported(ControlType eType, ControlPart ePart) { + if (!s_pWidgetImplementation) + return false; return s_pWidgetImplementation->isNativeControlSupported(eType, ePart); } @@ -59,7 +61,7 @@ bool CustomWidgetDraw::drawNativeControl(ControlType eType, ControlPart ePart, ControlState eState, const ImplControlValue& rValue, const OUString& /*aCaptions*/) { - if (s_pWidgetImplementation == nullptr) + if (!s_pWidgetImplementation) return false; bool bOldAA = m_rGraphics.getAntiAliasB2DDraw(); @@ -285,7 +287,7 @@ bool CustomWidgetDraw::getNativeControlRegion( ControlState eState, const ImplControlValue& /*aValue*/, const OUString& /*aCaption*/, tools::Rectangle& rNativeBoundingRegion, tools::Rectangle& rNativeContentRegion) { - if (s_pWidgetImplementation == nullptr) + if (!s_pWidgetImplementation) return false; return s_pWidgetImplementation->getRegion(eType, ePart, eState, rBoundingControlRegion, |