[Libreoffice-commits] core.git: 4 commits - chart2/qa chart2/source cui/source sw/inc

Caolán McNamara caolanm at redhat.com
Mon Apr 24 13:52:00 UTC 2017


 chart2/qa/extras/PivotChartTest.cxx                         |    1 +
 chart2/source/controller/main/ControllerCommandDispatch.cxx |    6 +++---
 cui/source/inc/cuitabarea.hxx                               |    4 ----
 sw/inc/htmltbl.hxx                                          |    4 ++--
 4 files changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 80486db4b691e9b716840438422b9001573d2a90
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 24 12:34:44 2017 +0100

    coverity#1405474 Unintended sign extension
    
    and
    
    coverity#1405473 Unintended sign extension
    coverity#1405472 Unintended sign extension
    coverity#1405471 Unintended sign extension
    
    Change-Id: I1db183206cb03167d0dd13b2a3470caa3ea1cb4e

diff --git a/sw/inc/htmltbl.hxx b/sw/inc/htmltbl.hxx
index 4aec0834be6e..5107eea17aed 100644
--- a/sw/inc/htmltbl.hxx
+++ b/sw/inc/htmltbl.hxx
@@ -426,13 +426,13 @@ inline void SwHTMLTableLayout::SetColumn( std::unique_ptr<SwHTMLTableLayoutColum
 
 inline SwHTMLTableLayoutCell *SwHTMLTableLayout::GetCell( sal_uInt16 nRow, sal_uInt16 nCol ) const
 {
-    return m_aCells[nRow*m_nCols+nCol].get();
+    return m_aCells[static_cast<size_t>(nRow)*m_nCols+nCol].get();
 }
 
 inline void SwHTMLTableLayout::SetCell( std::unique_ptr<SwHTMLTableLayoutCell> pCell,
                                sal_uInt16 nRow, sal_uInt16 nCol )
 {
-    m_aCells[nRow*m_nCols+nCol] = std::move(pCell);
+    m_aCells[static_cast<size_t>(nRow)*m_nCols+nCol] = std::move(pCell);
 }
 
 inline long SwHTMLTableLayout::GetBrowseWidthMin() const
commit a21e0d3aa88694c4000cd3839a7158aa2e21400f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 24 12:29:39 2017 +0100

    coverity#1405470 Unchecked dynamic_cast
    
    Change-Id: I5125ec90b83630225ca9aab689e814e5a7c03a4e

diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index 696c06d9e22d..89f6c1c9f36f 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -412,9 +412,9 @@ void ModelState::update( const Reference< frame::XModel > & xModel )
     bIsThreeD = (nDimensionCount == 3);
     if (xChartDoc.is())
     {
-        ChartModel* pModel = dynamic_cast<ChartModel*>(xChartDoc.get());
-        bHasOwnData = pModel->hasInternalDataProvider();
-        bHasDataFromPivotTable = pModel->isDataFromPivotTable();
+        ChartModel& rModel = dynamic_cast<ChartModel&>(*xChartDoc.get());
+        bHasOwnData = rModel.hasInternalDataProvider();
+        bHasDataFromPivotTable = rModel.isDataFromPivotTable();
     }
 
     bHasMainTitle =  TitleHelper::getTitle( TitleHelper::MAIN_TITLE, xModel ).is();
commit 655cfb327dea2abe63e9a3b30fbbcf51d9508455
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 24 12:27:58 2017 +0100

    coverity#1405475 Uninitialized scalar field
    
    Change-Id: If4709eb169196893378ceb7c2dc9c645d4a640a3

diff --git a/chart2/qa/extras/PivotChartTest.cxx b/chart2/qa/extras/PivotChartTest.cxx
index dc97b629bbed..20a37b72595f 100644
--- a/chart2/qa/extras/PivotChartTest.cxx
+++ b/chart2/qa/extras/PivotChartTest.cxx
@@ -135,6 +135,7 @@ struct Value
 
     Value(OUString const & rString)
         : maString(rString)
+        , mfValue(0.0)
         , mbIsValue(false)
     {}
 
commit e402e112a1fb5599c6869c5e69fe10d3798f1d4b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 24 12:24:56 2017 +0100

    coverity#1405477 Uninitialized pointer field
    
    and
    
    coverity#1405476 Uninitialized pointer field
    
    Change-Id: I6f6a13f5c3037ff11636938135bad72f8b3419d2

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 7d3a12f69d1b..6e45726d80e5 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -396,7 +396,6 @@ private:
 
     ChangeType*         m_pnGradientListState;
     ChangeType*         m_pnColorListState;
-    sal_Int32*          m_pPos;
 
     XFillStyleItem      m_aXFStyleItem;
     XFillGradientItem   m_aXGradientItem;
@@ -436,7 +435,6 @@ public:
     void    SetColorList( XColorListRef const & pColorList ) { m_pColorList = pColorList; }
     void    SetGradientList( XGradientListRef const & pGrdLst)
                 { m_pGradientList = pGrdLst; }
-    void    SetPos( sal_Int32* pPos ) { m_pPos = pPos; }
     void    SetGrdChgd( ChangeType* pIn ) { m_pnGradientListState = pIn; }
     void    SetColorChgd( ChangeType* pIn ) { m_pnColorListState = pIn; }
 };
@@ -468,7 +466,6 @@ private:
 
     ChangeType*         m_pnHatchingListState;
     ChangeType*         m_pnColorListState;
-    sal_Int32*          m_pPos;
 
     XFillStyleItem      m_aXFStyleItem;
     XFillHatchItem      m_aXHatchItem;
@@ -513,7 +510,6 @@ public:
     void    SetHatchingList( XHatchListRef const & pHtchLst)
                 { m_pHatchingList = pHtchLst; }
 
-    void    SetPos( sal_Int32* pPos ) { m_pPos = pPos; }
     void    SetHtchChgd( ChangeType* pIn ) { m_pnHatchingListState = pIn; }
     void    SetColorChgd( ChangeType* pIn ) { m_pnColorListState = pIn; }
 


More information about the Libreoffice-commits mailing list