[Libreoffice-commits] mso-dumper.git: msodumper/docrecord.py

Michael Stahl mstahl at redhat.com
Wed Jun 21 16:10:42 UTC 2017


 msodumper/docrecord.py |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 066645f49dbe22c893c8a176a7c97fe251ccff54
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jun 21 18:03:12 2017 +0200

    docrecord: fix reading of PChgTabsAdd, PChgTabsDel, PChgTabsDelClose
    
    These did not read all of their content so anything following them was
    messed up and possibly throwing exceptions.
    
    This broke the test_abi1157 since commit
    cc08c9db559ed7ac2bcb2d069fba62e9b2b8403a - before that, these were
    simply not read from this particular file at all since they happen
    to occur only in the 2nd half of FKPs.

diff --git a/msodumper/docrecord.py b/msodumper/docrecord.py
index c298ceb..d3ba5c1 100644
--- a/msodumper/docrecord.py
+++ b/msodumper/docrecord.py
@@ -597,8 +597,8 @@ class PChgTabsDel(BinaryStream):
     def dump(self):
         print '<pchgTabsDel type="PChgTabsDel" offset="%d">' % self.pos
         self.printAndSet("cTabs", self.readuInt8())
-        if self.cTabs != 0:
-            print '<todo what="PChgTabsDel::dump() cTabs is non-zero"/>'
+        for i in range(self.cTabs):
+            print '<rgdxaDel index="%d" value="%d"/>' % (i, self.readInt16())
         print '</pchgTabsDel>'
         self.parent.pos = self.pos
 
@@ -613,8 +613,10 @@ class PChgTabsDelClose(BinaryStream):
     def dump(self):
         print '<pchgTabsDelClose type="PChgTabsDelClose" offset="%d">' % self.pos
         self.printAndSet("cTabs", self.readuInt8())
-        if self.cTabs != 0:
-            print '<todo what="PChgTabsDelClose::dump() cTabs is non-zero"/>'
+        for i in range(self.cTabs):
+            print '<rgdxaDel index="%d" value="%d"/>' % (i, self.readInt16())
+        for i in range(self.cTabs):
+            print '<rgdxaClose index="%d" value="%d"/>' % (i, self.readInt16())
         print '</pchgTabsDelClose>'
         self.parent.pos = self.pos
 
@@ -630,7 +632,9 @@ class PChgTabsAdd(BinaryStream):
         print '<pchgTabsAdd type="PChgTabsAdd" offset="%d">' % self.pos
         self.printAndSet("cTabs", self.readuInt8())
         for i in range(self.cTabs):
-            print '<rgdxaDel index="%d" value="%d"/>' % (i, self.readuInt16())
+            print '<rgdxaAdd index="%d" value="%d"/>' % (i, self.readInt16())
+        for i in range(self.cTabs):
+            print '<rgtbdAdd index="%d" value="%d"/>' % (i, self.readuInt8())
         print '</pchgTabsAdd>'
         self.parent.pos = self.pos
 


More information about the Libreoffice-commits mailing list