[Libreoffice-commits] core.git: 5 commits - libreofficekit/qa sc/source vcl/inc wizards/com

Caolán McNamara caolanm at redhat.com
Thu Feb 4 09:30:33 UTC 2016


 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |    5 ++
 sc/source/ui/dbgui/PivotLayoutDialog.cxx            |   39 +++++++++-----------
 vcl/inc/unx/gtk/gtkinst.hxx                         |    7 +++
 wizards/com/sun/star/wizards/document/Control.java  |   16 ++++----
 4 files changed, 38 insertions(+), 29 deletions(-)

New commits:
commit 7b0b9da7cb9a342c060666ea9d60bca700e25359
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 4 09:25:51 2016 +0000

    coverity#1351756 Dereference before null check
    
    Change-Id: Iae465c91693967983623087214e79e0f264c551c

diff --git a/wizards/com/sun/star/wizards/document/Control.java b/wizards/com/sun/star/wizards/document/Control.java
index 9ff4691..5731aa7 100644
--- a/wizards/com/sun/star/wizards/document/Control.java
+++ b/wizards/com/sun/star/wizards/document/Control.java
@@ -185,21 +185,21 @@ public class Control extends Shape
         else
         {
             Size aPeerSize = getPeerSize();
-            int  aWidth;
+            int nWidth;
             if (aPeerSize == null)
-                aWidth = 0;
+                nWidth = 0;
             else
-                aWidth = aPeerSize.Width;
+                nWidth = aPeerSize.Width;
 
             // We increase the preferred Width a bit so that the control does not become too small
             // when we change the border from "3D" to "Flat"
             if (getControlType() == FormHandler.SOCHECKBOX)
             {
-                return aWidth * oFormHandler.getXPixelFactor();
+                return nWidth * oFormHandler.getXPixelFactor();
             }
             else
             {
-                return (aWidth * oFormHandler.getXPixelFactor()) + 200;
+                return (nWidth * oFormHandler.getXPixelFactor()) + 200;
             }
         }
     }
