summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2009-07-17 01:57:37 -0400
committerKohei Yoshida <kyoshida@novell.com>2009-07-17 02:06:24 -0400
commit7887d94e854cdc420085a176ad4bcb1edec9cffe (patch)
tree7a58054659d2c3a3c36cf5ad4d8c23fb6c6b018d
parent99eb3574e6d7a3b673b5e6e176bde0dff8fb1919 (diff)
[xls-dump] Parse cached data for in-line arrays with static values.
* scratch/mso-dumper/src/xlsrecord.py:
-rw-r--r--scratch/mso-dumper/src/xlsrecord.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/scratch/mso-dumper/src/xlsrecord.py b/scratch/mso-dumper/src/xlsrecord.py
index 1db916d2e..cd137a6a8 100644
--- a/scratch/mso-dumper/src/xlsrecord.py
+++ b/scratch/mso-dumper/src/xlsrecord.py
@@ -272,6 +272,42 @@ class Array(BaseRecordHandler):
self.appendLine("formula bytes: %s"%globals.getRawBytes(tokens, True, False))
self.appendLine("tokens: " + ftext)
+ if self.getCurrentPos() >= len(self.bytes):
+ return
+
+ # cached values
+ cols = self.readUnsignedInt(1) + 1
+ rows = self.readUnsignedInt(2) + 1
+ self.appendLine("array size: cols=%d, rows=%d"%(cols, rows))
+ for row in xrange(0, rows):
+ for col in xrange(0, cols):
+ msg = "(row=%d, col=%d): "%(row, col)
+ valtype = self.readUnsignedInt(1)
+ if valtype == 0x00:
+ # empty - ignore 8 bytes.
+ self.readUnsignedInt(8)
+ msg += "empty"
+ elif valtype == 0x01:
+ # double
+ val = self.readDouble()
+ msg += "double: %g"%val
+ elif valtype == 0x02:
+ # string
+ strLen = self.readUnsignedInt(2) + 1
+ text, strLen = globals.getRichText(self.readBytes(strLen), strLen)
+ msg += "text: '%s'"%text
+ elif valtype == 0x04:
+ # bool
+ val = self.readUnsignedInt(1)
+ msg += "bool: " + self.getTrueFalse(val)
+ elif valtype == 0x10:
+ # error
+ val = self.readUnsignedInt(1)
+ msg += "error: %d"%val
+ self.appendLine(msg)
+
+ return
+
class Label(BaseRecordHandler):