diff options
author | Adam Co <rattles2013@gmail.com> | 2013-11-26 13:56:46 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-26 14:02:02 +0100 |
commit | 8d7cb7773dafda969c22bb9cca658bf1c677798d (patch) | |
tree | 18d9efda9a959322f98d9fd69e77615fdebf2036 /filter | |
parent | fc708d6286e184d7f1b63e4a334d5aa1c7959516 (diff) |
Moved 'DateTimeToOString' from 'filter' package to 'tools' package
After the move now other classes can convert DateTime to OString also
Reviewed on:
https://gerrit.libreoffice.org/6816
Change-Id: I0ceb9a5cc26103a6cb36d7765a717770ec3fbe7d
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/util.cxx | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx index 828d5de239b7..0bd7cbefda60 100644 --- a/filter/source/msfilter/util.cxx +++ b/filter/source/msfilter/util.cxx @@ -79,50 +79,6 @@ DateTime DTTM2DateTime( long lDTTM ) return aDateTime; } -/// Append the number as 2-digit when less than 10. -static void lcl_AppendTwoDigits( OStringBuffer &rBuffer, sal_Int32 nNum ) -{ - if ( nNum < 0 || nNum > 99 ) - { - rBuffer.append( "00" ); - return; - } - - if ( nNum < 10 ) - rBuffer.append( '0' ); - - rBuffer.append( nNum ); -} - -OString DateTimeToOString( const DateTime& rDateTime ) -{ - DateTime aInUTC( rDateTime ); -// HACK: this is correct according to the spec, but MSOffice believes everybody lives -// in UTC+0 when reading it back -// aInUTC.ConvertToUTC(); - - OStringBuffer aBuffer( 25 ); - aBuffer.append( sal_Int32( aInUTC.GetYear() ) ); - aBuffer.append( '-' ); - - lcl_AppendTwoDigits( aBuffer, aInUTC.GetMonth() ); - aBuffer.append( '-' ); - - lcl_AppendTwoDigits( aBuffer, aInUTC.GetDay() ); - aBuffer.append( 'T' ); - - lcl_AppendTwoDigits( aBuffer, aInUTC.GetHour() ); - aBuffer.append( ':' ); - - lcl_AppendTwoDigits( aBuffer, aInUTC.GetMin() ); - aBuffer.append( ':' ); - - lcl_AppendTwoDigits( aBuffer, aInUTC.GetSec() ); - aBuffer.append( 'Z' ); // we are in UTC - - return aBuffer.makeStringAndClear(); -} - sal_Unicode bestFitOpenSymbolToMSFont(sal_Unicode cChar, rtl_TextEncoding& rChrSet, OUString& rFontName, bool bDisableUnicodeSupport) { |