summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/stylesheet
diff options
context:
space:
mode:
authorZsolt Kozaroczy <[email protected]>2023-05-22 10:33:45 +0200
committerGitHub <[email protected]>2023-05-22 10:33:45 +0200
commit0f812ee216076a4c713f6cadb0751bac45f6b9da (patch)
tree95549c3a1899db8791268a71d4a33f5b9ce7847f /lib/axlsx/stylesheet
parent56ff466673b8aff9a6508e29ebfaf4ee21f5fae9 (diff)
parent611b57cdd44f3f5e91394c699ad98b7c05330a2e (diff)
downloadcaxlsx-0f812ee216076a4c713f6cadb0751bac45f6b9da.tar.gz
caxlsx-0f812ee216076a4c713f6cadb0751bac45f6b9da.zip
Merge pull request #242 from tagliala/chore/fix-minor-safe-offenses
Remove minor safe offenses
Diffstat (limited to 'lib/axlsx/stylesheet')
-rw-r--r--lib/axlsx/stylesheet/color.rb2
-rw-r--r--lib/axlsx/stylesheet/styles.rb10
2 files changed, 5 insertions, 7 deletions
diff --git a/lib/axlsx/stylesheet/color.rb b/lib/axlsx/stylesheet/color.rb
index 87308bb1..24fe3bc3 100644
--- a/lib/axlsx/stylesheet/color.rb
+++ b/lib/axlsx/stylesheet/color.rb
@@ -53,7 +53,7 @@ module Axlsx
def rgb=(v)
Axlsx::validate_string(v)
v = v.upcase
- v = v * 3 if v.size == 2
+ v *= 3 if v.size == 2
v = v.rjust(8, 'FF')
raise ArgumentError, "Invalid color rgb value: #{v}." unless /[0-9A-F]{8}/.match?(v)
diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb
index f67c711a..625f6a02 100644
--- a/lib/axlsx/stylesheet/styles.rb
+++ b/lib/axlsx/stylesheet/styles.rb
@@ -278,11 +278,9 @@ module Axlsx
# Add styles to style_index cache for re-use
style_index[xf_index] = raw_style
- return xf_index
+ xf_index
else
- dxf_index = (dxfs << style)
-
- return dxf_index
+ dxfs << style
end
end
@@ -457,9 +455,9 @@ module Axlsx
end
if options[:type] == :dxf
- return border
+ border
else
- return borders << border
+ borders << border
end
end