[Libreoffice-commits] core.git: 2 commits - sc/source

Tor Lillqvist tml at collabora.com
Thu Mar 3 20:06:31 UTC 2016


 sc/source/core/tool/interpr8.cxx |   24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

New commits:
commit 56f81d96e321d941abb43ed6b26a987bf815f36a
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Mar 3 21:38:22 2016 +0200

    We don't use 'using' for other std types either in this file
    
    Change-Id: I561e515da65db619330b536e3c8c6de555730740

diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index 7651291..48bd916 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -17,8 +17,6 @@
 #include <cmath>
 #include <vector>
 
-
-using ::std::vector;
 using namespace formula;
 
 struct DataPoint
@@ -72,7 +70,7 @@ class ScETSForecastCalculation
 {
 private:
     SvNumberFormatter* mpFormatter;
-    vector< DataPoint > maRange;        // data (X, Y)
+    std::vector< DataPoint > maRange;   // data (X, Y)
     double* mpBase;                     // calculated base value array
     double* mpTrend;                    // calculated trend factor array
     double* mpPerIdx;                   // calculated periodical deviation array, not used with eds
@@ -267,7 +265,7 @@ bool ScETSForecastCalculation::PreprocessDataRange( ScMatrixRef rMatX, ScMatrixR
 
                 case 5 : // MEDIAN
                          {
-                             vector< double > aTmp;
+                             std::vector< double > aTmp;
                              aTmp.push_back( maRange[ i - 1 ].Y );
                              while ( maRange[ i ].X == maRange[ i - 1 ].X  && i < mnCount )
                              {
@@ -436,7 +434,7 @@ bool ScETSForecastCalculation::prefillPerIdx()
             return false;
         }
         SCSIZE nPeriods = mnCount / mnSmplInPrd;
-        vector< double > aPeriodAverage( nPeriods, 0.0 );
+        std::vector< double > aPeriodAverage( nPeriods, 0.0 );
         for ( SCSIZE i = 0; i < nPeriods ; i++ )
         {
             for ( SCSIZE j = 0; j < mnSmplInPrd; j++ )
@@ -1003,7 +1001,7 @@ bool ScETSForecastCalculation::GetETSPredictionIntervals( ScMatrixRef rTMat, ScM
     std::unique_ptr< double[] > xScenBase( new double[nSize]);
     std::unique_ptr< double[] > xScenTrend( new double[nSize]);
     std::unique_ptr< double[] > xScenPerIdx( new double[nSize]);
-    vector< vector< double > >  aPredictions( nSize, vector< double >( cnScenarios ) );
+    std::vector< std::vector< double > >  aPredictions( nSize, std::vector< double >( cnScenarios ) );
 
     // fill scenarios
     for ( SCSIZE k = 0; k < cnScenarios; k++ )
@@ -1132,7 +1130,7 @@ bool ScETSForecastCalculation::GetEDSPredictionIntervals( ScMatrixRef rTMat, ScM
 
     double z = ScInterpreter::gaussinv( ( 1.0 + fPILevel ) / 2.0 );
     double o = 1 - fPILevel;
-    vector< double > c( nSize );
+    std::vector< double > c( nSize );
     for ( SCSIZE i = 0; i < nSize; i++ )
     {
         c[ i ] = sqrt( 1 + ( fPILevel / pow( 1 + o, 3.0 ) ) *
commit db145e5073e42ae71a77c5987ae673cfe97426d1
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Mar 3 21:36:58 2016 +0200

    delete works fine on nullptr
    
    Change-Id: I373df68f8ce59d34d98a8c5608a16deb278ecec3

diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index d2e160e..7651291 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -142,14 +142,10 @@ ScETSForecastCalculation::ScETSForecastCalculation( SCSIZE nSize, SvNumberFormat
 
 ScETSForecastCalculation::~ScETSForecastCalculation()
 {
-    if ( mpBase )
-        delete mpBase;
-    if ( mpTrend )
-        delete mpTrend;
-    if ( mpPerIdx )
-        delete mpPerIdx;
-    if ( mpForecast )
-        delete mpForecast;
+    delete mpBase;
+    delete mpTrend;
+    delete mpPerIdx;
+    delete mpForecast;
 }
 
 bool ScETSForecastCalculation::PreprocessDataRange( ScMatrixRef rMatX, ScMatrixRef rMatY, int& rSmplInPrd,


More information about the Libreoffice-commits mailing list