Class: Gnm::Sheet

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(wb, name, type, columns, rows) ⇒ Gnm::Sheet

Create a new Sheet of type type, and associate it with wb. The type cannot be changed later.

Parameters:

  • wb (Gnm::Workbook)

    #Workbook

  • name (String)

    An unquoted name

  • type (Gnm::SheetType)

    GnmSheetType

  • columns (Integer)

    The number of columns for the sheet

  • rows (Integer)

    The number of rows for the sheet

Class Method Details

.apply_style_undo(sr, style) ⇒ GOffice::Undo

Returns the new #GOUndo.

Parameters:

  • sr (Gnm::SheetRange)

    Gnm::SheetRange

  • style (Gnm::Style)

    Gnm::Style

Returns:

  • (GOffice::Undo)

    the new #GOUndo.

.cell_initnil

Returns:

  • (nil)

.cell_queue_respan(cell) ⇒ nil

Parameters:

  • cell (Gnm::Cell)

Returns:

  • (nil)

.cell_set_expr(cell, texpr) ⇒ nil

Marks the sheet as dirty Clears old spans. Flags status updates Queues recalcs

Parameters:

  • cell (Gnm::Cell)

    Gnm::Cell

  • texpr (Gnm::ExprTop)

    New expression for cell.

Returns:

  • (nil)

.cell_set_text(cell, str, markup) ⇒ nil

Marks the sheet as dirty Clears old spans. Flags status updates Queues recalcs

Parameters:

  • cell (Gnm::Cell)

    A cell.

  • str (String)

    the text to set.

  • markup (Pango::AttrList)

    an optional PangoAttrList.

Returns:

  • (nil)

.cell_set_value(cell, v) ⇒ nil

Stores, without copying, the supplied value. It marks the sheet as dirty.

The value is rendered and spans are calculated. It queues a redraw and checks to see if the edit region or selection content changed.

NOTE : This DOES check for array partitioning.

Parameters:

  • cell (Gnm::Cell)

    Gnm::Cell

  • v (Gnm::Value)

    Gnm::Value

Returns:

  • (nil)

.cell_shutdownnil

Returns:

  • (nil)

.clear_region_undo(sr, clear_flags) ⇒ GOffice::Undo

Returns the new #GOUndo.

Parameters:

  • sr (Gnm::SheetRange)

    Gnm::SheetRange

  • clear_flags (Integer)

    flags.

Returns:

  • (GOffice::Undo)

    the new #GOUndo.

.conditions_share_conditions_add(conds) ⇒ Gnm::StyleConditions

nil if conds had not been seen before.

Parameters:

Returns:

.conditions_share_conditions_remove(conds) ⇒ nil

This notifies the sheet conditions manager that one use of the shared conditions has gone away.

Parameters:

Returns:

  • (nil)

.flag_status_update_cell(cell) ⇒ nil

flag the sheet as requiring an update to the status display if the supplied cell location is the edit cursor, or part of the selected region.

Will cause the format toolbar, the edit area, and the auto expressions to be updated if appropriate.

Parameters:

  • cell (Gnm::Cell)

    The cell that has changed.

Returns:

  • (nil)

.merge_relocate(ri, pundo) ⇒ nil

Shifts merged regions that need to move.

Parameters:

  • ri (Gnm::ExprRelocateInfo)

    Descriptor of what is moving.

  • pundo (GOffice::Undo)

    Undo information.

Returns:

  • (nil)

.move_range(rinfo, pundo, cc) ⇒ nil

Move a range as specified in rinfo report warnings to cc. if pundo is non-nil, invalidate references to the target region that are being cleared, and store the undo information in pundo. If it is nil do NOT INVALIDATE.

Parameters:

  • rinfo (Gnm::ExprRelocateInfo)
  • pundo (GOffice::Undo)

    undo object

  • cc (GOffice::CmdContext)

    The command context

Returns:

  • (nil)

.objects_initnil

Returns:

  • (nil)

.objects_relocate(rinfo, update, pundo) ⇒ nil

Uses the relocation info and the anchors to decide whether or not, and how to relocate objects when the grid moves (eg ins/del col/row).

Parameters:

  • rinfo (Gnm::ExprRelocateInfo)

    details on what should be moved.

  • update (Boolean)

    Should we do the bound_update now, or leave it for later. if FALSE honour the move_with_cells flag.

  • pundo (GOffice::Undo)

    add dropped objects to ::objects

Returns:

  • (nil)

.objects_shutdownnil

Returns:

  • (nil)

.style_insdel_colrow(rinfo) ⇒ nil

Insert of delete style columns/rows.

For the insert case, we stretch the preceding column/row into there space we open.

Parameters:

  • rinfo (Gnm::ExprRelocateInfo)

Returns:

  • (nil)

.style_relocate(rinfo) ⇒ nil

Slide the styles from the origin region to the new position.

Parameters:

  • rinfo (Gnm::ExprRelocateInfo)

Returns:

  • (nil)

.suggest_size(cols, rows) ⇒ nil

This function produces a valid sheet size that is reasonable for data of cols columns by rows rows. If possible, this will be a size bigger in both dimensions. However, that is not always possible and when it is not, the suggested will be smaller in one or both directions.

Parameters:

  • cols (Integer)

    number of columns

  • rows (Integer)

    number of rows

Returns:

  • (nil)

.valid_size(cols, rows) ⇒ Boolean

Parameters:

  • cols (Integer)
  • rows (Integer)

Returns:

  • (Boolean)

Instance Method Details

#add_sort_setup(key, setup) ⇒ nil

Parameters:

  • key (String)
  • setup (GObject)

Returns:

  • (nil)

#apply_border(range, borders) ⇒ nil

Parameters:

  • range (Gnm::Range)

    Gnm::Range around which to place borders

  • borders (Array<Gnm::Border>)

    Border styles to set.

Returns:

  • (nil)

#apply_style(range, style) ⇒ nil

A mid level routine that applies the supplied partial style style to the target range and performs the necessary respanning and redrawing.

Parameters:

  • range (Gnm::Range)

    the range to which should be applied

  • style (Gnm::Style)

    A Gnm::Style partial style

Returns:

  • (nil)

#apply_style_gi(range, style) ⇒ nil

A mid level routine that applies the supplied partial style style to the target range and performs the necessary respanning and redrawing.

Parameters:

  • range (Gnm::Range)

    the range to which should be applied

  • style (Gnm::Style)

    A Gnm::Style partial style

Returns:

  • (nil)

#cell_create(col, row) ⇒ Gnm::Cell

Creates a new cell and adds it to the sheet hash.

Parameters:

  • col (Integer)
  • row (Integer)

Returns:

  • (Gnm::Cell)

#cell_fetch(col, row) ⇒ Gnm::Cell

If no cell existed at that location before, it is created.

Parameters:

  • col (Integer)

    the cell column

  • row (Integer)

    the cell row

Returns:

  • (Gnm::Cell)

    a Gnm::Cell containing at (col,row).

#cell_foreach(callback, data) ⇒ nil

Call callback with an argument of data for each cell in the sheet

Parameters:

  • callback (GLib::HFunc)
  • data (GObject)

Returns:

  • (nil)

#cell_get(col, row) ⇒ Gnm::Cell

Returns a Gnm::Cell, or nil if the cell does not exist.

Parameters:

  • col (Integer)

    the cell column

  • row (Integer)

    the cell row

Returns:

  • (Gnm::Cell)

    a Gnm::Cell, or nil if the cell does not exist

#cell_get_value(col, row) ⇒ Gnm::Value

value will be nil only when the cell does not exist.

Parameters:

  • col (Integer)

    Source column

  • row (Integer)

    Source row

