summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-11-02 09:24:19 -0400
committerJan Holesovsky <kendy@collabora.com>2018-11-08 09:14:41 +0100
commitf4100192c33ce17e2190388812ad5b2fe5e58acc (patch)
tree235d852bf71d096cb86654b860801b38e61bd076 /vcl
parent438169ebbbcb32bca1a6feb42285d1950a1ce89d (diff)
LOK: custom widgets: check size of API structures
Change-Id: Iff50f7aeb471870230e9e822657deed6aefad268
Diffstat (limited to 'vcl')
-rw-r--r--vcl/headless/CustomWidgetDraw.cxx1
-rw-r--r--vcl/inc/WidgetThemeLibrary.hxx7
2 files changed, 6 insertions, 2 deletions
diff --git a/vcl/headless/CustomWidgetDraw.cxx b/vcl/headless/CustomWidgetDraw.cxx
index d7eb359311a8..d1454911489f 100644
--- a/vcl/headless/CustomWidgetDraw.cxx
+++ b/vcl/headless/CustomWidgetDraw.cxx
@@ -311,6 +311,7 @@ bool CustomWidgetDraw::updateSettings(AllSettings& rSettings)
return false;
WidgetDrawStyle aStyle;
+ aStyle.nSize = sizeof(WidgetDrawStyle);
if (s_pWidgetImplementation->updateSettings(aStyle))
{
diff --git a/vcl/inc/WidgetThemeLibrary.hxx b/vcl/inc/WidgetThemeLibrary.hxx
index cfd10522b30d..488781496cad 100644
--- a/vcl/inc/WidgetThemeLibrary.hxx
+++ b/vcl/inc/WidgetThemeLibrary.hxx
@@ -21,6 +21,7 @@ namespace vcl
{
struct WidgetDrawStyle
{
+ uint32_t nSize;
Color maFaceColor;
Color maLightColor;
Color maLightBorderColor;
@@ -39,7 +40,8 @@ struct WidgetDrawStyle
struct ControlDrawParameters
{
ControlDrawParameters(cairo_t* i_pCairo, ControlPart i_ePart, ControlState i_eState)
- : pCairo(i_pCairo)
+ : nSize(sizeof(ControlDrawParameters))
+ , pCairo(i_pCairo)
, ePart(i_ePart)
, eState(i_eState)
, eButtonValue(ButtonValue::DontKnow)
@@ -48,6 +50,7 @@ struct ControlDrawParameters
{
}
+ uint32_t nSize;
cairo_t* pCairo;
ControlPart ePart;
ControlState eState;
@@ -92,7 +95,7 @@ struct _WidgetThemeLibrary
bool (*drawListNet)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
bool (*drawListHeader)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
- bool (*updateSettings)(WidgetDrawStyle& rSettings);
+ bool (*updateSettings)(WidgetDrawStyle& rStyle);
};
extern "C" vcl::WidgetThemeLibrary* CreateWidgetThemeLibrary();