src/docrecord.py | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-)
New commits: commit 0eff7797b92b60fc0d5a8926f95b2227e3e18fb2 Author: Miklos Vajna <[email protected]> Date: Tue Jan 8 17:35:25 2013 +0100 PapxInFkp: handle non-zero cb diff --git a/src/docrecord.py b/src/docrecord.py index 13e3e40..0aa271d 100644 --- a/src/docrecord.py +++ b/src/docrecord.py @@ -567,9 +567,9 @@ class PapxInFkp(DOCDirStream): if self.cb == 0: self.printAndSet("cb_", self.readuInt8()) grpPrlAndIstd = GrpPrlAndIstd(self.bytes, self.pos, 2 * self.cb_) - grpPrlAndIstd.dump() else: - print '<todo what="PapxInFkp::dump() first byte is not 0"/>' + grpPrlAndIstd = GrpPrlAndIstd(self.bytes, self.pos, self.cb) + grpPrlAndIstd.dump() print '</papxInFkp>' class BxPap(DOCDirStream): commit 48ca425259dad99f2c2c8b0c7e2dc3f93adfa973 Author: Miklos Vajna <[email protected]> Date: Tue Jan 8 17:29:24 2013 +0100 dump PChgTabsPapxOperand diff --git a/src/docrecord.py b/src/docrecord.py index 5638a5e..13e3e40 100644 --- a/src/docrecord.py +++ b/src/docrecord.py @@ -371,6 +371,45 @@ class BRC(DOCDirStream): self.printAndSet("fReserved", self.fReserved) print '</brc>' +class PChgTabsDel(DOCDirStream): + """The PChgTabsDel structure specifies the locations at which custom tab stops are ignored.""" + def __init__(self, parent): + DOCDirStream.__init__(self, parent.bytes) + self.pos = parent.pos + + 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"/>' + print '</pchgTabsDel>' + +class PChgTabsAdd(DOCDirStream): + """The PChgTabsAdd structure specifies the locations and properties of custom tab stops.""" + def __init__(self, parent): + DOCDirStream.__init__(self, parent.bytes) + self.pos = parent.pos + + def dump(self): + print '<pchgTabsAdd type="PChgTabsAdd" offset="%d">' % self.pos + self.printAndSet("cTabs", self.readuInt8()) + if self.cTabs != 0: + print '<todo what="PChgTabsAdd::dump() cTabs is non-zero"/>' + print '</pchgTabsAdd>' + +class PChgTabsPapxOperand(DOCDirStream): + """The PChgTabsPapxOperand structure is used by sprmPChgTabsPapx to specify custom tab stops to be added or ignored.""" + def __init__(self, parent): + DOCDirStream.__init__(self, parent.bytes) + self.pos = parent.pos + + def dump(self): + print '<pchgTabsPapxOperand type="PChgTabsPapxOperand" offset="%d">' % self.pos + self.printAndSet("cb", self.readuInt8()) + PChgTabsDel(self).dump() + PChgTabsAdd(self).dump() + print '</pchgTabsPapxOperand>' + class BrcOperand(DOCDirStream): """The BrcOperand structure is the operand to several SPRMs that control borders.""" def __init__(self, parent): @@ -422,6 +461,8 @@ class Sprm(DOCDirStream): elif self.getOperandSize() == 9: if self.sprm in (0xd234, 0xd235, 0xd236, 0xd237): self.ct = BrcOperand(self) + elif self.sprm == 0xc60d: + self.ct = PChgTabsPapxOperand(self) else: print '<todo what="Sprm::__init__() unhandled sprm of size 9"/>' _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
