summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/stylesheet/styles.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-04-25 20:31:25 +0900
committerRandy Morgan <[email protected]>2012-04-25 20:31:25 +0900
commit164c8a518c69cada031db80b903efbdc70b77864 (patch)
treef6c514fbbc09ec8f4d2cd684113ee1841798bdd7 /lib/axlsx/stylesheet/styles.rb
parent4242c992d411125d09519c27e56933c1e6a9ae16 (diff)
downloadcaxlsx-164c8a518c69cada031db80b903efbdc70b77864.tar.gz
caxlsx-164c8a518c69cada031db80b903efbdc70b77864.zip
properly return a numFmt object or numFmtId based on add style type info
Diffstat (limited to 'lib/axlsx/stylesheet/styles.rb')
-rw-r--r--lib/axlsx/stylesheet/styles.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb
index d3a7cbf5..0cd9458d 100644
--- a/lib/axlsx/stylesheet/styles.rb
+++ b/lib/axlsx/stylesheet/styles.rb
@@ -336,9 +336,8 @@ module Axlsx
if options[:format_code] || options[:type] == :dxf
#If this is a standard xf we pull from numFmts the highest current and increment for num_fmt
options[:num_fmt] ||= (@numFmts.map{ |num_fmt| num_fmt.numFmtId }.max + 1) if options[:type] != :dxf
- #BUG? should we be pulling the max from xdfs.numFmt when the type is :dxf?
numFmt = NumFmt.new(:numFmtId => options[:num_fmt] || 0, :formatCode=> options[:format_code].to_s)
- options[:type] == :dxf ? numFmt : numFmts << numFmt
+ options[:type] == :dxf ? numFmt : (numFmts << numFmt; numFmt.numFmtId)
else
options[:num_fmt]
end