From b75bc4b5de529f27fe56beb2d86f907411fa1e17 Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Wed, 28 Oct 2015 12:33:53 +0100 Subject: Date: avoid temporary conversions to sal_uIntPtr Change-Id: Ib52c5d1a55d17c572fd5be9a3ce36c6de7965220 --- tools/source/datetime/tdate.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tools') 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(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((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: */ -- cgit v1.2.3