[ooo-build-commit] scratch/mso-dumper

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Dec 31 14:46:36 PST 2009


 scratch/mso-dumper/src/xlsrecord.py |   22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

New commits:
commit 68e4381dba26f762e703909c7580cb1c5a8c0f7e
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Dec 31 17:46:00 2009 -0500

    [xls-dump] Re-worked ExternSheet handler.
    
    * scratch/mso-dumper/src/xlsrecord.py:

diff --git a/scratch/mso-dumper/src/xlsrecord.py b/scratch/mso-dumper/src/xlsrecord.py
index d6d65f5..c07aaba 100644
--- a/scratch/mso-dumper/src/xlsrecord.py
+++ b/scratch/mso-dumper/src/xlsrecord.py
@@ -1128,14 +1128,22 @@ class SupBook(BaseRecordHandler):
 
 class ExternSheet(BaseRecordHandler):
 
-    def parseBytes (self):
-        num = globals.getSignedInt(self.bytes[0:2])
+    def __parseBytes (self):
+        self.sheets = []
+        num = self.readUnsignedInt(2)
         for i in xrange(0, num):
-            offset = 2 + i*6
-            book = globals.getSignedInt(self.bytes[offset:offset+2])
-            firstSheet = globals.getSignedInt(self.bytes[offset+2:offset+4])
-            lastSheet  = globals.getSignedInt(self.bytes[offset+4:offset+6])
-            self.appendLine("SUPBOOK record ID: %d  (sheet ID range: %d - %d)"%(book, firstSheet, lastSheet))
+            book = self.readUnsignedInt(2)
+            sheet1 = self.readUnsignedInt(2)
+            sheet2 = self.readUnsignedInt(2)
+            self.sheets.append((book, sheet1, sheet2))
+
+    def parseBytes (self):
+        self.__parseBytes()
+        for sh in self.sheets:
+            self.appendLine("SUPBOOK record ID: %d  (sheet ID range: %d - %d)"%(sh[0], sh[1], sh[2]))
+
+    def fillModel (self, model):
+        self.__parseBytes()
 
 
 class ExternName(BaseRecordHandler):


More information about the ooo-build-commit mailing list