[Libreoffice-commits] core.git: include/vcl vcl/unx

Caolán McNamara caolanm at redhat.com
Sun Jun 18 13:35:51 UTC 2017


 include/vcl/sysdata.hxx                  |    6 ++++++
 vcl/unx/generic/gdi/cairo_xlib_cairo.cxx |    3 +++
 vcl/unx/generic/gdi/salgdi.cxx           |    3 +++
 3 files changed, 12 insertions(+)

New commits:
commit 207a2c3e2a44cb6b6c338a983dd2a72469f694ac
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jun 18 14:33:25 2017 +0100

    coverity#1412875 Uninitialized pointer field
    
    Change-Id: Ib9e40cdec5c8b87eaccf4ce941c0c8641b28e5c7

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;
 }


More information about the Libreoffice-commits mailing list