def autowidth(widtharray)
      return if value.nil?
      if styles.cellXfs[style].alignment && styles.cellXfs[style].alignment.wrap_text
        first = true
        value.to_s.split(/\r?\n/, -1).each do |line|
          if first
            first = false
          else
            widtharray << 0
          end
          widtharray[-1] += string_width(line, font_size)
        end
      else
        widtharray[-1] += string_width(value.to_s, font_size)
      end
      widtharray
    end
def autowidth(widtharray)
      return if value.nil?
      if styles.cellXfs[style].alignment && styles.cellXfs[style].alignment.wrap_text
        first = true
        value.to_s.split(/\r?\n/, -1).each do |line|
          if first
            first = false
          else
            widtharray << 0
          end
          widtharray[-1] += string_width(line, font_size)
        end
      else
        widtharray[-1] += string_width(value.to_s, font_size)
      end
      widtharray
    end
Tries to work out the width of the longest line in the run
 @param [Array] widtharray this array is populated with the widths of each line in the run.
 @return [Array]