summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorPaul Kmiec <[email protected]>2023-05-15 17:04:59 -0700
committerPaul Kmiec <[email protected]>2023-05-15 17:04:59 -0700
commit1201ef7145463a14d263a093d7d53a2f235e48e0 (patch)
treec4e60b2bd74fb22fb93e3bad1cef15f7bdc4e244 /lib
parent447b2522bc4a06c8436e708eae40cf7244dc0ec4 (diff)
downloadcaxlsx-1201ef7145463a14d263a093d7d53a2f235e48e0.tar.gz
caxlsx-1201ef7145463a14d263a093d7d53a2f235e48e0.zip
Remove ability to set `u=` to true in favor of :single
The `u=` would convert `true` to `:single` for backwards compatibility. However, it is more explicit to set it to `:single` or one of the other underline options instead of relying on the conversion.
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/util/validators.rb4
-rw-r--r--lib/axlsx/workbook/worksheet/cell.rb4
2 files changed, 2 insertions, 6 deletions
diff --git a/lib/axlsx/util/validators.rb b/lib/axlsx/util/validators.rb
index 752ffc76..e9cf13b6 100644
--- a/lib/axlsx/util/validators.rb
+++ b/lib/axlsx/util/validators.rb
@@ -107,9 +107,7 @@ module Axlsx
end
VALID_BOOLEAN_CLASSES = [TrueClass, FalseClass, Integer, String, Symbol].freeze
- VALID_BOOLEAN_TRUE_VALUES = [true, 1, '1', 'true', :true].freeze
- VALID_BOOLEAN_FALSE_VALUES = [false, 0, '0', 'false', :false].freeze
- VALID_BOOLEAN_VALUES = VALID_BOOLEAN_TRUE_VALUES.zip(VALID_BOOLEAN_FALSE_VALUES).flatten.freeze
+ VALID_BOOLEAN_VALUES = [true, false, 1, 0, '1', '0', 'true', 'false', :true, :false].freeze
BOOLEAN_VALIDATOR = lambda { |arg| VALID_BOOLEAN_VALUES.include?(arg) }
# Requires that the value is a form that can be evaluated as a boolean in an xml document.
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb
index b44656e3..cbf55482 100644
--- a/lib/axlsx/workbook/worksheet/cell.rb
+++ b/lib/axlsx/workbook/worksheet/cell.rb
@@ -285,15 +285,13 @@ module Axlsx
def extend=(v) set_run_style :validate_boolean, :extend, v; end
# The inline underline property for the cell.
- # It must be one of :none, :single, :double, :singleAccounting, :doubleAccounting, true
+ # It must be one of :none, :single, :double, :singleAccounting, :doubleAccounting
# @return [Boolean]
# @return [String]
- # @note true is for backwards compatability and is reassigned to :single
attr_reader :u
# @see u
def u=(v)
- v = :single if VALID_BOOLEAN_TRUE_VALUES.include?(v)
set_run_style :validate_cell_u, :u, v
end