diff options
| author | raiis <[email protected]> | 2012-11-28 00:36:51 +0200 |
|---|---|---|
| committer | raiis <[email protected]> | 2012-11-28 00:36:51 +0200 |
| commit | e5c43799db3c88938a8abaefab61d8018c07a82e (patch) | |
| tree | ba30f2b0ef787c95c652e53945ed8abb21749f0f /lib/axlsx/stylesheet/styles.rb | |
| parent | 0962f913904343db03d253cc72681c8213aacea3 (diff) | |
| download | caxlsx-e5c43799db3c88938a8abaefab61d8018c07a82e.tar.gz caxlsx-e5c43799db3c88938a8abaefab61d8018c07a82e.zip | |
Better way hot to override borders style.
Diffstat (limited to 'lib/axlsx/stylesheet/styles.rb')
| -rw-r--r-- | lib/axlsx/stylesheet/styles.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb index ab2903f2..74894052 100644 --- a/lib/axlsx/stylesheet/styles.rb +++ b/lib/axlsx/stylesheet/styles.rb @@ -321,10 +321,9 @@ module Axlsx raise ArgumentError, (ERR_INVALID_BORDER_OPTIONS % b_opts) unless b_opts.keys.include?(:style) && b_opts.keys.include?(:color) border = Border.new b_opts (b_opts[:edges] || [:left, :right, :top, :bottom]).each do |edge| - sb_opts = options["border_#{edge}".to_sym] - style = (!sb_opts.nil? && sb_opts.keys.include?(:style)) ? sb_opts[:style] : b_opts[:style] - color = (!sb_opts.nil? && sb_opts.keys.include?(:color)) ? sb_opts[:color] : b_opts[:color] - b_options = { :name => edge, :style => style, :color => Color.new(:rgb => color) } + edge_options = options["border_#{edge}".to_sym] || {} + border_edge = b_opts.merge(edge_options) + b_options = { :name => edge, :style => border_edge[:style], :color => Color.new(:rgb => border_edge[:color]) } border.prs << BorderPr.new(b_options) end options[:type] == :dxf ? border : borders << border |
