diff options
| author | Paul Kmiec <[email protected]> | 2023-05-04 16:31:08 -0700 |
|---|---|---|
| committer | Paul Kmiec <[email protected]> | 2023-05-04 18:02:55 -0700 |
| commit | fabe8cb2571c8865270247ca78ddc01d493a9ee1 (patch) | |
| tree | 27fe0b0df8c9bec8f746d92a0d128cad197027b2 /lib/axlsx/workbook/worksheet/pivot_table.rb | |
| parent | fef93ec8ae2caf8a3f8310dbf8101c103e5905e4 (diff) | |
| download | caxlsx-fabe8cb2571c8865270247ca78ddc01d493a9ee1.tar.gz caxlsx-fabe8cb2571c8865270247ca78ddc01d493a9ee1.zip | |
Fix tests / code to work with frozen string literals
Diffstat (limited to 'lib/axlsx/workbook/worksheet/pivot_table.rb')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/pivot_table.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/axlsx/workbook/worksheet/pivot_table.rb b/lib/axlsx/workbook/worksheet/pivot_table.rb index 8c6cb83e..e97b8119 100644 --- a/lib/axlsx/workbook/worksheet/pivot_table.rb +++ b/lib/axlsx/workbook/worksheet/pivot_table.rb @@ -186,13 +186,13 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '<?xml version="1.0" encoding="UTF-8"?>' - str << ('<pivotTableDefinition xmlns="' << XML_NS << '" name="' << name << '" cacheId="' << cache_definition.cache_id.to_s << '"' << (data.size <= 1 ? ' dataOnRows="1"' : '') << ' applyNumberFormats="0" applyBorderFormats="0" applyFontFormats="0" applyPatternFormats="0" applyAlignmentFormats="0" applyWidthHeightFormats="1" dataCaption="Data" showMultipleLabel="0" showMemberPropertyTips="0" useAutoFormatting="1" indent="0" compact="0" compactData="0" gridDropZones="1" multipleFieldFilters="0">') + str << (+'<pivotTableDefinition xmlns="' << XML_NS << '" name="' << name << '" cacheId="' << cache_definition.cache_id.to_s << '"' << (data.size <= 1 ? ' dataOnRows="1"' : '') << ' applyNumberFormats="0" applyBorderFormats="0" applyFontFormats="0" applyPatternFormats="0" applyAlignmentFormats="0" applyWidthHeightFormats="1" dataCaption="Data" showMultipleLabel="0" showMemberPropertyTips="0" useAutoFormatting="1" indent="0" compact="0" compactData="0" gridDropZones="1" multipleFieldFilters="0">') - str << ('<location firstDataCol="1" firstDataRow="1" firstHeaderRow="1" ref="' << ref << '"/>') - str << ('<pivotFields count="' << header_cells_count.to_s << '">') + str << (+'<location firstDataCol="1" firstDataRow="1" firstHeaderRow="1" ref="' << ref << '"/>') + str << (+'<pivotFields count="' << header_cells_count.to_s << '">') header_cell_values.each do |cell_value| subtotal = !no_subtotals_on_headers.include?(cell_value) @@ -205,12 +205,12 @@ module Axlsx str << '<rowFields count="1"><field x="-2"/></rowFields>' str << '<rowItems count="2"><i><x/></i> <i i="1"><x v="1"/></i></rowItems>' else - str << ('<rowFields count="' << rows.size.to_s << '">') + str << (+'<rowFields count="' << rows.size.to_s << '">') rows.each do |row_value| - str << ('<field x="' << header_index_of(row_value).to_s << '"/>') + str << (+'<field x="' << header_index_of(row_value).to_s << '"/>') end str << '</rowFields>' - str << ('<rowItems count="' << rows.size.to_s << '">') + str << (+'<rowItems count="' << rows.size.to_s << '">') rows.size.times do |i| str << '<i/>' end @@ -229,16 +229,16 @@ module Axlsx str << '<colItems count="1"><i/></colItems>' end else - str << ('<colFields count="' << columns.size.to_s << '">') + str << (+'<colFields count="' << columns.size.to_s << '">') columns.each do |column_value| - str << ('<field x="' << header_index_of(column_value).to_s << '"/>') + str << (+'<field x="' << header_index_of(column_value).to_s << '"/>') end str << '</colFields>' end unless pages.empty? - str << ('<pageFields count="' << pages.size.to_s << '">') + str << (+'<pageFields count="' << pages.size.to_s << '">') pages.each do |page_value| - str << ('<pageField fld="' << header_index_of(page_value).to_s << '"/>') + str << (+'<pageField fld="' << header_index_of(page_value).to_s << '"/>') end str << '</pageFields>' end |
