diff options
author | Eike Rathke <erack@redhat.com> | 2014-03-18 11:18:30 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-03-18 11:18:30 +0100 |
commit | 71d45a05919029845fe0a20e36b8bddc9236f427 (patch) | |
tree | b8b45cfb88d75d5e8d725b09969b51635b4cff74 /msodumper/xlsrecord.py | |
parent | c4192de229ceb549b0a7bc26fa1b1fc38972d83d (diff) |
implemented MergeCells
Diffstat (limited to 'msodumper/xlsrecord.py')
-rw-r--r-- | msodumper/xlsrecord.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/msodumper/xlsrecord.py b/msodumper/xlsrecord.py index 1a0f336..e908067 100644 --- a/msodumper/xlsrecord.py +++ b/msodumper/xlsrecord.py @@ -15,6 +15,24 @@ class RecordError(Exception): pass # ------------------------------------------------------------------- # record handler classes +class Ref8(object): + + def __init__ (self, strm): + self.row1 = strm.readUnsignedInt(2) + self.row2 = strm.readUnsignedInt(2) + self.col1 = strm.readUnsignedInt(2) + self.col2 = strm.readUnsignedInt(2) + + def toString (self): + string = ("(col=%d,row=%d) - (col=%d,row=%d)"% + (self.col1, self.row1, self.col2, self.row2)) + if self.col1 == 0 and self.col2 == 0xFF: + string += ", entire column" + if self.row1 == 0 and self.row2 == 0xFFFF: + string += ", entire row" + return string + + class RefU(object): def __init__ (self, strm): @@ -3533,6 +3551,23 @@ class SXViewSource(BaseRecordHandler): self.appendLine("data source type: %s"%srcType) +class MergeCells(BaseRecordHandler): + + def __parseBytes (self): + self.cmcs = self.readUnsignedInt(2) + self.rgref = [] + for i in xrange(0, self.cmcs): + self.rgref.append(Ref8(self)) + + def parseBytes (self): + self.__parseBytes() + self.appendLine("%d merge ranges:"%self.cmcs) + i = 0 + for ref in self.rgref: + i += 1 + self.appendLine("%d: %s"%(i,ref.toString())) + + class Sxvd(BaseRecordHandler): def __parseBytes (self): |