diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-03-17 08:36:26 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-04-18 21:34:46 +0200 |
commit | 9830fd36dbdb72c79703b0c61efc027fba793c5a (patch) | |
tree | 2e9d698e6ca109dc6627adb5c84aa2b635bcfe92 /extensions/source | |
parent | 5aaaf0694b6e3213685563fc3bc90d19b10f5c75 (diff) |
date/time IDL datatypes incompatible change
- nanosecond precision
- signed (allowed negative) year
Also: assorted improvements / bugfixes in date/time handling code.
Some factorisation of copy/pasted code.
Change-Id: I761a1b0b8731c82f19a0c37acbcf43d3c06d6cd6
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/logging/csvformatter.cxx | 4 | ||||
-rw-r--r-- | extensions/source/logging/logrecord.cxx | 2 | ||||
-rw-r--r-- | extensions/source/logging/plaintextformatter.cxx | 4 | ||||
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 4 | ||||
-rw-r--r-- | extensions/source/propctrlr/standardcontrol.cxx | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/extensions/source/logging/csvformatter.cxx b/extensions/source/logging/csvformatter.cxx index 19b2a2b2b692..7bf518813c33 100644 --- a/extensions/source/logging/csvformatter.cxx +++ b/extensions/source/logging/csvformatter.cxx @@ -263,14 +263,14 @@ namespace logging // ISO 8601 char buffer[ 30 ]; const size_t buffer_size = sizeof( buffer ); - snprintf( buffer, buffer_size, "%04i-%02i-%02iT%02i:%02i:%02i.%02i", + snprintf( buffer, buffer_size, "%04i-%02i-%02iT%02i:%02i:%02i.%09i", (int)record.LogTime.Year, (int)record.LogTime.Month, (int)record.LogTime.Day, (int)record.LogTime.Hours, (int)record.LogTime.Minutes, (int)record.LogTime.Seconds, - (int)record.LogTime.HundredthSeconds ); + (int)record.LogTime.NanoSeconds ); aLogEntry.appendAscii( buffer ); aLogEntry.append(comma_char); } diff --git a/extensions/source/logging/logrecord.cxx b/extensions/source/logging/logrecord.cxx index ce9c8ba8d036..dfd0cb8f21d1 100644 --- a/extensions/source/logging/logrecord.cxx +++ b/extensions/source/logging/logrecord.cxx @@ -68,7 +68,7 @@ namespace logging aTimeStamp.Hours = aDateTime.Hours; aTimeStamp.Minutes = aDateTime.Minutes; aTimeStamp.Seconds = aDateTime.Seconds; - aTimeStamp.HundredthSeconds = ::sal::static_int_cast< sal_Int16 >( aDateTime.NanoSeconds / 10000000 ); + aTimeStamp.NanoSeconds = aDateTime.NanoSeconds; return LogRecord( _rLoggerName, diff --git a/extensions/source/logging/plaintextformatter.cxx b/extensions/source/logging/plaintextformatter.cxx index 7396263b8a24..7ce48752cc85 100644 --- a/extensions/source/logging/plaintextformatter.cxx +++ b/extensions/source/logging/plaintextformatter.cxx @@ -129,9 +129,9 @@ namespace logging aLogEntry.appendAscii( buffer ); aLogEntry.appendAscii( " " ); - snprintf( buffer, buffer_size, "%04i-%02i-%02i %02i:%02i:%02i.%02i", + snprintf( buffer, buffer_size, "%04i-%02i-%02i %02i:%02i:%02i.%09i", (int)_rRecord.LogTime.Year, (int)_rRecord.LogTime.Month, (int)_rRecord.LogTime.Day, - (int)_rRecord.LogTime.Hours, (int)_rRecord.LogTime.Minutes, (int)_rRecord.LogTime.Seconds, (int)_rRecord.LogTime.HundredthSeconds ); + (int)_rRecord.LogTime.Hours, (int)_rRecord.LogTime.Minutes, (int)_rRecord.LogTime.Seconds, (int)_rRecord.LogTime.NanoSeconds ); aLogEntry.appendAscii( buffer ); aLogEntry.appendAscii( " " ); diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 2b68425ae3af..773a4e6e199d 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -590,7 +590,7 @@ namespace pcr { util::Time aTime; OSL_VERIFY( _rControlValue >>= aTime ); - aPropertyValue <<= (sal_Int32)DBTypeConversion::toINT32( aTime ); + aPropertyValue <<= DBTypeConversion::toINT64( aTime ); } break; @@ -726,7 +726,7 @@ namespace pcr case PROPERTY_ID_DEFAULT_TIME: case PROPERTY_ID_TIME: { - sal_Int32 nTime = 0; + sal_Int64 nTime = 0; OSL_VERIFY( _rPropertyValue >>= nTime ); aControlValue <<= DBTypeConversion::toTime( nTime ); } diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index f9caaae10131..60f533ac9df1 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -87,7 +87,7 @@ namespace pcr } else { - ::Time aTime( aUNOTime.Hours, aUNOTime.Minutes, aUNOTime.Seconds, aUNOTime.HundredthSeconds ); + ::Time aTime( aUNOTime.Hours, aUNOTime.Minutes, aUNOTime.Seconds, aUNOTime.NanoSeconds ); getTypedControlWindow()->SetTime( aTime ); } } @@ -99,7 +99,7 @@ namespace pcr if ( !getTypedControlWindow()->GetText().isEmpty() ) { ::Time aTime( getTypedControlWindow()->GetTime() ); - util::Time aUNOTime( aTime.Get100Sec(), aTime.GetSec(), aTime.GetMin(), aTime.GetHour() ); + util::Time aUNOTime( aTime.GetNanoSec(), aTime.GetSec(), aTime.GetMin(), aTime.GetHour() ); aPropValue <<= aUNOTime; } return aPropValue; |