diff options
| author | Paul Kmiec <[email protected]> | 2023-05-07 16:09:03 -0700 |
|---|---|---|
| committer | Paul Kmiec <[email protected]> | 2023-05-09 08:21:58 -0700 |
| commit | 88c26606594a2024e17adff9dd9853812dc839cc (patch) | |
| tree | a2206699b97209f5648092f9ceb08dced035a998 /lib/axlsx/workbook/worksheet/data_validation.rb | |
| parent | 3b4509a56c9f2fce8bf3194062458ce74c0d41ca (diff) | |
| download | caxlsx-88c26606594a2024e17adff9dd9853812dc839cc.tar.gz caxlsx-88c26606594a2024e17adff9dd9853812dc839cc.zip | |
Do not change the whitespace that is produced by to_xml_string's
Diffstat (limited to 'lib/axlsx/workbook/worksheet/data_validation.rb')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/data_validation.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/axlsx/workbook/worksheet/data_validation.rb b/lib/axlsx/workbook/worksheet/data_validation.rb index d5fa5908..eca90743 100644 --- a/lib/axlsx/workbook/worksheet/data_validation.rb +++ b/lib/axlsx/workbook/worksheet/data_validation.rb @@ -235,10 +235,12 @@ module Axlsx # @return [String] def to_xml_string(str = +'') valid_attributes = get_valid_attributes + h = Axlsx.instance_values_for(self).select { |key, _| valid_attributes.include?(key.to_sym) && !CHILD_ELEMENTS.include?(key.to_sym) } str << '<dataValidation ' - Axlsx.instance_values_for(self).each do |key, value| - str << key << '="' << Axlsx.booleanize(value).to_s << '" ' if (valid_attributes.include?(key.to_sym) && !CHILD_ELEMENTS.include?(key.to_sym)) + h.each_with_index do |key_value, index| + str << ' ' unless index.zero? + str << key_value.first << '="' << Axlsx.booleanize(key_value.last).to_s << '"' end str << '>' str << '<formula1>' << self.formula1 << '</formula1>' if @formula1 and valid_attributes.include?(:formula1) |
