summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/stylesheet
diff options
context:
space:
mode:
authorJurriaan Pruis <[email protected]>2014-04-04 11:39:25 +0200
committerJurriaan Pruis <[email protected]>2014-04-04 11:39:25 +0200
commit5ccab460b65f597398f1d8a1b2a5a83039b80a9e (patch)
tree6fa3a9e38f81e6f59693acf8861b12938d0030bf /lib/axlsx/stylesheet
parentc649ee7d5ac699d0fc5a36550f502216f9b7318f (diff)
downloadcaxlsx-5ccab460b65f597398f1d8a1b2a5a83039b80a9e.tar.gz
caxlsx-5ccab460b65f597398f1d8a1b2a5a83039b80a9e.zip
Fix boolean values so the output matches Excel and works on Numbers
Use 1 or 0 instead of 'true' or 'false' in the XML output
Diffstat (limited to 'lib/axlsx/stylesheet')
-rw-r--r--lib/axlsx/stylesheet/font.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/axlsx/stylesheet/font.rb b/lib/axlsx/stylesheet/font.rb
index 6d77d58b..8770297d 100644
--- a/lib/axlsx/stylesheet/font.rb
+++ b/lib/axlsx/stylesheet/font.rb
@@ -140,6 +140,9 @@ module Axlsx
def to_xml_string(str = '')
str << '<font>'
instance_values.each do |k, v|
+ if v == true || v == false
+ v = v ? 1 : 0
+ end
v.is_a?(Color) ? v.to_xml_string(str) : (str << ('<' << k.to_s << ' val="' << v.to_s << '"/>'))
end
str << '</font>'