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

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Aug 8 11:42:25 PDT 2011


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

New commits:
commit 9100904ec65766365372bcd960eb635d9f052c26
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Mon Aug 8 14:41:28 2011 -0400

    Added handler for MULBLANK record.
    
    This record stores a series of blank cells in a row.

diff --git a/src/xlsrecord.py b/src/xlsrecord.py
index d029b43..538eb5e 100644
--- a/src/xlsrecord.py
+++ b/src/xlsrecord.py
@@ -1087,6 +1087,28 @@ class MulRK(BaseRecordHandler):
             cell = xlsmodel.NumberCell(decodeRK(rkrec.number))
             sheet.setCell(col, self.row, cell)
 
+class MulBlank(BaseRecordHandler):
+
+    def __parseBytes (self):
+        self.row = self.readUnsignedInt(2)
+        self.col1 = self.readUnsignedInt(2)
+        self.col2 = -1
+        self.xfCells = []
+        while True:
+            val = self.readUnsignedInt(2)
+            if self.isEndOfRecord():
+                self.col2 = val
+                break
+            self.xfCells.append(val)
+
+    def parseBytes (self):
+        self.__parseBytes()
+        self.appendLine("row: %d"%self.row)
+        self.appendLine("columns: %d-%d"%(self.col1, self.col2))
+        s = "XF Record IDs:"
+        for xfCell in self.xfCells:
+            s += " %d"%xfCell
+        self.appendLine(s)
 
 
 class Number(BaseRecordHandler):
diff --git a/src/xlsstream.py b/src/xlsstream.py
index ba71f7e..88ccd80 100644
--- a/src/xlsstream.py
+++ b/src/xlsstream.py
@@ -127,7 +127,7 @@ recData = {
     0x00B9: ["RECIPNAME", "Recipient Name"],
     0x00BC: ["SHRFMLA", "Shared Formula"],
     0x00BD: ["MULRK", "Multiple RK Cells", xlsrecord.MulRK],
-    0x00BE: ["MULBLANK", "Multiple Blank Cells"],
+    0x00BE: ["MULBLANK", "Multiple Blank Cells", xlsrecord.MulBlank],
     0x00C1: ["MMS", "ADDMENU/DELMENU Record Group Count"],
     0x00C2: ["ADDMENU", "Menu Addition"],
     0x00C3: ["DELMENU", "Menu Deletion"],


More information about the Libreoffice-commits mailing list