LibreOffice Module sc (master) 1
|
#include <sharedformula.hxx>
Static Public Member Functions | |
template<typename Iter > | |
static void | groupFormulaCells (const Iter &itBeg, const Iter &itEnd) |
Group formula cells stored in the passed container. More... | |
static const ScFormulaCell * | getSharedTopFormulaCell (const CellStoreType::position_type &aPos) |
Get shared formula top cell from position, if any, else nullptr. More... | |
static bool | splitFormulaCellGroup (const CellStoreType::position_type &aPos, sc::EndListeningContext *pCxt) |
Split existing shared formula range at specified position. More... | |
static bool | splitFormulaCellGroups (const ScDocument &rDoc, CellStoreType &rCells, std::vector< SCROW > &rBounds) |
Split existing shared formula ranges at specified row positions. More... | |
static bool | joinFormulaCells (const CellStoreType::position_type &rPos, ScFormulaCell &rCell1, ScFormulaCell &rCell2) |
See if two specified adjacent formula cells can be merged, and if they can, merge them into the same group. More... | |
static bool | joinFormulaCellAbove (const CellStoreType::position_type &aPos) |
Merge with an existing formula group (if any) located immediately above if the cell at specified position is a formula cell, and its formula tokens are identical to that of the above formula group. More... | |
static void | unshareFormulaCell (const CellStoreType::position_type &aPos, ScFormulaCell &rCell) |
Turn a shared formula cell into a non-shared one, and split it off from the adjacent formula cell groups. More... | |
static void | unshareFormulaCells (const ScDocument &rDoc, CellStoreType &rCells, std::vector< SCROW > &rRows) |
Make specified formula cells non-shared ones, and split them off from their respective adjacent formula cell groups. More... | |
static void | startListeningAsGroup (StartListeningContext &rCxt, ScFormulaCell **ppSharedTop) |
Have all formula cells belonging to a group start listening to their references. More... | |
Definition at line 23 of file sharedformula.hxx.
|
static |
Get shared formula top cell from position, if any, else nullptr.
Definition at line 20 of file sharedformula.cxx.
References sc::element_type_formula, ScFormulaCell::GetCellGroup(), and ScFormulaCell::IsShared().
Referenced by ScColumn::DetachFormulaCells().
|
inlinestatic |
Group formula cells stored in the passed container.
The formula cells in the container are assumed to be all non-shared.
Definition at line 32 of file sharedformula.hxx.
References ScFormulaCell::CompareByTokenArray(), ScFormulaCell::CreateCellGroup(), ScFormulaCell::EqualInvariant, ScFormulaCell::GetCellGroup(), ScFormulaCell::NotEqual, and ScFormulaCell::SetCellGroup().
|
static |
Merge with an existing formula group (if any) located immediately above if the cell at specified position is a formula cell, and its formula tokens are identical to that of the above formula group.
aPos | position of cell to examine. |
Definition at line 212 of file sharedformula.cxx.
References sc::element_type_formula, and joinFormulaCells().
Referenced by ScColumn::AttachFormulaCells(), ScColumn::DeleteRow(), ScColumn::MoveTo(), ScTable::SortReorderByColumn(), and ScColumn::UpdateReferenceOnCopy().
|
static |
See if two specified adjacent formula cells can be merged, and if they can, merge them into the same group.
rPos | position object of the first cell |
rCell1 | first cell |
rCell2 | second cell located immediately below the first cell. |
Definition at line 149 of file sharedformula.cxx.
References ScDocument::AddDelayedFormulaGroupingCell(), ScFormulaCell::aPos, ScFormulaCell::CompareByTokenArray(), ScFormulaCell::CreateCellGroup(), ScFormulaCell::EqualInvariant, ScFormulaCell::GetCellGroup(), ScFormulaCell::GetDocument(), i, ScDocument::IsDelayedFormulaGrouping(), n, ScFormulaCell::NotEqual, ScAddress::Row(), and ScFormulaCell::SetCellGroup().
Referenced by joinFormulaCellAbove(), and ScColumn::JoinNewFormulaCell().
|
static |
Split existing shared formula range at specified position.
The cell at specified position becomes the top cell of the lower shared formula range after this call. This method does nothing if the cell at specified position is not a formula cell.
aPos | position of cell to examine. |
pCxt | context to be used, if any, may be nullptr. |
Definition at line 36 of file sharedformula.cxx.
References ScFormulaCell::aPos, sc::element_type_formula, ScFormulaCell::EndListeningTo(), ScFormulaCell::GetCellGroup(), ScFormulaCell::GetDocument(), ScFormulaCell::GetSharedTopRow(), ScFormulaCell::IsShared(), ScAddress::Row(), ScFormulaCell::SetCellGroup(), ScFormulaCell::SetNeedsListening(), and ScAddress::UNINITIALIZED.
Referenced by ScColumn::DetachFormulaCells(), ScColumn::MoveTo(), and splitFormulaCellGroups().
|
static |
Split existing shared formula ranges at specified row positions.
rCells | cell storage container |
rBounds | row positions at which to split existing shared formula ranges. Note that this method will directly modify this parameter to sort and remove duplicates. |
Definition at line 117 of file sharedformula.cxx.
References splitFormulaCellGroup(), and ScDocument::ValidRow().
Referenced by ScColumn::ConvertFormulaToValue(), ScColumn::SplitFormulaGroupByRelativeRef(), ScTable::SplitFormulaGroups(), ScColumn::SwapNonEmpty(), unshareFormulaCells(), and ScColumn::UpdateReference().
|
static |
Have all formula cells belonging to a group start listening to their references.
rCxt | context object. |
ppSharedTop | memory position of the pointer of the topmost formula cell instance in the cell storage. The caller is responsible for ensuring that it is indeed the topmost cell of a shared formula group. |
Definition at line 353 of file sharedformula.cxx.
References ScRange::aEnd, ScFormulaCell::aPos, BCA_LISTEN_ALWAYS, ScFormulaCell::GetCellGroup(), ScFormulaCell::GetCode(), formula::FormulaTokenArray::GetCode(), formula::FormulaTokenArray::GetCodeLen(), sc::StartListeningContext::getDoc(), ScFormulaCell::GetSharedLength(), ScAddress::IncRow(), formula::FormulaTokenArray::IsRecalcModeAlways(), ScSingleRefData::IsRowRel(), ScFormulaCell::IsSharedTop(), ScAddress::IsValid(), p, ScDocument::SetDetectiveDirty(), ScFormulaCell::SetNeedsListening(), ScDocument::StartListeningArea(), ScDocument::StartListeningCell(), ScFormulaCell::StartListeningTo(), formula::svDoubleRef, formula::svSingleRef, t, and ScSingleRefData::toAbs().
|
static |
Turn a shared formula cell into a non-shared one, and split it off from the adjacent formula cell groups.
aPos | position of cell to examine |
rCell | formula cell instance |
Definition at line 230 of file sharedformula.cxx.
References ScFormulaCell::aPos, ScFormulaCell::GetCellGroup(), ScFormulaCell::GetSharedLength(), ScFormulaCell::GetSharedTopRow(), ScFormulaCell::IsShared(), ScAddress::Row(), and ScFormulaCell::SetCellGroup().
Referenced by ScColumn::DeleteContent(), ScColumn::DetachFormulaCell(), and ScDocumentImport::setFormulaCell().
|
static |
Make specified formula cells non-shared ones, and split them off from their respective adjacent formula cell groups.
rCells | cell storage container |
rRows | row positions at which to unshare formula cells. |
Definition at line 325 of file sharedformula.cxx.
References ScDocument::MaxRow(), and splitFormulaCellGroups().
Referenced by ScTable::UnshareFormulaCells().