summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/stylesheet/styles.rb
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-05-27 18:55:25 +0200
committerGeremia Taglialatela <[email protected]>2023-05-31 09:41:47 +0200
commitd9b42a4da1d35e5741da67dfca7dfc9a73518787 (patch)
treeb50a13988274298233f249eee776d67a8629b154 /lib/axlsx/stylesheet/styles.rb
parent8918a00eb0ff7b40240be5c94c4c245c95579acb (diff)
downloadcaxlsx-d9b42a4da1d35e5741da67dfca7dfc9a73518787.tar.gz
caxlsx-d9b42a4da1d35e5741da67dfca7dfc9a73518787.zip
Fix Style/ConditionalAssignment offenses
Diffstat (limited to 'lib/axlsx/stylesheet/styles.rb')
-rw-r--r--lib/axlsx/stylesheet/styles.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb
index c3dd8d06..91055c96 100644
--- a/lib/axlsx/stylesheet/styles.rb
+++ b/lib/axlsx/stylesheet/styles.rb
@@ -265,12 +265,12 @@ module Axlsx
alignment = parse_alignment_options options
protection = parse_protection_options options
- case options[:type]
- when :dxf
- style = Dxf.new :fill => fill, :font => font, :numFmt => numFmt, :border => border, :alignment => alignment, :protection => protection
- else
- style = Xf.new :fillId => fill || 0, :fontId => font || 0, :numFmtId => numFmt || 0, :borderId => border || 0, :alignment => alignment, :protection => protection, :applyFill => !fill.nil?, :applyFont => !font.nil?, :applyNumberFormat => !numFmt.nil?, :applyBorder => !border.nil?, :applyAlignment => !alignment.nil?, :applyProtection => !protection.nil?
- end
+ style = case options[:type]
+ when :dxf
+ Dxf.new :fill => fill, :font => font, :numFmt => numFmt, :border => border, :alignment => alignment, :protection => protection
+ else
+ Xf.new :fillId => fill || 0, :fontId => font || 0, :numFmtId => numFmt || 0, :borderId => border || 0, :alignment => alignment, :protection => protection, :applyFill => !fill.nil?, :applyFont => !font.nil?, :applyNumberFormat => !numFmt.nil?, :applyBorder => !border.nil?, :applyAlignment => !alignment.nil?, :applyProtection => !protection.nil?
+ end
if options[:type] == :xf
xf_index = (cellXfs << style)