[Libreoffice-commits] core.git: basic/source chart2/source connectivity/source sc/source sc/workben

Eike Rathke erack at redhat.com
Wed Jul 19 18:13:48 UTC 2017


 basic/source/runtime/methods.cxx                 |    4 ++--
 chart2/source/view/axes/DateHelper.cxx           |    2 +-
 chart2/source/view/axes/DateScaling.cxx          |    2 +-
 chart2/source/view/axes/ScaleAutomatism.cxx      |    4 ++--
 chart2/source/view/axes/Tickmarks_Dates.cxx      |    6 +++---
 chart2/source/view/charttypes/VSeriesPlotter.cxx |    4 ++--
 chart2/source/view/main/ChartView.cxx            |    2 +-
 connectivity/source/drivers/calc/CTable.cxx      |    2 +-
 sc/source/core/data/conditio.cxx                 |   16 ++++++++--------
 sc/source/core/data/dpgroup.cxx                  |    2 +-
 sc/source/core/data/dputil.cxx                   |    2 +-
 sc/source/core/data/table4.cxx                   |    8 ++++----
 sc/source/core/tool/interpr2.cxx                 |   18 +++++++++---------
 sc/source/core/tool/interpr8.cxx                 |   12 ++++++------
 sc/source/ui/cctrl/checklistmenu.cxx             |    2 +-
 sc/source/ui/docshell/docsh8.cxx                 |    2 +-
 sc/source/ui/view/cellsh1.cxx                    |    4 ++--
 sc/workben/addin.cxx                             |    2 +-
 18 files changed, 47 insertions(+), 47 deletions(-)

New commits:
commit 772b846c462e6465955769ed93cde046603073bb
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Jul 18 23:23:24 2017 +0200

    Change the most obvious Date+=(long)... to Date+=static_cast<sal_Int32>(...)
    
    Simple search
    git grep -l 'Date.*[+-].*[(<] *long *[>)]'
    
    Since
    
        commit f5b0cc2a3690ba963b3f150886e1d5ddddee9530
        Date:   Sat Jul 1 16:01:15 2017 +0200
    
    Date operators +,-,+=,-= have sal_Int32 operands instead of long.
    
    Change-Id: I2387cbceadcb056831225e4111353980d50a94d4
    Reviewed-on: https://gerrit.libreoffice.org/40163
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 478a59a0e1f2..92ae738a362b 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1704,7 +1704,7 @@ sal_Int16 implGetDateDay( double aDate )
     aDate -= 2.0; // standardize: 1.1.1900 => 0.0
     aDate = floor( aDate );
     Date aRefDate( 1, 1, 1900 );
-    aRefDate += static_cast<long>(aDate);
+    aRefDate += static_cast<sal_Int32>(aDate);
 
     sal_Int16 nRet = (sal_Int16)( aRefDate.GetDay() );
     return nRet;
@@ -4674,7 +4674,7 @@ bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay,
         if (nAddMonths)
             aCurDate.AddMonths( nAddMonths);
         if (nAddDays)
-            aCurDate += (long)nAddDays;
+            aCurDate += nAddDays;
     }
 
     long nDiffDays = GetDayDiff( aCurDate );
