[Libreoffice-commits] core.git: 10 commits - basic/source chart2/source

Stephan Bergmann sbergman at redhat.com
Tue Oct 6 06:31:45 PDT 2015


 basic/source/classes/sbunoobj.cxx                  |    1 
 basic/source/comp/token.cxx                        |    3 --
 basic/source/runtime/methods.cxx                   |   14 +++++++++--
 chart2/source/tools/DataSeriesHelper.cxx           |    4 ---
 chart2/source/tools/ThreeDHelper.cxx               |   13 ++++------
 chart2/source/view/axes/VCartesianAxis.cxx         |   26 ++++++++++-----------
 chart2/source/view/charttypes/BarChart.cxx         |    3 --
 chart2/source/view/main/PlottingPositionHelper.cxx |    4 +--
 chart2/source/view/main/VLegend.cxx                |    7 +----
 9 files changed, 37 insertions(+), 38 deletions(-)

New commits:
commit a6b42f9138acf3edb775ba03fc59406186d73808
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 6 15:13:07 2015 +0200

    clang-analyzer-deadcode.DeadStores
    
    Change-Id: I96ab1c0683eadef1f7012b346705450e69ca5a65

diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index d293165..584ea6b 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -516,10 +516,7 @@ awt::Size lcl_placeLegendEntries(
         nTextLineHeight = lcl_getTextLineHeight( aRowHeights, nNumberOfRows, fViewFontSize );
     }
 
-    sal_Int32 nCurrentXPos = nXPadding;
-    sal_Int32 nCurrentYPos = nYPadding;
-    if( !bSymbolsLeftSide )
-        nCurrentXPos = -nXPadding;
+    sal_Int32 nCurrentXPos = bSymbolsLeftSide ? nXPadding : -nXPadding;
 
     // place entries into column and rows
     sal_Int32 nMaxYPos = 0;
