ooo-build r11391 - in trunk: . scratch/sc-xlsutil scratch/sc-xlsutil/src



Author: kyoshida
Date: Wed Jan 23 22:51:41 2008
New Revision: 11391
URL: http://svn.gnome.org/viewvc/ooo-build?rev=11391&view=rev

Log:
2008-01-23  Kohei Yoshida  <kyoshida novell com>

	* scratch/sc-xlsutil/src/ole.py:
	* scratch/sc-xlsutil/src/stream.py:
	* scratch/sc-xlsutil/xls_dump.py: print sector array info in the SAT &
	more identified record types.


Modified:
   trunk/ChangeLog
   trunk/scratch/sc-xlsutil/src/ole.py
   trunk/scratch/sc-xlsutil/src/stream.py
   trunk/scratch/sc-xlsutil/xls_dump.py

Modified: trunk/scratch/sc-xlsutil/src/ole.py
==============================================================================
--- trunk/scratch/sc-xlsutil/src/ole.py	(original)
+++ trunk/scratch/sc-xlsutil/src/ole.py	Wed Jan 23 22:51:41 2008
@@ -322,6 +322,10 @@
 
 
     def buildArray (self):
+        if len(self.array) > 0:
+            # array already built.
+            return
+
         numItems = int(self.sectorSize/4)
         self.array = []
         for secID in self.sectorIDs:
@@ -337,9 +341,38 @@
         print("="*68)
         print("Sector Allocation Table (SAT)")
         print("-"*68)
+        sectorTotal = len(self.array)
+        sectorP  = 0       # >= 0
+        sectorM1 = 0       # -1
+        sectorM2 = 0       # -2
+        sectorM3 = 0       # -3
+        sectorM4 = 0       # -4
+        sectorMElse = 0    # < -4
+        sectorLiveTotal = 0
         for i in xrange(0, len(self.array)):
             item = self.array[i]
-            output("%3d : %3d\n"%(i, item))
+            if item >= 0:
+                sectorP += 1
+            elif item == -1:
+                sectorM1 += 1
+            elif item == -2:
+                sectorM2 += 1
+            elif item == -3:
+                sectorM3 += 1
+            elif item == -4:
+                sectorM4 += 1
+            elif item < -4:
+                sectorMElse += 1
+            else:
+                sectorLiveTotal += 1
+        print("total sector count:          %4d"%sectorTotal)
+        print("* live sector count:         %4d"%sectorP)
+        print("* end-of-chain sector count: %4d"%sectorM2)  # end-of-chain is also live
+
+        print("* free sector count:         %4d"%sectorM1)
+        print("* SAT sector count:          %4d"%sectorM3)
+        print("* MSAT sector count:         %4d"%sectorM4)
+        print("* other sector count:        %4d"%sectorMElse)
 
 
     def getSectorIDChain (self, initID):

Modified: trunk/scratch/sc-xlsutil/src/stream.py
==============================================================================
--- trunk/scratch/sc-xlsutil/src/stream.py	(original)
+++ trunk/scratch/sc-xlsutil/src/stream.py	Wed Jan 23 22:51:41 2008
@@ -9,65 +9,31 @@
     0x000D: ["CALCMODE", "Calculation Mode"],
     0x000E: ["PRECISION", "Precision"],
     0x000F: ["REFMODE", "Reference Mode"],
-    0x0100: ["SXVDEX", "Extended PivotTable View Fields"],
-    0x0103: ["SXFORMULA", "PivotTable Formula Record"],
     0x0010: ["DELTA", "Iteration Increment"],
     0x0011: ["ITERATION", "Iteration Mode"],
-    0x0122: ["SXDBEX", "PivotTable Cache Data"],
     0x0012: ["PROTECT", "Protection Flag"],
-    0x013D: ["TABID", "Sheet Tab Index Array"],
     0x0013: ["PASSWORD", "Protection Password"],
     0x0014: ["HEADER", "Print Header on Each Page"],
     0x0015: ["FOOTER", "Print Footer on Each Page"],
-    0x0160: ["USESELFS", "Natural Language Formulas Flag"],
-    0x0161: ["DSF", "Double Stream File"],
     0x0016: ["EXTERNCOUNT", "Number of External References"],
     0x0017: ["EXTERNSHEET", "External Reference"],
     0x0019: ["WINDOWPROTECT", "Windows Are Protected"],
-    0x01A9: ["USERBVIEW", "Workbook Custom View Settings"],
-    0x01AA: ["USERSVIEWBEGIN", "Custom View Settings"],
-    0x01AB: ["USERSVIEWEND", "End of Custom View Records"],
-    0x01AD: ["QSI", "External Data Range"],
-    0x01AE: ["SUPBOOK", "Supporting Workbook"],
     0x001A: ["VERTICALPAGEBREAKS", "Explicit Column Page Breaks"],
-    0x01B0: ["CONDFMT", "Conditional Formatting Range Information"],
-    0x01B1: ["CF", "Conditional Formatting Conditions"],
-    0x01B2: ["DVAL", "Data Validation Information"],
-    0x01B5: ["DCONBIN", "Data Consolidation Information"],
-    0x01B6: ["TXO", "Text Object"],
-    0x01B7: ["REFRESHALL", "Refresh Flag"],
-    0x01B8: ["HLINK", "Hyperlink"],
-    0x01BB: ["SXFDBTYPE", "SQL Datatype Identifier"],
-    0x01BE: ["DV", "Data Validation Criteria"],
     0x001B: ["HORIZONTALPAGEBREAKS", "Explicit Row Page Breaks"],
     0x001C: ["NOTE", "Comment Associated with a Cell"],
     0x001D: ["SELECTION", "Current Selection"],
-    0x0200: ["DIMENSIONS", "Cell Table Size"],
-    0x0201: ["BLANK", "Cell Value"],
-    0x0203: ["NUMBER", "Cell Value"],
-    0x0204: ["LABEL", "Cell Value"],
-    0x0205: ["BOOLERR", "Cell Value"],
-    0x0207: ["STRING", "String Value of a Formula"],
-    0x0208: ["ROW", "Describes a Row"],
-    0x020B: ["INDEX", "Index Record"],
-    0x0218: ["NAME", "Defined Name"],
-    0x0221: ["ARRAY", "Array-Entered Formula"],
-    0x0223: ["EXTERNNAME", "Externally Referenced Name"],
-    0x0225: ["DEFAULTROWHEIGHT", "Default Row Height"],
-    0x0231: ["FONT", "Font Description"],
-    0x0236: ["TABLE", "Data Table"],
+    0x0022: ["DATEMODE", "Base Date for Displaying Date Values"],
     0x0026: ["LEFTMARGIN", "Left Margin Measurement"],
     0x0027: ["RIGHTMARGIN", "Right Margin Measurement"],
     0x0028: ["TOPMARGIN", "Top Margin Measurement"],
-    0x0293: ["STYLE", "Style Information"],
     0x0029: ["BOTTOMMARGIN", "Bottom Margin Measurement"],
     0x002A: ["PRINTHEADERS", "Print Row/Column Labels"],
     0x002B: ["PRINTGRIDLINES", "Print Gridlines Flag"],
     0x002F: ["FILEPASS", "File Is Password-Protected"],
+    0x0031: ["FONT", "Font and Character Formatting"],
     0x003C: ["CONTINUE", "Continues Long Records"],
-    0x0406: ["FORMULA", "Cell Formula"],
+    0x003D: ["WINDOW1", "Window Information"],
     0x0040: ["BACKUP", "Save Backup Version of the File"],
-    0x041E: ["FORMAT", "Number Format"],
     0x0041: ["PANE", "Number of Panes and Their Position"],
     0x0042: ["CODEPAGE/CODENAME", "Default Code Page/VBE Object Name"],
     0x004D: ["PLS", "Environment-Specific Print Record"],
@@ -87,7 +53,6 @@
     0x007D: ["COLINFO", "Column Formatting Information"],
     0x007E: ["RK", "Cell Value"],
     0x007F: ["IMDATA", "Image Data"],
-    0x0809: ["BOF", "Beginning of File"],
     0x0080: ["GUTS", "Size of Row and Column Gutters"],
     0x0081: ["WSBOOL", "Additional Workspace Information"],
     0x0082: ["GRIDSET", "State Change of Gridlines Option"],
@@ -167,13 +132,52 @@
     0x00FB: ["SXFORMAT", "PivotTable Format Record"],
     0x00FC: ["SST", "Shared String Table"],
     0x00FD: ["LABELSST", "Cell Value"],
-    0x003D: ["WINDOW1", "Window Information"],
-    0x0022: ["DATEMODE", "Base Date for Displaying Date Values"],
-    0x023E: ["WINDOW2", "Sheet Window Information"],
+    0x00FF: ["EXTSST", "Extended Shared String Table"],
+    0x0100: ["SXVDEX", "Extended PivotTable View Fields"],
+    0x0103: ["SXFORMULA", "PivotTable Formula Record"],
+    0x0122: ["SXDBEX", "PivotTable Cache Data"],
+    0x013D: ["TABID", "Sheet Tab Index Array"],
+    0x0160: ["USESELFS", "Natural Language Formulas Flag"],
+    0x0161: ["DSF", "Double Stream File"],
+    0x01A9: ["USERBVIEW", "Workbook Custom View Settings"],
+    0x01AA: ["USERSVIEWBEGIN", "Custom View Settings"],
+    0x01AB: ["USERSVIEWEND", "End of Custom View Records"],
+    0x01AD: ["QSI", "External Data Range"],
+    0x01AE: ["SUPBOOK", "Supporting Workbook"],
     0x01AF: ["PROT4REV", "Shared Workbook Protection Flag"],
+    0x01B0: ["CONDFMT", "Conditional Formatting Range Information"],
+    0x01B1: ["CF", "Conditional Formatting Conditions"],
+    0x01B2: ["DVAL", "Data Validation Information"],
+    0x01B5: ["DCONBIN", "Data Consolidation Information"],
+    0x01B6: ["TXO", "Text Object"],
+    0x01B7: ["REFRESHALL", "Refresh Flag"],
+    0x01B8: ["HLINK", "Hyperlink"],
+    0x01BB: ["SXFDBTYPE", "SQL Datatype Identifier"],
     0x01BC: ["PROT4REVPASS", "Shared Workbook Protection Password"],
-    0x0031: ["FONT", "Font and Character Formatting"],
-    0x00FF: ["EXTSST", "Extended Shared String Table"] }
+    0x01BE: ["DV", "Data Validation Criteria"],
+    0x0200: ["DIMENSIONS", "Cell Table Size"],
+    0x0201: ["BLANK", "Cell Value"],
+    0x0203: ["NUMBER", "Cell Value"],
+    0x0204: ["LABEL", "Cell Value"],
+    0x0205: ["BOOLERR", "Cell Value"],
+    0x0207: ["STRING", "String Value of a Formula"],
+    0x0208: ["ROW", "Describes a Row"],
+    0x020B: ["INDEX", "Index Record"],
+    0x0218: ["NAME", "Defined Name"],
+    0x0221: ["ARRAY", "Array-Entered Formula"],
+    0x0223: ["EXTERNNAME", "Externally Referenced Name"],
+    0x0225: ["DEFAULTROWHEIGHT", "Default Row Height"],
+    0x0231: ["FONT", "Font Description"],
+    0x0236: ["TABLE", "Data Table"],
+    0x023E: ["WINDOW2", "Sheet Window Information"],
+    0x0293: ["STYLE", "Style Information"],
+    0x0406: ["FORMULA", "Cell Formula"],
+    0x041E: ["FORMAT", "Number Format"],
+    0x0809: ["BOF", "Beginning of File"],
+    0x0862: ["SHEETLAYOUT", "Tab Color below Sheet Name"],
+    0x0867: ["SHEETPROTECTION", "Sheet Protection Options"],
+    0x0868: ["RANGEPROTECTION", "Protected Range on Protected Sheet"]
+}
 
 
 class XLStream(object):

Modified: trunk/scratch/sc-xlsutil/xls_dump.py
==============================================================================
--- trunk/scratch/sc-xlsutil/xls_dump.py	(original)
+++ trunk/scratch/sc-xlsutil/xls_dump.py	Wed Jan 23 22:51:41 2008
@@ -15,8 +15,8 @@
         file.close()
         strm.printStreamInfo()
         strm.printHeader()
-#       strm.printMSAT()
-#       strm.printSAT()
+        strm.printMSAT()
+        strm.printSAT()
 #       strm.printSSAT()
         strm.printDirectory()
         dirnames = strm.getDirectoryNames()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]