diff options
| -rw-r--r-- | lib/axlsx/workbook/workbook.rb | 2 | ||||
| -rw-r--r-- | test/tc_package.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/axlsx/workbook/workbook.rb b/lib/axlsx/workbook/workbook.rb index c1d304a4..54dd9df1 100644 --- a/lib/axlsx/workbook/workbook.rb +++ b/lib/axlsx/workbook/workbook.rb @@ -313,6 +313,7 @@ require 'axlsx/workbook/worksheet/selection.rb' end end str << '</sheets>' + defined_names.to_xml_string(str) unless pivot_tables.empty? str << '<pivotCaches>' pivot_tables.each_with_index do |pivot_table, index| @@ -321,7 +322,6 @@ require 'axlsx/workbook/worksheet/selection.rb' end str << '</pivotCaches>' end - defined_names.to_xml_string(str) str << '</workbook>' end diff --git a/test/tc_package.rb b/test/tc_package.rb index bc683575..be303419 100644 --- a/test/tc_package.rb +++ b/test/tc_package.rb @@ -9,7 +9,7 @@ class TestPackage < Test::Unit::TestCase ws.add_row ['Yes!', 'We', 'can!'] ws.add_hyperlink :ref => ws.rows.first.cells.last, :location => 'https://github.com/randym' # TODO this needs to be confirmed and checked. Validation errors should not be happening here!!!!!! - #ws.workbook.add_defined_name("#{ws.name}!A1:C2", :name => '_xlnm.Print_Titles', :hidden => true) + ws.workbook.add_defined_name("#{ws.name}!A1:C2", :name => '_xlnm.Print_Titles', :hidden => true) ws.protect_range('A1:C1') ws.protect_range(ws.rows.last.cells) ws.add_comment :author => 'alice', :text => 'Hi Bob', :ref => 'A12' |
