summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/worksheet/col.rb
diff options
context:
space:
mode:
authorJurriaan Pruis <[email protected]>2014-01-15 23:44:02 +0100
committerJurriaan Pruis <[email protected]>2014-02-26 20:09:21 +0100
commitbe8e00332c73439cf17083173ea74f1505100df9 (patch)
tree383ec2e23fc0a14aa5ad90e139648a79814eeded /lib/axlsx/workbook/worksheet/col.rb
parenta271a7d0f26ecb26d01aad00e094744d6fe8b0d2 (diff)
downloadcaxlsx-be8e00332c73439cf17083173ea74f1505100df9.tar.gz
caxlsx-be8e00332c73439cf17083173ea74f1505100df9.zip
Huge refactoring
Do not create huge strings Let Row inherit from SimpleTypedList Optimized sanitizing Optimized validation And more..
Diffstat (limited to 'lib/axlsx/workbook/worksheet/col.rb')
-rw-r--r--lib/axlsx/workbook/worksheet/col.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/axlsx/workbook/worksheet/col.rb b/lib/axlsx/workbook/worksheet/col.rb
index 0a3edf87..01086ac3 100644
--- a/lib/axlsx/workbook/worksheet/col.rb
+++ b/lib/axlsx/workbook/worksheet/col.rb
@@ -122,22 +122,19 @@ module Axlsx
# @param [Boolean] use_autowidth If this is false, the cell's
# autowidth value will be ignored.
def update_width(cell, fixed_width=nil, use_autowidth=true)
- if fixed_width.is_a? Numeric
- self.width = fixed_width
- elsif use_autowidth
- cell_width = cell.autowidth
- self.width = cell_width unless (width || 0) > (cell_width || 0)
- #self.width = [width || 0, cell.autowidth || 0].max
- end
+ if fixed_width.is_a? Numeric
+ self.width = fixed_width
+ elsif use_autowidth
+ cell_width = cell.autowidth
+ self.width = cell_width unless (width || 0) > (cell_width || 0)
+ end
end
# Serialize this columns data to an xml string
# @param [String] str
# @return [String]
def to_xml_string(str = '')
- str << '<col '
- serialized_attributes str
- str << '/>'
+ serialized_tag('col', str)
end
end