[Libreoffice-commits] mso-dumper.git: src/docrecord.py test/doc

Miklos Vajna vmiklos at kemper.freedesktop.org
Wed Aug 21 08:35:15 PDT 2013


 src/docrecord.py            |    3 ++-
 test/doc/pass/abi1876-4.doc |binary
 test/doc/test.py            |    9 +++++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 128cafae5f049af552f65baa26c0d9a728da2f3a
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Wed Aug 21 17:29:18 2013 +0200

    fcSpex == 0xffffffff means no offset

diff --git a/src/docrecord.py b/src/docrecord.py
index 61be2b4..c02e0d3 100644
--- a/src/docrecord.py
+++ b/src/docrecord.py
@@ -270,7 +270,8 @@ class Sed(DOCDirStream):
         print '<aSed type="Sed" offset="%d" size="%d bytes">' % (self.pos, Sed.size)
         self.printAndSet("fn", self.readuInt16())
         self.printAndSet("fcSepx", self.readuInt32())
-        Sepx(self).dump()
+        if self.fcSepx != 0xffffffff:
+            Sepx(self).dump()
         self.printAndSet("fnMpr", self.readuInt16())
         self.printAndSet("fcMpr", self.readuInt32())
         print '</aSed>'
diff --git a/test/doc/pass/abi1876-4.doc b/test/doc/pass/abi1876-4.doc
new file mode 100644
index 0000000..fda3b49
Binary files /dev/null and b/test/doc/pass/abi1876-4.doc differ
diff --git a/test/doc/test.py b/test/doc/test.py
index c6f71d7..03eb87e 100755
--- a/test/doc/test.py
+++ b/test/doc/test.py
@@ -46,6 +46,15 @@ class Test(unittest.TestCase):
     def getHex(self, num):
         return int(num, 16)
 
+    def test_pass(self):
+        """This test just makes sure that all files in the 'pass' directory are
+        dumped without problems."""
+
+        for dirname, dirnames, filenames in os.walk('pass'):
+            for filename in filenames:
+                if filename.endswith(".doc"):
+                    self.dump(os.path.join(dirname, filename).replace('.doc', ''))
+
     def test_hello(self):
         self.dump('hello')
 


More information about the Libreoffice-commits mailing list