summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-09-03 15:15:43 +0200
committerJan Holesovsky <kendy@collabora.com>2018-11-09 18:42:28 +0100
commitef4e531b59b10efbd6a0c8adf60bb41aa4c91ae4 (patch)
treeb2ad33b203563aecedce47faa8d739c96a4b1168
parenteef2768482037d3eb161a5f3d7dd1bc46ccf5ff9 (diff)
custom widgets: return early when the widget lib is not available
Change-Id: I1d740b4a3840f73015f34bd2143663a919db2956
-rw-r--r--vcl/headless/CustomWidgetDraw.cxx6
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,