diff --git a/chart2/source/view/axes/DateHelper.cxx b/chart2/source/view/axes/DateHelper.cxx
index 9779ef0a2c4c..afefa628ff89 100644
--- a/chart2/source/view/axes/DateHelper.cxx
+++ b/chart2/source/view/axes/DateHelper.cxx
@@ -69,7 +69,7 @@ bool DateHelper::IsLessThanOneYearAway( const Date& rD1, const Date& rD2 )
 
 double DateHelper::RasterizeDateValue( double fValue, const Date& rNullDate, long TimeResolution )
 {
-    Date aDate(rNullDate); aDate += static_cast<long>(::rtl::math::approxFloor(fValue));
+    Date aDate(rNullDate); aDate += static_cast<sal_Int32>(::rtl::math::approxFloor(fValue));
     switch(TimeResolution)
     {
         case css::chart::TimeUnit::DAY:
diff --git a/chart2/source/view/axes/DateScaling.cxx b/chart2/source/view/axes/DateScaling.cxx
index 742adc3cb044..449c25c461c9 100644
--- a/chart2/source/view/axes/DateScaling.cxx
+++ b/chart2/source/view/axes/DateScaling.cxx
@@ -59,7 +59,7 @@ double SAL_CALL DateScaling::doScaling( double value )
     else
     {
         Date aDate(m_aNullDate);
-        aDate += static_cast<long>(::rtl::math::approxFloor(value));
+        aDate += static_cast<sal_Int32>(::rtl::math::approxFloor(value));
         switch( m_nTimeUnit )
         {
             case DAY:
diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx
index 0ccb61445a32..97d84fa310e5 100644
--- a/chart2/source/view/axes/ScaleAutomatism.cxx
+++ b/chart2/source/view/axes/ScaleAutomatism.cxx
@@ -548,8 +548,8 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis(
         ExplicitIncrementData& rExplicitIncrement,
         bool bAutoMinimum, bool bAutoMaximum ) const
 {
-    Date aMinDate(m_aNullDate); aMinDate += static_cast<long>(::rtl::math::approxFloor(rExplicitScale.Minimum));
-    Date aMaxDate(m_aNullDate); aMaxDate += static_cast<long>(::rtl::math::approxFloor(rExplicitScale.Maximum));
+    Date aMinDate(m_aNullDate); aMinDate += static_cast<sal_Int32>(::rtl::math::approxFloor(rExplicitScale.Minimum));
+    Date aMaxDate(m_aNullDate); aMaxDate += static_cast<sal_Int32>(::rtl::math::approxFloor(rExplicitScale.Maximum));
     rExplicitIncrement.PostEquidistant = false;
 
     if( aMinDate > aMaxDate )
diff --git a/chart2/source/view/axes/Tickmarks_Dates.cxx b/chart2/source/view/axes/Tickmarks_Dates.cxx
index 51ba441f5e97..b7ba8487b72a 100644
--- a/chart2/source/view/axes/Tickmarks_Dates.cxx
+++ b/chart2/source/view/axes/Tickmarks_Dates.cxx
@@ -68,8 +68,8 @@ void DateTickFactory::getAllTicks( TickInfoArraysType& rAllTickInfos, bool bShif
 
     Date aNull(m_aScale.NullDate);
 
-    Date aDate = aNull + static_cast<long>(::rtl::math::approxFloor(m_aScale.Minimum));
-    Date aMaxDate = aNull + static_cast<long>(::rtl::math::approxFloor(m_aScale.Maximum));
+    Date aDate = aNull + static_cast<sal_Int32>(::rtl::math::approxFloor(m_aScale.Minimum));
+    Date aMaxDate = aNull + static_cast<sal_Int32>(::rtl::math::approxFloor(m_aScale.Maximum));
 
     uno::Reference< chart2::XScaling > xScaling(m_aScale.Scaling);
     uno::Reference< chart2::XScaling > xInverseScaling(m_xInverseScaling);
@@ -111,7 +111,7 @@ void DateTickFactory::getAllTicks( TickInfoArraysType& rAllTickInfos, bool bShif
     }
 
     //create minor date tickinfos
-    aDate = aNull + static_cast<long>(::rtl::math::approxFloor(m_aScale.Minimum));
+    aDate = aNull + static_cast<sal_Int32>(::rtl::math::approxFloor(m_aScale.Minimum));
     while( aDate<= aMaxDate )
     {
         if( bShifted && aDate==aMaxDate )
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 1d9c90a7bb4b..0cd1aa8d8896 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -1382,11 +1382,11 @@ long VSeriesPlotter::calculateTimeResolutionOnXAxis()
             aNullDate = m_apNumberFormatterWrapper->getNullDate();
         if( aIt!=aEnd )
         {
-            Date aPrevious(aNullDate); aPrevious+=static_cast<long>(rtl::math::approxFloor(*aIt));
+            Date aPrevious(aNullDate); aPrevious+=static_cast<sal_Int32>(rtl::math::approxFloor(*aIt));
             ++aIt;
             for(;aIt!=aEnd;++aIt)
             {
-                Date aCurrent(aNullDate); aCurrent+=static_cast<long>(rtl::math::approxFloor(*aIt));
+                Date aCurrent(aNullDate); aCurrent+=static_cast<sal_Int32>(rtl::math::approxFloor(*aIt));
                 if( nRet == css::chart::TimeUnit::YEAR )
                 {
                     if( DateHelper::IsInSameYear( aPrevious, aCurrent ) )
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index c93e7d8480a9..181b283545fe 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -1861,7 +1861,7 @@ bool ChartView::getExplicitValuesForAxis(
             //remove 'one' from max
             if( rExplicitScale.AxisType == css::chart2::AxisType::DATE )
             {
-                Date aMaxDate(rExplicitScale.NullDate); aMaxDate += static_cast<long>(::rtl::math::approxFloor(rExplicitScale.Maximum));
+                Date aMaxDate(rExplicitScale.NullDate); aMaxDate += static_cast<sal_Int32>(::rtl::math::approxFloor(rExplicitScale.Maximum));
                 //for explicit scales with shifted categories we need one interval more
                 switch( rExplicitScale.TimeResolution )
                 {
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx
index 73c73c1327bd..52737b61aca6 100644
--- a/connectivity/source/drivers/calc/CTable.cxx
+++ b/connectivity/source/drivers/calc/CTable.cxx
@@ -348,7 +348,7 @@ static void lcl_SetValue( ORowSetValue& rValue, const Reference<XSpreadsheet>& x
                 if ( eCellType == CellContentType_VALUE )
                 {
                     ::Date aDate( rNullDate );
-                    aDate += (long)::rtl::math::approxFloor( xCell->getValue() );
+                    aDate += static_cast<sal_Int32>(::rtl::math::approxFloor( xCell->getValue() ));
                     rValue = aDate.GetUNODate();
                 }
                 else
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 5c5c3125851c..3e9ec4c10b80 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1619,12 +1619,12 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
 
     const Date& rActDate = *mpCache;
     SvNumberFormatter* pFormatter = mpDoc->GetFormatTable();
-    long nCurrentDate = rActDate - pFormatter->GetNullDate();
+    sal_Int32 nCurrentDate = rActDate - pFormatter->GetNullDate();
 
     double nVal = rCell.getValue();
-    long nCellDate = (long) ::rtl::math::approxFloor(nVal);
+    sal_Int32 nCellDate = static_cast<sal_Int32>(::rtl::math::approxFloor(nVal));
     Date aCellDate = pFormatter->GetNullDate();
-    aCellDate += (long) ::rtl::math::approxFloor(nVal);
+    aCellDate += static_cast<sal_Int32>(::rtl::math::approxFloor(nVal));
 
     switch(meType)
     {
@@ -1647,8 +1647,8 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
         case condformat::LASTWEEK:
             if( rActDate.GetDayOfWeek() != SUNDAY )
             {
-                Date aBegin(rActDate - 8 - static_cast<long>(rActDate.GetDayOfWeek()));
-                Date aEnd(rActDate - 2 -static_cast<long>(rActDate.GetDayOfWeek()));
+                Date aBegin(rActDate - 8 - static_cast<sal_Int32>(rActDate.GetDayOfWeek()));
+                Date aEnd(rActDate - 2 - static_cast<sal_Int32>(rActDate.GetDayOfWeek()));
                 return aCellDate.IsBetween( aBegin, aEnd );
             }
             else
@@ -1661,8 +1661,8 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
         case condformat::THISWEEK:
             if( rActDate.GetDayOfWeek() != SUNDAY )
             {
-                Date aBegin(rActDate - 1 - static_cast<long>(rActDate.GetDayOfWeek()));
-                Date aEnd(rActDate + 5 - static_cast<long>(rActDate.GetDayOfWeek()));
+                Date aBegin(rActDate - 1 - static_cast<sal_Int32>(rActDate.GetDayOfWeek()));
+                Date aEnd(rActDate + 5 - static_cast<sal_Int32>(rActDate.GetDayOfWeek()));
                 return aCellDate.IsBetween( aBegin, aEnd );
             }
             else
@@ -1674,7 +1674,7 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
         case condformat::NEXTWEEK:
             if( rActDate.GetDayOfWeek() != SUNDAY )
             {
-                return aCellDate.IsBetween( rActDate + 6 - static_cast<long>(rActDate.GetDayOfWeek()), rActDate + 12 - static_cast<long>(rActDate.GetDayOfWeek()) );
+                return aCellDate.IsBetween( rActDate + 6 - static_cast<sal_Int32>(rActDate.GetDayOfWeek()), rActDate + 12 - static_cast<sal_Int32>(rActDate.GetDayOfWeek()) );
             }
             else
             {
diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index 1c2dcaed5164..705d62dff6b5 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/core/data/dpgroup.cxx
@@ -203,7 +203,7 @@ bool ScDPGroupDateFilter::match( const ScDPItemData & rCellData ) const
             continue;
         }
 
-        Date date = maNullDate + static_cast<long>(approxFloor(rCellData.GetValue()));
+        Date date = maNullDate + static_cast<sal_Int32>(approxFloor(rCellData.GetValue()));
         switch (nGroupType)
         {
             case DataPilotFieldGroupBy::YEARS:
diff --git a/sc/source/core/data/dputil.cxx b/sc/source/core/data/dputil.cxx
index 4d6094d39ff5..30272169f1cc 100644
--- a/sc/source/core/data/dputil.cxx
+++ b/sc/source/core/data/dputil.cxx
@@ -334,7 +334,7 @@ sal_Int32 ScDPUtil::getDatePartValue(
     else
     {
         Date aDate = pFormatter->GetNullDate();
-        aDate += (long)::rtl::math::approxFloor(fValue);
+        aDate += static_cast<sal_Int32>(::rtl::math::approxFloor(fValue));
 
         switch ( nDatePart )
         {
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 77d51762f3ef..f211d97a5619 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -270,10 +270,10 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
                 Date aNullDate = pDocument->GetFormatTable()->GetNullDate();
                 Date aDate1 = aNullDate;
                 nVal = aFirstCell.mfValue;
-                aDate1 += (long)nVal;
+                aDate1 += static_cast<sal_Int32>(nVal);
                 Date aDate2 = aNullDate;
                 nVal = GetValue(nCol+nAddX, nRow+nAddY);
-                aDate2 += (long)nVal;
+                aDate2 += static_cast<sal_Int32>(nVal);
                 if ( aDate1 != aDate2 )
                 {
                     long nCmpInc = 0;
@@ -301,7 +301,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
                         if (aCell.meType == CELLTYPE_VALUE)
                         {
                             nVal = aCell.mfValue;
-                            aDate2 = aNullDate + (long) nVal;
+                            aDate2 = aNullDate + static_cast<sal_Int32>(nVal);
                             if ( eType == FILL_DAY )
                             {
                                 if ( aDate2-aDate1 != nCmpInc )
@@ -1079,7 +1079,7 @@ void ScTable::IncDate(double& rVal, sal_uInt16& nDayOfMonth, double nStep, FillD
     long nInc = (long) nStep;       // upper/lower limits ?
     Date aNullDate = pDocument->GetFormatTable()->GetNullDate();
     Date aDate = aNullDate;
-    aDate += (long)rVal;
+    aDate += static_cast<sal_Int32>(rVal);
     switch (eCmd)
     {
         case FILL_WEEKDAY:
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 749673a0a7ec..ae9877e5a4fb 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -126,21 +126,21 @@ void ScInterpreter::ScGetActTime()
 void ScInterpreter::ScGetYear()
 {
     Date aDate = pFormatter->GetNullDate();
-    aDate += (long) GetInt32();
+    aDate += GetInt32();
     PushDouble( (double) aDate.GetYear() );
 }
 
 void ScInterpreter::ScGetMonth()
 {
     Date aDate = pFormatter->GetNullDate();
-    aDate += (long) GetInt32();
+    aDate += GetInt32();
     PushDouble( (double) aDate.GetMonth() );
 }
 
 void ScInterpreter::ScGetDay()
 {
     Date aDate = pFormatter->GetNullDate();
-    aDate += (long) GetInt32();
+    aDate += GetInt32();
     PushDouble((double) aDate.GetDay());
 }
 
@@ -200,7 +200,7 @@ void ScInterpreter::ScGetDayOfWeek()
             nFlag = 1;
 
         Date aDate = pFormatter->GetNullDate();
-        aDate += (long) GetInt32();
+        aDate += GetInt32();
         int nVal = (int) aDate.GetDayOfWeek();  // MONDAY = 0
         switch (nFlag)
         {
@@ -242,7 +242,7 @@ void ScInterpreter::ScWeeknumOOo()
         sal_Int16 nFlag = GetInt16();
 
         Date aDate = pFormatter->GetNullDate();
-        aDate += (long) GetInt32();
+        aDate += GetInt32();
         PushInt( (int) aDate.GetWeekOfYear( nFlag == 1 ? SUNDAY : MONDAY ));
     }
 }
@@ -259,7 +259,7 @@ void ScInterpreter::ScGetWeekOfYear()
             nFlag = GetInt16();
 
         Date aDate = pFormatter->GetNullDate();
-        aDate += (long) GetInt32();
+        aDate += GetInt32();
 
         sal_Int32 nMinimumNumberOfDaysInWeek;
         DayOfWeek eFirstDayOfWeek;
@@ -302,7 +302,7 @@ void ScInterpreter::ScGetIsoWeekOfYear()
     if ( MustHaveParamCount( GetByte(), 1 ) )
     {
         Date aDate = pFormatter->GetNullDate();
-        aDate += (long) GetInt32();
+        aDate += GetInt32();
         PushInt( (int) aDate.GetWeekOfYear() );
     }
 }
@@ -737,9 +737,9 @@ void ScInterpreter::ScGetDiffDate360()
             else
                 fSign = 1.0;
             Date aDate1 = pFormatter->GetNullDate();
-            aDate1 += (long) ::rtl::math::approxFloor(nDate1);
+            aDate1 += static_cast<sal_Int32>(::rtl::math::approxFloor(nDate1));
             Date aDate2 = pFormatter->GetNullDate();
-            aDate2 += (long) ::rtl::math::approxFloor(nDate2);
+            aDate2 += static_cast<sal_Int32>(::rtl::math::approxFloor(nDate2));
             if (aDate1.GetDay() == 31)
                 aDate1 -= (sal_uLong) 1;
             else if (!bFlag)
diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index b964a0a209a5..389c223c2d69 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -193,11 +193,11 @@ bool ScETSForecastCalculation::PreprocessDataRange( const ScMatrixRef& rMatX, co
     // If month interval is used, replace maRange.X with month values
     // for ease of calculations.
     Date aNullDate = mpFormatter->GetNullDate();
-    Date aDate = aNullDate + static_cast< long >( maRange[ 0 ].X );
+    Date aDate = aNullDate + static_cast< sal_Int32 >( maRange[ 0 ].X );
     mnMonthDay = aDate.GetDay();
     for ( SCSIZE i = 1; i < mnCount && mnMonthDay; i++ )
     {
-        Date aDate1 = aNullDate + static_cast< long >( maRange[ i ].X );
+        Date aDate1 = aNullDate + static_cast< sal_Int32 >( maRange[ i ].X );
         if ( aDate != aDate1 )
         {
             if ( aDate1.GetDay() != mnMonthDay )
@@ -210,7 +210,7 @@ bool ScETSForecastCalculation::PreprocessDataRange( const ScMatrixRef& rMatX, co
     {
         for ( SCSIZE i = 0; i < mnCount; i++ )
         {
-            aDate = aNullDate + static_cast< long >( maRange[ i ].X );
+            aDate = aNullDate + static_cast< sal_Int32 >( maRange[ i ].X );
             maRange[ i ].X = aDate.GetYear() * 12 + aDate.GetMonth();
         }
     }
@@ -332,13 +332,13 @@ bool ScETSForecastCalculation::PreprocessDataRange( const ScMatrixRef& rMatX, co
         SCSIZE nMissingXCount = 0;
         double fOriginalCount = static_cast< double >( mnCount );
         if ( mnMonthDay )
-            aDate = aNullDate + static_cast< long >( maRange[ 0 ].X );
+            aDate = aNullDate + static_cast< sal_Int32 >( maRange[ 0 ].X );
         for ( SCSIZE i = 1; i < mnCount; i++ )
         {
             double fDist;
             if ( mnMonthDay )
             {
-                Date aDate1 = aNullDate + static_cast< long >( maRange[ i ].X );
+                Date aDate1 = aNullDate + static_cast< sal_Int32 >( maRange[ i ].X );
                 fDist = 12 * ( aDate1.GetYear() - aDate.GetYear() ) +
                          ( aDate1.GetMonth() - aDate.GetMonth() );
                 aDate = aDate1;
@@ -812,7 +812,7 @@ void ScETSForecastCalculation::refill()
 
 double ScETSForecastCalculation::convertXtoMonths( double x )
 {
-    Date aDate = mpFormatter->GetNullDate() + static_cast< long >( x );
+    Date aDate = mpFormatter->GetNullDate() + static_cast< sal_Int32 >( x );
     int nYear = aDate.GetYear();
     int nMonth = aDate.GetMonth();
     double fMonthLength;
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 86f8a2d446cf..b52ff6bf86b8 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1435,7 +1435,7 @@ void ScCheckListMenuWindow::addDateMember(const OUString& rsName, double nVal, b
 
     // Convert the numeric date value to a date object.
     Date aDate = pFormatter->GetNullDate();
-    aDate += static_cast<long>(rtl::math::approxFloor(nVal));
+    aDate += static_cast<sal_Int32>(rtl::math::approxFloor(nVal));
 
     sal_Int16 nYear = aDate.GetYear();
     sal_uInt16 nMonth = aDate.GetMonth();
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 2cdcbbfe96c6..2f5b104ee18c 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -967,7 +967,7 @@ ErrCode ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncoding
                             else
                             {
                                 Date aDate = pNumFmt->GetNullDate();        // tools date
-                                aDate += (long)fVal;                        //! approxfloor?
+                                aDate += static_cast<sal_Int32>(fVal);      //! approxfloor?
                                 xRowUpdate->updateDate( nCol+1, aDate.GetUNODate() );
                             }
                         }
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index c6c3d7631f71..1ffb68bcb209 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -691,9 +691,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                         {
                             const Date& rNullDate = pDoc->GetFormatTable()->GetNullDate();
                             Date aStartDate = rNullDate;
-                            aStartDate+= (long)fStartVal;
+                            aStartDate += static_cast<sal_Int32>(fStartVal);
                             Date aEndDate = rNullDate;
-                            aEndDate+= (long)fInputEndVal;
+                            aEndDate += static_cast<sal_Int32>(fInputEndVal);
                             double fTempDate=0;
 
                             if(aStartDate.GetYear()!=aEndDate.GetYear())
diff --git a/sc/workben/addin.cxx b/sc/workben/addin.cxx
index 7689afe85b86..0361ff0731cc 100644
--- a/sc/workben/addin.cxx
+++ b/sc/workben/addin.cxx
@@ -346,7 +346,7 @@ OUString SAL_CALL ScTestAddIn::getDateString( const css::uno::Reference< css::be
         {
             Date aNewDate( aDate.Day, aDate.Month, aDate.Year );
 
-            aNewDate += (long)(fValue+0.5);
+            aNewDate += static_cast<sal_Int32>(fValue+0.5);
 
             String aRet;
             aRet += aNewDate.GetDay();


More information about the Libreoffice-commits mailing list