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

Caolán McNamara caolanm at redhat.com
Wed Dec 30 05:19:08 PST 2015


 vcl/inc/generic/glyphcache.hxx  |    2 +-
 vcl/unx/generic/app/saldisp.cxx |   12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 87584ed0f292e79669a74d2040d668f11fdc2c2b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 30 13:01:35 2015 +0000

    coverity#1346892 Non-virtual destructor
    
    Change-Id: Ie718df17cc5f12ebc244d3decca4aa7644f6b120

diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx
index 2ac31c4..f1159545 100644
--- a/vcl/inc/generic/glyphcache.hxx
+++ b/vcl/inc/generic/glyphcache.hxx
@@ -55,7 +55,7 @@ class VCL_DLLPUBLIC GlyphCache
 {
 public:
     explicit                GlyphCache();
-                            ~GlyphCache();
+    virtual                 ~GlyphCache();
 
     static GlyphCache&      GetInstance();
 
commit cf2912c183faa44ca6b99723e2111505d8308709
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Dec 29 21:06:27 2015 +0000

    cppcheck: allocaCalled
    
    Change-Id: I9ccd506b20dcfb492767bf4d0c42dff8c1c0b815

diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 9296a6f..7fe000b 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -27,7 +27,6 @@
 #include <ctype.h>
 
 #if defined(SOLARIS) || defined(AIX)
-#include <sal/alloca.h>
 #include <osl/module.h>
 #endif
 
@@ -73,6 +72,7 @@
 #include <osl/socket.h>
 #include <poll.h>
 #include <memory>
+#include <vector>
 
 #include <com/sun/star/uno/DeploymentException.hpp>
 #include <officecfg/Office/Common.hxx>
@@ -211,7 +211,7 @@ bool SalDisplay::BestVisual( Display     *pDisplay,
                                            &aVI, &nVisuals );
     // pVInfos should contain at least one visual, otherwise
     // we're in trouble
-    int* pWeight = static_cast<int*>(alloca( sizeof(int)*nVisuals ));
+    std::vector<int> aWeights(nVisuals);
     int i;
     for( i = 0; i < nVisuals; i++ )
     {
@@ -232,17 +232,17 @@ bool SalDisplay::BestVisual( Display     *pDisplay,
         {
             bUsable = true;
         }
-        pWeight[ i ] = bUsable ? nTrueColor*pVInfos[i].depth : -1024;
-        pWeight[ i ] -= pVInfos[ i ].visualid;
+        aWeights[i] = bUsable ? nTrueColor*pVInfos[i].depth : -1024;
+        aWeights[i] -= pVInfos[ i ].visualid;
     }
 
     int nBestVisual = 0;
     int nBestWeight = -1024;
     for( i = 0; i < nVisuals; i++ )
     {
-        if( pWeight[ i ] > nBestWeight )
+        if (aWeights[i] > nBestWeight)
         {
-            nBestWeight = pWeight[ i ];
+            nBestWeight = aWeights[i];
             nBestVisual = i;
         }
     }


More information about the Libreoffice-commits mailing list