summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-06-20 19:40:59 +0900
committerRandy Morgan <[email protected]>2012-06-20 19:40:59 +0900
commitaa361626894b48fbd9ab2aa19d1e4e34ec704b33 (patch)
treeef579baf61693b9ac016a06b5e3621b6d9167c93 /lib
parent3d3d8e3aba0c49fe5adef5cf1058c3157314b2b2 (diff)
downloadcaxlsx-aa361626894b48fbd9ab2aa19d1e4e34ec704b33.tar.gz
caxlsx-aa361626894b48fbd9ab2aa19d1e4e34ec704b33.zip
parse out protected_range: NOTE excel does not support this part of the spec!
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/util/simple_typed_list.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/worksheet.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/axlsx/util/simple_typed_list.rb b/lib/axlsx/util/simple_typed_list.rb
index e3336678..e3516398 100644
--- a/lib/axlsx/util/simple_typed_list.rb
+++ b/lib/axlsx/util/simple_typed_list.rb
@@ -149,7 +149,7 @@ module Axlsx
def to_xml_string(str = '')
classname = @allowed_types[0].name.split('::').last
- el_name = serialize_as || (classname[0,1].downcase + classname[1..-1])
+ el_name = serialize_as.to_s || (classname[0,1].downcase + classname[1..-1])
str << '<' << el_name << ' count="' << @list.size.to_s << '">'
@list.each { |item| item.to_xml_string(str) }
str << '</' << el_name << '>'
diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb
index 513f0453..d5c1037b 100644
--- a/lib/axlsx/workbook/worksheet/worksheet.rb
+++ b/lib/axlsx/workbook/worksheet/worksheet.rb
@@ -541,6 +541,11 @@ module Axlsx
str.concat '</sheetData>'
str.concat "<autoFilter ref='%s'></autoFilter>" % @auto_filter if @auto_filter
@sheet_protection.to_xml_string(str) if @sheet_protection
+ unless @protected_ranges.empty?
+ str << '<protectedRanges>'
+ @protected_ranges.each { |pr| pr.to_xml_string(str) }
+ str << '</protectedRanges>'
+ end
str.concat "<mergeCells count='%s'>%s</mergeCells>" % [@merged_cells.size, @merged_cells.reduce('') { |memo, obj| memo += "<mergeCell ref='%s'></mergeCell>" % obj } ] unless @merged_cells.empty?
print_options.to_xml_string(str) if @print_options
page_margins.to_xml_string(str) if @page_margins