[Libreoffice-commits] mso-dumper.git: src/docrecord.py

Miklos Vajna vmiklos at kemper.freedesktop.org
Mon Oct 14 03:58:51 PDT 2013


 src/docrecord.py |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 01f7b8a16a32916f8fc984b2f66b69f53ed4068d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Oct 14 12:58:32 2013 +0200

    LFO: make it easier to spot PlfLfo.rgLfo in the dump
    
    The spec refers to the list override table with this name.

diff --git a/src/docrecord.py b/src/docrecord.py
index 58625e6..04cf8c0 100644
--- a/src/docrecord.py
+++ b/src/docrecord.py
@@ -3580,12 +3580,14 @@ class PlfLst(DOCDirStream):
 
 class LFO(DOCDirStream):
     """The LFO structure specifies the LSTF element that corresponds to a list that contains a paragraph."""
-    def __init__(self, plfLfo):
+    def __init__(self, plfLfo, name, index):
         DOCDirStream.__init__(self, plfLfo.bytes)
         self.pos = plfLfo.pos
+        self.name = name
+        self.index = index
 
     def dump(self):
-        print '<lfo type="LFO" offset="%d">' % self.pos
+        print '<%s type="LFO" index="%s" offset="%d">' % (self.name, self.index, self.pos)
         self.printAndSet("lsid", self.readInt32())
         self.printAndSet("unused1", self.readuInt32())
         self.printAndSet("unused2", self.readuInt32())
@@ -3593,7 +3595,7 @@ class LFO(DOCDirStream):
         self.printAndSet("ibstFltAutoNum", self.readuInt8())
         Grfhic(self).dump()
         self.printAndSet("unused3", self.readuInt8())
-        print '</lfo>'
+        print '</%s>' % self.name
 
 class LFOData(DOCDirStream):
     """The LFOData structure contains the Main Document CP of the corresponding LFO."""
@@ -3621,7 +3623,7 @@ class PlfLfo(DOCDirStream):
         self.printAndSet("lfoMac", self.readInt32())
         lfos = []
         for i in range(self.lfoMac):
-            lfo = LFO(self)
+            lfo = LFO(self, "rgLfo", i)
             lfos.append(lfo)
             lfo.dump()
             self.pos = lfo.pos


More information about the Libreoffice-commits mailing list