Kaydet (Commit) 102b01c8 authored tarafından Jochen Nitschke's avatar Jochen Nitschke Kaydeden (comit) Noel Grandin

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/40241Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 4a128f33
...@@ -176,7 +176,7 @@ private: ...@@ -176,7 +176,7 @@ private:
Color* mpStandardColor; Color* mpStandardColor;
Color* mpSaturdayColor; Color* mpSaturdayColor;
Color* mpSundayColor; Color* mpSundayColor;
sal_uLong mnDayCount; sal_Int32 mnDayCount;
long mnDaysOffX; long mnDaysOffX;
long mnWeekDayOffY; long mnWeekDayOffY;
long mnDaysOffY; long mnDaysOffY;
......
...@@ -418,7 +418,7 @@ void Calendar::ImplFormat() ...@@ -418,7 +418,7 @@ void Calendar::ImplFormat()
maFirstDate = aTempDate; maFirstDate = aTempDate;
nWeekDay = (sal_uInt16)aTempDate.GetDayOfWeek(); nWeekDay = (sal_uInt16)aTempDate.GetDayOfWeek();
nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7; nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7;
maFirstDate -= (sal_uLong)nWeekDay; maFirstDate -= static_cast<sal_Int32>(nWeekDay);
mnDayCount = nWeekDay; mnDayCount = nWeekDay;
sal_uInt16 nDaysInMonth; sal_uInt16 nDaysInMonth;
sal_uInt16 nMonthCount = (sal_uInt16)(mnMonthPerLine*mnLines); sal_uInt16 nMonthCount = (sal_uInt16)(mnMonthPerLine*mnLines);
...@@ -981,7 +981,7 @@ void Calendar::ImplUpdateSelection( IntDateSet* pOld ) ...@@ -981,7 +981,7 @@ void Calendar::ImplUpdateSelection( IntDateSet* pOld )
for ( IntDateSet::const_iterator it = pOld->begin(); it != pOld->end(); ++it ) 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() ) if ( pNew->find( nKey ) == pNew->end() )
{ {
Date aTempDate( nKey ); Date aTempDate( nKey );
...@@ -991,7 +991,7 @@ void Calendar::ImplUpdateSelection( IntDateSet* pOld ) ...@@ -991,7 +991,7 @@ void Calendar::ImplUpdateSelection( IntDateSet* pOld )
for ( IntDateSet::const_iterator it = pNew->begin(); it != pNew->end(); ++it ) 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() ) if ( pOld->find( nKey ) == pOld->end() )
{ {
Date aTempDate( nKey ); Date aTempDate( nKey );
...@@ -1256,8 +1256,7 @@ void Calendar::ImplEndTracking( bool bCancel ) ...@@ -1256,8 +1256,7 @@ void Calendar::ImplEndTracking( bool bCancel )
if ( !bCancel ) if ( !bCancel )
{ {
// determine if we should scroll the visible area // determine if we should scroll the visible area
sal_uLong nSelCount = mpSelectTable->size(); if ( !mpSelectTable->empty() )
if ( nSelCount )
{ {
Date aFirstSelDate( *mpSelectTable->begin() ); Date aFirstSelDate( *mpSelectTable->begin() );
Date aLastSelDate( *mpSelectTable->rbegin() ); Date aLastSelDate( *mpSelectTable->rbegin() );
...@@ -1695,7 +1694,7 @@ void Calendar::SetCurDate( const Date& rNewDate ) ...@@ -1695,7 +1694,7 @@ void Calendar::SetCurDate( const Date& rNewDate )
while ( nDateOff > aTempDate.GetDaysInMonth() ) while ( nDateOff > aTempDate.GetDaysInMonth() )
{ {
aFirstDate += aFirstDate.GetDaysInMonth(); aFirstDate += aFirstDate.GetDaysInMonth();
long nDaysInMonth = aTempDate.GetDaysInMonth(); sal_Int32 nDaysInMonth = aTempDate.GetDaysInMonth();
aTempDate += nDaysInMonth; aTempDate += nDaysInMonth;
nDateOff -= nDaysInMonth; nDateOff -= nDaysInMonth;
} }
...@@ -1779,7 +1778,7 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const ...@@ -1779,7 +1778,7 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const
long nX; long nX;
long nY; long nY;
sal_uLong nDaysOff; sal_Int32 nDaysOff;
sal_uInt16 nDayIndex; sal_uInt16 nDayIndex;
Date aDate = GetFirstMonth(); Date aDate = GetFirstMonth();
...@@ -1787,7 +1786,7 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const ...@@ -1787,7 +1786,7 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const
{ {
aRect = GetDateRect( aDate ); aRect = GetDateRect( aDate );
nDaysOff = aDate-rDate; nDaysOff = aDate-rDate;
nX = (long)(nDaysOff*mnDayWidth); nX = nDaysOff*mnDayWidth;
aRect.Left() -= nX; aRect.Left() -= nX;
aRect.Right() -= nX; aRect.Right() -= nX;
return aRect; return aRect;
...@@ -1803,7 +1802,7 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const ...@@ -1803,7 +1802,7 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const
aRect = GetDateRect( aLastDate ); aRect = GetDateRect( aLastDate );
nDaysOff = rDate-aLastDate; nDaysOff = rDate-aLastDate;
nDayIndex = 0; nDayIndex = 0;
for ( sal_uLong i = 0; i <= nDaysOff; i++ ) for ( sal_Int32 i = 0; i <= nDaysOff; i++ )
{ {
if ( aLastDate == rDate ) if ( aLastDate == rDate )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment