diff options
| -rw-r--r-- | lib/axlsx/stylesheet/font.rb | 3 | ||||
| -rw-r--r-- | test/stylesheet/tc_styles.rb | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/axlsx/stylesheet/font.rb b/lib/axlsx/stylesheet/font.rb index 657c4c30..d35aebf8 100644 --- a/lib/axlsx/stylesheet/font.rb +++ b/lib/axlsx/stylesheet/font.rb @@ -103,7 +103,8 @@ module Axlsx # @option options [Integer] sz def initialize(options={}) options.each do |o| - self.send("#{o[0]}=", o[1]) if self.respond_to? o[0] + next if o[1].nil? + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" end end # @see name diff --git a/test/stylesheet/tc_styles.rb b/test/stylesheet/tc_styles.rb index 18235fff..719a066b 100644 --- a/test/stylesheet/tc_styles.rb +++ b/test/stylesheet/tc_styles.rb @@ -46,7 +46,7 @@ class TestStyles < Test::Unit::TestCase num_fmt = {:num_fmt => 5} both = { :format_code => "#000", :num_fmt => 0 } assert_equal(@styles.parse_num_fmt_options, nil, 'noop if neither :format_code or :num_fmt exist') - max = @styles.numFmts.map{ |num_fmt| num_fmt.numFmtId }.max + max = @styles.numFmts.map{ |nf| nf.numFmtId }.max @styles.parse_num_fmt_options(f_code) assert_equal(@styles.numFmts.last.numFmtId, max + 1, "new numfmts gets next available id") assert(@styles.parse_num_fmt_options(num_fmt).is_a?(Integer), "Should return the provided num_fmt if not dxf") |
