[Libreoffice-commits] mso-dumper.git: 2 commits - src/docrecord.py src/msodraw.py test/doc

Miklos Vajna vmiklos at kemper.freedesktop.org
Sat Aug 24 12:59:08 PDT 2013


 src/docrecord.py            |   18 ++++++++++++------
 src/msodraw.py              |    1 +
 test/doc/pass/abi4893-1.doc |binary
 3 files changed, 13 insertions(+), 6 deletions(-)

New commits:
commit 7f0bc79651c057472054e73a226801be12c21342
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Sat Aug 24 21:50:05 2013 +0200

    PICFAndOfficeArtData: handle unexpected picf.mfpf.mm

diff --git a/src/docrecord.py b/src/docrecord.py
index 69d3571..16d99e0 100644
--- a/src/docrecord.py
+++ b/src/docrecord.py
@@ -688,7 +688,7 @@ class MFPF(DOCDirStream):
                 0x0066: "MM_SHAPEFILE",
                 }
         print '<mfpf type="MFPF" offset="%d">' % self.pos
-        self.printAndSet("mm", self.readInt16(), dict = mmDict)
+        self.printAndSet("mm", self.readInt16(), dict = mmDict, default = "todo")
         self.printAndSet("xExt", self.readuInt16())
         self.printAndSet("yExt", self.readuInt16())
         self.printAndSet("swHMF", self.readuInt16())
@@ -986,14 +986,18 @@ class PICF(DOCDirStream):
 
     def dump(self):
         print '<picf type="PICF" offset="%d">' % self.pos
+        posOrig = self.pos
         self.printAndSet("lcb", self.readInt32())
         self.printAndSet("cbHeader", self.readInt16())
         assert self.cbHeader == 0x44
         self.mfpf = MFPF(self)
         self.mfpf.dump()
-        PICF_Shape(self, "innerHeader").dump()
-        PICMID(self).dump()
-        self.printAndSet("cProps", self.readuInt16())
+        if self.mfpf.mm == 0x0064: # MM_SHAPEFILE
+            PICF_Shape(self, "innerHeader").dump()
+            PICMID(self).dump()
+            self.printAndSet("cProps", self.readuInt16())
+        else:
+            self.pos = posOrig + self.cbHeader
         self.parent.pos = self.pos
         print '</picf>'
 
@@ -1018,11 +1022,13 @@ class PICFAndOfficeArtData(DOCDirStream):
             picf = PICF(self)
             picf.dump()
             assert self.pos == pos + 68
-            if picf.mfpf.mm == 0x0066:
+            if picf.mfpf.mm == 0x0066: # MM_SHAPEFILE
                 print '<todo what="PICFAndOfficeArtData::dump(): picf.mfpf.mm == MM_SHAPEFILE is unhandled"/>'
-            else:
+            elif picf.mfpf.mm == 0x0064: # MM_SHAPE
                 remaining = picf.lcb - (self.pos - pos)
                 msodraw.InlineSpContainer(self, remaining).dumpXml(self, getWordModel(self.parent.mainStream))
+            else:
+                print '<todo what="PICFAndOfficeArtData::dump(): picf.mfpf.mm is unhandled (not MM_SHAPE or MM_SHAPEFILE): %d"/>' % picf.mfpf.mm
         else:
             print '<todo what="PICFAndOfficeArtData::dump(): handle sprmCFData or sprmCFOle2"/>'
         print '</PICFAndOfficeArtData>'
diff --git a/test/doc/pass/abi4893-1.doc b/test/doc/pass/abi4893-1.doc
new file mode 100644
index 0000000..704500a
Binary files /dev/null and b/test/doc/pass/abi4893-1.doc differ
commit fb0859f1b797adf084f2f3b6121ea5c37da27380
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Aug 23 10:59:59 2013 +0200

    recognize fillFocus

diff --git a/src/msodraw.py b/src/msodraw.py
index 87c969f..8384c48 100644
--- a/src/msodraw.py
+++ b/src/msodraw.py
@@ -739,6 +739,7 @@ class FOPT:
         0x01D6: ['lineJoinStyle'],
         0x01D7: ['lineEndCapStyle'],
         0x0104: ['pib'],
+        0x018C: ['fillFocus'],
     }
 
     class E:


More information about the Libreoffice-commits mailing list