summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-02-12 13:01:27 +0900
committerRandy Morgan <[email protected]>2012-02-12 13:01:27 +0900
commit669570ed0be33441da3a128e8eb37aece90e4bdd (patch)
tree2d70d6099f1c744635523380797a4823e923ff22
parent376988c854889d7b9708601bce11575a11491bee (diff)
downloadcaxlsx-669570ed0be33441da3a128e8eb37aece90e4bdd.tar.gz
caxlsx-669570ed0be33441da3a128e8eb37aece90e4bdd.zip
patching unbalanced ends
-rw-r--r--lib/axlsx/workbook/shared_strings_table.rb37
1 files changed, 18 insertions, 19 deletions
diff --git a/lib/axlsx/workbook/shared_strings_table.rb b/lib/axlsx/workbook/shared_strings_table.rb
index afd8498c..f8c2361e 100644
--- a/lib/axlsx/workbook/shared_strings_table.rb
+++ b/lib/axlsx/workbook/shared_strings_table.rb
@@ -32,7 +32,7 @@ module Axlsx
cells = cells.flatten.reject { |c| c.type != :string }
@count = cells.size
@unique_cells = []
- resolve cells
+ resolve(cells)
end
@@ -48,25 +48,24 @@ module Axlsx
end
builder.to_xml(:save_with => 0)
end
- end
-
- private
- # Interate over all of the cells in the array.
- # if our unique cells array does not contain a sharable cell,
- # add the cell to our unique cells array and set the ssti attribute on the index of this cell in the shared strings table
- # if a sharable cell already exists in our unique_cells array, set the ssti attribute of the cell and move on.
- # @return [Array] unique cells
- def resolve(cells)
- cells.each do |cell|
- index = @unique_cells.index { |item| item.shareable(cell) }
- if index == nil
- cell.send :ssti=, @unique_cells.size
- @unique_cells << cell
- else
- cell.send :ssti=, index
+ private
+
+ # Interate over all of the cells in the array.
+ # if our unique cells array does not contain a sharable cell,
+ # add the cell to our unique cells array and set the ssti attribute on the index of this cell in the shared strings table
+ # if a sharable cell already exists in our unique_cells array, set the ssti attribute of the cell and move on.
+ # @return [Array] unique cells
+ def resolve(cells)
+ cells.each do |cell|
+ index = @unique_cells.index { |item| item.shareable(cell) }
+ if index == nil
+ cell.send :ssti=, @unique_cells.size
+ @unique_cells << cell
+ else
+ cell.send :ssti=, index
+ end
end
- end
+ end
end
-
end