[Libreoffice-commits] .: 2 commits - src/globals.py src/xlsrecord.py src/xlsstream.py

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Aug 8 13:13:46 PDT 2011


 src/globals.py   |    8 ++++++++
 src/xlsrecord.py |   11 +++++++++++
 src/xlsstream.py |    5 +++--
 3 files changed, 22 insertions(+), 2 deletions(-)

New commits:
commit 12b571ba40be6151e1178d8ce1b25284464099ca
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Mon Aug 8 16:13:58 2011 -0400

    Properly named BEGIN and END.
    
    Beginning and end of chart sheet substream, respectively.  These
    records hold no data.

diff --git a/src/xlsstream.py b/src/xlsstream.py
index 66cacf6..651f856 100644
--- a/src/xlsstream.py
+++ b/src/xlsstream.py
@@ -265,8 +265,8 @@ recData = {
     0x1026: ["CHFONT", "?"],
     0x1027: ["CHOBJECTLINK", "?"],
     0x1032: ["CHFRAME", "Border and Area Formatting of A Chart"],
-    0x1033: ["CHBEGIN", "Start of Chart Record Block"],
-    0x1034: ["CHEND", "End of Chart Record Block"],
+    0x1033: ["BEGIN", "Start of Chart Sheet Substream"],
+    0x1034: ["END", "End of Chart Sheet Substream"],
     0x1035: ["CHPLOTFRAME", "Chart Plot Frame"],
     0x103A: ["CHCHART3D", "?"],
     0x103C: ["CHPICFORMAT", "?"],
commit 5113300d78c848e586c97048025b276971d4fdb1
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Mon Aug 8 16:09:31 2011 -0400

    Handler for PLOTGROWTH.
    
    Font scaling info in the plot area.

diff --git a/src/globals.py b/src/globals.py
index 8f757e5..ca7a92e 100644
--- a/src/globals.py
+++ b/src/globals.py
@@ -108,6 +108,14 @@ class ByteStream(object):
         self.moveForward (byteLen)
         return text
 
+    def readFixedPoint (self):
+        # [MS-OSHARED] Section 2.2.1.6 FixedPoint
+        integral = self.readSignedInt(2)
+        fractional = self.readUnsignedInt(2)
+        val = 0.0
+        val += integral + (fractional / 65536.0)
+        return val
+
     def moveBack (self, byteCount):
         self.pos -= byteCount
         if self.pos < 0:
diff --git a/src/xlsrecord.py b/src/xlsrecord.py
index 13a6a89..b75225b 100644
--- a/src/xlsrecord.py
+++ b/src/xlsrecord.py
@@ -1270,6 +1270,17 @@ class Obj(BaseRecordHandler):
         self.appendLineBoolean("  automatic fill style", autoFill)
         self.appendLineBoolean("  automatic line style", autoLine)
 
+class PlotGrowth(BaseRecordHandler):
+
+    def __parseBytes (self):
+        self.dx = self.readFixedPoint()
+        self.dy = self.readFixedPoint()
+
+    def parseBytes (self):
+        self.__parseBytes()
+        self.appendLine("horizontal growth: %g"%self.dx)
+        self.appendLine("vertical growth: %g"%self.dy)
+
 class PrintSize(BaseRecordHandler):
 
     Types = [
diff --git a/src/xlsstream.py b/src/xlsstream.py
index c1d0bf5..66cacf6 100644
--- a/src/xlsstream.py
+++ b/src/xlsstream.py
@@ -290,6 +290,7 @@ recData = {
     0x1060: ["FBI", "Font Information for Chart", xlsrecord.Fbi],
     0x1061: ["CHPIEEXT", "?"],
     0x1062: ["CHLABELRANGE2", "?"],
+    0x1064: ["PLOTGROWTH", "Font Scaling Information in the Plot Area", xlsrecord.PlotGrowth],
     0x1065: ["CHSIINDEX*", "?"],
     0x1066: ["CHESCHERFORMAT", "?"]
 }


More information about the Libreoffice-commits mailing list