src/xlsrecord.py | 35 +++++++++++++++++++++++++++++++++-- src/xlsstream.py | 3 ++- 2 files changed, 35 insertions(+), 3 deletions(-)
New commits: commit 980a33eb78ee294c7ec701343c7f07108ca70d9a Author: Kohei Yoshida <kohei.yosh...@suse.com> Date: Thu Mar 1 15:41:20 2012 -0500 Handlers for SXInt and SXRng. diff --git a/src/xlsrecord.py b/src/xlsrecord.py index 5526773..4393c8f 100644 --- a/src/xlsrecord.py +++ b/src/xlsrecord.py @@ -3617,9 +3617,14 @@ class SXError(BaseRecordHandler): pass -class SXInteger(BaseRecordHandler): +class SXInt(BaseRecordHandler): + + def __parseBytes (self): + self.num = self.readSignedInt(2) + def parseBytes (self): - pass + self.__parseBytes() + self.appendLineInt("value", self.num) class SXString(BaseRecordHandler): @@ -3632,6 +3637,32 @@ class SXString(BaseRecordHandler): self.__parseBytes() self.appendLineString("value", self.text) + +class SXRng(BaseRecordHandler): + + groupTypes = [ + "numeric value", + "seconds", + "minutes", + "hours", + "days", + "months", + "quarters", + "years" + ] + + def __parseBytes (self): + flag = self.readUnsignedInt(2) + self.fAutoStart = (flag & 0x0001) != 0 # A + self.fAutoEnd = (flag & 0x0002) != 0 # B + self.iByType = (flag & 0x001C) / 4 # C + + def parseBytes (self): + self.__parseBytes() + self.appendLineBoolean("auto start", self.fAutoStart) + self.appendLineBoolean("auto end", self.fAutoEnd) + self.appendLineString("group type", globals.getValueOrUnknown(SXRng.groupTypes, self.iByType)) + # ------------------------------------------------------------------- # CT - Change Tracking diff --git a/src/xlsstream.py b/src/xlsstream.py index c8664c2..aab6ce5 100644 --- a/src/xlsstream.py +++ b/src/xlsstream.py @@ -141,7 +141,7 @@ recData = { 0x00C9: ["SXDOUBLE", "Double Value", xlsrecord.SXDouble], 0x00CA: ["SXBOOLEAN", "Boolean Value", xlsrecord.SXBoolean], 0x00CB: ["SXERROR", "Error Code", xlsrecord.SXError], - 0x00CC: ["SXINTEGER", "Integer Value", xlsrecord.SXInteger], + 0x00CC: ["SXINT", "Integer Value", xlsrecord.SXInt], 0x00CD: ["SXSTRING", "String", xlsrecord.SXString], 0x00CE: ["SXDTR", "Date & Time Special Format", xlsrecord.SXDtr], 0x00CF: ["SXEMPTY", "Empty Value"], @@ -152,6 +152,7 @@ recData = { 0x00D5: ["SXSTREAMID", "PivotCache Stream ID", xlsrecord.SXStreamID], 0x00D6: ["RSTRING", "Cell with Character Formatting"], 0x00D7: ["DBCELL", "Stream Offsets", xlsrecord.DBCell], + 0x00D8: ["SXRNG", "Numeric/Date Grouping Properties", xlsrecord.SXRng], 0x00DA: ["BOOKBOOL", "Workbook Option Flag"], 0x00DC: ["PARAMQRY", "Query Parameters"], 0x00DC: ["SXEXT", "External Source Information"], _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits