def set_row(*args)
      return unless args[0]
      row = args[0]
      height = args[1] || @default_height
      xf     = args[2]
      hidden = args[3] || 0
      level  = args[4] || 0
      collapsed = args[5] || 0

      # Get the default row height.
      default_height = @default_row_height

      # Use min col in check_dimensions. Default to 0 if undefined.
      min_col = @dim_colmin || 0

      # Check that row and col are valid and store max and min values.
      check_dimensions(row, min_col)
      store_row_col_max_min_values(row, min_col)

      height ||= default_height

      # If the height is 0 the row is hidden and the height is the default.
      if height == 0
        hidden = 1
        height = default_height
      end

      # Set the limits for the outline levels (0 <= x <= 7).
      level = 0 if level < 0
      level = 7 if level > 7

      @outline_row_level = level if level > @outline_row_level

      # Store the row properties.
      @set_rows[row] = [height, xf, hidden, level, collapsed]

      # Store the row change to allow optimisations.
      @row_size_changed = true

      height = 0 if ptrue?(hidden)

      # Store the row sizes for use when calculating image vertices.
      @row_sizes[row] = height
    end
def set_row(*args)
      return unless args[0]
      row = args[0]
      height = args[1] || @default_height
      xf     = args[2]
      hidden = args[3] || 0
      level  = args[4] || 0
      collapsed = args[5] || 0

      # Get the default row height.
      default_height = @default_row_height

      # Use min col in check_dimensions. Default to 0 if undefined.
      min_col = @dim_colmin || 0

      # Check that row and col are valid and store max and min values.
      check_dimensions(row, min_col)
      store_row_col_max_min_values(row, min_col)

      height ||= default_height

      # If the height is 0 the row is hidden and the height is the default.
      if height == 0
        hidden = 1
        height = default_height
      end

      # Set the limits for the outline levels (0 <= x <= 7).
      level = 0 if level < 0
      level = 7 if level > 7

      @outline_row_level = level if level > @outline_row_level

      # Store the row properties.
      @set_rows[row] = [height, xf, hidden, level, collapsed]

      # Store the row change to allow optimisations.
      @row_size_changed = true

      height = 0 if ptrue?(hidden)

      # Store the row sizes for use when calculating image vertices.
      @row_sizes[row] = height
    end
