[ooo-build-commit] scratch/mso-dumper
Kohei Yoshida
kohei at kemper.freedesktop.org
Thu Dec 17 13:04:11 PST 2009
scratch/mso-dumper/src/xlsrecord.py | 28 ++++++++++++++++++++++++++++
scratch/mso-dumper/src/xlsstream.py | 2 +-
2 files changed, 29 insertions(+), 1 deletion(-)
New commits:
commit a3f396494e0e37f907fdb03f7fc06b2d3c075085
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Thu Dec 17 16:04:16 2009 -0500
[xls-dump] Initial support for parsing MSODRAWING records.
MSODRAWING records contain drawing objects, which are specified
in a separate 621-page specification (yuck!).
* scratch/mso-dumper/src/xlsrecord.py:
* scratch/mso-dumper/src/xlsstream.py:
diff --git a/scratch/mso-dumper/src/xlsrecord.py b/scratch/mso-dumper/src/xlsrecord.py
index ca33099..5f7b88a 100644
--- a/scratch/mso-dumper/src/xlsrecord.py
+++ b/scratch/mso-dumper/src/xlsrecord.py
@@ -2138,3 +2138,31 @@ class CHSourceLink(BaseRecordHandler):
lenToken = self.readUnsignedInt(2)
tokens = self.readBytes(lenToken)
self.appendLine("formula tokens: %s"%globals.getRawBytes(tokens,True,False))
+
+
+class MSODrawing(BaseRecordHandler):
+
+ class RecordHeader:
+ def __init__ (self):
+ self.recVer = 0
+ self.recInstance = 0
+ self.recType = 0
+ self.recLen = 0
+
+ def readRecordHeader (self):
+ rh = MSODrawing.RecordHeader()
+ mixed = self.readUnsignedInt(2)
+ rh.recVer = (mixed & 0x000F)
+ rh.recInstance = (mixed & 0xFFF0) / 16
+ rh.recType = self.readUnsignedInt(2)
+ rh.recLen = self.readUnsignedInt(4)
+ return rh
+
+ def parseBytes (self):
+ rh = self.readRecordHeader()
+ self.appendLine("recVer: 0x%1.1X"%rh.recVer)
+ self.appendLine("recInstance: 0x%3.3X"%rh.recInstance)
+ self.appendLine("recType: 0x%4.4X"%rh.recType)
+ self.appendLine("recLen: %d"%rh.recLen)
+
+ return
diff --git a/scratch/mso-dumper/src/xlsstream.py b/scratch/mso-dumper/src/xlsstream.py
index 9665da0..f3dd844 100644
--- a/scratch/mso-dumper/src/xlsstream.py
+++ b/scratch/mso-dumper/src/xlsstream.py
@@ -135,7 +135,7 @@ recData = {
0x00E3: ["SXVS", "View Source", xlsrecord.SXViewSource],
0x00EA: ["TABIDCONF", "Sheet Tab ID of Conflict History"],
0x00EB: ["MSODRAWINGGROUP", "Microsoft Office Drawing Group"],
- 0x00EC: ["MSODRAWING", "Microsoft Office Drawing"],
+ 0x00EC: ["MSODRAWING", "Microsoft Office Drawing", xlsrecord.MSODrawing],
0x00ED: ["MSODRAWINGSELECTION", "Microsoft Office Drawing Selection"],
0x00EF: ["PHONETIC", "Asian Phonetic Settings", xlsrecord.PhoneticInfo],
0x00F0: ["SXRULE", "PivotTable Rule Data"],
More information about the ooo-build-commit
mailing list