Method: Spreadsheet::Excel::Writer::Workbook#write_styles

Defined in:
lib/spreadsheet/excel/writer/workbook.rb

#write_styles(workbook, writer) ⇒ Object



552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
# File 'lib/spreadsheet/excel/writer/workbook.rb', line 552

def write_styles workbook, writer
  # TODO: Style implementation. The following is simply a standard builtin
  #       style.
  # TODO: User defined styles
  data = [
    0x8000, #   Bit  Mask    Contents
            # 11- 0  0x0fff  Index to style XF record (➜ 6.115)
            #    15  0x8000  Always 1 for built-in styles
    0x00,   # Identifier of the built-in cell style:
            # 0x00 = Normal
            # 0x01 = RowLevel_lv (see next field)
            # 0x02 = ColLevel_lv (see next field)
            # 0x03 = Comma
            # 0x04 = Currency
            # 0x05 = Percent
            # 0x06 = Comma [0] (BIFF4-BIFF8)
            # 0x07 = Currency [0] (BIFF4-BIFF8)
            # 0x08 = Hyperlink (BIFF8)
            # 0x09 = Followed Hyperlink (BIFF8)
    0xff,   # Level for RowLevel or ColLevel style (zero-based, lv),
            # 0xff otherwise
            # The RowLevel and ColLevel styles specify the formatting of
            # subtotal cells in a specific outline level. The level is
            # specified by the last field in the STYLE record. Valid values
            # are 0…6 for the outline levels 1…7.
  ]
  write_op writer, 0x0293, data.pack('vC2')
end