:call-seq:
   set_row(row [ , height, format, hidden, level, collapsed ] )

 This method can be used to change the default properties of a row.
 All parameters apart from +row+ are optional.

 The most common use for this method is to change the height of a row:

     worksheet.set_row(0, 20)    # Row 1 height set to 20

 If you wish to set the format without changing the height you can
 pass +nil+ as the height parameter:

     worksheet.set_row(0, nil, format)

 The +format+ parameter will be applied to any cells in the row that
 don't have a format. For example

     worksheet.set_row(0, nil, format1)      # Set the format for row 1
     worksheet.write('A1', 'Hello')          # Defaults to format1
     worksheet.write('B1', 'Hello', format2) # Keeps format2

 If you wish to define a row format in this way you should call the
 method before any calls to {#write()}[#method-i-write]. Calling it afterwards will overwrite
 any format that was previously specified.

 The +hidden+ parameter should be set to 1 if you wish to hide a row.
 This can be used, for example, to hide intermediary steps in a
 complicated calculation:

     worksheet.set_row(0, 20,  format, 1)
     worksheet.set_row(1, nil, nil,    1)

 The +level+ parameter is used to set the outline level of the row.
 Outlines are described in "OUTLINES AND GROUPING IN EXCEL". Adjacent
 rows with the same outline level are grouped together into a single
 outline.

 The following example sets an outline level of 1 for rows 1
 and 2 (zero-indexed):

     worksheet.set_row(1, nil, nil, 0, 1)
     worksheet.set_row(2, nil, nil, 0, 1)

 The +hidden+ parameter can also be used to hide collapsed outlined rows
 when used in conjunction with the +level+ parameter.

     worksheet.set_row(1, nil, nil, 1, 1)
     worksheet.set_row(2, nil, nil, 1, 1)

 For collapsed outlines you should also indicate which row has the
 collapsed + symbol using the optional +collapsed+ parameter.

     worksheet.set_row(3, nil, nil, 0, 0, 1)

 For a more complete example see the outline.rb and outline_collapsed.rb
 programs in the examples directory of the distro.

 Excel allows up to 7 outline levels. Therefore the +level+ parameter
 should be in the range <tt>0 <= level <= 7</tt>.

 == OUTLINES AND GROUPING IN EXCEL

 Excel allows you to group rows or columns so that they can be hidden or
 displayed with a single mouse click. This feature is referred to as
 outlines.

 Outlines can reduce complex data down to a few salient sub-totals or
 summaries.

 This feature is best viewed in Excel but the following is an ASCII
 representation of what a worksheet with three outlines might look like.
 Rows 3-4 and rows 7-8 are grouped at level 2. Rows 2-9 are grouped at
 level 1. The lines at the left hand side are called outline level bars.

             ------------------------------------------
      1 2 3 |   |   A   |   B   |   C   |   D   |  ...
             ------------------------------------------
       _    | 1 |   A   |       |       |       |  ...
      |  _  | 2 |   B   |       |       |       |  ...
      | |   | 3 |  (C)  |       |       |       |  ...
      | |   | 4 |  (D)  |       |       |       |  ...
      | -   | 5 |   E   |       |       |       |  ...
      |  _  | 6 |   F   |       |       |       |  ...
      | |   | 7 |  (G)  |       |       |       |  ...
      | |   | 8 |  (H)  |       |       |       |  ...
      | -   | 9 |   I   |       |       |       |  ...
      -     | . |  ...  |  ...  |  ...  |  ...  |  ...

 Clicking the minus sign on each of the level 2 outlines will collapse
 and hide the data as shown in the next figure. The minus sign changes
 to a plus sign to indicate that the data in the outline is hidden.

             ------------------------------------------
      1 2 3 |   |   A   |   B   |   C   |   D   |  ...
             ------------------------------------------
       _    | 1 |   A   |       |       |       |  ...
      |     | 2 |   B   |       |       |       |  ...
      | +   | 5 |   E   |       |       |       |  ...
      |     | 6 |   F   |       |       |       |  ...
      | +   | 9 |   I   |       |       |       |  ...
      -     | . |  ...  |  ...  |  ...  |  ...  |  ...

 Clicking on the minus sign on the level 1 outline will collapse the
 remaining rows as follows:

             ------------------------------------------
      1 2 3 |   |   A   |   B   |   C   |   D   |  ...
             ------------------------------------------
            | 1 |   A   |       |       |       |  ...
      +     | . |  ...  |  ...  |  ...  |  ...  |  ...

 Grouping in WritXLSX is achieved by setting the outline level via the
 set_row() and set_column() worksheet methods:

     set_row(row, height, format, hidden, level, collapsed)
     set_column(first_col, last_col, width, format, hidden, level, collapsed)

 The following example sets an outline level of 1 for rows 1 and 2
 (zero-indexed) and columns B to G. The parameters $height and $XF are
 assigned default values since they are undefined:

     worksheet.set_row(1, nil, nil, 0, 1)
     worksheet.set_row(2, nil, nil, 0, 1)
     worksheet.set_column('B:G', nil, nil, 0, 1)

 Excel allows up to 7 outline levels. Therefore the +level+ parameter
 should be in the range <tt>0 <= $level <= 7</tt>.

 Rows and columns can be collapsed by setting the +hidden+ flag for the
 hidden rows/columns and setting the +collapsed+ flag for the row/column
 that has the collapsed + symbol:

     worksheet.set_row(1, nil, nil, 1, 1)
     worksheet.set_row(2, nil, nil, 1, 1)
     worksheet.set_row(3, nil, nil, 0, 0, 1)          # Collapsed flag.

     worksheet.set_column('B:G', nil, nil, 1, 1)
     worksheet.set_column('H:H', nil, nil, 0, 0, 1)   # Collapsed flag.

 Note: Setting the $collapsed flag is particularly important for
 compatibility with OpenOffice.org and Gnumeric.

 For a more complete example see the outline.rb and outline_collapsed.rb
 programs in the examples directory of the distro.

 Some additional outline properties can be set via the outline_settings()
 worksheet method, see above.