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 /vcl | |
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 'vcl')
-rw-r--r-- | vcl/source/control/field2.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 97ec32d6bb44..aeeef95c77f9 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -2452,9 +2452,11 @@ sal_Bool TimeFormatter::ImplTimeReformat( const OUString& rStr, OUString& rOutSt n += aTempTime.GetSec(); rOutStr = OUString::number( n ); rOutStr += ImplGetLocaleDataWrapper().getTime100SecSep(); - if ( aTempTime.Get100Sec() < 10 ) - rOutStr += "0"; - rOutStr += OUString::number( aTempTime.Get100Sec() ); + std::ostringstream ostr; + ostr.fill('0'); + ostr.width(9); + ostr << aTempTime.GetNanoSec(); + rOutStr += OUString::createFromAscii(ostr.str().c_str()); } else if ( mbDuration ) rOutStr = ImplGetLocaleDataWrapper().getDuration( aTempTime, bSecond, b100Sec ); @@ -2755,9 +2757,11 @@ void TimeFormatter::ImplSetUserTime( const Time& rNewTime, Selection* pNewSelect n += aNewTime.GetSec(); aStr = OUString::number( n ); aStr += ImplGetLocaleDataWrapper().getTime100SecSep(); - if ( aNewTime.Get100Sec() < 10 ) - aStr += "0"; - aStr += OUString::number( aNewTime.Get100Sec() ); + std::ostringstream ostr; + ostr.fill('0'); + ostr.width(9); + ostr << aNewTime.GetNanoSec(); + aStr += OUString::createFromAscii(ostr.str().c_str()); } else if ( mbDuration ) { |