[Libreoffice-commits] .: src/xlsrecord.py src/xlsstream.py

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Apr 7 17:38:41 PDT 2011


 src/xlsrecord.py |   14 ++++++++++++++
 src/xlsstream.py |    2 +-
 2 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 5605b8f7229bb1b1178f6c2e6c9d2e8c7c1331c5
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Apr 7 20:37:06 2011 -0400

    Added handler for SxIvd records.

diff --git a/src/xlsrecord.py b/src/xlsrecord.py
index f104c36..6d917ce 100644
--- a/src/xlsrecord.py
+++ b/src/xlsrecord.py
@@ -125,6 +125,8 @@ Like parseBytes(), the derived classes must overwrite this method."""
         except:
             print("%4.4Xh: Error interpreting the record!"%self.header)
 
+    def debug (self, msg):
+        print ("%4.4Xh: %s"%(self.header, msg))
 
     def appendLine (self, line):
         self.lines.append(line)
@@ -2262,6 +2264,18 @@ class DConRef(BaseRecordHandler):
         self.appendLine("range: %s"%self.ref.toString())
         self.appendLine("sheet name: %s"%self.sheetName)
 
+class SXIvd(BaseRecordHandler):
+
+    def __parseBytes (self):
+        self.ids = []
+        n = self.getSize() / 2
+        for i in xrange(0, n):
+            self.ids.append(self.readSignedInt(2))
+
+    def parseBytes (self):
+        self.__parseBytes()
+        for id in self.ids:
+            self.appendLine("field value: %d"%id)
 
 class SXViewEx9(BaseRecordHandler):
 
diff --git a/src/xlsstream.py b/src/xlsstream.py
index 2b2a4ae..0595d1f 100644
--- a/src/xlsstream.py
+++ b/src/xlsstream.py
@@ -120,7 +120,7 @@ recData = {
     0x00B0: ["SXVIEW", "View Definition", xlsrecord.SXView],
     0x00B1: ["SXVD", "View Fields", xlsrecord.SXViewFields],
     0x00B2: ["SXVI", "View Item", xlsrecord.SXViewItem],
-    0x00B4: ["SXIVD", "Row/Column Field IDs"],
+    0x00B4: ["SXIVD", "Row/Column Field IDs", xlsrecord.SXIvd],
     0x00B5: ["SXLI", "Line Item Array"],
     0x00B6: ["SXPI", "Page Item"],
     0x00B8: ["DOCROUTE", "Routing Slip Information"],


More information about the Libreoffice-commits mailing list