diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-07-20 17:34:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-20 20:53:33 +0200 |
commit | 102b01c80a271ccaec226d7b0bcc960917ea6b57 (patch) | |
tree | 04577f77e7b4191a8b9a6d620cb41ce4f905b312 /svtools | |
parent | 4a128f336a146a12c28bb9f3bdfa24d2198d85dc (diff) |
change some Date += long to Date += sal_Int32
found by adding
Date& operator+=(long) = delete;
to Date class
Change-Id: I0e6b59a2e789f2bdf2f271b99d10c6acbae8bf55
Reviewed-on: https://gerrit.libreoffice.org/40241
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/calendar.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx index f48bff13eb1c..324a548b0bf2 100644 --- a/svtools/source/control/calendar.cxx +++ b/svtools/source/control/calendar.cxx @@ -418,7 +418,7 @@ void Calendar::ImplFormat() maFirstDate = aTempDate; nWeekDay = (sal_uInt16)aTempDate.GetDayOfWeek(); nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7; - maFirstDate -= (sal_uLong)nWeekDay; + maFirstDate -= static_cast<sal_Int32>(nWeekDay); mnDayCount = nWeekDay; sal_uInt16 nDaysInMonth; sal_uInt16 nMonthCount = (sal_uInt16)(mnMonthPerLine*mnLines); @@ -981,7 +981,7 @@ void Calendar::ImplUpdateSelection( IntDateSet* pOld ) for ( IntDateSet::const_iterator it = pOld->begin(); it != pOld->end(); ++it ) { - sal_uLong nKey = *it; + sal_Int32 nKey = *it; if ( pNew->find( nKey ) == pNew->end() ) { Date aTempDate( nKey ); @@ -991,7 +991,7 @@ void Calendar::ImplUpdateSelection( IntDateSet* pOld ) for ( IntDateSet::const_iterator it = pNew->begin(); it != pNew->end(); ++it ) { - sal_uLong nKey = *it; + sal_Int32 nKey = *it; if ( pOld->find( nKey ) == pOld->end() ) { Date aTempDate( nKey ); @@ -1256,8 +1256,7 @@ void Calendar::ImplEndTracking( bool bCancel ) if ( !bCancel ) { // determine if we should scroll the visible area - sal_uLong nSelCount = mpSelectTable->size(); - if ( nSelCount ) + if ( !mpSelectTable->empty() ) { Date aFirstSelDate( *mpSelectTable->begin() ); Date aLastSelDate( *mpSelectTable->rbegin() ); @@ -1695,7 +1694,7 @@ void Calendar::SetCurDate( const Date& rNewDate ) while ( nDateOff > aTempDate.GetDaysInMonth() ) { aFirstDate += aFirstDate.GetDaysInMonth(); - long nDaysInMonth = aTempDate.GetDaysInMonth(); + sal_Int32 nDaysInMonth = aTempDate.GetDaysInMonth(); aTempDate += nDaysInMonth; nDateOff -= nDaysInMonth; } @@ -1779,7 +1778,7 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const long nX; long nY; - sal_uLong nDaysOff; + sal_Int32 nDaysOff; sal_uInt16 nDayIndex; Date aDate = GetFirstMonth(); @@ -1787,7 +1786,7 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const { aRect = GetDateRect( aDate ); nDaysOff = aDate-rDate; - nX = (long)(nDaysOff*mnDayWidth); + nX = nDaysOff*mnDayWidth; aRect.Left() -= nX; aRect.Right() -= nX; return aRect; @@ -1803,7 +1802,7 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const aRect = GetDateRect( aLastDate ); nDaysOff = rDate-aLastDate; nDayIndex = 0; - for ( sal_uLong i = 0; i <= nDaysOff; i++ ) + for ( sal_Int32 i = 0; i <= nDaysOff; i++ ) { if ( aLastDate == rDate ) { |