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

Miklos Vajna vmiklos at kemper.freedesktop.org
Tue Nov 27 02:21:47 PST 2012


 src/docrecord.py |   95 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 92 insertions(+), 3 deletions(-)

New commits:
commit 9defe6bd69547bcfdea95d8b9130a6343dc475b0
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Tue Nov 27 11:13:20 2012 +0100

    dump Dop97

diff --git a/src/docrecord.py b/src/docrecord.py
index d6c3eae..e239a55 100755
--- a/src/docrecord.py
+++ b/src/docrecord.py
@@ -815,7 +815,9 @@ class Dop95(DOCDirStream):
 
     def dump(self):
         print '<dop95 type="Dop95" offset="%d" size="88 bytes">' % self.pos
-        DopBase(self).dump()
+        dopBase = DopBase(self)
+        dopBase.dump()
+        assert dopBase.pos == self.pos + 84
         self.pos += 84
         Copts80(self).dump()
         self.pos += 4
@@ -829,9 +831,94 @@ class Dop97(DOCDirStream):
         self.dop = dop
 
     def dump(self):
-        Dop95(self).dump()
+        print '<dop97 type="Dop97" offset="%d" size="500 bytes">' % self.pos
+        dop95 = Dop95(self)
+        dop95.dump()
+        assert dop95.pos == self.pos + 88
         self.pos += 88
 
+        self.printAndSet("adt", self.getuInt16())
+        self.pos += 2
+        # TODO doptypography
+        self.pos += 310
+        # TODO dogrid
+        self.pos += 10
+
+        buf = self.getuInt8()
+        self.pos += 1
+        self.printAndSet("unused1", self.getBit(buf, 0))
+        self.printAndSet("lvlDop", (buf & 0x1e) >> 1) # 2..5th bits
+        self.printAndSet("fGramAllDone", self.getBit(buf, 5))
+        self.printAndSet("fGramAllClean", self.getBit(buf, 6))
+        self.printAndSet("fSubsetFonts", self.getBit(buf, 7))
+
+        buf = self.getuInt8()
+        self.pos += 1
+        self.printAndSet("unused2", self.getBit(buf, 0))
+        self.printAndSet("fHtmlDoc", self.getBit(buf, 1))
+        self.printAndSet("fDiskLvcInvalid", self.getBit(buf, 2))
+        self.printAndSet("fSnapBorder", self.getBit(buf, 3))
+        self.printAndSet("fIncludeHeader", self.getBit(buf, 4))
+        self.printAndSet("fIncludeFooter", self.getBit(buf, 5))
+        self.printAndSet("unused3", self.getBit(buf, 6))
+        self.printAndSet("unused4", self.getBit(buf, 7))
+
+        self.printAndSet("unused5", self.getuInt16())
+        self.pos += 2
+        # TODO asumyi
+        self.pos += 12
+        self.printAndSet("cChWS", self.getuInt32())
+        self.pos += 4
+        self.printAndSet("cChWSWithSubdocs", self.getuInt32())
+        self.pos += 4
+        self.printAndSet("grfDocEvents", self.getuInt32())
+        self.pos += 4
+
+        buf = self.getuInt32()
+        self.pos += 4
+        self.printAndSet("fVirusPrompted", self.getBit(buf, 0))
+        self.printAndSet("fVirusLoadSafe", self.getBit(buf, 1))
+        self.printAndSet("KeyVirusSession30", (buf & 0xfffffffc) >> 2)
+
+        self.printAndSet("space1", self.getuInt32())
+        self.pos += 4
+        self.printAndSet("space2", self.getuInt32())
+        self.pos += 4
+        self.printAndSet("space3", self.getuInt32())
+        self.pos += 4
+        self.printAndSet("space4", self.getuInt32())
+        self.pos += 4
+        self.printAndSet("space5", self.getuInt32())
+        self.pos += 4
+        self.printAndSet("space6", self.getuInt32())
+        self.pos += 4
+        self.printAndSet("space7", self.getuInt32())
+        self.pos += 4
+        self.printAndSet("space8", self.getuInt16())
+        self.pos += 2
+
+        self.printAndSet("cpMaxListCacheMainDoc", self.getuInt32())
+        self.pos += 4
+        self.printAndSet("ilfoLastBulletMain", self.getuInt16())
+        self.pos += 2
+        self.printAndSet("ilfoLastNumberMain", self.getuInt16())
+        self.pos += 2
+        self.printAndSet("cDBC", self.getuInt32())
+        self.pos += 4
+        self.printAndSet("cDBCWithSubdocs", self.getuInt32())
+        self.pos += 4
+        self.printAndSet("reserved3a", self.getuInt32())
+        self.pos += 4
+        self.printAndSet("nfcFtnRef", self.getuInt16())
+        self.pos += 2
+        self.printAndSet("nfcEdnRef", self.getuInt16())
+        self.pos += 2
+        self.printAndSet("hpsZoomFontPag", self.getuInt16())
+        self.pos += 2
+        self.printAndSet("dywDispPag", self.getuInt16())
+        self.pos += 2
+        print '</dop97>'
+
 class Dop2000(DOCDirStream):
     """The Dop2000 structure contains document and compatibility settings."""
     def __init__(self, dop):
@@ -840,7 +927,9 @@ class Dop2000(DOCDirStream):
         self.dop = dop
 
     def dump(self):
-        Dop97(self).dump()
+        dop97 = Dop97(self)
+        dop97.dump()
+        assert dop97.pos == self.pos + 500
         self.pos += 500
 
 class Dop2002(DOCDirStream):


More information about the Libreoffice-commits mailing list