summaryrefslogtreecommitdiff
path: root/tools/source/datetime
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2006-06-19 12:37:11 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2006-06-19 12:37:11 +0000
commit962dfb77b8057795476a6f1672610fa7cc9c1313 (patch)
treefb48e686fba0930e34600508096fc527eebdec81 /tools/source/datetime
parentba0ea6fe8a3bfe35619f4dcd199a7aaafe55f7c9 (diff)
INTEGRATION: CWS warnings01 (1.5.8); FILE MERGED
2006/05/26 13:44:01 sb 1.5.8.4: #i53898# Made code warning-free and/or compile at all after resync to SRC680m170. 2006/05/23 17:54:50 sb 1.5.8.3: RESYNC: (1.5-1.6); FILE MERGED 2006/01/05 10:14:21 fs 1.5.8.2: #i53898# warning-free code 2005/10/14 11:19:31 sb 1.5.8.1: #i53898# Made code warning-free; cleanup.
Diffstat (limited to 'tools/source/datetime')
-rw-r--r--tools/source/datetime/datetime.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/tools/source/datetime/datetime.cxx b/tools/source/datetime/datetime.cxx
index ba9360d34bbb..85a51f09758c 100644
--- a/tools/source/datetime/datetime.cxx
+++ b/tools/source/datetime/datetime.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: datetime.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: hr $ $Date: 2006-04-19 14:02:20 $
+ * last change: $Author: hr $ $Date: 2006-06-19 13:37:11 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -141,13 +141,13 @@ BOOL DateTime::operator <=( const DateTime& rDateTime ) const
|*
*************************************************************************/
-ULONG DateTime::GetSecFromDateTime( const Date& rDate ) const
+long DateTime::GetSecFromDateTime( const Date& rDate ) const
{
if ( Date::operator<( rDate ) )
return 0;
else
{
- ULONG nSec = *this- (DateTime) rDate;
+ long nSec = Date( *this ) - rDate;
nSec *= 24UL*60*60;
long nHour = GetHour();
long nMin = GetMin();
@@ -171,7 +171,7 @@ void DateTime::MakeDateTimeFromSec( const Date& rDate, ULONG nSec )
long nDays = nSec / (24UL*60*60);
((Date*)this)->operator=( rDate );
nSec -= nDays * (24UL*60*60);
- USHORT nMin = nSec / 60;
+ USHORT nMin = (USHORT)(nSec / 60);
nSec -= nMin * 60;
((Time*)this)->operator=( Time( 0, nMin, (USHORT)nSec ) );
operator+=( nDays );
@@ -427,14 +427,18 @@ DateTime DateTime::CreateFromWin32FileDateTime( const sal_uInt32 & rLower, const
nDays -= nYears * 365 + nYears / 4 - nYears / 100 + nYears / 400;
USHORT nMonths = 0;
- for( long nDaysCount = nDays; nDaysCount >= 0; )
+ for( sal_Int64 nDaysCount = nDays; nDaysCount >= 0; )
{
nDays = nDaysCount;
nMonths ++;
- nDaysCount -= Date( 1, nMonths, 1601 + nYears ).GetDaysInMonth();
+ nDaysCount -= Date(
+ 1, nMonths, sal::static_int_cast< USHORT >(1601 + nYears) ).
+ GetDaysInMonth();
}
- Date _aDate( (USHORT)( nDays + 1 ), nMonths, nYears + 1601 );
+ Date _aDate(
+ (USHORT)( nDays + 1 ), nMonths,
+ sal::static_int_cast< USHORT >(nYears + 1601) );
Time _aTime( ULONG( ( aTime / ( a100nPerSecond * 60 * 60 ) ) % sal_Int64( 24 ) ),
ULONG( ( aTime / ( a100nPerSecond * 60 ) ) % sal_Int64( 60 ) ),
ULONG( ( aTime / ( a100nPerSecond ) ) % sal_Int64( 60 ) ) );