summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-07-20 18:32:57 +0200
committerEike Rathke <erack@redhat.com>2017-07-21 12:24:27 +0200
commitfcd0361d6be8d088be12e500f0120afd7995d1ac (patch)
tree9e18c0310405d68d9151db9073cc8f6926df077d /connectivity
parent2e486daff35ab16e810bfdafb24b19bcbf2fe8cd (diff)
Eliminate Date::operator+=() and -=() and replace with Date::AddDays()
Clarifies code and gets rid of explicitly casting the operand to sal_Int32. Also in preparation of removing DateTime::operator+=(sal_Int32) that is confusingly similar to DateTime::operator+=(double) and just depends on type. Change-Id: I83422e2940fbb017978db9b5734b4966228af3de Reviewed-on: https://gerrit.libreoffice.org/40248 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/calc/CTable.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx
index 52737b61aca6..eab69b4e9792 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 += static_cast<sal_Int32>(::rtl::math::approxFloor( xCell->getValue() ));
+ aDate.AddDays(::rtl::math::approxFloor( xCell->getValue() ));
rValue = aDate.GetUNODate();
}
else
@@ -402,7 +402,7 @@ static void lcl_SetValue( ORowSetValue& rValue, const Reference<XSpreadsheet>& x
aDateTime.Hours = (sal_uInt16) nIntTime;
::Date aDate( rNullDate );
- aDate += nIntDays;
+ aDate.AddDays( nIntDays );
aDateTime.Day = aDate.GetDay();
aDateTime.Month = aDate.GetMonth();
aDateTime.Year = aDate.GetYear();