@@ -213,11 +213,11 @@ public class Control extends Shape
         else
         {
             Size aPeerSize = getPeerSize();
-            int nHeight = aPeerSize.Height;
+            int nHeight;
             if (aPeerSize == null)
-                 nHeight = 0;
+                nHeight = 0;
             else
-                 nHeight = aPeerSize.Height;
+                nHeight = aPeerSize.Height;
 
             // We increase the preferred Height a bit so that the control does not become too small
             // when we change the border from "3D" to "Flat"
commit a18d3ed2e8e224a4ae2244342df51a9651aadb5c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 4 09:22:29 2016 +0000

    coverity#1351757 Uninitialized pointer field
    
    Change-Id: I996dc17ba0c01bf23283687dffb563b0eac3a31a

diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 0e77d96..b2962d4 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -140,6 +140,11 @@ public:
         m_pProgressBar(nullptr),
         m_pStatusbarLabel(nullptr),
         m_pZoomLabel(nullptr),
+        m_pSaveButton(nullptr),
+        m_pCopyButton(nullptr),
+        m_pPasteButton(nullptr),
+        m_pUndo(nullptr),
+        m_pRedo(nullptr),
         m_pEnableEditing(nullptr),
         m_pBold(nullptr),
         m_pItalic(nullptr),
commit 58dd33145db1dbc883bc243e0b764c42bfca3741
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 4 09:19:09 2016 +0000

    coverity#1351758 Uninitialized pointer field
    
    Change-Id: I50639f0f83c2f1135a0c2002145e02fdf15034a5

diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
index 93a041b..3122956 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -137,7 +137,12 @@ class GtkDragSource : public cppu::WeakComponentImplHelper<css::datatransfer::dn
     css::uno::Reference<css::datatransfer::XTransferable> m_xTrans;
     VclToGtkHelper m_aConversionHelper;
 public:
-    GtkDragSource() : WeakComponentImplHelper( m_aMutex ) {}
+    GtkDragSource()
+        : WeakComponentImplHelper(m_aMutex)
+        , m_pFrame(nullptr)
+    {
+    }
+
     virtual ~GtkDragSource();
 
     // XDragSource
commit 2ce227a7642647267c982909a8b3175d22c58b74
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 4 09:17:42 2016 +0000

    coverity#1351755 Dereference null return value
    
    Change-Id: I144a2c498763534b8aff604bdb3440180ac0f2ff

diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 03a8db2..d7982a9 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -517,12 +517,16 @@ void ScPivotLayoutDialog::ApplyChanges()
         {
             const ScRange& rOldRange = pOldDPObj->GetOutRange();
 
+            ScDPObject *pDPObj = nullptr;
             // FIXME: if the new range overlaps with the old one, the table actually doesn't move
             // and shouldn't therefore be deleted
             if ( ( ( rOldRange != aDestinationRange ) && !rOldRange.In( aDestinationRange ) )
                  || bToNewSheet )
             {
-                ScDPObject *pDPObj = mpDocument->GetDPAtCursor( maPivotParameters.nCol, maPivotParameters.nRow, maPivotParameters.nTab);
+                mpDocument->GetDPAtCursor( maPivotParameters.nCol, maPivotParameters.nRow, maPivotParameters.nTab);
+            }
+            if (pDPObj)
+            {
                 ScDBDocFunc aFunc( *(mpViewData->GetDocShell() ));
                 aFunc.RemovePivotTable( *pDPObj, true, false);
                 mpViewData->GetView()->CursorPosChanged();
commit c4ac8af7da53567fa91148a8c7319eb3e6870196
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 4 09:14:47 2016 +0000

    pItem isn't used here, its the same as result, so weird cast can go
    
    Change-Id: Ib646fcffa3d2298b06565ef78b69873546d76b0a

diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 1ed0e93..03a8db2 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -512,28 +512,23 @@ void ScPivotLayoutDialog::ApplyChanges()
 
     if (pResult != nullptr)
     {
-        const SfxBoolItem* pItem = reinterpret_cast<const SfxBoolItem*>(pResult);
-
-        if (pItem)
+        // existing pivot table might have moved to a new range or a new sheet
+        if ( pOldDPObj != nullptr  )
         {
-           // existing pivot table might have moved to a new range or a new sheet
-           if ( pOldDPObj != nullptr  )
-           {
-               const ScRange& rOldRange = pOldDPObj->GetOutRange();
-
-               // FIXME: if the new range overlaps with the old one, the table actually doesn't move
-               // and shouldn't therefore be deleted
-               if ( ( ( rOldRange != aDestinationRange ) && !rOldRange.In( aDestinationRange ) )
-                    || bToNewSheet )
-               {
-                   ScDPObject *pDPObj = mpDocument->GetDPAtCursor( maPivotParameters.nCol, maPivotParameters.nRow, maPivotParameters.nTab);
-                   ScDBDocFunc aFunc( *(mpViewData->GetDocShell() ));
-                   aFunc.RemovePivotTable( *pDPObj, true, false);
-                   mpViewData->GetView()->CursorPosChanged();
-               }
-           }
-           return;
+            const ScRange& rOldRange = pOldDPObj->GetOutRange();
+
+            // FIXME: if the new range overlaps with the old one, the table actually doesn't move
+            // and shouldn't therefore be deleted
+            if ( ( ( rOldRange != aDestinationRange ) && !rOldRange.In( aDestinationRange ) )
+                 || bToNewSheet )
+            {
+                ScDPObject *pDPObj = mpDocument->GetDPAtCursor( maPivotParameters.nCol, maPivotParameters.nRow, maPivotParameters.nTab);
+                ScDBDocFunc aFunc( *(mpViewData->GetDocShell() ));
+                aFunc.RemovePivotTable( *pDPObj, true, false);
+                mpViewData->GetView()->CursorPosChanged();
+            }
         }
+        return;
     }
 
     SetDispatcherLock(true);


More information about the Libreoffice-commits mailing list