[ooo-build-commit] scratch/mso-dumper
Kohei Yoshida
kohei at kemper.freedesktop.org
Mon Jan 4 16:00:18 PST 2010
scratch/mso-dumper/src/globals.py | 3 +++
scratch/mso-dumper/src/node.py | 2 +-
scratch/mso-dumper/src/xlsrecord.py | 4 +++-
3 files changed, 7 insertions(+), 2 deletions(-)
New commits:
commit b447d684b7453d32d10bd181fb112443e159b03c
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Jan 4 14:24:10 2010 -0500
[xls-dump] Fixed several bugs with number handling.
* scratch/mso-dumper/src/globals.py: added global debug() function.
* scratch/mso-dumper/src/node.py: convert 'long' number type to string.
* scratch/mso-dumper/src/xlsrecord.py: when dividing an RK number, don't
forget that the final value is a floating point.
diff --git a/scratch/mso-dumper/src/globals.py b/scratch/mso-dumper/src/globals.py
index 0ae4959..b522d00 100644
--- a/scratch/mso-dumper/src/globals.py
+++ b/scratch/mso-dumper/src/globals.py
@@ -98,6 +98,9 @@ def output (msg):
def error (msg):
sys.stderr.write("Error: " + msg)
+def debug (msg):
+ sys.stderr.write("DEBUG: %s\n"%msg)
+
def encodeName (name):
"""Encode name that contains unprintable characters."""
diff --git a/scratch/mso-dumper/src/node.py b/scratch/mso-dumper/src/node.py
index 35158dc..b1d7910 100644
--- a/scratch/mso-dumper/src/node.py
+++ b/scratch/mso-dumper/src/node.py
@@ -126,7 +126,7 @@ def convertAttrValue (val):
val = "true"
else:
val = "false"
- elif type(val) == type(0):
+ elif type(val) == type(0) or type(val) == type(0L):
val = "%d"%val
elif type(val) == type(0.0):
val = "%g"%val
diff --git a/scratch/mso-dumper/src/xlsrecord.py b/scratch/mso-dumper/src/xlsrecord.py
index 5acdf3f..1dc1d44 100644
--- a/scratch/mso-dumper/src/xlsrecord.py
+++ b/scratch/mso-dumper/src/xlsrecord.py
@@ -2,6 +2,8 @@
import struct, sys
import globals, formula, xlsmodel
+from globals import debug
+
# -------------------------------------------------------------------
# record handler classes
@@ -36,7 +38,7 @@ def decodeRK (rkval):
realVal = struct.unpack('<d', tmpBytes)[0]
if multi100:
- realVal /= 100
+ realVal /= 100.0
return realVal
More information about the ooo-build-commit
mailing list