summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-06-18 14:33:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-06-18 14:33:49 +0100
commit207a2c3e2a44cb6b6c338a983dd2a72469f694ac (patch)
treedf38f5125a8bd7bed5254bd4337b964d3b641b61
parent3b0f8ece47f70f53b1462c824463c453b47c3020 (diff)
coverity#1412875 Uninitialized pointer field
Change-Id: Ib9e40cdec5c8b87eaccf4ce941c0c8641b28e5c7
-rw-r--r--include/vcl/sysdata.hxx6
-rw-r--r--vcl/unx/generic/gdi/cairo_xlib_cairo.cxx3
-rw-r--r--vcl/unx/generic/gdi/salgdi.cxx3
3 files changed, 12 insertions, 0 deletions
diff --git a/include/vcl/sysdata.hxx b/include/vcl/sysdata.hxx
index 18c4376c40a0..ae9e57f0344c 100644
--- a/include/vcl/sysdata.hxx
+++ b/include/vcl/sysdata.hxx
@@ -138,7 +138,10 @@ struct SystemGraphicsData
#elif defined( IOS )
CGContextRef rCGContext; // CoreGraphics graphic context
#elif defined( UNX )
+ void* pDisplay; // the relevant display connection
long hDrawable; // a drawable
+ void* pVisual; // the visual in use
+ int nScreen; // the current screen of the drawable
void* pXRenderFormat; // render format for drawable
#endif
SystemGraphicsData()
@@ -153,7 +156,10 @@ struct SystemGraphicsData
#elif defined( IOS )
, rCGContext( NULL )
#elif defined( UNX )
+ , pDisplay( nullptr )
, hDrawable( 0 )
+ , pVisual( nullptr )
+ , nScreen( 0 )
, pXRenderFormat( nullptr )
#endif
{ }
diff --git a/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx b/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx
index 803c02343958..4ee1eec061cc 100644
--- a/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx
+++ b/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx
@@ -65,7 +65,10 @@ namespace cairo
{}
X11SysData::X11SysData( const SystemGraphicsData& pSysDat ) :
+ pDisplay(pSysDat.pDisplay),
hDrawable(pSysDat.hDrawable),
+ pVisual(pSysDat.pVisual),
+ nScreen(pSysDat.nScreen),
pRenderFormat(pSysDat.pXRenderFormat)
{}
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index b231dfc8f478..39a58c326057 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -490,7 +490,10 @@ SystemGraphicsData X11SalGraphics::GetGraphicsData() const
SystemGraphicsData aRes;
aRes.nSize = sizeof(aRes);
+ aRes.pDisplay = GetXDisplay();
aRes.hDrawable = hDrawable_;
+ aRes.pVisual = GetVisual().visual;
+ aRes.nScreen = m_nXScreen.getXScreen();
aRes.pXRenderFormat = m_pXRenderFormat;
return aRes;
}