[Libreoffice-commits] core.git: svtools/source

Jan Holesovsky kendy at suse.cz
Thu Apr 25 05:00:28 PDT 2013


 svtools/source/misc/templatefoldercache.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 4fa553e4071a0ba4981a690429903c4e68607864
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Thu Apr 25 13:56:00 2013 +0200

    fdo#62088: Fix regression introduced by the DateTime incompatible change.
    
    It is not good to mess with the stream operators, more so when the size of the
    data changes ;-)
    
    Change-Id: Id02b83224496a28575f4e12196892de198793983

diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index aa2bade..c023720 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -29,6 +29,7 @@
 #include <ucbhelper/content.hxx>
 #include <rtl/ref.hxx>
 #include <salhelper/simplereferenceobject.hxx>
+#include <tools/time.hxx>
 #include <tools/urlobj.hxx>
 #include <tools/debug.hxx>
 #include <unotools/pathoptions.hxx>
@@ -57,7 +58,9 @@ namespace svt
     //---------------------------------------------------------------------
     SvStream& operator << ( SvStream& _rStorage, const util::DateTime& _rDate )
     {
-        _rStorage << _rDate.NanoSeconds;
+        sal_uInt16 hundredthSeconds = static_cast< sal_uInt16 >( _rDate.NanoSeconds / Time::nanoPerCenti );
+        _rStorage << hundredthSeconds;
+
         _rStorage << _rDate.Seconds;
         _rStorage << _rDate.Minutes;
         _rStorage << _rDate.Hours;
@@ -71,7 +74,10 @@ namespace svt
     //---------------------------------------------------------------------
     SvStream& operator >> ( SvStream& _rStorage, util::DateTime& _rDate )
     {
-        _rStorage >> _rDate.NanoSeconds;
+        sal_uInt16 hundredthSeconds;
+        _rStorage >> hundredthSeconds;
+        _rDate.NanoSeconds = static_cast< sal_uInt32 >( hundredthSeconds ) * Time::nanoPerCenti;
+
         _rStorage >> _rDate.Seconds;
         _rStorage >> _rDate.Minutes;
         _rStorage >> _rDate.Hours;


More information about the Libreoffice-commits mailing list