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

Miklos Vajna vmiklos at kemper.freedesktop.org
Wed Nov 28 05:55:24 PST 2012


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

New commits:
commit bcf93df813ed3829e85f088a00a0811a263673d2
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Wed Nov 28 14:54:38 2012 +0100

    dump Dop2007

diff --git a/src/docrecord.py b/src/docrecord.py
index b166db4..435f2f1 100755
--- a/src/docrecord.py
+++ b/src/docrecord.py
@@ -978,7 +978,7 @@ class Dop2002(DOCDirStream):
         self.dop = dop
 
     def dump(self):
-        print '<dop2002 type="Dop2000" offset="%d" size="594 bytes">' % self.pos
+        print '<dop2002 type="Dop2002" offset="%d" size="594 bytes">' % self.pos
         dop2000 = Dop2000(self)
         dop2000.dump()
         assert dop2000.pos == self.pos + 544
@@ -1027,7 +1027,7 @@ class Dop2003(DOCDirStream):
         self.dop = dop
 
     def dump(self):
-        print '<dop2003 type="Dop2000" offset="%d" size="616 bytes">' % self.pos
+        print '<dop2003 type="Dop2003" offset="%d" size="616 bytes">' % self.pos
         dop2002 = Dop2002(self)
         dop2002.dump()
         assert dop2002.pos == self.pos + 594
@@ -1077,11 +1077,34 @@ class Dop2007(DOCDirStream):
         self.dop = dop
 
     def dump(self):
+        print '<dop2007 type="Dop2007" offset="%d">' % self.pos
         dop2003 = Dop2003(self)
         dop2003.dump()
         assert dop2003.pos == self.pos + 616
         self.pos += 616
 
+        self.printAndSet("reserved1", self.readuInt32())
+
+        buf = self.readuInt16()
+        self.printAndSet("fRMTrackFormatting", self.getBit(buf, 0))
+        self.printAndSet("fRMTrackMoves", self.getBit(buf, 1))
+        self.printAndSet("reserved2", self.getBit(buf, 2))
+        self.printAndSet("empty1", self.getBit(buf, 3))
+        self.printAndSet("empty2", self.getBit(buf, 4))
+        self.printAndSet("ssm", (buf & 0x01e0) >> 5) # 6..9th bits
+        self.printAndSet("fReadingModeInkLockDownActualPage", self.getBit(buf, 9))
+        self.printAndSet("fAutoCompressPictures", self.getBit(buf, 10))
+        self.printAndSet("reserved3", (buf & 0xf800) >> 11) # 12..16th bits
+        self.printAndSet("reserved3_", self.readuInt16())
+
+        self.printAndSet("empty3", self.readuInt32())
+        self.printAndSet("empty4", self.readuInt32())
+        self.printAndSet("empty5", self.readuInt32())
+        self.printAndSet("empty6", self.readuInt32())
+        # TODO dopMth
+        self.pos += 34
+        print '</dop2007>'
+
 class Dop(DOCDirStream):
     """The Dop structure contains the document and compatibility settings for the document."""
     def __init__(self, fib):
@@ -1093,7 +1116,7 @@ class Dop(DOCDirStream):
     def dump(self):
         print '<dop type="Dop" offset="%s" size="%d bytes">' % (self.pos, self.size)
         if self.fib.nFibNew == 0x0112:
-            Dop2007(self).dump()
+            dop2007 = Dop2007(self)
         else:
             print """<todo what="Dop.dump() doesn't know how to handle nFibNew = %s">""" % hex(self.nFibNew)
         print '</dop>'
commit 456026e66daa832a291a5507184b1bd3b19b6fdf
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Wed Nov 28 14:37:54 2012 +0100

    dump Dop2003

diff --git a/src/docrecord.py b/src/docrecord.py
index 649eddd..b166db4 100755
--- a/src/docrecord.py
+++ b/src/docrecord.py
@@ -1027,11 +1027,48 @@ class Dop2003(DOCDirStream):
         self.dop = dop
 
     def dump(self):
+        print '<dop2003 type="Dop2000" offset="%d" size="616 bytes">' % self.pos
         dop2002 = Dop2002(self)
         dop2002.dump()
         assert dop2002.pos == self.pos + 594
         self.pos += 594
 
+        buf = self.readuInt8()
+        self.printAndSet("fTreatLockAtnAsReadOnly", self.getBit(buf, 0))
+        self.printAndSet("fStyleLock", self.getBit(buf, 1))
+        self.printAndSet("fAutoFmtOverride", self.getBit(buf, 2))
+        self.printAndSet("fRemoveWordML", self.getBit(buf, 3))
+        self.printAndSet("fApplyCustomXForm", self.getBit(buf, 4))
+        self.printAndSet("fStyleLockEnforced", self.getBit(buf, 5))
+        self.printAndSet("fFakeLockAtn", self.getBit(buf, 6))
+        self.printAndSet("fIgnoreMixedContent", self.getBit(buf, 7))
+
+        buf = self.readuInt8()
+        self.printAndSet("fShowPlaceholderText", self.getBit(buf, 0))
+        self.printAndSet("unused", self.getBit(buf, 1))
+        self.printAndSet("fWord97Doc", self.getBit(buf, 2))
+        self.printAndSet("fStyleLockTheme", self.getBit(buf, 3))
+        self.printAndSet("fStyleLockQFSet", self.getBit(buf, 4))
+        self.printAndSet("empty1", (buf & 0xe0) >> 5) # 6..8th bits
+        self.printAndSet("empty1_", self.readuInt16())
+
+        buf = self.readuInt8()
+        self.printAndSet("fReadingModeInkLockDown", self.getBit(buf, 0))
+        self.printAndSet("fAcetateShowInkAtn", self.getBit(buf, 1))
+        self.printAndSet("fFilterDttm", self.getBit(buf, 2))
+        self.printAndSet("fEnforceDocProt", self.getBit(buf, 3))
+        self.printAndSet("iDocProtCur", (buf & 0x70) >> 4) # 5..7th bits
+        self.printAndSet("fDispBkSpSaved", self.getBit(buf, 7))
+
+        self.printAndSet("empty2", self.readuInt8())
+        self.printAndSet("dxaPageLock", self.readuInt32())
+        self.printAndSet("dyaPageLock", self.readuInt32())
+        self.printAndSet("pctFontLock", self.readuInt32())
+        self.printAndSet("grfitbid", self.readuInt8())
+        self.printAndSet("empty3", self.readuInt8())
+        self.printAndSet("ilfoMacAtCleanup", self.readuInt16())
+        print '</dop2003>'
+
 class Dop2007(DOCDirStream):
     """The Dop2007 structure contains document and compatibility settings."""
     def __init__(self, dop):
@@ -1040,7 +1077,9 @@ class Dop2007(DOCDirStream):
         self.dop = dop
 
     def dump(self):
-        Dop2003(self).dump()
+        dop2003 = Dop2003(self)
+        dop2003.dump()
+        assert dop2003.pos == self.pos + 616
         self.pos += 616
 
 class Dop(DOCDirStream):


More information about the Libreoffice-commits mailing list