[Libreoffice-commits] .: 3 commits - src/pptrecord.py src/pptstream.py
Tor Lillqvist
tml at kemper.freedesktop.org
Thu May 3 05:38:44 PDT 2012
src/pptrecord.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
src/pptstream.py | 7 ++++---
2 files changed, 52 insertions(+), 3 deletions(-)
New commits:
commit a19153ea5e828e4465e9e9896a5ab050945ec28e
Author: Tor Lillqvist <tlillqvist at suse.com>
Date: Thu May 3 15:36:11 2012 +0300
Add ViewInfoAtom handler
diff --git a/src/pptrecord.py b/src/pptrecord.py
index 6e37c93..bdfbbd3 100644
--- a/src/pptrecord.py
+++ b/src/pptrecord.py
@@ -101,6 +101,15 @@ append a line to be displayed.
bytes = self.readBytes(8)
return globals.getDouble(bytes)
+ def readRatio (self):
+ numer = self.readSignedInt(4)
+ denom = self.readSignedInt(4)
+ return "%d/%d"%(numer, denom)
+
+ def readScaling (self):
+ xratio = self.readRatio()
+ yratio = self.readRatio()
+ return "(%s,%s)"%(xratio, yratio)
class String(BaseRecordHandler):
"""Textual content."""
@@ -433,6 +442,18 @@ class SlideViewInfoAtom(BaseRecordHandler):
self.appendLine("snap to shape: %s"%(self.readUnsignedInt(1)!=0))
# -------------------------------------------------------------------
+# special record handler: view info atom
+
+class ViewInfoAtom(BaseRecordHandler):
+ """View Info atom."""
+
+ def parseBytes (self):
+ self.appendLine("current scale: %s"%self.readScaling())
+ self.readBytes(24)
+ self.appendLine("origin: (%d,%d)"%(self.readSignedInt(4), self.readSignedInt(4)))
+ self.appendLine("zoom to fit: %s"%(self.readUnsignedInt(1)!=0))
+
+# -------------------------------------------------------------------
# special record handlers: ppt97 animation info
class AnimationInfo(BaseRecordHandler):
diff --git a/src/pptstream.py b/src/pptstream.py
index 06244a8..13f9ecb 100644
--- a/src/pptstream.py
+++ b/src/pptstream.py
@@ -228,7 +228,7 @@ recData = {
1018: ["DFF_PST_SlideViewInfo"],
1019: ["DFF_PST_GuideAtom"],
1020: ["DFF_PST_ViewInfo"],
- 1021: ["DFF_PST_ViewInfoAtom"],
+ 1021: ["DFF_PST_ViewInfoAtom", pptrecord.ViewInfoAtom],
1022: ["DFF_PST_SlideViewInfoAtom", pptrecord.SlideViewInfoAtom],
1023: ["DFF_PST_VBAInfo"],
1024: ["DFF_PST_VBAInfoAtom"],
commit a859c34443aade31a7e68cb8ce132cf793645f0f
Author: Tor Lillqvist <tlillqvist at suse.com>
Date: Thu May 3 15:15:10 2012 +0300
Add SlideViewInfoAtom handler
diff --git a/src/pptrecord.py b/src/pptrecord.py
index a8fe231..6e37c93 100644
--- a/src/pptrecord.py
+++ b/src/pptrecord.py
@@ -422,6 +422,17 @@ class SlidePersistAtom(BaseRecordHandler):
self.appendLine("unique slide id: %d"%self.readUnsignedInt(4))
# -------------------------------------------------------------------
+# special record handler: slide view info atom
+
+class SlideViewInfoAtom(BaseRecordHandler):
+ """Slide View Info atom."""
+
+ def parseBytes (self):
+ self.appendLine("guides visible: %s"%(self.readUnsignedInt(1)!=0))
+ self.appendLine("snap to grid: %s"%(self.readUnsignedInt(1)!=0))
+ self.appendLine("snap to shape: %s"%(self.readUnsignedInt(1)!=0))
+
+# -------------------------------------------------------------------
# special record handlers: ppt97 animation info
class AnimationInfo(BaseRecordHandler):
diff --git a/src/pptstream.py b/src/pptstream.py
index c45ac7a..06244a8 100644
--- a/src/pptstream.py
+++ b/src/pptstream.py
@@ -229,7 +229,7 @@ recData = {
1019: ["DFF_PST_GuideAtom"],
1020: ["DFF_PST_ViewInfo"],
1021: ["DFF_PST_ViewInfoAtom"],
- 1022: ["DFF_PST_SlideViewInfoAtom"],
+ 1022: ["DFF_PST_SlideViewInfoAtom", pptrecord.SlideViewInfoAtom],
1023: ["DFF_PST_VBAInfo"],
1024: ["DFF_PST_VBAInfoAtom"],
1025: ["DFF_PST_SSDocInfoAtom"],
commit bebeb28afb2502043f6e00eaa4d7d9f7d804bed2
Author: Tor Lillqvist <tlillqvist at suse.com>
Date: Thu May 3 15:11:37 2012 +0300
Add SlidePersistAtom handler
diff --git a/src/pptrecord.py b/src/pptrecord.py
index d13df90..a8fe231 100644
--- a/src/pptrecord.py
+++ b/src/pptrecord.py
@@ -1,3 +1,4 @@
+# -*- tab-width: 4; indent-tabs-mode: nil -*-
########################################################################
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -406,6 +407,21 @@ class SlideInfo(BaseRecordHandler):
self.appendLine("speed: %d"%self.readUnsignedInt(1))
# -------------------------------------------------------------------
+# special record handler: slide persist atom
+
+class SlidePersistAtom(BaseRecordHandler):
+ """Slide Persist atom."""
+
+ def parseBytes (self):
+ slideref=self.readUnsignedInt(4)
+ self.appendLine("logical slide reference: %4.4Xh (%d)"%(slideref, slideref))
+ flags=self.readUnsignedInt(4)
+ self.appendLine("outline view is collapsed: %s"%((flags & 0x02)!=0))
+ self.appendLine("slide contains shapes other than placeholders: %s"%((flags & 0x04)!=0))
+ self.appendLine("number of placeholder texts: %d"%self.readUnsignedInt(4))
+ self.appendLine("unique slide id: %d"%self.readUnsignedInt(4))
+
+# -------------------------------------------------------------------
# special record handlers: ppt97 animation info
class AnimationInfo(BaseRecordHandler):
diff --git a/src/pptstream.py b/src/pptstream.py
index 4468e81..c45ac7a 100644
--- a/src/pptstream.py
+++ b/src/pptstream.py
@@ -1,3 +1,4 @@
+# -*- tab-width: 4; indent-tabs-mode: nil -*-
########################################################################
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -217,7 +218,7 @@ recData = {
1008: ["DFF_PST_Notes"],
1009: ["DFF_PST_NotesAtom"],
1010: ["DFF_PST_Environment"],
- 1011: ["DFF_PST_SlidePersistAtom"],
+ 1011: ["DFF_PST_SlidePersistAtom", pptrecord.SlidePersistAtom],
1012: ["DFF_PST_Scheme"],
1013: ["DFF_PST_SchemeAtom"],
1014: ["DFF_PST_DocViewInfo"],
More information about the Libreoffice-commits
mailing list