[ooo-build-commit] .: 2 commits - scratch/mso-dumper

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Apr 15 12:59:11 PDT 2010


 scratch/mso-dumper/src/xlsrecord.py |   49 ++++++++++++++++++++++++++++++++++++
 scratch/mso-dumper/src/xlsstream.py |    4 +-
 2 files changed, 51 insertions(+), 2 deletions(-)

New commits:
commit 3ae6a8c35dfa6087b93bae057035843b3b21a9cb
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Apr 15 15:58:12 2010 -0400

    [xls-dump] Added handler for DV record.
    
    DV record stores data validation information.  I'm not entirely finished
    with this yet.
    
    * 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 87e170d..fe661ea 100644
--- a/scratch/mso-dumper/src/xlsrecord.py
+++ b/scratch/mso-dumper/src/xlsrecord.py
@@ -700,6 +700,31 @@ class Dimensions(BaseRecordHandler):
         sh.setFirstFreeCell(self.colMax, self.rowMax)
 
 
+class Dv(BaseRecordHandler):
+
+    def __parseBytes (self):
+        bits = self.readUnsignedInt(4)
+        self.valType      = (bits & 0x0000000F)
+        self.errStyle     = (bits & 0x00000070) / (2**4)
+        self.strLookup    = (bits & 0x00000080) != 0
+        self.allowBlank   = (bits & 0x00000100) != 0
+        self.noDropDown   = (bits & 0x00000200) != 0
+        self.imeMode      = (bits & 0x0003FC00) / (2**10)    # take 8 bits and shift by 10 bits
+        self.showInputMsg = (bits & 0x00040000) != 0
+        self.showErrorMsg = (bits & 0x00080000) != 0
+        self.operator     = (bits & 0x00F00000) / (2**20)
+
+    def parseBytes (self):
+        self.__parseBytes()
+        self.appendLine("type: 0x%1.1X"%self.valType)
+        self.appendLine("error style: 0x%1.1X"%self.errStyle)
+        self.appendLineBoolean("list of valid inputs", self.strLookup)
+        self.appendLineBoolean("allow blank", self.allowBlank)
+
+    def fillModel (self, model):
+        self.__parseBytes()
+
+
 class DVal(BaseRecordHandler):
 
     def __parseBytes (self):
diff --git a/scratch/mso-dumper/src/xlsstream.py b/scratch/mso-dumper/src/xlsstream.py
index a8de009..bc11785 100644
--- a/scratch/mso-dumper/src/xlsstream.py
+++ b/scratch/mso-dumper/src/xlsstream.py
@@ -196,7 +196,7 @@ recData = {
     0x01B8: ["HLINK", "Hyperlink", xlsrecord.Hyperlink],
     0x01BB: ["SXFDBTYPE", "SQL Datatype Identifier"],
     0x01BC: ["PROT4REVPASS", "Shared Workbook Protection Password"],
-    0x01BE: ["DV", "Data Validation Criteria"],
+    0x01BE: ["DV", "Data Validation Criteria", xlsrecord.Dv],
     0x01C0: ["EXCEL9FILE", "Excel 9 File"],
     0X01C1: ["RECALCID", "Recalc Information"],
     0x0200: ["DIMENSIONS", "Cell Table Size", xlsrecord.Dimensions],
commit 18a7aff484009f5285dc43ea45b99e93ed3c6f9d
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Apr 15 14:55:46 2010 -0400

    [xls-dump] Added handler for DVAL record.
    
    * 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 aa378ba..87e170d 100644
--- a/scratch/mso-dumper/src/xlsrecord.py
+++ b/scratch/mso-dumper/src/xlsrecord.py
@@ -700,6 +700,30 @@ class Dimensions(BaseRecordHandler):
         sh.setFirstFreeCell(self.colMax, self.rowMax)
 
 
+class DVal(BaseRecordHandler):
+
+    def __parseBytes (self):
+        bits = self.readUnsignedInt(2)
+        self.winClosed = (bits & 0x0001) != 0
+        self.left = self.readUnsignedInt(4)
+        self.top = self.readUnsignedInt(4)
+        self.objID = self.readSignedInt(4)
+        self.dvCount = self.readUnsignedInt(4)
+
+    def parseBytes (self):
+        self.__parseBytes()
+        self.appendLineBoolean("window was closed", self.winClosed)
+        self.appendLine("window position: (x=%d,y=%d)"%(self.left, self.top))
+        s = ''
+        if self.objID == -1:
+            s = '(no drop-down displayed)'
+        self.appendLine("drop-down button object ID: %d %s"%(self.objID, s))
+        self.appendLine("number of DV records: %d"%self.dvCount)
+
+    def fillModel (self, model):
+        self.__parseBytes()
+
+
 class FilePass(BaseRecordHandler):
 
     def parseBytes (self):
diff --git a/scratch/mso-dumper/src/xlsstream.py b/scratch/mso-dumper/src/xlsstream.py
index 79d70e7..a8de009 100644
--- a/scratch/mso-dumper/src/xlsstream.py
+++ b/scratch/mso-dumper/src/xlsstream.py
@@ -189,7 +189,7 @@ recData = {
     0x01AF: ["PROT4REV", "Shared Workbook Protection Flag"],
     0x01B0: ["CONDFMT", "Conditional Formatting Range Information", xlsrecord.CondFmt],
     0x01B1: ["CF", "Conditional Formatting Conditions", xlsrecord.CF],
-    0x01B2: ["DVAL", "Data Validation Information"],
+    0x01B2: ["DVAL", "Data Validation Information", xlsrecord.DVal],
     0x01B5: ["DCONBIN", "Data Consolidation Information"],
     0x01B6: ["TXO", "Text Object"],
     0x01B7: ["REFRESHALL", "Refresh Flag", xlsrecord.RefreshAll],


More information about the ooo-build-commit mailing list