lib/axlsx/workbook/worksheet/col.rb in axlsx-2.0.1 vs lib/axlsx/workbook/worksheet/col.rb in axlsx-2.1.0.pre
- old
+ new
@@ -120,25 +120,22 @@
# @param [Integer] fixed_width If this is specified the width is set
# to this value and the cell's attributes are ignored.
# @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
end