summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-06-21 18:03:12 +0200
committerMichael Stahl <mstahl@redhat.com>2017-06-21 18:09:40 +0200
commit066645f49dbe22c893c8a176a7c97fe251ccff54 (patch)
tree0457309bd2a6fca9603d92273c3b4effc4a503b5
parent4ffce41ef44ad925ce0abce2832542c79b0d866c (diff)
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.
-rw-r--r--msodumper/docrecord.py14
1 files changed, 9 insertions, 5 deletions
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