summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/stylesheet
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-09-14 18:13:40 +0900
committerRandy Morgan <[email protected]>2012-09-14 18:13:40 +0900
commit55a0dd9d3b522876dc97e109b2d38b261cdaf752 (patch)
treefd69743e98a045f45a7e16dcc6e90bb3dd235736 /lib/axlsx/stylesheet
parent3e4ee23a46c12f1a634f2cadee1798b0cb1000ff (diff)
downloadcaxlsx-55a0dd9d3b522876dc97e109b2d38b261cdaf752.tar.gz
caxlsx-55a0dd9d3b522876dc97e109b2d38b261cdaf752.zip
Patch for 1.8.7 and update table style example to use custom name
Diffstat (limited to 'lib/axlsx/stylesheet')
-rw-r--r--lib/axlsx/stylesheet/styles.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb
index fd956a8c..240d86fa 100644
--- a/lib/axlsx/stylesheet/styles.rb
+++ b/lib/axlsx/stylesheet/styles.rb
@@ -279,7 +279,11 @@ module Axlsx
# @return [Font|Integer]
def parse_font_options(options={})
return if (options.keys & [:fg_color, :sz, :b, :i, :u, :strike, :outline, :shadow, :charset, :family, :font_name]).empty?
- font = Font.new(fonts.first.instance_values.merge(options))
+ fonts.first.instance_values.each do |key, value|
+ # Thanks for that 1.8.7 - cant do a simple merge...
+ options[key.to_sym] = value unless options.keys.include?(key.to_sym)
+ end
+ font = Font.new(options)
font.color = Color.new(:rgb => options[:fg_color]) if options[:fg_color]
font.name = options[:font_name] if options[:font_name]
options[:type] == :dxf ? font : fonts << font