summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-09-30 09:08:50 +0900
committerRandy Morgan <[email protected]>2012-09-30 09:08:50 +0900
commita1f64c74f44c3ce2c32061d1adf9baab94aef4ba (patch)
tree7513316f605d81cba9f515dd6670eaa106d5ad04 /lib
parent000423e08d831fed83faca86f4473f966f25f86b (diff)
downloadcaxlsx-a1f64c74f44c3ce2c32061d1adf9baab94aef4ba.tar.gz
caxlsx-a1f64c74f44c3ce2c32061d1adf9baab94aef4ba.zip
Finished and Specced Auto Filter with Filters (standard) filter support
This means you can add autofilters that will restrict the visible rows based on a specified value.
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb b/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb
index 0dd57283..05da57ef 100644
--- a/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb
+++ b/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb
@@ -54,7 +54,8 @@ module Axlsx
start_point = Axlsx::name_to_indices(first_cell)
end_point = Axlsx::name_to_indices(last_cell)
# The +1 is so we skip the header row with the filter drop downs
- rows = worksheet.rows[(start_point.last+1)..end_point.last]
+ rows = worksheet.rows[(start_point.last+1)..end_point.last] || []
+
column_offset = start_point.first
columns.each do |column|
rows.each do |row|