[Libreoffice-commits] .: 2 commits - src/docdraw.py
Miklos Vajna
vmiklos at kemper.freedesktop.org
Tue Dec 4 03:24:28 PST 2012
src/docdraw.py | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 82 insertions(+)
New commits:
commit babae6f628b21851347f2da363ea9272e9613997
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Tue Dec 4 12:19:08 2012 +0100
dump OfficeArtFOPT
diff --git a/src/docdraw.py b/src/docdraw.py
index 0051a9e..82bc79f 100644
--- a/src/docdraw.py
+++ b/src/docdraw.py
@@ -232,6 +232,71 @@ class OfficeArtClientData(DOCDirStream):
print '</clientData>'
assert self.pos == pos + rh.recLen
+class OfficeArtFOPTEOPID(DOCDirStream):
+ """The OfficeArtFOPTEOPID record specifies the header for an entry in a property table."""
+ def __init__(self, parent):
+ DOCDirStream.__init__(self, parent.bytes)
+ self.pos = parent.pos
+ self.parent = parent
+
+ def dump(self):
+ buf = self.readuInt16()
+ self.printAndSet("opid", buf & 0x3fff) # 1..14th bits
+ self.printAndSet("fBid", self.getBit(buf, 14))
+ self.printAndSet("fComplex", self.getBit(buf, 15))
+ self.parent.pos = self.pos
+
+class OfficeArtFOPTE(DOCDirStream):
+ """The OfficeArtFOPTE record specifies an entry in a property table."""
+ def __init__(self, parent):
+ DOCDirStream.__init__(self, parent.bytes)
+ self.pos = parent.pos
+ self.parent = parent
+
+ def dump(self):
+ print '<opid>'
+ self.opid = OfficeArtFOPTEOPID(self)
+ self.opid.dump()
+ print '</opid>'
+ self.printAndSet("op", self.readInt32())
+ self.parent.pos = self.pos
+
+class OfficeArtRGFOPTE(DOCDirStream):
+ """The OfficeArtRGFOPTE record specifies a property table."""
+ def __init__(self, parent, name):
+ DOCDirStream.__init__(self, parent.bytes)
+ self.pos = parent.pos
+ self.name = name
+ self.parent = parent
+
+ def dump(self):
+ print '<%s type="OfficeArtRGFOPTE" offset="%d">' % (self.name, self.pos)
+ for i in range(self.parent.rh.recInstance):
+ print '<rgfopte index="%d" offset="%d">' % (i, self.pos)
+ entry = OfficeArtFOPTE(self)
+ entry.dump()
+ if entry.opid.fComplex:
+ print '<todo what="OfficeArtRGFOPTE: fComplex != 0 unhandled"/>'
+ print '</rgfopte>'
+ print '</%s>' % self.name
+ self.parent.pos = self.pos
+
+class OfficeArtFOPT(DOCDirStream):
+ """The OfficeArtFOPT record specifies a table of OfficeArtRGFOPTE properties."""
+ def __init__(self, officeArtSpContainer, pos):
+ DOCDirStream.__init__(self, officeArtSpContainer.bytes)
+ self.pos = pos
+ self.officeArtSpContainer = officeArtSpContainer
+
+ def dump(self):
+ print '<shapePrimaryOptions type="OfficeArtFOPT" offset="%d">' % self.pos
+ self.rh = OfficeArtRecordHeader(self, "rh")
+ self.rh.dump()
+ pos = self.pos
+ OfficeArtRGFOPTE(self, "fopt").dump()
+ print '</shapePrimaryOptions>'
+ assert self.pos == pos + self.rh.recLen
+
class OfficeArtSpContainer(DOCDirStream):
"""The OfficeArtSpContainer record specifies a shape container."""
def __init__(self, parent, pos):
@@ -318,6 +383,7 @@ recMap = {
0xf008: OfficeArtFDG,
0xf009: OfficeArtFSPGR,
0xf00a: OfficeArtFSP,
+ 0xf00b: OfficeArtFOPT,
0xf011: OfficeArtClientData,
0xf11e: OfficeArtSplitMenuColorContainer,
}
commit 29a64bf55ff781f0bf81483fed3b5c42cdbf6fbf
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Tue Dec 4 11:48:32 2012 +0100
dump OfficeArtClientData
diff --git a/src/docdraw.py b/src/docdraw.py
index 26b4ccf..0051a9e 100644
--- a/src/docdraw.py
+++ b/src/docdraw.py
@@ -217,6 +217,21 @@ class OfficeArtFSP(DOCDirStream):
print '</shapeProp>'
assert self.pos == pos + rh.recLen
+class OfficeArtClientData(DOCDirStream):
+ def __init__(self, officeArtSpContainer, pos):
+ DOCDirStream.__init__(self, officeArtSpContainer.bytes)
+ self.pos = pos
+ self.officeArtSpContainer = officeArtSpContainer
+
+ def dump(self):
+ print '<clientData type="OfficeArtClientData" offset="%d">' % self.pos
+ rh = OfficeArtRecordHeader(self, "rh")
+ rh.dump()
+ pos = self.pos
+ self.printAndSet("data", self.readuInt32())
+ print '</clientData>'
+ assert self.pos == pos + rh.recLen
+
class OfficeArtSpContainer(DOCDirStream):
"""The OfficeArtSpContainer record specifies a shape container."""
def __init__(self, parent, pos):
@@ -303,6 +318,7 @@ recMap = {
0xf008: OfficeArtFDG,
0xf009: OfficeArtFSPGR,
0xf00a: OfficeArtFSP,
+ 0xf011: OfficeArtClientData,
0xf11e: OfficeArtSplitMenuColorContainer,
}
More information about the Libreoffice-commits
mailing list