[Libreoffice-commits] .: src/docrecord.py src/docstream.py

Miklos Vajna vmiklos at kemper.freedesktop.org
Thu Jan 10 08:25:16 PST 2013


 src/docrecord.py |   39 +++++++++++++++++++++++++++++++++++++++
 src/docstream.py |    5 ++++-
 2 files changed, 43 insertions(+), 1 deletion(-)

New commits:
commit 867beebfcbb643f924e54f95e7238e975f334db5
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Jan 10 17:25:10 2013 +0100

    dump PlfLst

diff --git a/src/docrecord.py b/src/docrecord.py
index d5742f7..1dbff49 100644
--- a/src/docrecord.py
+++ b/src/docrecord.py
@@ -2385,4 +2385,43 @@ class PlcfGram(DOCDirStream, PLC):
             print '</aCP>'
         print '</plcfGram>'
 
+class LSTF(DOCDirStream):
+    """The LSTF structure contains formatting properties that apply to an entire list."""
+    def __init__(self, plfLst):
+        DOCDirStream.__init__(self, plfLst.bytes)
+        self.pos = plfLst.pos
+        self.size = 28
+
+    def dump(self):
+        print '<lstf type="LSTF" offset="%d" size="%d bytes">' % (self.pos, self.size)
+        self.printAndSet("lsid", self.readInt32())
+        self.printAndSet("tplc", self.readInt32())
+        for i in range(9):
+            print '<rgistdPara value="%s"/>' % self.readInt16()
+        buf = self.readuInt8()
+        self.printAndSet("fSimpleList", self.getBit(buf, 0))
+        self.printAndSet("unused1", self.getBit(buf, 1))
+        self.printAndSet("fAutoNum", self.getBit(buf, 2))
+        self.printAndSet("unused2", self.getBit(buf, 3))
+        self.printAndSet("fHybrid", self.getBit(buf, 4))
+        self.printAndSet("reserved1", (buf & 0xe0) >> 5) # 6..8th bits
+        self.printAndSet("grfhic", self.readuInt8()) # TODO dump grfhic
+        print '</lstf>'
+
+class PlfLst(DOCDirStream):
+    """The PlfLst structure contains the list formatting information for the document."""
+    def __init__(self, mainStream):
+        DOCDirStream.__init__(self, mainStream.doc.getDirectoryStreamByName("1Table").bytes, mainStream = mainStream)
+        self.pos = mainStream.fcPlfLst
+        self.size = mainStream.lcbPlfLst
+
+    def dump(self):
+        print '<plfLst type="PlfLst" offset="%d" size="%d bytes">' % (self.pos, self.size)
+        self.printAndSet("cLst", self.readInt16())
+        for i in range(self.cLst):
+            rgLstf = LSTF(self)
+            rgLstf.dump()
+            self.pos = rgLstf.pos
+        print '</plfLst>'
+
 # vim:set filetype=python shiftwidth=4 softtabstop=4 expandtab:
diff --git a/src/docstream.py b/src/docstream.py
index c5c9fcc..ad46e1a 100644
--- a/src/docstream.py
+++ b/src/docstream.py
@@ -350,7 +350,7 @@ class WordDocumentStream(DOCDirStream):
             ["fcSttbFnm"],
             ["lcbSttbFnm"],
             ["fcPlfLst"],
-            ["lcbPlfLst"],
+            ["lcbPlfLst", self.handleLcbPlfLst],
             ["fcPlfLfo"],
             ["lcbPlfLfo"],
             ["fcPlcfTxbxBkd"],
@@ -518,6 +518,9 @@ class WordDocumentStream(DOCDirStream):
     def handleLcbPlcfGram(self):
         docrecord.PlcfGram(self).dump()
 
+    def handleLcbPlfLst(self):
+        docrecord.PlfLst(self).dump()
+
     def dumpFibRgFcLcb97(self, name):
         print '<%s type="FibRgFcLcb97" size="744 bytes">' % name
         self.__dumpFibRgFcLcb97()


More information about the Libreoffice-commits mailing list