@@ -527,7 +524,7 @@ awt::Size lcl_placeLegendEntries(
     sal_Int32 nColumn = 0;
     for( nColumn = 0; nColumn < nNumberOfColumns; ++nColumn )
     {
-        nCurrentYPos = nYPadding;
+        sal_Int32 nCurrentYPos = nYPadding;
         for( nRow = 0; nRow < nNumberOfRows; ++nRow )
         {
             sal_Int32 nEntry = (nColumn + nRow * nNumberOfColumns);
commit 0411b3477f5ec941710933bf2f242d965ae3fe1e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 6 15:11:30 2015 +0200

    clang-analyzer-deadcode.DeadStores
    
    Change-Id: Ibde6ee93edae124da52e2a03528a240d4066baa7

diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx b/chart2/source/view/main/PlottingPositionHelper.cxx
index 25a22a6..78903ea 100644
--- a/chart2/source/view/main/PlottingPositionHelper.cxx
+++ b/chart2/source/view/main/PlottingPositionHelper.cxx
@@ -365,8 +365,8 @@ void PolarPlottingPositionHelper::setScales( const std::vector< ExplicitScaleDat
     double fTranslate =1.0;
     double fScale     =FIXED_SIZE_FOR_3D_CHART_VOLUME/2.0;
 
-    double fTranslateLogicZ =fTranslate;
-    double fScaleLogicZ     =fScale;
+    double fTranslateLogicZ;
+    double fScaleLogicZ;
     {
         double fScaleDirectionZ = AxisOrientation_MATHEMATICAL==m_aScales[2].Orientation ? 1.0 : -1.0;
         double MinZ = getLogicMinZ();
commit a4ef2e39e590ee0c0b57237eff0d3649af46bf8e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 6 15:09:39 2015 +0200

    clang-analyzer-deadcode.DeadStores
    
    Change-Id: I7243c1590384472bf40cdbdb5af0614fffcb253b

diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx
index 519f98f..9ab6ae7 100644
--- a/chart2/source/view/charttypes/BarChart.cxx
+++ b/chart2/source/view/charttypes/BarChart.cxx
@@ -828,10 +828,9 @@ void BarChart::createShapes()
                             double fLowerBarDepth = fLogicBarDepth;
                             double fUpperBarDepth = fLogicBarDepth;
                             {
-                                double fOuterBarDepth = fLogicBarDepth;
                                 if( lcl_hasGeometry3DVariableWidth(nGeometry3D) && fCompleteHeight!=0.0 )
                                 {
-                                    fOuterBarDepth = fLogicBarDepth * (fTopHeight)/(fabs(fCompleteHeight));
+                                    double fOuterBarDepth = fLogicBarDepth * (fTopHeight)/(fabs(fCompleteHeight));
                                     fLowerBarDepth = (fBaseValue < fUpperYValue) ? fabs(fLogicBarDepth) : fabs(fOuterBarDepth);
                                     fUpperBarDepth = (fBaseValue < fUpperYValue) ? fabs(fOuterBarDepth) : fabs(fLogicBarDepth);
                                 }
commit 1888b37a83368f11540ab1ef200d25d3c91bee28
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 6 15:08:14 2015 +0200

    clang-analyzer-deadcode.DeadStores
    
    Change-Id: I3f34115b7d73e71441404866fc45894f78ab28f6

diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index b7ddd0f..a8022b3 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -1134,19 +1134,12 @@ void VCartesianAxis::get2DAxisMainLine(
     //m_aAxisProperties might get updated and changed here because
     //    the label alignment and inner direction sign depends exactly of the choice of the axis line position which is made here in this method
 
-    double fMinX = m_pPosHelper->getLogicMinX();
-    double fMinY = m_pPosHelper->getLogicMinY();
-    double fMinZ = m_pPosHelper->getLogicMinZ();
-    double fMaxX = m_pPosHelper->getLogicMaxX();
-    double fMaxY = m_pPosHelper->getLogicMaxY();
-    double fMaxZ = m_pPosHelper->getLogicMaxZ();
-
-    double fXStart = fMinX;
-    double fYStart = fMinY;
-    double fZStart = fMinZ;
-    double fXEnd = fXStart;
-    double fYEnd = fYStart;
-    double fZEnd = fZStart;
+    double const fMinX = m_pPosHelper->getLogicMinX();
+    double const fMinY = m_pPosHelper->getLogicMinY();
+    double const fMinZ = m_pPosHelper->getLogicMinZ();
+    double const fMaxX = m_pPosHelper->getLogicMaxX();
+    double const fMaxY = m_pPosHelper->getLogicMaxY();
+    double const fMaxZ = m_pPosHelper->getLogicMaxZ();
 
     double fXOnXPlane = fMinX;
     double fXOther = fMaxX;
@@ -1184,6 +1177,13 @@ void VCartesianAxis::get2DAxisMainLine(
         fZOther = fMaxZ;
     }
 
+    double fXStart = fMinX;
+    double fYStart = fMinY;
+    double fZStart = fMinZ;
+    double fXEnd;
+    double fYEnd;
+    double fZEnd = fZStart;
+
     if( 0==m_nDimensionIndex ) //x-axis
     {
         if( fCrossesOtherAxis < fMinY )
commit 7b9b559035e515d06c19adcc5012c718782f9134
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 6 15:06:04 2015 +0200

    clang-analyzer-deadcode.DeadStores
    
    Change-Id: I09d518a81b392bef444d7e01aa08ce30a2aee984

diff --git a/chart2/source/tools/ThreeDHelper.cxx b/chart2/source/tools/ThreeDHelper.cxx
index 4bb69d3..ba0c377 100644
--- a/chart2/source/tools/ThreeDHelper.cxx
+++ b/chart2/source/tools/ThreeDHelper.cxx
@@ -1372,7 +1372,6 @@ void ThreeDHelper::getRoundedEdgesAndObjectLines(
                             , aPercentDiagonalPropertyName, uno::makeAny( static_cast< sal_Int16 >(rnRoundedEdges) ) ) )
                     {
                         bDifferentRoundedEdges = true;
-                        nCurrentRoundedEdges = -1;
                     }
                 }
 
commit 338ef54e40cdf40e43ec08e3b8bb384e78e016bf
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 6 15:05:53 2015 +0200

    clang-analyzer-deadcode.DeadStores
    
    Change-Id: I12efd66cdacbe73080855694fe397136ea59aabd

diff --git a/chart2/source/tools/ThreeDHelper.cxx b/chart2/source/tools/ThreeDHelper.cxx
index 4956eef..4bb69d3 100644
--- a/chart2/source/tools/ThreeDHelper.cxx
+++ b/chart2/source/tools/ThreeDHelper.cxx
@@ -1050,13 +1050,11 @@ void ThreeDHelper::getRotationFromDiagram( const uno::Reference< beans::XPropert
     }
     else
     {
-        fXAngle = BaseGFXHelper::Rad2Deg( fXAngle );
-        fYAngle = BaseGFXHelper::Rad2Deg( fYAngle );
-        fZAngle = BaseGFXHelper::Rad2Deg( fZAngle );
-
-        rnHorizontalAngleDegree = ::basegfx::fround(fXAngle);
-        rnVerticalAngleDegree = ::basegfx::fround(-1.0*fYAngle);
-        //nZRotation = ::basegfx::fround(-1.0*fZAngle);
+        rnHorizontalAngleDegree = basegfx::fround(
+            BaseGFXHelper::Rad2Deg(fXAngle));
+        rnVerticalAngleDegree = basegfx::fround(
+            -1.0 * BaseGFXHelper::Rad2Deg(fYAngle));
+        // nZRotation = basegfx::fround(-1.0 * BaseGFXHelper::Rad2Deg(fZAngle));
     }
 
     lcl_shiftAngleToIntervalMinus180To180( rnHorizontalAngleDegree );
commit 94ebb584439f40dee356740070f292b2e7996f4b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 6 15:02:00 2015 +0200

    clang-analyzer-deadcode.DeadStores
    
    Change-Id: If852229c04eb5787fb017cf13f483d406d60bf07

diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx
index 4329161..6cea303 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -423,11 +423,9 @@ void setStackModeAtSeries(
     if( xCorrespondingCoordinateSystem.is() &&
         1 < xCorrespondingCoordinateSystem->getDimension() )
     {
-        sal_Int32 nAxisIndexCount = aAxisIndexSet.size();
-        if( !nAxisIndexCount )
+        if( aAxisIndexSet.empty() )
         {
             aAxisIndexSet.insert(0);
-            nAxisIndexCount = aAxisIndexSet.size();
         }
 
         for( ::std::set< sal_Int32 >::const_iterator aIt = aAxisIndexSet.begin();
commit e8233e1510cf9f16a42feb5d60e5fdfda4f921fc
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 6 15:00:29 2015 +0200

    clang-analyzer-deadcode.DeadStores
    
    Change-Id: I03769bd4105e4e1d140b2885978ea9da9ef866de

diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 4628686..9d83fcc 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -682,8 +682,8 @@ void implRemoveDirRecursive( const OUString& aDirPath )
 
     FileStatus aFileStatus( osl_FileStatus_Mask_Type );
     nRet = aItem.getFileStatus( aFileStatus );
-    FileStatus::Type aType = aFileStatus.getFileType();
-    bool bFolder = isFolder( aType );
+    bool bFolder = nRet == FileBase::E_None
+        && isFolder( aFileStatus.getFileType() );
 
     if( !bExists || !bFolder )
     {
@@ -710,6 +710,11 @@ void implRemoveDirRecursive( const OUString& aDirPath )
         // Handle flags
         FileStatus aFileStatus2( osl_FileStatus_Mask_Type | osl_FileStatus_Mask_FileURL );
         nRet = aItem2.getFileStatus( aFileStatus2 );
+        if( nRet != FileBase::E_None )
+        {
+            SAL_WARN("basic", "getFileStatus failed");
+            continue;
+        }
         OUString aPath = aFileStatus2.getFileURL();
 
         // Directory?
@@ -3056,6 +3061,11 @@ RTLFUNC(Dir)
                         // Handle flags
                         FileStatus aFileStatus( osl_FileStatus_Mask_Type | osl_FileStatus_Mask_FileName );
                         nRet = aItem.getFileStatus( aFileStatus );
+                        if( nRet != FileBase::E_None )
+                        {
+                            SAL_WARN("basic", "getFileStatus failed");
+                            continue;
+                        }
 
                         // Only directories?
                         if( bFolderFlag )
commit 5e02785ff1fe807846155e2024534333231fa7e2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 6 14:58:53 2015 +0200

    clang-analyzer-deadcode.DeadStores
    
    Change-Id: Ib26cbbc839040c49288606f588cb7400d7e40b83

diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx
index d6131e2..03f1a5a 100644
--- a/basic/source/comp/token.cxx
+++ b/basic/source/comp/token.cxx
@@ -194,9 +194,8 @@ TokenLabelInfo::TokenLabelInfo()
     SbiToken eLabelToken[] = { ACCESS, ALIAS, APPEND, BASE, BINARY, CLASSMODULE,
                                COMPARE, COMPATIBLE, DEFERR, _ERROR_, BASIC_EXPLICIT, LIB, LINE, LPRINT, NAME,
                                TOBJECT, OUTPUT, PROPERTY, RANDOM, READ, STEP, STOP, TEXT, VBASUPPORT, NIL };
-    SbiToken* pTok = eLabelToken;
     SbiToken eTok;
-    for( pTok = eLabelToken ; (eTok = *pTok) != NIL ; ++pTok )
+    for( SbiToken* pTok = eLabelToken ; (eTok = *pTok) != NIL ; ++pTok )
     {
         m_pTokenCanBeLabelTab[eTok] = true;
     }
commit 66ef46479983b8600b4cd7543fff3420ffce6a8a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 6 14:57:16 2015 +0200

    clang-analyzer-deadcode.DeadStores
    
    Change-Id: I2ef946572a61eb766454d2df0cb2ff523050ed7e

diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 2918736..0e9c826 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -4693,7 +4693,6 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP
             args[1] <<= xProxy;
 
             Reference< XInterface > xRet;
-            bSuccess = false;
             try
             {
                 xRet = xComImplementsFactory->createInstanceWithArguments( args );


More information about the Libreoffice-commits mailing list