[Libreoffice-commits] .: src/xlsrecord.py src/xlsstream.py
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
[Libreoffice-commits] .: src/xlsrecord.py src/xlsstream.py
src/xlsrecord.py | 106 --- src/xlsstream.py |2 - 2 files changed, 49 insertions(+), 59 deletions(-) New commits: commit 21b82dc9ca6c869699f4ab759361fe4b76b028c3 Author: Kohei Yoshida kohei.yosh...@suse.com Date: Mon Feb 27 22:00:52 2012 -0500 Re-did handler for SXVD record. SXVD record stores pivot table field data. diff --git a/src/xlsrecord.py b/src/xlsrecord.py index 4e7d99c..55ea471 100644 --- a/src/xlsrecord.py +++ b/src/xlsrecord.py @@ -3258,66 +3258,56 @@ class SXViewSource(BaseRecordHandler): self.appendLine(data source type: %s%srcType) -class SXViewFields(BaseRecordHandler): +class Sxvd(BaseRecordHandler): -def parseBytes (self): -axis = globals.getSignedInt(self.readBytes(2)) -subtotalCount = globals.getSignedInt(self.readBytes(2)) -subtotalType = globals.getSignedInt(self.readBytes(2)) -itemCount = globals.getSignedInt(self.readBytes(2)) -nameLen = globals.getSignedInt(self.readBytes(2)) - -axisType = 'unknown' -if axis == 0: -axisType = 'no axis' -elif axis == 1: -axisType = 'row' -elif axis == 2: -axisType = 'column' -elif axis == 4: -axisType = 'page' -elif axis == 8: -axisType = 'data' - -subtotalTypeName = 'unknown' -if subtotalType == 0x: -subtotalTypeName = 'None' -elif subtotalType == 0x0001: -subtotalTypeName = 'Default' -elif subtotalType == 0x0002: -subtotalTypeName = 'Sum' -elif subtotalType == 0x0004: -subtotalTypeName = 'CountA' -elif subtotalType == 0x0008: -subtotalTypeName = 'Average' -elif subtotalType == 0x0010: -subtotalTypeName = 'Max' -elif subtotalType == 0x0020: -subtotalTypeName = 'Min' -elif subtotalType == 0x0040: -subtotalTypeName = 'Product' -elif subtotalType == 0x0080: -subtotalTypeName = 'Count' -elif subtotalType == 0x0100: -subtotalTypeName = 'Stdev' -elif subtotalType == 0x0200: -subtotalTypeName = 'StdevP' -elif subtotalType == 0x0400: -subtotalTypeName = 'Var' -elif subtotalType == 0x0800: -subtotalTypeName = 'VarP' - -self.appendLine(axis type: %s%axisType) -self.appendLine(number of subtotals: %d%subtotalCount) -self.appendLine(subtotal type: %s%subtotalTypeName) -self.appendLine(number of items: %d%itemCount) - -if nameLen == -1: -self.appendLine(name: null (use name in the cache)) -else: -name, nameLen = globals.getRichText(self.readRemainingBytes(), nameLen) -self.appendLine(name: %s%name) +def __parseBytes (self): +flag = self.readUnsignedInt(2) +self.sxaxisRw = (flag 0x0001) != 0 +self.sxaxisCol = (flag 0x0002) != 0 +self.sxaxisPage = (flag 0x0004) != 0 +self.sxaxisData = (flag 0x0008) != 0 +self.cSub = self.readUnsignedInt(2) +flag = self.readUnsignedInt(2) +self.fDefault = (flag 0x0001) != 0 # A +self.fSum = (flag 0x0002) != 0 # B +self.fCounta= (flag 0x0004) != 0 # C +self.fAverage = (flag 0x0008) != 0 # D +self.fMax = (flag 0x0010) != 0 # E +self.fMin = (flag 0x0020) != 0 # F +self.fProduct = (flag 0x0040) != 0 # G +self.fCount = (flag 0x0080) != 0 # H +self.fStdev = (flag 0x0100) != 0 # I +self.fStdevp= (flag 0x0200) != 0 # J +self.fVariance = (flag 0x0400) != 0 # K +self.fVariancep = (flag 0x0800) != 0 # L +self.cItm = self.readSignedInt(2) +cchName = self.readUnsignedInt(2) +self.stName = '(null)' +if cchName != 0x: +self.stName = self.readXLUnicodeStringNoCch(cchName) +def parseBytes (self): +self.__parseBytes() +self.appendLine(axes type) +self.appendLineBoolean( row, self.sxaxisRw) +self.appendLineBoolean( column, self.sxaxisCol) +self.appendLineBoolean( page, self.sxaxisPage) +self.appendLineBoolean( data, self.sxaxisData) +self.appendLineInt(subtotal count, self.cSub) +self.appendLineBoolean( default, self.fDefault) +self.appendLineBoolean( sum, self.fSum) +self.appendLineBoolean( counta, self.fCounta) +self.appendLineBoolean( average, self.fAverage) +self.appendLineBoolean( max, self.fMax) +self.appendLineBoolean( min, self.fMin) +self.appendLineBoolean( product, self.fProduct) +self.appendLineBoolean( count, self.fCount) +self.appendLineBoolean( stdev, self.fStdev) +self.appendLineBoolean( stdevp, self.fStdevp) +
[Libreoffice-commits] .: src/xlsrecord.py
src/xlsrecord.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6451bece90617796590557490710dc63a79a4279 Author: Kohei Yoshida kohei.yosh...@suse.com Date: Mon Feb 27 22:05:05 2012 -0500 Clarify what the number of pivot items means. diff --git a/src/xlsrecord.py b/src/xlsrecord.py index 55ea471..5526773 100644 --- a/src/xlsrecord.py +++ b/src/xlsrecord.py @@ -3306,7 +3306,7 @@ class Sxvd(BaseRecordHandler): self.appendLineBoolean( stdevp, self.fStdevp) self.appendLineBoolean( variance, self.fVariance) self.appendLineBoolean( variancep, self.fVariancep) -self.appendLineInt(number of pivot items, self.cItm) +self.appendLineInt(number of SXVI records that follow, self.cItm) self.appendLineString(caption, self.stName) class SXViewFieldsEx(BaseRecordHandler): ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: src/xlsrecord.py
src/xlsrecord.py |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) New commits: commit 32d8a9f6e45f5ea74ffe3e26f02b02d310b73686 Author: Kohei Yoshida kohei.yosh...@suse.com Date: Thu Feb 23 21:38:37 2012 -0500 Worked a little on dumping AreaFormat. diff --git a/src/xlsrecord.py b/src/xlsrecord.py index ddcb2f2..eab87d9 100644 --- a/src/xlsrecord.py +++ b/src/xlsrecord.py @@ -92,12 +92,17 @@ def decodeRK (rkval, auxData = None): return realVal + class LongRGB(object): def __init__ (self, r, g, b): self.red = r self.green = g self.blue = b +def toString (self): +return (R=%d,G=%d,B=%d)%(self.red, self.green, self.blue) + + def dumpRgb(rgb): return {'r': rgb.red, 'g': rgb.green, @@ -3865,7 +3870,8 @@ class AreaFormat(BaseRecordHandler): def parseBytes (self): self.__parseBytes() -# TODO: dump all data +self.appendLineString(foreground color, self.foreColor.toString()) +self.appendLineString(background color, self.backColor.toString()) def dumpData(self): self.__parseBytes() ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: src/xlsrecord.py src/xlsstream.py
src/xlsrecord.py | 29 ++--- src/xlsstream.py |4 ++-- 2 files changed, 28 insertions(+), 5 deletions(-) New commits: commit b262254d0ef440a31883faa51f9c61f4e1fead71 Author: Kohei Yoshida kohei.yosh...@suse.com Date: Thu Feb 23 22:39:27 2012 -0500 Dump a little more chart related records. diff --git a/src/xlsrecord.py b/src/xlsrecord.py index d9c0a98..4e7d99c 100644 --- a/src/xlsrecord.py +++ b/src/xlsrecord.py @@ -3832,6 +3832,19 @@ class Frame(BaseRecordHandler): 'auto-position': self.autoPosition}) class LineFormat(BaseRecordHandler): + +lineStyles = [ +'Solid', # 0x +'Dash',# 0x0001 +'Dot', # 0x0002 +'Dash-dot',# 0x0003 +'Dash dot-dot ', # 0x0004 +'None',# 0x0005 +'Dark gray pattern', # 0x0006 +'Medium gray pattern', # 0x0007 +'Light gray pattern ' # 0x0008 +] + def __parseBytes(self): self.rgb = self.readLongRGB() self.lns = self.readUnsignedInt(2) @@ -3845,7 +3858,9 @@ class LineFormat(BaseRecordHandler): def parseBytes (self): self.__parseBytes() -# TODO: dump all data +self.appendLineString(line color, self.rgb.toString()) +self.appendLineString(line style, +globals.getValueOrUnknown(LineFormat.lineStyles, self.lns)) def dumpData(self): self.__parseBytes() @@ -3913,7 +3928,8 @@ class MarkerFormat(BaseRecordHandler): def parseBytes (self): self.__parseBytes() -# TODO: dump all data +self.appendLineString(foreground color, self.rgbFore.toString()) +self.appendLineString(background color, self.rgbBack.toString()) def dumpData(self): self.__parseBytes() @@ -4108,13 +4124,20 @@ class CatLab(BaseRecordHandler): 'auto-catlabel-real': self.autoCatLabelReal}) class Chart3DBarShape(BaseRecordHandler): + def __parseBytes(self): self.riser = self.readUnsignedInt(1) self.taper = self.readUnsignedInt(1) def parseBytes (self): self.__parseBytes() -# TODO: dump all data +s = '' +if self.riser: +s = 'ellipse' +else: +s = 'rectangle' +self.appendLineString(base shape of data points, s) +self.appendLineInt(taper style, self.taper) def dumpData(self): self.__parseBytes() diff --git a/src/xlsstream.py b/src/xlsstream.py index 7d831c9..c6c230f 100644 --- a/src/xlsstream.py +++ b/src/xlsstream.py @@ -249,7 +249,7 @@ recData = { 0x1003: [SERIES, Data Properties for Series, Trendlines or Error Bars, xlsrecord.Series], 0x1006: [CHDATAFORMAT, Data point or series that the formatting information that follows applies to (2.4.74), xlsrecord.DataFormat], 0x1007: [LINEFORMAT, Appearance of A Line, xlsrecord.LineFormat], -0x1009: [CHMARKERFORMAT, Color, size, and shape of the markers, xlsrecord.MarkerFormat], +0x1009: [MARKERFORMAT, Color, Size, and Shape of the Markers, xlsrecord.MarkerFormat], 0x100A: [AREAFORMAT, Patterns and Colors in Filled Region of Chart, xlsrecord.AreaFormat], 0x100B: [CHPIEFORMAT, Distance of a data point from the center, xlsrecord.PieFormat], 0x100C: [CHATTACHEDLABEL, Properties of a data label, xlsrecord.AttachedLabel], @@ -296,7 +296,7 @@ recData = { 0x1051: [BRAI, Data Source of A Chart, xlsrecord.Brai], 0x105B: [CHSERERRORBAR, ?], 0x105D: [CHSERIESFORMAT, Series properties, xlsrecord.SerFmt], -0x105F: [CH3DDATAFORMAT, Shape of the data points(2.4.47), xlsrecord.Chart3DBarShape], +0x105F: [CHART3DBARSHAPE, Shape of the Data Points, xlsrecord.Chart3DBarShape], 0x1060: [FBI, Font Information for Chart, xlsrecord.Fbi], 0x1061: [CHPIEEXT, Pie/bar of pie chart group, xlsrecord.BobPop], 0x1062: [AXCEXT, Additional extension properties of a date axis(2.4.9), xlsrecord.AxcExt], ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: src/xlsrecord.py src/xlsstream.py
src/xlsrecord.py | 82 +++ src/xlsstream.py |5 ++- 2 files changed, 86 insertions(+), 1 deletion(-) New commits: commit c88811e3f6b15e08d1da682d97eed0eb8c42c75e Author: Kohei Yoshida kohei.yosh...@suse.com Date: Tue Feb 14 00:42:58 2012 -0500 Handler for SXLI. diff --git a/src/xlsrecord.py b/src/xlsrecord.py index 4a78e37..ddcb2f2 100644 --- a/src/xlsrecord.py +++ b/src/xlsrecord.py @@ -2733,6 +2733,7 @@ class SxIvd(BaseRecordHandler): self.appendLine() self.appendMultiLine(NOTE: The first one of this record is for row fields, whereas the second one is for column fields.) + class SXViewEx9(BaseRecordHandler): def parseBytes (self): @@ -2951,6 +2952,7 @@ class SXDBB(BaseRecordHandler): for item in self.items: self.appendLine(item) + class SXDbEx(BaseRecordHandler): def parseBytes (self): @@ -3081,6 +3083,86 @@ class SXFDB(BaseRecordHandler): self.appendLineString(field name, self.stFieldName) +class SXLI(BaseRecordHandler): + +itemTypes = { +0x00: 'value in the data', +0x01: 'automatic subtotal selection', +0x02: 'SUM', +0x03: 'COUNTA', +0x04: 'COUNT', +0x05: 'AVERAGE', +0x06: 'MAX', +0x07: 'MIN', +0x08: 'PRODUCT', +0x09: 'STDEV', +0x0A: 'STDEVP', +0x0B: 'VAR', +0x0C: 'VARP', +0x0D: 'grand total', +0x0E: 'blank line' +} + +class Item(object): +def __init__ (self, strm): +self.cSic = strm.readSignedInt(2) +flag = strm.readUnsignedInt(2) +self.itmType = (flag 0x7FFF) +self.isxviMac = strm.readSignedInt(2) +flag = strm.readUnsignedInt(2) +self.fMultiDataName = (flag 0x0001) != 0 +self.iData= (flag 0x01FE) / 2 +self.fSbt = (flag 0x0200) != 0 +self.fBlock = (flag 0x0400) != 0 +self.fGrand = (flag 0x0800) != 0 +self.fMultiDataOnAxis = (flag 0x1000) != 0 +G = (flag 0x2000) != 0 # unused +H = (flag 0x4000) != 0 # unused +I = (flag 0x8000) != 0 # reserved +self.rgisxvi = [] +if self.isxviMac 0: +for i in xrange(0, self.isxviMac): +id = strm.readSignedInt(2) +self.rgisxvi.append(id) + +def appendLines (self, parent): +parent.appendLine() +parent.appendLine( pivot line) +parent.appendLine() +parent.appendLineInt(pivot item index count, self.cSic) +parent.appendLineString(item type, globals.getValueOrUnknown(SXLI.itemTypes, self.itmType)) +parent.appendLineInt(number of elements, self.isxviMac) +if self.fMultiDataName: +parent.appendLineString(data field name, subtotal) +else: +parent.appendLineString(data field name, total) +parent.appendLineInt(data item index, self.iData) +parent.appendLineBoolean(subtotal, self.fSbt) +parent.appendLineBoolean(block total, self.fBlock) +parent.appendLineBoolean(grand total, self.fGrand) +parent.appendLineBoolean(multi data on axis, self.fMultiDataOnAxis) +s = +first = True +for id in self.rgisxvi: +if first: +first = False +else: +s += , +s += %d%id +parent.appendLineString(pivot line entry, s) + +def __parseBytes (self): +self.items = [] +while not self.isEndOfRecord(): +obj = SXLI.Item(self) +self.items.append(obj) + +def parseBytes (self): +self.__parseBytes() +for item in self.items: +item.appendLines(self) + + class SXStreamID(BaseRecordHandler): def parseBytes (self): diff --git a/src/xlsstream.py b/src/xlsstream.py index 912bc25..7d831c9 100644 --- a/src/xlsstream.py +++ b/src/xlsstream.py @@ -124,7 +124,7 @@ recData = { 0x00B1: [SXVD, View Fields, xlsrecord.SXViewFields], 0x00B2: [SXVI, View Item, xlsrecord.SXVI], 0x00B4: [SXIVD, Row/Column Field IDs, xlsrecord.SxIvd], -0x00B5: [SXLI, Line Item Array], +0x00B5: [SXLI, Line Item Array, xlsrecord.SXLI], 0x00B6: [SXPI, Page Item], 0x00B8: [DOCROUTE, Routing Slip Information], 0x00B9: [RECIPNAME, Recipient Name], @@ -335,6 +335,7 @@ class StreamData(object): def isPivotCacheStream (self, name): return self.pivotCacheIDs.has_key(name) + class XLStream(object): def __init__ (self, chars, params, strmData): @@ -411,11 +412,13 @@ class XLStream(object): strm = XLDirStream(bytes, self.params,
[Libreoffice-commits] .: src/xlsrecord.py src/xlsstream.py
src/xlsrecord.py | 34 ++ src/xlsstream.py |4 ++-- 2 files changed, 36 insertions(+), 2 deletions(-) New commits: commit 0a22d737a78c21ec5d5bc3a7612cc928847c776d Author: Kohei Yoshida kohei.yosh...@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 = { +0x: 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], ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: src/xlsrecord.py
src/xlsrecord.py | 11 +++ 1 file changed, 11 insertions(+) New commits: commit 312d0fcaa9f106fa55ae6d4480e8ab482eef7a2a Author: Kohei Yoshida kohei.yosh...@suse.com Date: Fri Feb 10 19:16:07 2012 -0500 Handler for SXDtr is now complete. diff --git a/src/xlsrecord.py b/src/xlsrecord.py index c162d1c..f433f6c 100644 --- a/src/xlsrecord.py +++ b/src/xlsrecord.py @@ -2920,9 +2920,20 @@ class SXDtr(BaseRecordHandler): self.yr = self.readUnsignedInt(2) self.mon = self.readUnsignedInt(2) self.dom = self.readUnsignedInt(1) +self.hr = self.readUnsignedInt(1) +self.min = self.readUnsignedInt(1) +self.sec = self.readUnsignedInt(1) def parseBytes (self): self.__parseBytes() +self.appendLine(year (1900-): %d%self.yr) +self.appendLine(month (1-12): %d%self.mon) +self.appendLine(day of month (0-31) : %d%self.dom) +self.appendLine(hour (0-23) : %d%self.hr) +self.appendLine(minutes (0-59) : %d%self.min) +self.appendLine(seconds (0-59) : %d%self.sec) +self.appendLine() +self.appendMultiLine(The month value must be 1 if the day of month value is 0.) class SXFDBType(BaseRecordHandler): ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: src/xlsrecord.py src/xlsstream.py
src/xlsrecord.py |6 +++--- src/xlsstream.py | 36 ++-- 2 files changed, 21 insertions(+), 21 deletions(-) New commits: commit 57a4947d097ab5588337d02eb964cf8ea5736c6a Author: Kohei Yoshida kohei.yosh...@suse.com Date: Fri Feb 10 19:33:17 2012 -0500 Renamed SXField to SXFDB to reflect the spec. diff --git a/src/xlsrecord.py b/src/xlsrecord.py index f433f6c..05ed4eb 100644 --- a/src/xlsrecord.py +++ b/src/xlsrecord.py @@ -2960,7 +2960,7 @@ class SXFDBType(BaseRecordHandler): s = globals.getValueOrUnknown(SXFDBType.types, self.wTypeSql) self.appendLine(ODBC Type: %s%s) -class SXField(BaseRecordHandler): +class SXFDB(BaseRecordHandler): dataTypeNames = { 0x: 'spc', @@ -2989,8 +2989,8 @@ class SXField(BaseRecordHandler): self.appendLine(num group: %s%self.getYesNo(numGroup)) self.appendLine(long index: %s%self.getYesNo(longIndex)) dataType = (flags 0x0DE0) -if SXField.dataTypeNames.has_key(dataType): -self.appendLine(data type: %s (%4.4Xh)%(SXField.dataTypeNames[dataType], dataType)) +if SXFDB.dataTypeNames.has_key(dataType): +self.appendLine(data type: %s (%4.4Xh)%(SXFDB.dataTypeNames[dataType], dataType)) else: self.appendLine(data type: unknown (%4.4Xh)%dataType) diff --git a/src/xlsstream.py b/src/xlsstream.py index 9459f25..1292994 100644 --- a/src/xlsstream.py +++ b/src/xlsstream.py @@ -1,7 +1,7 @@ # # Copyright (c) 2010-2012 Kohei Yoshida -# +# # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the Software), to deal in the Software without @@ -10,10 +10,10 @@ # copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following # conditions: -# +# # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -136,15 +136,15 @@ recData = { 0x00C3: [DELMENU, Menu Deletion], 0x00C5: [SXDI, Data Item, xlsrecord.SXDataItem], 0x00C6: [SXDB, PivotTable Cache Data, xlsrecord.SXDb], -0x00C7: [SXFIELD, Pivot Field, xlsrecord.SXField], -0x00C8: [SXINDEXLIST, Indices to Source Data], -0x00C9: [SXDOUBLE, Double Value, xlsrecord.SXDouble], -0x00CA: [SXBOOLEAN, Boolean Value, xlsrecord.SXBoolean], -0x00CB: [SXERROR, Error Code, xlsrecord.SXError], -0x00CC: [SXINTEGER, Integer Value, xlsrecord.SXInteger], +0x00C7: [SXFDB, Pivot Field, xlsrecord.SXFDB], +0x00C8: [SXINDEXLIST, Indices to Source Data], +0x00C9: [SXDOUBLE, Double Value, xlsrecord.SXDouble], +0x00CA: [SXBOOLEAN, Boolean Value, xlsrecord.SXBoolean], +0x00CB: [SXERROR, Error Code, xlsrecord.SXError], +0x00CC: [SXINTEGER, Integer Value, xlsrecord.SXInteger], 0x00CD: [SXSTRING, String, xlsrecord.SXString], 0x00CE: [SXDTR, Date Time Special Format, xlsrecord.SXDtr], -0x00CF: [SXEMPTY, Empty Value], +0x00CF: [SXEMPTY, Empty Value], 0x00D0: [SXTBL, Multiple Consolidation Source Info], 0x00D1: [SXTBRGIITM, Page Item Name Count], 0x00D2: [SXTBPG, Page Item Indexes], @@ -464,14 +464,14 @@ class XLDirStream(object): return pos, header, size, bytes def __getRecordHandler (self, header, size, bytes): -# record handler that parses the raw bytes and displays more +# record handler that parses the raw bytes and displays more # meaningful information. -handler = None +handler = None if recData.has_key(header) and len(recData[header]) = 3: handler = recData[header][2](header, size, bytes, self.strmData) if handler != None and self.strmData.encrypted: -# record handler exists. Parse the record and display more info +# record handler exists. Parse the record and display more info # unless the stream is encrypted. handler = None @@ -479,7 +479,7 @@ class XLDirStream(object): def __postReadRecord (self, header): if recData.has_key(header) and recData[header][0] == FILEPASS: -# presence of FILEPASS record indicates that the stream is +# presence of FILEPASS record indicates that the stream is # encrypted. self.strmData.encrypted = True @@ -498,10 +498,10 @@ class XLDirStream(object): def readRecord (self): pos, header, size, bytes = self.__readRecordBytes() -#
[Libreoffice-commits] .: src/xlsrecord.py
src/xlsrecord.py | 97 ++- 1 file changed, 61 insertions(+), 36 deletions(-) New commits: commit 21c1f9dd6dcb53b87d6ec2267b2289b310b7b08b Author: Kohei Yoshida kohei.yosh...@suse.com Date: Fri Feb 10 21:54:22 2012 -0500 Re-did parsing of SXFDB record per MS-XLS spec. diff --git a/src/xlsrecord.py b/src/xlsrecord.py index 05ed4eb..e2c7383 100644 --- a/src/xlsrecord.py +++ b/src/xlsrecord.py @@ -195,6 +195,14 @@ Like parseBytes(), the derived classes must overwrite this method. if len(singleLine) 0: self.lines.append(singleLine) +def appendLineString (self, name, value): +text = %s: %s%(name, value) +self.appendLine(text) + +def appendLineInt (self, name, value): +text = %s: %d%(name, value) +self.appendLine(text) + def appendLineBoolean (self, name, value): text = %s: %s%(name, self.getYesNo(value)) self.appendLine(text) @@ -227,6 +235,9 @@ Like parseBytes(), the derived classes must overwrite this method. else: return falseStr +def readXLUnicodeString (self): +return self.readUnicodeString() + def readShortXLUnicodeString (self): cch = self.readUnsignedInt(1) return self.readUnicodeString(cch) @@ -2914,6 +2925,7 @@ 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): @@ -2935,6 +2947,7 @@ class SXDtr(BaseRecordHandler): self.appendLine() self.appendMultiLine(The month value must be 1 if the day of month value is 0.) + class SXFDBType(BaseRecordHandler): types = { @@ -2960,6 +2973,7 @@ class SXFDBType(BaseRecordHandler): s = globals.getValueOrUnknown(SXFDBType.types, self.wTypeSql) self.appendLine(ODBC Type: %s%s) + class SXFDB(BaseRecordHandler): dataTypeNames = { @@ -2974,43 +2988,54 @@ class SXFDB(BaseRecordHandler): 0x0D80: 'dat+str[+int/dbl]' } +def __parseBytes (self): +# parse flag +bits = self.readUnsignedInt(2) +self.fAllAtoms = (bits 0x0001) != 0 # A +self.fSomeUnhashed = (bits 0x0002) != 0 # B (undefined, must be ignored) +self.fUsed = (bits 0x0004) != 0 # C (undefined, must be ignored) +self.fHasParent = (bits 0x0008) != 0 # D +self.fRangeGroup = (bits 0x0010) != 0 # E +self.fNumField = (bits 0x0020) != 0 # F +unused = (bits 0x0040) != 0 # G (unused) +self.fTextEtcField = (bits 0x0080) != 0 # H +self.fnumMinMaxValid = (bits 0x0100) != 0 # I +self.fShortIitms = (bits 0x0200) != 0 # J +self.fNonDates = (bits 0x0400) != 0 # K +self.fDateInField= (bits 0x0800) != 0 # L +unused = (bits 0x1000) != 0 # M +self.fServerBased= (bits 0x2000) != 0 # N +self.fCantGetUniqueItems = (bits 0x4000) != 0 # O +self.fCalculatedField= (bits 0x8000) != 0 # P + +self.ifdbParent = self.readUnsignedInt(2) +self.ifdbBase = self.readUnsignedInt(2) +self.citmUnq = self.readUnsignedInt(2) # (undefined, must be ignored) +self.csxoper = self.readUnsignedInt(2) +self.cisxoper = self.readUnsignedInt(2) +self.catm = self.readUnsignedInt(2) +self.stFieldName = self.readXLUnicodeString() + def parseBytes (self): -flags = self.readUnsignedInt(2) -origItems = (flags 0x0001) -postponed = (flags 0x0002) -calculated = (flags 0x0004) -groupChild = (flags 0x0008) -numGroup = (flags 0x0010) -longIndex = (flags 0x0200) -self.appendLine(original items: %s%self.getYesNo(origItems)) -self.appendLine(postponed: %s%self.getYesNo(postponed)) -self.appendLine(calculated: %s%self.getYesNo(calculated)) -self.appendLine(group child: %s%self.getYesNo(groupChild)) -self.appendLine(num group: %s%self.getYesNo(numGroup)) -self.appendLine(long index: %s%self.getYesNo(longIndex)) -dataType = (flags 0x0DE0) -if SXFDB.dataTypeNames.has_key(dataType): -self.appendLine(data type: %s (%4.4Xh)%(SXFDB.dataTypeNames[dataType], dataType)) -else: -self.appendLine(data type: unknown (%4.4Xh)%dataType) - -grpSubField = self.readUnsignedInt(2) -grpBaseField = self.readUnsignedInt(2) -itemCount = self.readUnsignedInt(2) -grpItemCount = self.readUnsignedInt(2) -baseItemCount = self.readUnsignedInt(2) -srcItemCount = self.readUnsignedInt(2) -self.appendLine(group sub-field: %d%grpSubField) -
[Libreoffice-commits] .: src/xlsrecord.py src/xlsstream.py
src/xlsrecord.py | 56 ++- src/xlsstream.py |4 ++- 2 files changed, 54 insertions(+), 6 deletions(-) New commits: commit b8394504efdb3437d48c3ae9783c5969b036732f Author: Kohei Yoshida kohei.yosh...@suse.com Date: Fri Feb 10 23:54:08 2012 -0500 Handler for SXDBB record. This requires storing unique values for each field item in order to print them in the SXDBB records. diff --git a/src/xlsrecord.py b/src/xlsrecord.py index e2c7383..d75ab55 100644 --- a/src/xlsrecord.py +++ b/src/xlsrecord.py @@ -133,6 +133,16 @@ def dumpFrtHeader(header): return {'rt': header.rt, 'flags': header.flags} + +class PivotField(object): +Data about pivot cache field. + +This is to be stored in the persistent stream data, to be used in the SXDBB +records. +def __init__ (self): +self.hasMoreThan255 = False +self.values = [] + class BaseRecordHandler(globals.ByteStream): def __init__ (self, header, size, bytes, strmData): @@ -2917,6 +2927,24 @@ class SXDb(BaseRecordHandler): self.appendLine(changed by: %s%changedBy) +class SXDBB(BaseRecordHandler): + +def __parseBytes (self): +self.items = [] +for fld in self.strmData.pivotCacheFields: +if fld.hasMoreThan255: +# read 2 bytes +idx = self.readUnsignedInt(2) +else: +idx = self.readUnsignedInt(1) +s = fld.values[idx] +self.items.append(s) + +def parseBytes (self): +self.__parseBytes() +for item in self.items: +self.appendLine(item) + class SXDbEx(BaseRecordHandler): def parseBytes (self): @@ -2935,6 +2963,8 @@ class SXDtr(BaseRecordHandler): self.hr = self.readUnsignedInt(1) self.min = self.readUnsignedInt(1) self.sec = self.readUnsignedInt(1) +s = %d-%d-%dT%2.2d-%2.2d-%2.2d%(self.yr, self.mon, self.dom, self.hr, self.min, self.sec) +self.strmData.pivotCacheFields[-1].values.append(s) def parseBytes (self): self.__parseBytes() @@ -3016,6 +3046,13 @@ class SXFDB(BaseRecordHandler): self.catm = self.readUnsignedInt(2) self.stFieldName = self.readXLUnicodeString() +if self.fAllAtoms: +# this cached field has a collection of items in the following +# SXDBB records. +obj = PivotField() +obj.hasMoreThan255 = self.fShortIitms +self.strmData.pivotCacheFields.append(obj) + def parseBytes (self): self.__parseBytes() self.appendLineBoolean(collection of items, self.fAllAtoms) @@ -3481,9 +3518,14 @@ class PivotQueryTableEx(BaseRecordHandler): class SXDouble(BaseRecordHandler): + +def __parseBytes (self): +self.val = self.readDouble() +self.strmData.pivotCacheFields[-1].values.append(%g%self.val) + def parseBytes (self): -val = self.readDouble() -self.appendLine(value: %g%val) +self.__parseBytes() +self.appendLine(value: %g%self.val) class SXBoolean(BaseRecordHandler): @@ -3501,10 +3543,14 @@ class SXInteger(BaseRecordHandler): class SXString(BaseRecordHandler): + +def __parseBytes (self): +self.text = self.readXLUnicodeString() +self.strmData.pivotCacheFields[-1].values.append(self.text) + def parseBytes (self): -textLen = self.readUnsignedInt(2) -text, textLen = globals.getRichText(self.readRemainingBytes(), textLen) -self.appendLine(value: %s%text) +self.__parseBytes() +self.appendLineString(value, self.text) # --- # CT - Change Tracking diff --git a/src/xlsstream.py b/src/xlsstream.py index 1292994..44695bf 100644 --- a/src/xlsstream.py +++ b/src/xlsstream.py @@ -137,7 +137,7 @@ recData = { 0x00C5: [SXDI, Data Item, xlsrecord.SXDataItem], 0x00C6: [SXDB, PivotTable Cache Data, xlsrecord.SXDb], 0x00C7: [SXFDB, Pivot Field, xlsrecord.SXFDB], -0x00C8: [SXINDEXLIST, Indices to Source Data], +0x00C8: [SXDBB, Indices to Source Data, xlsrecord.SXDBB], 0x00C9: [SXDOUBLE, Double Value, xlsrecord.SXDouble], 0x00CA: [SXBOOLEAN, Boolean Value, xlsrecord.SXBoolean], 0x00CB: [SXERROR, Error Code, xlsrecord.SXError], @@ -319,11 +319,13 @@ recDataRev = { 0x0151: [EONB*, Change Track End of Nested Block] } + class StreamData(object): run-time stream data. def __init__ (self): self.encrypted = False self.pivotCacheIDs = {} +self.pivotCacheFields = [] def appendPivotCacheId (self, newId): # must be 4-digit with leading '0's. ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: src/xlsrecord.py src/xlsstream.py
src/xlsrecord.py | 30 +- src/xlsstream.py |3 ++- 2 files changed, 31 insertions(+), 2 deletions(-) New commits: commit ae360336389ce7cf15cc7501cf50454ae5929e2c Author: Kohei Yoshida kohei.yosh...@suse.com Date: Fri Jan 20 23:19:32 2012 -0500 Parse shared formula records. diff --git a/src/xlsrecord.py b/src/xlsrecord.py index 11c2fce..9e31317 100644 --- a/src/xlsrecord.py +++ b/src/xlsrecord.py @@ -1,6 +1,6 @@ # -# Copyright (c) 2010 Kohei Yoshida +# Copyright (c) 2010-2012 Kohei Yoshida # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation @@ -2631,6 +2631,34 @@ class FeatureHeader(BaseRecordHandler): return +class ShrFmla(BaseRecordHandler): + +def __parseBytes (self): +self.ref = RefU(self) +self.readBytes(1) # 8-bits reserved +self.cUse = self.readUnsignedInt(1) +lenFormula = self.readUnsignedInt(2) +self.tokens = self.readBytes(lenFormula) + +def parseBytes (self): +self.__parseBytes() +self.appendLine(range: %s%self.ref.toString()) +self.appendLine(cell count: %d%self.cUse) +self.appendLine(formula token length: %d%len(self.tokens)) +if len(self.tokens): +ftext = None +try: +parser = formula.FormulaParser(self.header, self.tokens) +parser.parse() +ftext = parser.getText() +except formula.FormulaParserError as e: +ftext = (Error: %s)%e.args[0] +if ftext != None: +self.appendLine(formula: %s%ftext) + + + + # --- # SX - Pivot Table diff --git a/src/xlsstream.py b/src/xlsstream.py index bb9f6ae..57b5e13 100644 --- a/src/xlsstream.py +++ b/src/xlsstream.py @@ -1,6 +1,6 @@ # -# Copyright (c) 2010 Kohei Yoshida +# Copyright (c) 2010-2012 Kohei Yoshida # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation @@ -220,6 +220,7 @@ recData = { 0x027E: [RK, Cell with Encoded Integer or Floating-Point, xlsrecord.RK], 0x0293: [STYLE, Style Information, xlsrecord.Style], 0x041E: [FORMAT, Number Format, xlsrecord.Format], +0x04BC: [SHRFMLA, Shared Formula, xlsrecord.ShrFmla], 0x0802: [QSISXTAG, Pivot Table and Query Table Extensions, xlsrecord.PivotQueryTableEx], 0x0809: [BOF, Beginning of File, xlsrecord.BOF], 0x0810: [SXVIEWEX9, Pivot Table Extensions, xlsrecord.SXViewEx9], ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: src/xlsrecord.py src/xlsstream.py
src/xlsrecord.py | 38 ++ src/xlsstream.py |4 ++-- 2 files changed, 40 insertions(+), 2 deletions(-) New commits: commit 9d825cc43815bd9accabe792abca76f3cc1fb18f Author: Kohei Yoshida kohei.yosh...@suse.com Date: Wed Nov 23 16:57:05 2011 -0500 Handlers for WINDOW2 and PANE records. Handler for WINDOW2 is still incomplete. diff --git a/src/xlsrecord.py b/src/xlsrecord.py index 6927836..11c2fce 100644 --- a/src/xlsrecord.py +++ b/src/xlsrecord.py @@ -2347,6 +2347,44 @@ class Font(BaseRecordHandler): self.appendLine(font family: %s%Font.getFontFamily(fontFamily)) self.appendLine(font name: %s (%d)%(fontName, nameLen)) +class Window2(BaseRecordHandler): +def __parseBytes (self): +flag = self.readUnsignedInt(2) +self.displayFormula = (flag 0x0001) != 0 +self.displayGrid = (flag 0x0002) != 0 +self.displayHeadings = (flag 0x0004) != 0 +self.frozen = (flag 0x0008) != 0 + +def parseBytes (self): +self.__parseBytes() +self.appendLineBoolean(display formula, self.displayFormula) +self.appendLineBoolean(display grid, self.displayGrid) +self.appendLineBoolean(display headings, self.displayHeadings) +self.appendLineBoolean(frozen window, self.frozen) + +class Pane(BaseRecordHandler): + +activePanes = [ +bottom-right, +top-right, +bottom-left, +top-left +] + +def __parseBytes (self): +self.x = self.readUnsignedInt(2) +self.y = self.readUnsignedInt(2) +self.bottomRow = self.readUnsignedInt(2) +self.rightCol = self.readUnsignedInt(2) +self.activePane = self.readUnsignedInt(1) + +def parseBytes (self): +self.__parseBytes() +self.appendLine(split position: (x=%d,y=%d)%(self.x,self.y)) +self.appendLine(top-left position of SE pane: (row=%d,col=%d)% +(self.bottomRow,self.rightCol)) +self.appendLine(active pane: %s% +globals.getValueOrUnknown(Pane.activePanes, self.activePane)) class XF(BaseRecordHandler): diff --git a/src/xlsstream.py b/src/xlsstream.py index d000840..bb9f6ae 100644 --- a/src/xlsstream.py +++ b/src/xlsstream.py @@ -71,7 +71,7 @@ recData = { 0x003C: [CONTINUE, Continues Long Records], 0x003D: [WINDOW1, Window Information], 0x0040: [BACKUP, Save Backup Version of the File], -0x0041: [PANE, Number of Panes and Their Position], +0x0041: [PANE, Number of Panes and Their Position, xlsrecord.Pane], 0x0042: [CODEPAGE/CODENAME, Default Code Page/VBE Object Name], 0x004D: [PLS, Environment-Specific Print Record, xlsrecord.Pls], 0x0050: [DCON, Data Consolidation Information], @@ -216,7 +216,7 @@ recData = { 0x0225: [DEFAULTROWHEIGHT, Default Row Height, xlsrecord.DefRowHeight], 0x0231: [FONT, Font Description, xlsrecord.Font], 0x0236: [TABLE, Data Table], -0x023E: [WINDOW2, Sheet Window Information], +0x023E: [WINDOW2, Sheet Window Information, xlsrecord.Window2], 0x027E: [RK, Cell with Encoded Integer or Floating-Point, xlsrecord.RK], 0x0293: [STYLE, Style Information, xlsrecord.Style], 0x041E: [FORMAT, Number Format, xlsrecord.Format], ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: src/xlsrecord.py
src/xlsrecord.py |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) New commits: commit 942b730aca24786d07f5bcd20455b1deae646b83 Author: Kohei Yoshida kohei.yosh...@suse.com Date: Fri Nov 18 11:18:37 2011 -0500 Correctly parse string data for AUTOFILTER. diff --git a/src/xlsrecord.py b/src/xlsrecord.py index 1fec69c..2cdb224 100644 --- a/src/xlsrecord.py +++ b/src/xlsrecord.py @@ -231,6 +231,9 @@ Like parseBytes(), the derived classes must overwrite this method. cch = self.readUnsignedInt(1) return self.readUnicodeString(cch) +def readXLUnicodeStringNoCch (self, cch): +return self.readUnicodeString(cch) + def readLongRGB (self): r = self.readUnsignedInt(1) g = self.readUnsignedInt(1) @@ -412,11 +415,11 @@ class Autofilter(BaseRecordHandler): # pick up string(s) self.string1 = None if self.doper1.dataType == Autofilter.DoperType.String: -self.string1 = globals.getTextBytes(self.readBytes(self.doper1.strLen)) +self.string1 = self.readXLUnicodeStringNoCch(self.doper1.strLen) self.string2 = None if self.doper2.dataType == Autofilter.DoperType.String: -self.string2 = globals.getTextBytes(self.readBytes(self.doper2.strLen)) +self.string2 = self.readXLUnicodeStringNoCch(self.doper2.strLen) def parseBytes (self): self.__parseBytes() ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: src/xlsrecord.py
src/xlsrecord.py | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) New commits: commit f420f9653023b9fb427941c38ec929daf90e Author: Kohei Yoshida kohei.yosh...@suse.com Date: Fri Nov 18 11:42:54 2011 -0500 Read exactly 10 bytes in doper. I was reading 11 bytes for unknown type. diff --git a/src/xlsrecord.py b/src/xlsrecord.py index 2cdb224..6927836 100644 --- a/src/xlsrecord.py +++ b/src/xlsrecord.py @@ -396,7 +396,7 @@ class Autofilter(BaseRecordHandler): self.readBytes(6) # ignore 6 bytes else: doper = Autofilter.Doper() -self.readBytes(10) # ignore the entire 10 bytes +self.readBytes(9) # ignore the entire 10 bytes return doper def __parseBytes (self): @@ -414,16 +414,19 @@ class Autofilter(BaseRecordHandler): # pick up string(s) self.string1 = None -if self.doper1.dataType == Autofilter.DoperType.String: -self.string1 = self.readXLUnicodeStringNoCch(self.doper1.strLen) - self.string2 = None -if self.doper2.dataType == Autofilter.DoperType.String: -self.string2 = self.readXLUnicodeStringNoCch(self.doper2.strLen) +try: +if self.doper1.dataType == Autofilter.DoperType.String: +self.string1 = self.readXLUnicodeStringNoCch(self.doper1.strLen) + +if self.doper2.dataType == Autofilter.DoperType.String: +self.string2 = self.readXLUnicodeStringNoCch(self.doper2.strLen) +except: +pass def parseBytes (self): self.__parseBytes() -self.appendLine(filter index (= column ID): %d%self.filterIndex) +self.appendLine(filter index (relative column ID): %d%self.filterIndex) self.appendLine(joining: %s%self.getBoolVal(self.join, AND, OR)) self.appendLineBoolean(1st condition is simple equality, self.simple1) self.appendLineBoolean(2nd condition is simple equality, self.simple2) ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits