summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2015-10-28 12:33:53 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2015-10-28 14:08:34 +0100
commitb75bc4b5de529f27fe56beb2d86f907411fa1e17 (patch)
treefbfea081f566aeda53db5c4b1f65ac149153deaf /tools
parent1d927b23dfeef3cdc270c6c94e81e08180dabe76 (diff)
Date: avoid temporary conversions to sal_uIntPtr
Change-Id: Ib52c5d1a55d17c572fd5be9a3ce36c6de7965220
Diffstat (limited to 'tools')
-rw-r--r--tools/source/datetime/tdate.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx
index c27f1d0c7cbf..808ac4888d2d 100644
--- a/tools/source/datetime/tdate.cxx
+++ b/tools/source/datetime/tdate.cxx
@@ -133,7 +133,7 @@ static Date lcl_DaysToDate( long nDays )
while ( bCalc );
sal_uInt16 nMonth = 1;
- while ( (sal_uIntPtr)nTempDays > ImplDaysInMonth( nMonth, nYear ) )
+ while ( nTempDays > static_cast<long>(ImplDaysInMonth( nMonth, nYear )) )
{
nTempDays -= ImplDaysInMonth( nMonth, nYear );
nMonth++;
@@ -191,7 +191,7 @@ void Date::SetYear( sal_uInt16 nNewYear )
DayOfWeek Date::GetDayOfWeek() const
{
- return (DayOfWeek)((sal_uIntPtr)(GetAsNormalizedDays()-1) % 7);
+ return static_cast<DayOfWeek>((GetAsNormalizedDays()-1) % 7);
}
sal_uInt16 Date::GetDayOfYear() const
@@ -467,10 +467,7 @@ Date operator -( const Date& rDate, long nDays )
long operator -( const Date& rDate1, const Date& rDate2 )
{
- sal_uIntPtr nTempDays1 = rDate1.GetAsNormalizedDays();
- sal_uIntPtr nTempDays2 = rDate2.GetAsNormalizedDays();
-
- return nTempDays1 - nTempDays2;
+ return rDate1.GetAsNormalizedDays() - rDate2.GetAsNormalizedDays();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */