[Libreoffice-commits] .: src/ole.py

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Apr 7 21:04:36 PDT 2011


 src/ole.py |   31 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 16 deletions(-)

New commits:
commit 9704407e888fa41b49350737a576ad204bb6045b
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Apr 8 00:02:52 2011 -0400

    Let's not even print stream info for directories with 0 stream size.

diff --git a/src/ole.py b/src/ole.py
index edab59f..edc5d7b 100644
--- a/src/ole.py
+++ b/src/ole.py
@@ -645,7 +645,7 @@ entire file stream.
         self.__outputRaw("time last modified", entry.TimeModified)
 
         output("stream info: ")
-        if entry.StreamSectorID < 0:
+        if entry.StreamSectorID < 0 or entry.StreamSize == 0:
             print("[empty stream]")
         else:
             strmLoc = "SAT"
@@ -654,21 +654,20 @@ entire file stream.
             print("(first sector ID: %d; size: %d; location: %s)"%
                   (entry.StreamSectorID, entry.StreamSize, strmLoc))
     
-            if entry.StreamSize > 0:
-                satObj = None
-                secSize = 0
-                if entry.StreamLocation == StreamLocation.SAT:
-                    satObj = self.SAT
-                    secSize = self.header.getSectorSize()
-                elif entry.StreamLocation == StreamLocation.SSAT:
-                    satObj = self.SSAT
-                    secSize = self.header.getShortSectorSize()
-                if satObj != None:
-                    chain = satObj.getSectorIDChain(entry.StreamSectorID)
-                    print("sector count: %d"%len(chain))
-                    print("total sector size: %d"%(len(chain)*secSize))
-                    if self.params.showSectorChain:
-                        self.__outputSectorChain(chain)
+            satObj = None
+            secSize = 0
+            if entry.StreamLocation == StreamLocation.SAT:
+                satObj = self.SAT
+                secSize = self.header.getSectorSize()
+            elif entry.StreamLocation == StreamLocation.SSAT:
+                satObj = self.SSAT
+                secSize = self.header.getShortSectorSize()
+            if satObj != None:
+                chain = satObj.getSectorIDChain(entry.StreamSectorID)
+                print("sector count: %d"%len(chain))
+                print("total sector size: %d"%(len(chain)*secSize))
+                if self.params.showSectorChain:
+                    self.__outputSectorChain(chain)
 
 
     def __outputSectorChain (self, chain):


More information about the Libreoffice-commits mailing list