Index: relatorio/templates/opendocument.py
===================================================================
--- relatorio/templates/opendocument.py (revision 99:1efd21aa821f)
+++ relatorio/templates/opendocument.py (revision 100:33521906fedb)
@@ -23,4 +23,5 @@
 import re
 import md5
+import time
 import urllib
 import zipfile
@@ -401,5 +402,5 @@
         # find the position in the row of the cells holding the
         # <for> and </for> instructions
-        #XXX: count cells only instead of * ?
+        # We use "*" so as to count both normal cells and covered/hidden cells
         position_xpath_expr = 'count(preceding-sibling::*)'
         opening_pos = \
@@ -621,4 +622,5 @@
             files.setdefault(stream_for, []).append((kind, data, pos))
 
+        now = time.localtime()[:6]
         for f_info in self.inzip.infolist():
             if f_info.filename.startswith('ObjectReplacements'):
@@ -626,6 +628,11 @@
             elif f_info.filename in files:
                 stream = files[f_info.filename]
-                self.outzip.writestr(f_info.filename,
-                                     output_encode(self.xml_serializer(stream)))
+                # create a new file descriptor, copying some attributes from
+                # the original file
+                new_info = zipfile.ZipInfo(f_info.filename, now)
+                for attr in ('compress_type', 'flag_bits', 'create_system'):
+                    setattr(new_info, attr, getattr(f_info, attr))
+                serialized_stream = output_encode(self.xml_serializer(stream))
+                self.outzip.writestr(new_info, serialized_stream)
             else:
                 self.outzip.writestr(f_info, self.inzip.read(f_info.filename))
