summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHossein <hossein@libreoffice.org>2021-09-28 09:27:19 +0200
committerHossein <hossein@libreoffice.org>2021-09-28 09:29:10 +0200
commit7bcbe575ce88e4daa6f6335d0b78acc58917cb3e (patch)
tree5b1d57dd224979b5bb272c5b053c7c8c4f2cb3be
parentb88b38cef5e42137edf8441325765a8ac35aa8c3 (diff)
Added dump() for META_POLYLINE record in wmf-dump
Added dump() for the META_POLYLINE (PolyLine) record in wmf-dump.py Change-Id: Ie15f208ee46664cfcc915520d6416b1f3beb8421 Reviewed-on: https://gerrit.libreoffice.org/c/mso-dumper/+/122731 Tested-by: Hossein <hossein@libreoffice.org> Reviewed-by: Hossein <hossein@libreoffice.org>
-rw-r--r--msodumper/wmfrecord.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/msodumper/wmfrecord.py b/msodumper/wmfrecord.py
index 272ba79..dc1ecdb 100644
--- a/msodumper/wmfrecord.py
+++ b/msodumper/wmfrecord.py
@@ -1103,13 +1103,24 @@ class Polygon(WMFRecord):
assert self.pos == dataPos + self.RecordSize * 2
-class Polyline(WMFRecord):
- def __init__(self, parent):
+class PolyLine(WMFRecord):
+ def __init__(self, parent, name=None):
WMFRecord.__init__(self, parent)
+ if name:
+ self.name = name
+ else:
+ self.name = "polyline"
def dump(self):
- print("<todo/>")
- pass
+ dataPos = self.pos
+ print('<%s type="PolyLine">' % self.name)
+ self.printAndSet("RecordSize", self.readuInt32(), hexdump=False)
+ self.printAndSet("RecordFunction", self.readuInt16(), hexdump=True)
+ self.printAndSet("NumberOfPoints", self.readInt16(), hexdump=False)
+ for i in range(self.NumberOfPoints):
+ PointS(self, "aPoint%d" % i).dump()
+ print('</%s>' % self.name)
+ assert self.pos == dataPos + self.RecordSize * 2
class SetTextJustification(WMFRecord):
@@ -1824,7 +1835,7 @@ RecordType = {
0x0231: ['META_SETMAPPERFLAGS', SetMapperFlags],
0x0234: ['META_SELECTPALETTE', SelectPalette],
0x0324: ['META_POLYGON', Polygon],
- 0x0325: ['META_POLYLINE', Polyline],
+ 0x0325: ['META_POLYLINE', PolyLine],
0x020A: ['META_SETTEXTJUSTIFICATION', SetTextJustification],
0x020B: ['META_SETWINDOWORG', SetWindowOrg],
0x020C: ['META_SETWINDOWEXT', SetWindowExt],