ooo-build r15309 - in trunk: . scratch/mso-dumper/src
- From: kyoshida svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r15309 - in trunk: . scratch/mso-dumper/src
- Date: Tue, 10 Feb 2009 06:36:25 +0000 (UTC)
Author: kyoshida
Date: Tue Feb 10 06:36:25 2009
New Revision: 15309
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15309&view=rev
Log:
2009-02-10 Kohei Yoshida <kyoshida novell com>
* scratch/mso-dumper/src/xlsrecord.py:
* scratch/mso-dumper/src/xlsstream.py: added handler for BOUNDSHEET
records.
Modified:
trunk/ChangeLog
trunk/scratch/mso-dumper/src/xlsrecord.py
trunk/scratch/mso-dumper/src/xlsstream.py
Modified: trunk/scratch/mso-dumper/src/xlsrecord.py
==============================================================================
--- trunk/scratch/mso-dumper/src/xlsrecord.py (original)
+++ trunk/scratch/mso-dumper/src/xlsrecord.py Tue Feb 10 06:36:25 2009
@@ -143,6 +143,44 @@
self.appendLine("earliest Excel version that can read all records: %d"%lowestExcelVer)
+class BoundSheet(BaseRecordHandler):
+
+ hiddenStates = {0x00: 'visible', 0x01: 'hidden', 0x02: 'very hidden'}
+
+ sheetTypes = {0x00: 'worksheet or dialog sheet',
+ 0x01: 'Excel 4.0 macro sheet',
+ 0x02: 'chart',
+ 0x06: 'Visual Basic module'}
+
+ @staticmethod
+ def getHiddenState (flag):
+ if BoundSheet.hiddenStates.has_key(flag):
+ return BoundSheet.hiddenStates[flag]
+ else:
+ return 'unknown'
+
+ @staticmethod
+ def getSheetType (flag):
+ if BoundSheet.sheetTypes.has_key(flag):
+ return BoundSheet.sheetTypes[flag]
+ else:
+ return 'unknown'
+
+ def parseBytes (self):
+ posBOF = self.readUnsignedInt(4)
+ flags = self.readUnsignedInt(2)
+ textLen = self.readUnsignedInt(1)
+ text, textLen = globals.getRichText(self.readRemainingBytes(), textLen)
+ self.appendLine("BOF position in this stream: %d"%posBOF)
+ self.appendLine("sheet name: %s"%text)
+
+ hiddenState = (flags & 0x0003)
+ self.appendLine("hidden state: %s"%BoundSheet.getHiddenState(hiddenState))
+
+ sheetType = (flags & 0xFF00)
+ self.appendLine("sheet type: %s"%BoundSheet.getSheetType(sheetType))
+
+
class Formula(BaseRecordHandler):
def parseBytes (self):
Modified: trunk/scratch/mso-dumper/src/xlsstream.py
==============================================================================
--- trunk/scratch/mso-dumper/src/xlsstream.py (original)
+++ trunk/scratch/mso-dumper/src/xlsstream.py Tue Feb 10 06:36:25 2009
@@ -64,7 +64,7 @@
0x0082: ["GRIDSET", "State Change of Gridlines Option"],
0x0083: ["HCENTER", "Center Between Horizontal Margins"],
0x0084: ["VCENTER", "Center Between Vertical Margins"],
- 0x0085: ["BOUNDSHEET", "Sheet Information"],
+ 0x0085: ["BOUNDSHEET", "Sheet Information", xlsrecord.BoundSheet],
0x0086: ["WRITEPROT", "Workbook Is Write-Protected"],
0x0087: ["ADDIN", "Workbook Is an Add-in Macro"],
0x0088: ["EDG", "Edition Globals"],
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]