Returns:

  • (Gnm::Value)

    the cell's current value. The return

#cell_positions(comments) ⇒ Array<Gnm::EvalPos>

Collects a GPtrArray of GnmEvalPos pointers for all cells in a sheet. No particular order should be assumed.

Parameters:

  • comments (Boolean)

    If true, include cells with only comments also.

Returns:

  • (Array<Gnm::EvalPos>)

    the newly created array

#cell_remove(cell, redraw, queue_recalc) ⇒ nil

Remove the cell from the web of dependencies of a sheet. Do NOT free the cell, optionally redraw it, optionally queue it for recalc.

Parameters:

  • cell (Gnm::Cell)
  • redraw (Boolean)
  • queue_recalc (Boolean)

Returns:

  • (nil)

#cell_set_text_gi(col, row, str) ⇒ nil

Sets the contents of a cell.

Parameters:

  • col (Integer)

    Column number

  • row (Integer)

    Row number

  • str (String)

    the text to set.

Returns:

  • (nil)

#cell_set_value_gi(col, row, v) ⇒ nil

Set the value of the cell at (col,row) to v.

The value is rendered and spans are calculated. It queues a redraw and checks to see if the edit region or selection content changed.

Parameters:

  • col (Integer)

    Column number

  • row (Integer)

    Row number

  • v (Gnm::Value)

    Gnm::Value

Returns:

  • (nil)

#cells(r) ⇒ Array<Gnm::Cell>

Retrieves an array of all cells inside r.

Parameters:

  • r (Gnm::Range)

    a Gnm::Range

Returns:

  • (Array<Gnm::Cell>)

    the cells array.

#cells_countInteger

Returns the number of cells with content in the current workbook.

Returns:

  • (Integer)

#cells_extentGnm::Range

Calculates the area occupied by cells, including empty cells.

Returns:

  • (Gnm::Range)

    the range.

#clear_region(start_col, start_row, end_col, end_row, clear_flags, cc) ⇒ nil

Clears a region of cells, formats, object, etc. as indicated by clear_flags.

Parameters:

  • start_col (Integer)

    Starting column

  • start_row (Integer)

    Starting row

  • end_col (Integer)

    Ending column

  • end_row (Integer)

    Ending row

  • clear_flags (Gnm::SheetClearFlags)

    flags indicating what to clear

  • cc (GOffice::CmdContext)

    command context for error reporting

Returns:

  • (nil)

#col_fetch(col) ⇒ Gnm::ColRowInfo

will not be the default Col::RowInfo and may be changed.

Parameters:

  • col (Integer)

    Column number

Returns:

  • (Gnm::ColRowInfo)

    The Col::RowInfo for column col. This result

#col_get(col) ⇒ Gnm::ColRowInfo

if none has been allocated yet.

Parameters:

  • col (Integer)

    Column number

Returns:

  • (Gnm::ColRowInfo)

    A Col::RowInfo for the column, or nil

#col_get_default_size_pixelsInteger

Returns:

  • (Integer)

#col_get_default_size_ptsFloat

This function returns the raw sum, no rounding etc.

Returns:

  • (Float)

    the default number of pts in a column, including margins.

#col_get_distance_pixels(from, to) ⇒ Integer

measured from the upper left corner.

Parameters:

  • from (Integer)

    Starting column

  • to (Integer)

    Ending column, not inclusive

Returns:

  • (Integer)

    the number of pixels between columns from and to

#col_get_distance_pts(from, to) ⇒ Float

measured from the upper left corner.

Parameters:

  • from (Integer)

    Starting column

  • to (Integer)

    Ending column, not inclusive

Returns:

  • (Float)

    the number of points between columns from and to

#col_get_info(col) ⇒ Gnm::ColRowInfo

the default Col::RowInfo for columns and should not be changed.

Parameters:

  • col (Integer)

    Column number

Returns:

  • (Gnm::ColRowInfo)

    The Col::RowInfo for column col. This may be

#col_is_hidden(col) ⇒ Boolean

Parameters:

  • col (Integer)

Returns:

  • (Boolean)

#col_set_default_size_pixels(width_pixels) ⇒ nil

Parameters:

  • width_pixels (Integer)

Returns:

  • (nil)

#col_set_default_size_pts(width_pts) ⇒ nil

Parameters:

  • width_pts (Float)

Returns:

  • (nil)

#col_set_size_pixels(col, width_pixels, set_by_user) ⇒ nil

Parameters:

  • col (Integer)
  • width_pixels (Integer)
  • set_by_user (Boolean)

Returns:

  • (nil)

#col_set_size_pts(col, width_pts, set_by_user) ⇒ nil

Sets width of a col in pts, INCLUDING left and right margins, and the far grid line. This is a low level internal routine. It does NOT redraw, or reposition objects.

Parameters:

  • col (Integer)

    The col

  • width_pts (Float)

    The desired width in pts

  • set_by_user (Boolean)

    true if this was done by a user (ie, user manually set the width)

Returns:

  • (nil)

#col_size_fit_pixels(col, srow, erow, ignore_strings) ⇒ Integer

This routine computes the ideal size for the column to make the contents all cells in the column visible. flags doubles as an indicator that numeric cells should only cause a widening when they would otherwise cause "####" to be displayed.

Parameters:

  • col (Integer)

    the column that we want to query

  • srow (Integer)

    starting row.

  • erow (Integer)

    ending row.

  • ignore_strings (Boolean)

    skip cells containing string values. Currently this

Returns:

  • (Integer)

    Maximum size in pixels INCLUDING margins and grid lines or 0 if there are no cells.

#colrow_can_group(r, is_cols) ⇒ Boolean

false otherwise. You can invert the result if you need to find out if a group can be ungrouped.

Parameters:

  • r (Gnm::Range)

    A Gnm::Range

  • is_cols (Boolean)

    true for columns, false for rows.

Returns:

  • (Boolean)

    true if the cols/rows in r.start -> r.end can be grouped,

#colrow_copy_info(colrow, is_cols, cri) ⇒ nil

Parameters:

  • colrow (Integer)
  • is_cols (Boolean)
  • cri (Gnm::ColRowInfo)

Returns:

  • (nil)

#colrow_fetch(colrow, is_cols) ⇒ Gnm::ColRowInfo

Parameters:

  • colrow (Integer)
  • is_cols (Boolean)

Returns:

  • (Gnm::ColRowInfo)

#colrow_foreach(is_cols, first, last, callback, user_data) ⇒ Boolean

Iterates through the existing rows or columns within the range supplied. If a callback returns true, iteration stops.

Parameters:

  • is_cols (Boolean)

    true for columns, false for rows.

  • first (Integer)

    start position (inclusive)

  • last (Integer)

    stop position (inclusive), -1 meaning end-of-sheet

  • callback (Gnm::ColRowHandler)

    A callback function which should return true to stop the iteration.

  • user_data (GObject)

    A baggage pointer.

Returns:

  • (Boolean)

#colrow_get(colrow, is_cols) ⇒ Gnm::ColRowInfo

Parameters:

  • colrow (Integer)
  • is_cols (Boolean)

Returns:

  • (Gnm::ColRowInfo)

#colrow_get_default(is_cols) ⇒ Gnm::ColRowInfo

Returns the default Col::RowInfo.

Parameters:

  • is_cols (Boolean)

    true for columns, false for rows.

Returns:

  • (Gnm::ColRowInfo)

    the default Col::RowInfo.

#colrow_get_distance_pixels(is_cols, from, to) ⇒ Integer

measured from the upper left corner.

Parameters:

  • is_cols (Boolean)

    true for columns, false for rows.

  • from (Integer)

    Starting column/row

  • to (Integer)

    Ending column/row, not inclusive

Returns:

  • (Integer)

    the number of pixels between columns/rows from and to

#colrow_get_info(colrow, is_cols) ⇒ Gnm::ColRowInfo

Parameters:

  • colrow (Integer)
  • is_cols (Boolean)

Returns:

  • (Gnm::ColRowInfo)

#colrow_group_ungroup(r, is_cols, inc) ⇒ Boolean

Parameters:

  • r (Gnm::Range)
  • is_cols (Boolean)
  • inc (Boolean)

Returns:

  • (Boolean)

#colrow_gutter(is_cols, max_outline) ⇒ nil

Set the maximum outline levels for cols or rows.

Parameters:

  • is_cols (Boolean)

    true for columns, false for rows.

  • max_outline (Integer)

Returns:

  • (nil)

#colrow_optimizenil

Returns:

  • (nil)

#columnsInteger

Returns columns.

Returns:

  • (Integer)

    columns

#columns=(columns) ⇒ Integer

Parameters:

  • columns (Integer)

Returns:

  • (Integer)

    columns

  • (Integer)

    columns

#conditions_add(r, style) ⇒ nil

Parameters:

  • r (Gnm::Range)
  • style (Gnm::Style)

Returns:

  • (nil)

#conditions_dumpnil

Returns:

  • (nil)

#conditions_initnil

Returns:

  • (nil)

Parameters:

  • r (Gnm::Range)
  • qlink (Boolean)

Returns:

  • (nil)

#conditions_remove(r, style) ⇒ nil

Parameters:

  • r (Gnm::Range)
  • style (Gnm::Style)

Returns:

  • (nil)

#conditions_simplifynil

Returns:

  • (nil)

#conditions_uninitnil

Returns:

  • (nil)

#conventionsGnm::Conventions

Returns conventions.

Returns:

  • (Gnm::Conventions)

    conventions

#conventions=(conventions) ⇒ Gnm::Conventions

Parameters:

  • conventions (Gnm::Conventions)

Returns:

  • (Gnm::Conventions)

    conventions

  • (Gnm::Conventions)

    conventions

#date_convGOffice::DateConventions

This is purely a convenience function to access the conventions used for the workbook. All sheets in a workbook share the same date conventions.

Returns:

  • (GOffice::DateConventions)

    the date conventions in effect for the sheet.

#delete_cols(col, count, pundo, cc) ⇒ Boolean

Parameters:

  • col (Integer)

    At which position we want to start deleting columns

  • count (Integer)

    The number of columns to be deleted

  • pundo (GOffice::Undo)

    (transfer full): (allow-none): undo closure

  • cc (GOffice::CmdContext)

    The command context

Returns:

  • (Boolean)

#delete_rows(row, count, pundo, cc) ⇒ Boolean

Parameters:

  • row (Integer)

    At which position we want to start deleting rows

  • count (Integer)

    The number of rows to be deleted

  • pundo (GOffice::Undo)

    (transfer full): (allow-none): undo closure

  • cc (GOffice::CmdContext)

    The command context

Returns:

  • (Boolean)

#destroy_contentsnil

Returns:

  • (nil)

#display_column_header=(display_column_header) ⇒ Boolean

Parameters:

  • display_column_header (Boolean)

Returns:

  • (Boolean)

    display-column-header

  • (Boolean)

    display-column-header

#display_column_header?Boolean

Returns display-column-header.

Returns:

  • (Boolean)

    display-column-header

#display_formulas=(display_formulas) ⇒ Boolean

Parameters:

  • display_formulas (Boolean)

Returns:

  • (Boolean)

    display-formulas

  • (Boolean)

    display-formulas

#display_formulas?Boolean

Returns display-formulas.

Returns:

  • (Boolean)

    display-formulas

#display_grid=(display_grid) ⇒ Boolean

Parameters:

  • display_grid (Boolean)

Returns:

  • (Boolean)

    display-grid

  • (Boolean)

    display-grid

#display_grid?Boolean

Returns display-grid.

Returns:

  • (Boolean)

    display-grid

#display_outlines=(display_outlines) ⇒ Boolean

Parameters:

  • display_outlines (Boolean)

Returns:

  • (Boolean)

    display-outlines

  • (Boolean)

    display-outlines

#display_outlines?Boolean

Returns display-outlines.

Returns:

  • (Boolean)

    display-outlines

#display_outlines_below=(display_outlines_below) ⇒ Boolean

Parameters:

  • display_outlines_below (Boolean)

Returns:

  • (Boolean)

    display-outlines-below

  • (Boolean)

    display-outlines-below

#display_outlines_below?Boolean

Returns display-outlines-below.

Returns:

  • (Boolean)

    display-outlines-below

#display_outlines_right=(display_outlines_right) ⇒ Boolean

Parameters:

  • display_outlines_right (Boolean)

Returns:

  • (Boolean)

    display-outlines-right

  • (Boolean)

    display-outlines-right

#display_outlines_right?Boolean

Returns display-outlines-right.

Returns:

  • (Boolean)

    display-outlines-right

#display_row_header=(display_row_header) ⇒ Boolean

Parameters:

  • display_row_header (Boolean)

Returns:

  • (Boolean)

    display-row-header

  • (Boolean)

    display-row-header

#display_row_header?Boolean

Returns display-row-header.

Returns:

  • (Boolean)

    display-row-header

#display_zeros=(display_zeros) ⇒ Boolean

Parameters:

  • display_zeros (Boolean)

Returns:

  • (Boolean)

    display-zeros

  • (Boolean)

    display-zeros

#display_zeros?Boolean

Returns display-zeros.

Returns:

  • (Boolean)

    display-zeros

#dupGnm::Sheet

Create a duplicate sheet.

Returns:

#filter_at_pos(pos) ⇒ Gnm::Filter

Returns Gnm::Filter covering pos.

Parameters:

  • pos (Gnm::CellPos)

    location to query

Returns:

  • (Gnm::Filter)

    Gnm::Filter covering pos.

#filter_can_be_extended(f, r) ⇒ Gnm::Range

Returns Gnm::Range.

Parameters:

  • f (Gnm::Filter)
  • r (Gnm::Range)

Returns:

  • (Gnm::Range)

    Gnm::Range

#filter_insdel_colrow(is_cols, is_insert, start, count, pundo) ⇒ nil

Adjust filters as necessary to handle col/row insertions and deletions

Parameters:

  • is_cols (Boolean)

    true for columns, false for rows.

  • is_insert (Boolean)

    true for insert, false for delete.

  • start (Integer)

    Starting column or row.

  • count (Integer)

    Number of columns or rows.

  • pundo (GOffice::Undo)

    location to store undo closures.

Returns:

  • (nil)

#filter_intersect_rows(from, to) ⇒ Gnm::Filter

intersects the rows from to to.

Parameters:

  • from (Integer)

    starting row number

  • to (Integer)

    ending row number

Returns:

  • (Gnm::Filter)

    the Gnm::Filter, if any, that

#find_boundary_horizontal(col, move_row, base_row, count, jump_to_boundaries) ⇒ Integer

Calculate the column index for the column which is count units from start_col doing bounds checking. If jump_to_boundaries is true then count must be 1 and the jump is to the edge of the logical range.

This routine implements the logic necessary for ctrl-arrow style movement. That is more complicated than simply finding the last in a list of cells with content. If you are at the end of a range it will find the start of the next. Make sure that is the sort of behavior you want before calling this.

Parameters:

  • col (Integer)

    The column from which to begin searching.

  • move_row (Integer)

    The row in which to search for the edge of the range.

  • base_row (Integer)

    The height of the area being moved.

  • count (Integer)

    units to extend the selection vertically

  • jump_to_boundaries (Boolean)

    Jump to range boundaries.

Returns:

  • (Integer)

    the column index.

#find_boundary_vertical(move_col, row, base_col, count, jump_to_boundaries) ⇒ Integer

Calculate the row index for the row which is count units from start_row doing bounds checking. If jump_to_boundaries is true then count must be 1 and the jump is to the edge of the logical range.

This routine implements the logic necessary for ctrl-arrow style movement. That is more complicated than simply finding the last in a list of cells with content. If you are at the end of a range it will find the start of the next. Make sure that is the sort of behavior you want before calling this.

Parameters:

  • move_col (Integer)

    The col in which to search for the edge of the range.

  • row (Integer)

    The row from which to begin searching.

  • base_col (Integer)

    The width of the area being moved.

  • count (Integer)

    units to extend the selection vertically

  • jump_to_boundaries (Boolean)

    Jump to range boundaries.

Returns:

  • (Integer)

    the row index.

#find_sort_setup(key) ⇒ GObject

Returns the found sort setup or nil.

Parameters:

  • key (String)

Returns:

  • (GObject)

    the found sort setup or nil.

#flag_recompute_spansnil

Flag the sheet as requiring a full span recomputation the next time sheet_update is called.

Returns:

  • (nil)

#flag_status_update_range(range) ⇒ nil

flag the sheet as requiring an update to the status display if the supplied cell location contains the edit cursor, or intersects of the selected region.

Will cause the format toolbar, the edit area, and the auto expressions to be updated if appropriate.

Parameters:

  • range (Gnm::Range)

    GnmRange, or nil for full sheet

Returns:

  • (nil)

#flag_style_update_range(range) ⇒ nil

Flag format changes that will require updating the format indicators.

Parameters:

  • range (Gnm::Range)

    the range that is changing.

Returns:

  • (nil)

#foreach_cell_in_range(flags, r, callback, closure) ⇒ Gnm::Value

For each existing cell in the range specified, invoke the callback routine. If the only_existing flag is passed, then callbacks are only invoked for existing cells.

Note: this function does not honour the CELL_ITER_IGNORE_SUBTOTAL flag. NOTE: between 0.56 and 0.57, the traversal order changed. The order is now

   1    2    3
   4    5    6
   7    8    9

(This appears to be the order in which XL looks at the values of ranges.) If your code depends on any particular ordering, please add a very visible comment near the call.

Parameters:

  • flags (Gnm::CellIterFlags)
  • r (Gnm::Range)

    Gnm::Range

  • callback (Gnm::CellIterFunc)

    Cell::FilterFunc

  • closure (GObject)

    user data.

Returns:

  • (Gnm::Value)

    the value returned by the callback, which can be: non-nil on error, or VALUE_TERMINATE if some invoked routine requested to stop (by returning non-nil).

#foreach_cell_in_region(flags, start_col, start_row, end_col, end_row, callback, closure) ⇒ Gnm::Value

For each existing cell in the range specified, invoke the callback routine. If the only_existing flag is passed, then callbacks are only invoked for existing cells.

Note: this function does not honour the CELL_ITER_IGNORE_SUBTOTAL flag. NOTE: between 0.56 and 0.57, the traversal order changed. The order is now

   1    2    3
   4    5    6
   7    8    9

(This appears to be the order in which XL looks at the values of ranges.) If your code depends on any particular ordering, please add a very visible comment near the call.

Parameters:

  • flags (Gnm::CellIterFlags)
  • start_col (Integer)

    Starting column

  • start_row (Integer)

    Starting row

  • end_col (Integer)

    Ending column, -1 meaning last

  • end_row (Integer)

    Ending row, -1 meaning last

  • callback (Gnm::CellIterFunc)

    Cell::FilterFunc

  • closure (GObject)

    user data.

Returns:

  • (Gnm::Value)

    the value returned by the callback, which can be: non-nil on error, or VALUE_TERMINATE if some invoked routine requested to stop (by returning non-nil).

#foreach_name(func, data) ⇒ nil

Executes func for each name in sheet.

Parameters:

  • func (GLib::HFunc)

    #GHFunc

  • data (GObject)

    user data.

Returns:

  • (nil)

#freeze_object_views(qfreeze) ⇒ nil

Parameters:

  • qfreeze (Boolean)

Returns:

  • (nil)

#get_comment(pos) ⇒ Gnm::Comment

If there is a cell comment at pos in sheet return it.

Caller does get a reference to the object if it exists.

Parameters:

  • pos (Gnm::CellPos)

    Gnm::CellPos const *

Returns:

#get_extent(spans_and_merges_extend, include_hidden) ⇒ Gnm::Range

calculates the area occupied by cell data.

NOTE: When spans_and_merges_extend is true, this function will calculate all spans. That might be expensive.

NOTE: This refers to visible contents. Cells with empty values, including formulas with such values, are *ignored.

Parameters:

  • spans_and_merges_extend (Boolean)

    optionally extend region for spans and merges.

  • include_hidden (Boolean)

    whether to include the content of hidden cells.

Returns:

  • (Gnm::Range)

    the range.

#get_printarea(include_styles, ignore_printarea) ⇒ Gnm::Range

Parameters:

  • include_styles (Boolean)
  • ignore_printarea (Boolean)

Returns:

  • (Gnm::Range)

#get_size2(wb) ⇒ Gnm::SheetSize

Determines the sheet size, either of sheet if that is non-nil or of wb's default sheet. One of sheet and wb must be non-nil.

Parameters:

Returns:

  • (Gnm::SheetSize)

    the sheet size.

#get_view(wbv) ⇒ Gnm::SheetView

Find the SheetView corresponding to the supplied wbv.

Parameters:

Returns:

#guess_data_range(region) ⇒ nil

Makes a guess at the logical range containing region and returns the possibly expanded result in region. The range is also expanded upwards.

Parameters:

  • region (Gnm::Range)

    Gnm::Range

Returns:

  • (nil)

#guess_region(region) ⇒ nil

Makes a guess at the logical containing region and returns the possibly expanded result in region.

Parameters:

  • region (Gnm::Range)

    Gnm::Range

Returns:

  • (nil)

Returns the found Gnm::HLink.

Parameters:

  • pos (Gnm::CellPos)

    Gcm::CellPos

Returns:

#insert_cols(col, count, pundo, cc) ⇒ Boolean

Parameters:

  • col (Integer)

    At which position we want to insert

  • count (Integer)

    The number of columns to be inserted

  • pundo (GOffice::Undo)

    (transfer full): (allow-none): undo closure

  • cc (GOffice::CmdContext)

    The command context

Returns:

  • (Boolean)

#insert_rows(row, count, pundo, cc) ⇒ Boolean

Parameters:

  • row (Integer)

    At which position we want to insert

  • count (Integer)

    The number of rows to be inserted

  • pundo (GOffice::Undo)

    (transfer full): (allow-none): undo closure

  • cc (GOffice::CmdContext)

    The command context

Returns:

  • (Boolean)

#is_cell_empty(col, row) ⇒ Boolean

Parameters:

  • col (Integer)
  • row (Integer)

Returns:

  • (Boolean)

#is_region_empty(r) ⇒ Boolean

contain any cells

Parameters:

  • r (Gnm::Range)

    region to check

Returns:

  • (Boolean)

    true if the specified region of the sheet does not

#mark_dirtynil

Returns:

  • (nil)

#merge_add(r, clear, cc) ⇒ Boolean

Add a range to the list of merge targets. Checks for array splitting returns true if there was an error. Queues a respan. Only queues a redraw if clear is true.

Parameters:

  • r (Gnm::Range)

    The region to merge

  • clear (Boolean)

    should the non-corner content of the region be cleared and the style from the corner applied.

  • cc (GOffice::CmdContext)

    the calling context

Returns:

  • (Boolean)

#merge_contains_pos(pos) ⇒ Gnm::Range

nil if pos is not within a merged region.

Parameters:

  • pos (Gnm::CellPos)

    Position to look for a merged range.

Returns:

  • (Gnm::Range)

    the merged range covering pos, or

#merge_find_bounding_box(r) ⇒ nil

Extends r such that no merged range is split by its boundary.

Parameters:

  • r (Gnm::Range)

    the range to extend

Returns:

  • (nil)

#merge_get_adjacent(pos, left, right) ⇒ nil

Returns the nearest regions to either side of pos.

Parameters:

  • pos (Gnm::CellPos)

    the cell to test for adjacent regions.

  • left (Gnm::Range)

    the return for a region on the left

  • right (Gnm::Range)

    the return for a region on the right

Returns:

  • (nil)

#merge_get_overlap(r) ⇒ GLib::SList<Gnm::Range>

regions that overlap the target region. The list is ordered from top to bottom and RIGHT TO LEFT (by start coord).

Parameters:

  • r (Gnm::Range)

Returns:

  • (GLib::SList<Gnm::Range>)

    a list of the merged

#merge_is_corner(pos) ⇒ Gnm::Range

top-left corner of a merged region.

Parameters:

  • pos (Gnm::CellPos)

    cellpos if top left corner

Returns:

  • (Gnm::Range)

    a merged Gnm::Range covering pos if it is the

#merge_remove(r) ⇒ Boolean

Remove a merged range. Queues a redraw.

Parameters:

  • r (Gnm::Range)

    The region

Returns:

  • (Boolean)

    true if there was an error.

#nameString

Returns name.

Returns:

  • (String)

    name

#name=(name) ⇒ String

Parameters:

  • name (String)

Returns:

  • (String)

    name

  • (String)

    name

#names_check(r) ⇒ String

sheet!r is the target of a named range.

Preference is given to workbook scope over sheet.

Parameters:

  • r (Gnm::Range)

    Gnm::Range

Returns:

  • (String)

    The name of a Gnm::NamedExpr if

#nominal_printareaGnm::Range

Returns:

  • (Gnm::Range)

#objects_clear(r, t, pundo) ⇒ nil

Removes the objects in the region. t #GType

Parameters:

  • r (Gnm::Range)

    Gnm::Range to look in

  • t (GLib::Type)
  • pundo (GOffice::Undo)

Returns:

  • (nil)

#objects_dup(dst, range) ⇒ nil

Clones the objects of the src sheet and attaches them into the dst sheet

Parameters:

  • dst (Gnm::Sheet)

    The destination sheet to attach the objects to

  • range (Gnm::Range)

    Gnm::Range to look in

Returns:

  • (nil)

#objects_get(r, t) ⇒ GLib::SList<Gnm::SheetObject>

containing all objects of exactly the specified type (inheritance does not count) that are completely contained in r.

Parameters:

  • r (Gnm::Range)

    Gnm::Range to look in

  • t (GLib::Type)

    The type of object to lookup, %G_TYPE_NONE for any.

Returns:

#outline_direction=(is_cols) ⇒ nil

When changing the placement of outline collapse markers the flags need to be recomputed.

Parameters:

  • is_cols (Boolean)

    true for columns, false for rows.

Returns:

  • (nil)

#protected=(protected) ⇒ Boolean

Parameters:

  • protected (Boolean)

Returns:

  • (Boolean)

    protected

  • (Boolean)

    protected

#protected?Boolean

Returns protected.

Returns:

  • (Boolean)

    protected

#protected_allow_cell_formatting=(protected_allow_cell_formatting) ⇒ Boolean

Parameters:

  • protected_allow_cell_formatting (Boolean)

Returns:

  • (Boolean)

    protected-allow-cell-formatting

  • (Boolean)

    protected-allow-cell-formatting

#protected_allow_cell_formatting?Boolean

Returns protected-allow-cell-formatting.

Returns:

  • (Boolean)

    protected-allow-cell-formatting

#protected_allow_column_formatting=(protected_allow_column_formatting) ⇒ Boolean

Parameters:

  • protected_allow_column_formatting (Boolean)

Returns:

  • (Boolean)

    protected-allow-column-formatting

  • (Boolean)

    protected-allow-column-formatting

#protected_allow_column_formatting?Boolean

Returns protected-allow-column-formatting.

Returns:

  • (Boolean)

    protected-allow-column-formatting

#protected_allow_delete_columns=(protected_allow_delete_columns) ⇒ Boolean

Parameters:

  • protected_allow_delete_columns (Boolean)

Returns:

  • (Boolean)

    protected-allow-delete-columns

  • (Boolean)

    protected-allow-delete-columns

#protected_allow_delete_columns?Boolean

Returns protected-allow-delete-columns.

Returns:

  • (Boolean)

    protected-allow-delete-columns

#protected_allow_delete_rows=(protected_allow_delete_rows) ⇒ Boolean

Parameters:

  • protected_allow_delete_rows (Boolean)

Returns:

  • (Boolean)

    protected-allow-delete-rows

  • (Boolean)

    protected-allow-delete-rows

#protected_allow_delete_rows?Boolean

Returns protected-allow-delete-rows.

Returns:

  • (Boolean)

    protected-allow-delete-rows

#protected_allow_edit_auto_filters=(protected_allow_edit_auto_filters) ⇒ Boolean

Parameters:

  • protected_allow_edit_auto_filters (Boolean)

Returns:

  • (Boolean)

    protected-allow-edit-auto-filters

  • (Boolean)

    protected-allow-edit-auto-filters

#protected_allow_edit_auto_filters?Boolean

Returns protected-allow-edit-auto-filters.

Returns:

  • (Boolean)

    protected-allow-edit-auto-filters

#protected_allow_edit_objects=(protected_allow_edit_objects) ⇒ Boolean

Parameters:

  • protected_allow_edit_objects (Boolean)

Returns:

  • (Boolean)

    protected-allow-edit-objects

  • (Boolean)

    protected-allow-edit-objects

#protected_allow_edit_objects?Boolean

Returns protected-allow-edit-objects.

Returns:

  • (Boolean)

    protected-allow-edit-objects

#protected_allow_edit_pivottable=(protected_allow_edit_pivottable) ⇒ Boolean

Parameters:

  • protected_allow_edit_pivottable (Boolean)

Returns:

  • (Boolean)

    protected-allow-edit-pivottable

  • (Boolean)

    protected-allow-edit-pivottable

#protected_allow_edit_pivottable?Boolean

Returns protected-allow-edit-pivottable.

Returns:

  • (Boolean)

    protected-allow-edit-pivottable

#protected_allow_edit_scenarios=(protected_allow_edit_scenarios) ⇒ Boolean

Parameters:

  • protected_allow_edit_scenarios (Boolean)

Returns:

  • (Boolean)

    protected-allow-edit-scenarios

  • (Boolean)

    protected-allow-edit-scenarios

#protected_allow_edit_scenarios?Boolean

Returns protected-allow-edit-scenarios.

Returns:

  • (Boolean)

    protected-allow-edit-scenarios

#protected_allow_insert_columns=(protected_allow_insert_columns) ⇒ Boolean

Parameters:

  • protected_allow_insert_columns (Boolean)

Returns:

  • (Boolean)

    protected-allow-insert-columns

  • (Boolean)

    protected-allow-insert-columns

#protected_allow_insert_columns?Boolean

Returns protected-allow-insert-columns.

Returns:

  • (Boolean)

    protected-allow-insert-columns

#protected_allow_insert_hyperlinks=(protected_allow_insert_hyperlinks) ⇒ Boolean

Parameters:

  • protected_allow_insert_hyperlinks (Boolean)

Returns:

  • (Boolean)

    protected-allow-insert-hyperlinks

  • (Boolean)

    protected-allow-insert-hyperlinks

#protected_allow_insert_hyperlinks?Boolean

Returns protected-allow-insert-hyperlinks.

Returns:

  • (Boolean)

    protected-allow-insert-hyperlinks

#protected_allow_insert_rows=(protected_allow_insert_rows) ⇒ Boolean

Parameters:

  • protected_allow_insert_rows (Boolean)

Returns:

  • (Boolean)

    protected-allow-insert-rows

  • (Boolean)

    protected-allow-insert-rows

#protected_allow_insert_rows?Boolean

Returns protected-allow-insert-rows.

Returns:

  • (Boolean)

    protected-allow-insert-rows

#protected_allow_row_formatting=(protected_allow_row_formatting) ⇒ Boolean

Parameters:

  • protected_allow_row_formatting (Boolean)

Returns:

  • (Boolean)

    protected-allow-row-formatting

  • (Boolean)

    protected-allow-row-formatting

#protected_allow_row_formatting?Boolean

Returns protected-allow-row-formatting.

Returns:

  • (Boolean)

    protected-allow-row-formatting

#protected_allow_select_locked_cells=(protected_allow_select_locked_cells) ⇒ Boolean

Parameters:

  • protected_allow_select_locked_cells (Boolean)

Returns:

  • (Boolean)

    protected-allow-select-locked-cells

  • (Boolean)

    protected-allow-select-locked-cells

#protected_allow_select_locked_cells?Boolean

Returns protected-allow-select-locked-cells.

Returns:

  • (Boolean)

    protected-allow-select-locked-cells

#protected_allow_select_unlocked_cells=(protected_allow_select_unlocked_cells) ⇒ Boolean

Parameters:

  • protected_allow_select_unlocked_cells (Boolean)

Returns:

  • (Boolean)

    protected-allow-select-unlocked-cells

  • (Boolean)

    protected-allow-select-unlocked-cells

#protected_allow_select_unlocked_cells?Boolean

Returns protected-allow-select-unlocked-cells.

Returns:

  • (Boolean)

    protected-allow-select-unlocked-cells

#protected_allow_sort_ranges=(protected_allow_sort_ranges) ⇒ Boolean

Parameters:

  • protected_allow_sort_ranges (Boolean)

Returns:

  • (Boolean)

    protected-allow-sort-ranges

  • (Boolean)

    protected-allow-sort-ranges

#protected_allow_sort_ranges?Boolean

Returns protected-allow-sort-ranges.

Returns:

  • (Boolean)

    protected-allow-sort-ranges

#queue_redraw_range(range) ⇒ nil

This queues a redraw for the indicated range. The redraw will happen when Gnumeric returns to the gui main loop.

Parameters:

  • range (Gnm::Range)

    range to redraw

Returns:

  • (nil)

#queue_respan(start_row, end_row) ⇒ nil

queues a span generation for the selected rows. the caller is responsible for queuing a redraw

Parameters:

  • start_row (Integer)
  • end_row (Integer)

Returns:

  • (nil)

#range_bounding_box(r) ⇒ nil

Parameters:

  • r (Gnm::Range)

Returns:

  • (nil)

#range_calc_spans(r, flags) ⇒ nil

This is used to re-calculate cell dimensions and re-render a cell's text. eg. if a format has changed we need to re-render the cached version of the rendered text in the cell.

Parameters:

Returns:

  • (nil)

#range_contains_merges_or_arrays(r, cc, cmd, merges, arrays) ⇒ Boolean

Check to see if the target region sheet!r contains any merged regions or arrays. Report an error to the cc if it is supplied. arrays.

Parameters:

  • r (Gnm::Range)

    the range to check.

  • cc (GOffice::CmdContext)

    an optional place to report errors.

  • cmd (String)
  • merges (Boolean)

    if true, check for merges.

  • arrays (Boolean)

    if true, check for arrays.

Returns:

  • (Boolean)

    true if the target region sheet!r contains any merged regions or

#range_has_heading(src, top, ignore_styles) ⇒ Boolean

Checks for a header row in sheet!src. If top is true it looks for a header row from the top and if false it looks for a header col from the left

Parameters:

  • src (Gnm::Range)

    GnmRange to check

  • top (Boolean)

    Flag

  • ignore_styles (Boolean)

Returns:

  • (Boolean)

    true if src seems to have a heading

#range_splits_array(r, ignore, cc, cmd) ⇒ Boolean

Check the outer edges of range sheet!r to ensure that if an array is within it then the entire array is within the range. ignore is useful when src and dest ranges may overlap.

Parameters:

  • r (Gnm::Range)

    The range to check

  • ignore (Gnm::Range)

    a range in which it is ok to have an array.

  • cc (GOffice::CmdContext)

    place to report an error.

  • cmd (String)

    cmd name used with cc.

Returns:

  • (Boolean)

    true if an array would be split.

#range_splits_region(r, ignore, cc, cmd) ⇒ Boolean

A utility to see whether moving the range r will split any arrays or merged regions.

Parameters:

  • r (Gnm::Range)

    The range whose boundaries are checked

  • ignore (Gnm::Range)

    An optional range in which it is ok to have arrays and merges

  • cc (GOffice::CmdContext)

    The context that issued the command

  • cmd (String)

    The translated command name.

Returns:

  • (Boolean)

    whether any arrays or merged regions will be split.

#range_trim(r, cols, rows) ⇒ Boolean

This removes empty rows/cols from the right hand or bottom edges of the range depending on the value of cols or rows.

Parameters:

  • r (Gnm::Range)

    range to trim empty cells from

  • cols (Boolean)

    trim from right

  • rows (Boolean)

    trim from bottom

Returns:

  • (Boolean)

    true if the range was totally empty.

#range_unrender(r) ⇒ nil

Unrenders all cells in the given range. If r is nil, the all cells in the sheet are unrendered.

Parameters:

  • r (Gnm::Range)

    range to unrender

Returns:

  • (nil)

#ranges_split_region(ranges, cc, cmd) ⇒ Boolean

A utility to see whether moving any of the ranges ranges will split any arrays or merged regions.

Parameters:

  • ranges (GLib::SList<Gnm::Range>)

    A list of ranges to check.

  • cc (GOffice::CmdContext)

    The context that issued the command

  • cmd (String)

    The translated command name.

Returns:

  • (Boolean)

    whether any arrays or merged regions will be split.

#recompute_spans_for_col(col) ⇒ nil

This routine recomputes the column span for the cells that touches the column.

Parameters:

  • col (Integer)

    The column that changed

Returns:

  • (nil)

#redraw_all(header) ⇒ nil

Parameters:

  • header (Boolean)

Returns:

  • (nil)

#redraw_range(range) ⇒ nil

Redraw the indicated range, or at least the visible parts of it.

Parameters:

  • range (Gnm::Range)

    range to redraw

Returns:

  • (nil)

#redraw_region(start_col, start_row, end_col, end_row) ⇒ nil

Parameters:

  • start_col (Integer)
  • start_row (Integer)
  • end_col (Integer)
  • end_row (Integer)

Returns:

  • (nil)

#region_queue_recalc(range) ⇒ nil

Queues things that depend on sheet!range for recalc.

If range is nil the entire sheet is used.

Parameters:

  • range (Gnm::Range)

    Range

Returns:

  • (nil)

#resize(cols, rows, cc, perr) ⇒ GOffice::Undo

Returns the newly allocated #GOUndo.

Parameters:

  • cols (Integer)

    the new columns number.

  • rows (Integer)

    the new rows number.

  • cc (GOffice::CmdContext)

    GOCmd::Context.

  • perr (Boolean)

    will be true on error.

Returns:

  • (GOffice::Undo)

    the newly allocated #GOUndo.

#row_fetch(row) ⇒ Gnm::ColRowInfo

will not be the default Col::RowInfo and may be changed.

Parameters:

  • row (Integer)

    Row number

Returns:

  • (Gnm::ColRowInfo)

    The Col::RowInfo for row row. This result

#row_get(row) ⇒ Gnm::ColRowInfo

if none has been allocated yet.

Parameters:

  • row (Integer)

    Row number

Returns:

  • (Gnm::ColRowInfo)

    A Col::RowInfo for the row, or nil

#row_get_default_size_pixelsInteger

Returns:

  • (Integer)

#row_get_default_size_ptsFloat

This function returns the raw sum, no rounding etc.

Returns:

  • (Float)

    the default number of units in a row, including margins.

#row_get_distance_pixels(from, to) ⇒ Integer

measured from the upper left corner.

Parameters:

  • from (Integer)

    Starting row

  • to (Integer)

    Ending row, not inclusive

Returns:

  • (Integer)

    the number of pixels between rows from and to

#row_get_distance_pts(from, to) ⇒ Float

measured from the upper left corner.

Parameters:

  • from (Integer)

    Starting row

  • to (Integer)

    Ending row, not inclusive

Returns:

  • (Float)

    the number of points between rows from and to

#row_get_info(row) ⇒ Gnm::ColRowInfo

the default Col::RowInfo for rows and should not be changed.

Parameters:

  • row (Integer)

    column number

Returns:

  • (Gnm::ColRowInfo)

    The Col::RowInfo for row row. This may be

#row_is_hidden(row) ⇒ Boolean

Parameters:

  • row (Integer)

Returns:

  • (Boolean)

#row_set_default_size_pixels(height_pixels) ⇒ nil

Parameters:

  • height_pixels (Integer)

Returns:

  • (nil)

#row_set_default_size_pts(height_pts) ⇒ nil

Parameters:

  • height_pts (Float)

Returns:

  • (nil)

#row_set_size_pixels(row, height_pixels, set_by_user) ⇒ nil

Sets height of a row in pixels, INCLUDING top and bottom margins, and the lower grid line.

Parameters:

  • row (Integer)

    The row

  • height_pixels (Integer)

    The desired height

  • set_by_user (Boolean)

    true if this was done by a user (ie, user manually set the width)

Returns:

  • (nil)

#row_set_size_pts(row, height_pts, set_by_user) ⇒ nil

Sets height of a row in pts, INCLUDING top and bottom margins, and the lower grid line. This is a low level internal routine. It does NOT redraw, or reposition objects.

Parameters:

  • row (Integer)

    The row

  • height_pts (Float)

    The desired height in pts

  • set_by_user (Boolean)

    true if this was done by a user (ie, user manually set the height)

Returns:

  • (nil)

#row_size_fit_pixels(row, scol, ecol, ignore_strings) ⇒ Integer

This routine computes the ideal size for the row to make all data fit properly.

Parameters:

  • row (Integer)

    the row that we want to query

  • scol (Integer)

    starting column.

  • ecol (Integer)

    ending column.

  • ignore_strings (Boolean)

    skip cells containing string values.

Returns:

  • (Integer)

    Maximum size in pixels INCLUDING margins and grid lines or 0 if there are no cells.

#rowsInteger

Returns rows.

Returns:

  • (Integer)

    rows

#rows=(rows) ⇒ Integer

Parameters:

  • rows (Integer)

Returns:

  • (Integer)

    rows

  • (Integer)

    rows

#scenario_add(sc) ⇒ nil

Parameters:

Returns:

  • (nil)

#scenario_find(name) ⇒ Gnm::Scenario

Returns the found scenario, or nil.

Parameters:

  • name (String)

    the scenario name.

Returns:

#scenario_new(name) ⇒ Gnm::Scenario

Returns the newly created Gnm::Scenario.

Parameters:

  • name (String)

    the new scenario name.

Returns:

#scenario_remove(sc) ⇒ nil

Parameters:

Returns:

  • (nil)

#scrollbar_confignil

Returns:

  • (nil)

#selection_is_allowed(pos) ⇒ Boolean

Parameters:

  • pos (Gnm::CellPos)

Returns:

  • (Boolean)

#sheet_typeGnm::SheetType

Returns sheet-type.

Returns:

#sheet_type=(sheet_type) ⇒ Gnm::SheetType

Parameters:

Returns:

#sizeGnm::SheetSize

Returns the sheet size.

Returns:

  • (Gnm::SheetSize)

    the sheet size.

#slicers_at_pos(pos) ⇒ Gnm::SheetSlicer

Returns nil or the Gnm::SheetSlicer in sheet that overlaps with pos.

Parameters:

  • pos (Gnm::CellPos)

    Gnm::CellPos

Returns:

  • (Gnm::SheetSlicer)

    nil or the Gnm::SheetSlicer in sheet that overlaps with pos.

#solver_params=(param) ⇒ nil

Parameters:

Returns:

  • (nil)

#sort_setupsGLib::HashTable<GObject>

Returns the sort setups for sheet.

Returns:

  • (GLib::HashTable<GObject>)

    the sort setups for sheet.

#style_apply_border(range, borders) ⇒ nil

When a user applies a border to a region we attempt to remove the border from the opposing side to avoid overlapping border specifications. eg if we apply a top border to a range, we would clear the bottom border of the range offset upwards.

Parameters:

  • range (Gnm::Range)

    Gnm::Range around which to place borders

  • borders (Array<Gnm::Border>)

    Border styles to set.

Returns:

  • (nil)

#style_apply_col(col, style) ⇒ nil

NOTE: This is a simple wrapper for now. When we support col/row styles it will make life easier.

Apply a partial style to a full col.

Parameters:

  • col (Integer)

    Column

  • style (Gnm::Style)

    Gnm::Style

Returns:

  • (nil)

#style_apply_pos(col, row, style) ⇒ nil

Apply a partial style to a single cell

Parameters:

  • col (Integer)
  • row (Integer)
  • style (Gnm::Style)

    Gnm::Style

Returns:

  • (nil)

#style_apply_range(range, pstyle) ⇒ nil

Apply a partial style to a region.

Parameters:

  • range (Gnm::Range)

    Gnm::Range to apply over

  • pstyle (Gnm::Style)

    A partial style to apply

Returns:

  • (nil)

#style_apply_range2(range, pstyle) ⇒ nil

Apply a partial style to a region.

Parameters:

  • range (Gnm::Range)

    Gnm::Range to apply over

  • pstyle (Gnm::Style)

    A partial style to apply

Returns:

  • (nil)

#style_apply_row(row, style) ⇒ nil

NOTE: This is a simple wrapper for now. When we support col/row styles it will make life easier.

Apply a partial style to a full col.

Parameters:

  • row (Integer)
  • style (Gnm::Style)

    Gnm::Style

Returns:

  • (nil)

#style_collect_conditions(r) ⇒ Gnm::StyleList

responsible for freeing.

Parameters:

  • r (Gnm::Range)

Returns:

  • (Gnm::StyleList)

    a list of areas with conditionals, Caller is

responsible for freeing.

Parameters:

  • r (Gnm::Range)

Returns:

  • (Gnm::StyleList)

    a list of areas with hyperlinks, Caller is

#style_collect_validations(r) ⇒ Gnm::StyleList

message.

Parameters:

  • r (Gnm::Range)

    range to restrict to

Returns:

  • (Gnm::StyleList)

    a list of areas with validation or input

#style_defaultGnm::Style

Returns default style for the sheet.

Returns:

  • (Gnm::Style)

    default style for the sheet.

#style_find(st) ⇒ Gnm::Style

Looks up a style from the sheets collection. Linking if necessary.

Parameters:

  • st (Gnm::Style)

    a style

Returns:

  • (Gnm::Style)

    the new style.

#style_find_conflicts(r, style, borders) ⇒ Integer

Returns bitmask of conflicts.

Parameters:

  • r (Gnm::Range)

    Gnm::Range to query

  • style (Gnm::Style)
  • borders (Array<Gnm::Border>)

Returns:

  • (Integer)

    bitmask of conflicts

#style_foreach(func, user_data) ⇒ nil

Executes func for each style in the sheet.

Parameters:

  • func (GLib::Func)

    callback

  • user_data (GObject)

    user data.

Returns:

  • (nil)

#style_get(col, row) ⇒ Gnm::Style

the specified cell position

Parameters:

  • col (Integer)

    column number

  • row (Integer)

    row number

Returns:

  • (Gnm::Style)

    find the fully qualified style applicable to

#style_get_auto_pattern_colorGnm::Color

in this sheet.

Returns:

  • (Gnm::Color)

    the color for rendering auto colored patterns

#style_get_extent(r) ⇒ nil

A simple implementation that finds the smallest range containing all visible styles and containing res.

Parameters:

  • r (Gnm::Range)

    starting range and resulting range

Returns:

  • (nil)

#style_get_nondefault_extent(extent, src, col_defaults) ⇒ nil

Parameters:

  • extent (Gnm::Range)
  • src (Gnm::Range)
  • col_defaults (Gnm::Style)

Returns:

  • (nil)

#style_get_nondefault_rows(col_defaults) ⇒ Integer

Parameters:

  • col_defaults (Gnm::Style)

Returns:

  • (Integer)

#style_get_range(r) ⇒ Gnm::StyleList

Get a list of rectangles and their associated styles. Caller is responsible for freeing. Note that when a range is given, the resulting ranges are relative to the input range.

Parameters:

  • r (Gnm::Range)

    optional range to scan

Returns:

  • (Gnm::StyleList)

#style_get_row(sr) ⇒ nil

A utility routine which efficiently retrieves a range of styles within a row. It also merges adjacent borders as necessary.

Parameters:

  • sr (Gnm::StyleRow)

    Gnm::StyleRow

Returns:

  • (nil)

#style_get_row2(row) ⇒ Gnm::Style

Parameters:

  • row (Integer)

Returns:

  • (Gnm::Style)

#style_initnil

Returns:

  • (nil)

#style_is_default(r, col_defaults) ⇒ Boolean

Parameters:

  • r (Gnm::Range)
  • col_defaults (Gnm::Style)

Returns:

  • (Boolean)

#style_most_common(is_col) ⇒ Gnm::Style

or row.

Parameters:

  • is_col (Boolean)

    if true, look for common styles in columns; if FALSE, look in rows.

Returns:

  • (Gnm::Style)

    an array of styles describing the most common styles, one per column

#style_optimizenil

Returns:

  • (nil)

#style_range_foreach(r, func, user_data) ⇒ nil

Parameters:

  • r (Gnm::Range)

    optional range

  • func (GLib::HFunc)

    callback.

  • user_data (GObject)

    user data

Returns:

  • (nil)

Utility routine that checks to see if a region contains at least 1 hyper link and returns the 1st one it finds.

Parameters:

  • r (Gnm::Range)

Returns:

#style_resize(cols, rows) ⇒ nil

Parameters:

  • cols (Integer)
  • rows (Integer)

Returns:

  • (nil)

#style_set_auto_pattern_color(grid_color) ⇒ nil

Set the color for rendering auto colored patterns in this sheet.

Parameters:

  • grid_color (Gnm::Color)

    The color

Returns:

  • (nil)

#style_set_list(corner, l, range_modify, data) ⇒ Gnm::SpanCalcFlags

Overwrites the styles of the ranges given by corner with the content of list. Optionally transposing the ranges

Parameters:

  • corner (Gnm::CellPos)

    The top-left corner (in LTR mode)

  • l (Gnm::StyleList)

    Gnm::StyleList

  • range_modify (Gnm::sheet_style_set_list_cb_t)
  • data (GObject)

    user data

Returns:

#style_set_pos(col, row, style) ⇒ nil

Change the complete style for a single cell.

Parameters:

  • col (Integer)
  • row (Integer)
  • style (Gnm::Style)

Returns:

  • (nil)

#style_set_range(range, style) ⇒ nil

Change the complete style for a region.

Parameters:

  • range (Gnm::Range)

    Gnm::Range being changed

  • style (Gnm::Style)

    New Gnm::Style

Returns:

  • (nil)

#style_shutdownnil

Returns:

  • (nil)

Parameters:

  • st (Gnm::Style)

Returns:

  • (nil)

#style_update_grid_color(context) ⇒ nil

This function updates the color of gnm_style_border_none when the sheet to be rendered is known. gnm_style_border_none tells how to render the grid. Because the grid color may be different for different sheets, the functions which render the grid call this function first. The rule for selecting the grid color, which is the same as in Excel, is: - if the auto pattern color is default (which is black), the grid color is gray, as returned by style_color_grid (). - otherwise, the auto pattern color is used for the grid.

Parameters:

  • context (Gtk::StyleContext)

Returns:

  • (nil)

#tab_backgroundGnm::Color

Returns tab-background.

Returns:

  • (Gnm::Color)

    tab-background

#tab_background=(tab_background) ⇒ Gnm::Color

Parameters:

  • tab_background (Gnm::Color)

Returns:

  • (Gnm::Color)

    tab-background

  • (Gnm::Color)

    tab-background

#tab_foregroundGnm::Color

Returns tab-foreground.

Returns:

  • (Gnm::Color)

    tab-foreground

#tab_foreground=(tab_foreground) ⇒ Gnm::Color

Parameters:

  • tab_foreground (Gnm::Color)

Returns:

  • (Gnm::Color)

    tab-foreground

  • (Gnm::Color)

    tab-foreground

#text_is_rtl=(text_is_rtl) ⇒ Boolean

Parameters:

  • text_is_rtl (Boolean)

Returns:

  • (Boolean)

    text-is-rtl

  • (Boolean)

    text-is-rtl

#text_is_rtl?Boolean

Returns text-is-rtl.

Returns:

  • (Boolean)

    text-is-rtl

#updatenil

Should be called after a logical command has finished processing to request redraws for any pending events, and to update the various status regions

Returns:

  • (nil)

#update_only_gridnil

Should be called after a logical command has finished processing to request redraws for any pending events

Returns:

  • (nil)

#use_r1c1=(use_r1c1) ⇒ Boolean

Parameters:

  • use_r1c1 (Boolean)

Returns:

  • (Boolean)

    use-r1c1

  • (Boolean)

    use-r1c1

#use_r1c1?Boolean

Returns use-r1c1.

Returns:

  • (Boolean)

    use-r1c1

#visibilityGnm::SheetVisibility

Returns visibility.

Returns:

#visibility=(visibility) ⇒ Gnm::SheetVisibility

Parameters:

Returns:

#workbookGnm::Workbook

Returns workbook.

Returns:

#workbook=(workbook) ⇒ Gnm::Workbook

Parameters:

Returns:

#zoom_factorFloat

Returns zoom-factor.

Returns:

  • (Float)

    zoom-factor

#zoom_factor=(zoom_factor) ⇒ Float

Parameters:

  • zoom_factor (Float)

Returns:

  • (Float)

    zoom-factor

  • (Float)

    zoom-factor