[Libreoffice-commits] .: 2 commits - src/docrecord.py
Miklos Vajna
vmiklos at kemper.freedesktop.org
Wed Nov 28 09:00:01 PST 2012
src/docrecord.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 52 insertions(+), 2 deletions(-)
New commits:
commit eac894ee4ecfe9e2f700a497d2dc7ae7a5ffafba
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Wed Nov 28 17:58:53 2012 +0100
dump DopMth
diff --git a/src/docrecord.py b/src/docrecord.py
index 5b7c87b..6407e29 100755
--- a/src/docrecord.py
+++ b/src/docrecord.py
@@ -1145,6 +1145,36 @@ class Dop2003(DOCDirStream):
self.printAndSet("ilfoMacAtCleanup", self.readuInt16())
print '</dop2003>'
+class DopMth(DOCDirStream):
+ """The DopMth structure specifies document-wide math settings."""
+ def __init__(self, dop):
+ DOCDirStream.__init__(self, dop.bytes)
+ self.pos = dop.pos
+
+ def dump(self):
+ print '<dopMth type="DopMth" offset="%d" size="34 bytes">' % self.pos
+ buf = self.readuInt32()
+ self.printAndSet("mthbrk", (buf & 0x03)) # 1..2nd bits
+ self.printAndSet("mthbrkSub", (buf & 0xc) >> 2) # 3..4th bits
+ self.printAndSet("mthbpjc", (buf & 0x70) >> 4) # 5..7th bits
+ self.printAndSet("reserved1", self.getBit(buf, 7))
+ self.printAndSet("fMathSmallFrac", self.getBit(buf, 8))
+ self.printAndSet("fMathIntLimUndOvr", self.getBit(buf, 9))
+ self.printAndSet("fMathNaryLimUndOvr", self.getBit(buf, 10))
+ self.printAndSet("fMathWrapAlignLeft", self.getBit(buf, 11))
+ self.printAndSet("fMathUseDispDefaults", self.getBit(buf, 12))
+ self.printAndSet("reserved2", (buf & 0xffffe000) >> 13) # 14..32th bits
+
+ self.printAndSet("ftcMath", self.readuInt16())
+ self.printAndSet("dxaLeftMargin", self.readuInt32())
+ self.printAndSet("dxaRightMargin", self.readuInt32())
+ self.printAndSet("empty1", self.readuInt32())
+ self.printAndSet("empty2", self.readuInt32())
+ self.printAndSet("empty3", self.readuInt32())
+ self.printAndSet("empty4", self.readuInt32())
+ self.printAndSet("dxaIndentWrapped", self.readuInt32())
+ print '</dopMth>'
+
class Dop2007(DOCDirStream):
"""The Dop2007 structure contains document and compatibility settings."""
def __init__(self, dop):
@@ -1177,7 +1207,7 @@ class Dop2007(DOCDirStream):
self.printAndSet("empty4", self.readuInt32())
self.printAndSet("empty5", self.readuInt32())
self.printAndSet("empty6", self.readuInt32())
- # TODO dopMth
+ DopMth(self).dump()
self.pos += 34
print '</dop2007>'
commit 33d1ad9672822a8523ce08d685b2259894a23d88
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Wed Nov 28 17:42:15 2012 +0100
dump Asumyi
diff --git a/src/docrecord.py b/src/docrecord.py
index 45691fc..5b7c87b 100755
--- a/src/docrecord.py
+++ b/src/docrecord.py
@@ -884,6 +884,26 @@ class Dogrid(DOCDirStream):
self.printAndSet("fFollowMargins", self.getBit(buf, 7))
print '</dogrid>'
+class Asumyi(DOCDirStream):
+ """The Asumyi structure specifies AutoSummary state information"""
+ def __init__(self, dop):
+ DOCDirStream.__init__(self, dop.bytes)
+ self.pos = dop.pos
+
+ def dump(self):
+ print '<asumyi type="Asumyi" offset="%d" size="12 bytes">' % self.pos
+ buf = self.readuInt16()
+ self.printAndSet("fValid", self.getBit(buf, 0))
+ self.printAndSet("fView", self.getBit(buf, 1))
+ self.printAndSet("iViewBy", (buf & 0x0c) >> 2) # 3..4th bits
+ self.printAndSet("fUpdateProps", self.getBit(buf, 4))
+ self.printAndSet("reserved", (buf & 0xffe0) >> 5) # 6..16th bits
+
+ self.printAndSet("wDlgLevel", self.readuInt16())
+ self.printAndSet("lHighestLevel", self.readuInt32())
+ self.printAndSet("lCurrentLevel", self.readuInt32())
+ print '</asumyi>'
+
class Dop97(DOCDirStream):
"""The Dop97 structure contains document and compatibility settings."""
def __init__(self, dop):
@@ -926,7 +946,7 @@ class Dop97(DOCDirStream):
self.printAndSet("unused4", self.getBit(buf, 7))
self.printAndSet("unused5", self.readuInt16())
- # TODO asumyi
+ Asumyi(self).dump()
self.pos += 12
self.printAndSet("cChWS", self.readuInt32())
self.printAndSet("cChWSWithSubdocs", self.readuInt32())
More information about the Libreoffice-commits
mailing list