From 6890cac9f92d4e0d956dbb6bba450a2850ae5eec Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 17 Apr 2023 15:48:41 +0200 Subject: doc-dump: show table border colors Seen in core.git sw/qa/extras/ww8export/data/tdf80635_pageRightRTL.doc. Change-Id: I72ce7303bf1700670cd2ecd6623af60afd348b7e Reviewed-on: https://gerrit.libreoffice.org/c/mso-dumper/+/150519 Tested-by: Miklos Vajna Reviewed-by: Miklos Vajna --- msodumper/docrecord.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/msodumper/docrecord.py b/msodumper/docrecord.py index d7df861..dea48bc 100644 --- a/msodumper/docrecord.py +++ b/msodumper/docrecord.py @@ -818,6 +818,23 @@ class CMajorityOperand(BinaryStream): print('') +class BrcCvOperand(BinaryStream): + """The BrcCvOperand structure specifies border colors.""" + def __init__(self, parent): + BinaryStream.__init__(self, parent.bytes) + self.pos = parent.pos + + def dump(self): + print('' % self.pos) + self.printAndSet("cb", self.readuInt8()) + pos = self.pos + print('' % (self.pos, self.cb)) + while self.pos - pos < self.cb: + COLORREF(self).dump("cv") + print('') + print('') + + # The PgbApplyTo enumeration is used to specify the pages to which a page border applies. PgbApplyTo = { 0x0: "pgbAllPages", @@ -1596,6 +1613,8 @@ class Sprm(BinaryStream): self.ct = DefTableShd80Operand(self) elif self.sprm == 0xca47: self.ct = CMajorityOperand(self) + elif self.sprm in (0xD61A, 0xD61B, 0xD61C, 0xD61D): + self.ct = BrcCvOperand(self) else: print('' % hex(self.sprm)) else: -- cgit v1.2.3