diff options
| author | Geremia Taglialatela <[email protected]> | 2023-04-08 11:55:52 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-04-08 11:55:52 +0200 |
| commit | 48f392fb7752f14153126e9d154b4f9e2eef8fa7 (patch) | |
| tree | 35e6e5052cb33a7cd5245df137c80d4ec7cb9346 /lib/axlsx/stylesheet | |
| parent | 55526805cf28cc91a22df5811b26cd23bdefa8d3 (diff) | |
| download | caxlsx-48f392fb7752f14153126e9d154b4f9e2eef8fa7.tar.gz caxlsx-48f392fb7752f14153126e9d154b4f9e2eef8fa7.zip | |
Fix Layout/EmptyLineAfterGuardClause offenses
```
rubocop --only Layout/EmptyLineAfterGuardClause -a
```
Diffstat (limited to 'lib/axlsx/stylesheet')
| -rw-r--r-- | lib/axlsx/stylesheet/color.rb | 1 | ||||
| -rw-r--r-- | lib/axlsx/stylesheet/styles.rb | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/axlsx/stylesheet/color.rb b/lib/axlsx/stylesheet/color.rb index 28afaf11..4f358a78 100644 --- a/lib/axlsx/stylesheet/color.rb +++ b/lib/axlsx/stylesheet/color.rb @@ -54,6 +54,7 @@ module Axlsx v = v * 3 if v.size == 2 v = v.rjust(8, 'FF') raise ArgumentError, "Invalid color rgb value: #{v}." unless v.match(/[0-9A-F]{8}/) + @rgb = v end diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb index e55e2c95..2a210776 100644 --- a/lib/axlsx/stylesheet/styles.rb +++ b/lib/axlsx/stylesheet/styles.rb @@ -292,6 +292,7 @@ module Axlsx # @return [CellProtection] def parse_protection_options(options = {}) return if (options.keys & [:hidden, :locked]).empty? + CellProtection.new(options) end @@ -302,6 +303,7 @@ module Axlsx # @see CellAlignment def parse_alignment_options(options = {}) return unless options[:alignment] + CellAlignment.new options[:alignment] end @@ -322,6 +324,7 @@ 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? + Axlsx.instance_values_for(fonts.first).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) @@ -338,6 +341,7 @@ module Axlsx # @return [Fill|Integer] def parse_fill_options(options = {}) return unless options[:bg_color] + color = Color.new(:rgb => options[:bg_color]) dxf = options[:type] == :dxf color_key = dxf ? :bgColor : :fgColor |
