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

Kohei Yoshida kohei at kemper.freedesktop.org
Fri Feb 10 15:25:47 PST 2012


 src/xlsrecord.py |   34 ++++++++++++++++++++++++++++++++++
 src/xlsstream.py |    4 ++--
 2 files changed, 36 insertions(+), 2 deletions(-)

New commits:
commit 0a22d737a78c21ec5d5bc3a7612cc928847c776d
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Fri Feb 10 18:25:42 2012 -0500

    More handlers for pivot table records.
    
    I'm still working on SXDtr record handler.

diff --git a/src/xlsrecord.py b/src/xlsrecord.py
index 9e31317..c162d1c 100644
--- a/src/xlsrecord.py
+++ b/src/xlsrecord.py
@@ -2914,6 +2914,40 @@ class SXDbEx(BaseRecordHandler):
         self.appendLine("last changed: %g"%lastChanged)
         self.appendLine("count of SXFORMULA records for this cache: %d"%sxFmlaRecs)
 
+class SXDtr(BaseRecordHandler):
+
+    def __parseBytes (self):
+        self.yr = self.readUnsignedInt(2)
+        self.mon = self.readUnsignedInt(2)
+        self.dom = self.readUnsignedInt(1)
+
+    def parseBytes (self):
+        self.__parseBytes()
+
+class SXFDBType(BaseRecordHandler):
+
+    types = {
+        0x0000: "SQL_TYPE_NULL",
+        0x0001: "SQL_CHAR",
+        0x0003: "SQL_DECIMAL",
+        0x0004: "SQL_INTEGER",
+        0x0005: "SQL_SMALLINT",
+        0x0006: "SQL_FLOAT",
+        0x0007: "SQL_REAL",
+        0x0008: "SQL_DOUBLE",
+        0x000B: "SQL_TIMESTAMP",
+        0x000C: "SQL_VARCHAR",
+        0xFFF9: "SQL_BIT",
+        0xFFFE: "SQL_BINARY"
+    }
+
+    def __parseBytes (self):
+        self.wTypeSql = self.readUnsignedInt(2)
+
+    def parseBytes (self):
+        self.__parseBytes()
+        s = globals.getValueOrUnknown(SXFDBType.types, self.wTypeSql)
+        self.appendLine("ODBC Type: %s"%s)
 
 class SXField(BaseRecordHandler):
 
diff --git a/src/xlsstream.py b/src/xlsstream.py
index 57b5e13..9459f25 100644
--- a/src/xlsstream.py
+++ b/src/xlsstream.py
@@ -143,7 +143,7 @@ recData = {
     0x00CB: ["SXERROR", "Error Code", xlsrecord.SXError],                       
     0x00CC: ["SXINTEGER", "Integer Value", xlsrecord.SXInteger],                  
     0x00CD: ["SXSTRING", "String", xlsrecord.SXString],
-    0x00CE: ["SXDATETIME", "Date & Time Special Format"],    
+    0x00CE: ["SXDTR", "Date & Time Special Format", xlsrecord.SXDtr],
     0x00CF: ["SXEMPTY", "Empty Value"],                      
     0x00D0: ["SXTBL", "Multiple Consolidation Source Info"],
     0x00D1: ["SXTBRGIITM", "Page Item Name Count"],
@@ -197,7 +197,7 @@ recData = {
     0x01B6: ["TXO", "Text Object"],
     0x01B7: ["REFRESHALL", "Refresh Flag", xlsrecord.RefreshAll],
     0x01B8: ["HLINK", "Hyperlink", xlsrecord.Hyperlink],
-    0x01BB: ["SXFDBTYPE", "SQL Datatype Identifier"],
+    0x01BB: ["SXFDBTYPE", "SQL Datatype Identifier", xlsrecord.SXFDBType],
     0x01BC: ["PROT4REVPASS", "Shared Workbook Protection Password"],
     0x01BE: ["DV", "Data Validation Criteria", xlsrecord.Dv],
     0x01C0: ["EXCEL9FILE", "Excel 9 File"],


More information about the Libreoffice-commits mailing list