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

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

#write_styles(workbook, writer) ⇒ Object



508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'lib/spreadsheet/excel/writer/workbook.rb', line 508

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