# File lib/spreadsheet/excel/writer/format.rb, line 220
  def xf_used_attr
    atr_num = num_format & 1
    atr_fnt = font_index & 1
    atr_fnt = 1 unless @format.font.color == :text
    atr_alc = 0
    if horizontal_align != 0 \
      || vertical_align != 2 \
      || indent_level > 0 \
      || shrink? || merge_range? || text_wrap?
    then
      atr_alc = 1
    end
    atr_bdr = [top, bottom, left, right, cross_up, cross_down].max
    atr_pat = 0
    if  @format.pattern_fg_color != :border \
      || @format.pattern_bg_color != :pattern_bg \
      || pattern != 0x00
    then
      atr_pat = 1
    end
    atr_prot = hidden? || locked? ? 1 : 0
    attrs  = atr_num
    attrs |= atr_fnt << 1
    attrs |= atr_alc << 2
    attrs |= atr_bdr << 3
    attrs |= atr_pat << 4
    attrs |= atr_prot << 5
    attrs << 2
  end