LibreOffice Module sc (master) 1
|
Accessor class to ScDocument. More...
#include <documentimport.hxx>
Classes | |
struct | Attrs |
Public Member Functions | |
ScDocumentImport ()=delete | |
ScDocumentImport (ScDocument &rDoc) | |
ScDocumentImport (const ScDocumentImport &)=delete | |
const ScDocumentImport & | operator= (const ScDocumentImport &)=delete |
~ScDocumentImport () | |
ScDocument & | getDoc () |
const ScDocument & | getDoc () const |
void | initForSheets () |
Initialize the storage for all sheets after all the sheet instances have been created in the document. More... | |
void | setDefaultNumericScript (SvtScriptType nScript) |
void | setCellStyleToSheet (SCTAB nTab, const ScStyleSheet &rStyle) |
Apply specified cell style to an entire sheet. More... | |
SCTAB | getSheetIndex (const OUString &rName) const |
SCTAB | getSheetCount () const |
bool | appendSheet (const OUString &rName) |
void | setSheetName (SCTAB nTab, const OUString &rName) |
void | setOriginDate (sal_uInt16 nYear, sal_uInt16 nMonth, sal_uInt16 nDay) |
void | setAutoInput (const ScAddress &rPos, const OUString &rStr, const ScSetStringParam *pStringParam=nullptr) |
void | setNumericCell (const ScAddress &rPos, double fVal) |
void | setStringCell (const ScAddress &rPos, const OUString &rStr) |
void | setEditCell (const ScAddress &rPos, std::unique_ptr< EditTextObject > pEditText) |
void | setFormulaCell (const ScAddress &rPos, const OUString &rFormula, formula::FormulaGrammar::Grammar eGrammar, const double *pResult=nullptr) |
void | setFormulaCell (const ScAddress &rPos, const OUString &rFormula, formula::FormulaGrammar::Grammar eGrammar, const OUString &rResult) |
void | setFormulaCell (const ScAddress &rPos, std::unique_ptr< ScTokenArray > pArray) |
void | setFormulaCell (const ScAddress &rPos, ScFormulaCell *pCell) |
void | setMatrixCells (const ScRange &rRange, const ScTokenArray &rArray, formula::FormulaGrammar::Grammar eGrammar) |
void | setTableOpCells (const ScRange &rRange, const ScTabOpParam &rParam) |
void | fillDownCells (const ScAddress &rPos, SCROW nFillSize) |
void | setAttrEntries (SCTAB nTab, SCCOL nColStart, SCCOL nColEnd, Attrs &&rAttrs) |
Set an array of cell attributes to specified range of columns. More... | |
void | setRowsVisible (SCTAB nTab, SCROW nRowStart, SCROW nRowEnd, bool bVisible) |
void | setMergedCells (SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) |
void | invalidateBlockPositionSet (SCTAB nTab) |
void | finalize () |
void | broadcastRecalcAfterImport () |
Broadcast all formula cells that are marked with FormulaTokenArray::IsRecalcModeMustAfterImport() for a subsequent ScDocument::CalcFormulaTree(). More... | |
bool | isLatinScript (sal_uInt32 nFormat) |
small cache for hot call during import More... | |
bool | isLatinScript (const ScPatternAttr &) |
Private Member Functions | |
void | initColumn (ScColumn &rCol) |
Static Private Member Functions | |
static void | broadcastRecalcAfterImportColumn (ScColumn &rCol) |
Private Attributes | |
std::unique_ptr< ScDocumentImportImpl > | mpImpl |
Accessor class to ScDocument.
Its purpose is to allow import filter to fill the document model and nothing but that. Filling the document via this class does not trigger any kind of broadcasting, drawing object position calculation, or anything else that requires expensive computation which are unnecessary and undesirable during import.
Definition at line 40 of file documentimport.hxx.
|
delete |
ScDocumentImport::ScDocumentImport | ( | ScDocument & | rDoc | ) |
Definition at line 126 of file documentimport.cxx.
|
delete |
ScDocumentImport::~ScDocumentImport | ( | ) |
Definition at line 128 of file documentimport.cxx.
bool ScDocumentImport::appendSheet | ( | const OUString & | rName | ) |
Definition at line 175 of file documentimport.cxx.
References mpImpl, and ValidTab().
Referenced by ScOrcusFactory::append_sheet().
void ScDocumentImport::broadcastRecalcAfterImport | ( | ) |
Broadcast all formula cells that are marked with FormulaTokenArray::IsRecalcModeMustAfterImport() for a subsequent ScDocument::CalcFormulaTree().
Definition at line 815 of file documentimport.cxx.
References ScTable::aCol, broadcastRecalcAfterImportColumn(), mpImpl, and ScColContainer::size().
Referenced by oox::xls::WorkbookFragment::recalcFormulaCells().
|
staticprivate |
Definition at line 832 of file documentimport.cxx.
References ScColumn::maCells.
Referenced by broadcastRecalcAfterImport().
Definition at line 566 of file documentimport.cxx.
References ScTable::aCol, CELLTYPE_STRING, CELLTYPE_VALUE, ScAddress::Col(), ScRefCellValue::getDouble(), ScRefCellValue::getSharedString(), ScRefCellValue::getType(), sc::ColumnBlockPosition::miCellPos, mpImpl, ScAddress::Row(), and ScAddress::Tab().
Referenced by ScOrcusFactory::finalize().
void ScDocumentImport::finalize | ( | ) |
Definition at line 760 of file documentimport.cxx.
References ScTable::aCol, initColumn(), mpImpl, and ScColContainer::size().
Referenced by ScOrcusFactory::finalize(), oox::xls::WorkbookFragment::finalizeImport(), ImportExcel::Read(), and ImportExcel8::Read().
ScDocument & ScDocumentImport::getDoc | ( | ) |
Definition at line 132 of file documentimport.cxx.
References mpImpl.
Referenced by ScMyTables::AddMatrixRange(), ScOrcusStyles::applyXfToItemSet(), ScOrcusNamedExpression::commit(), ScOrcusFormula::commit(), ScOrucsImportCellStyle::commit(), ExcelToSc::Convert(), ScXMLExternalRefCellContext::endFastElement(), XclImpXFRangeBuffer::Finalize(), ScOrcusFactory::finalize(), oox::xls::PivotTable::finalizeFieldsImport(), oox::xls::FormulaBuffer::finalizeImport(), oox::xls::PivotTableBuffer::finalizeImport(), oox::xls::SheetDataBuffer::finalizeImport(), ImportExcel::Formula(), oox::xls::WorksheetGlobals::getHyperlinkUrl(), oox::xls::WorksheetHelper::getScDocument(), oox::xls::WorksheetGlobals::initializeWorksheetImport(), oox::xls::WorksheetGlobals::insertHyperlink(), lcl_PutString(), ScXMLTableRowCellContext::PutFormulaCell(), oox::xls::WorksheetHelper::putFormulaTokens(), ScOrcusRefResolver::resolve_address(), ScOrcusRefResolver::resolve_range(), ScOrcusStyles::ScOrcusStyles(), ScOrcusSheet::set_column_format(), ScOrcusSheetProperties::set_column_hidden(), ScOrcusSheetProperties::set_column_width(), ScOrcusSheet::set_date_time(), ScOrcusSheet::set_row_format(), ScOrcusSheetProperties::set_row_height(), ScOrcusSheetProperties::set_row_hidden(), setCellStyleToSheet(), ExcelToSc::SetComplCol(), ExcelToSc::SetComplRow(), setRowsVisible(), XclImpStringHelper::SetToDocument(), ImportExcel::Shrfmla(), oox::xls::Xf::writeToDoc(), and XclImpPCItem::WriteToSource().
const ScDocument & ScDocumentImport::getDoc | ( | ) | const |
Definition at line 137 of file documentimport.cxx.
References mpImpl.
SCTAB ScDocumentImport::getSheetCount | ( | ) | const |
Definition at line 170 of file documentimport.cxx.
References mpImpl.
Referenced by ScOrcusFactory::append_sheet(), and oox::xls::WorksheetBuffer::getAllSheetCount().
SCTAB ScDocumentImport::getSheetIndex | ( | const OUString & | rName | ) | const |
rName | sheet name. |
Definition at line 161 of file documentimport.cxx.
References mpImpl.
Referenced by ScOrcusFactory::get_sheet().
|
private |
Definition at line 778 of file documentimport.cxx.
References ScColumn::CellStorageModified(), ScColumn::maCells, ScColumn::maCellTextAttrs, mpImpl, ScColumn::nCol, ScColumn::nTab, and ScColumn::RegroupFormulaCells().
Referenced by finalize().
void ScDocumentImport::initForSheets | ( | ) |
Initialize the storage for all sheets after all the sheet instances have been created in the document.
Definition at line 142 of file documentimport.cxx.
References mpImpl.
void ScDocumentImport::invalidateBlockPositionSet | ( | SCTAB | nTab | ) |
Definition at line 198 of file documentimport.cxx.
References mpImpl.
Referenced by oox::xls::SheetDataBuffer::finalizeImport().
bool ScDocumentImport::isLatinScript | ( | const ScPatternAttr & | rPatAttr | ) |
Definition at line 839 of file documentimport.cxx.
References ScPatternAttr::GetNumberFormat(), isLatinScript(), and mpImpl.
bool ScDocumentImport::isLatinScript | ( | sal_uInt32 | nFormat | ) |
small cache for hot call during import
Definition at line 846 of file documentimport.cxx.
References sc::NumFmtUtil::isLatinScript(), and mpImpl.
Referenced by oox::xls::Xf::applyPatternToAttrList(), and isLatinScript().
|
delete |
References finalize().
void ScDocumentImport::setAttrEntries | ( | SCTAB | nTab, |
SCCOL | nColStart, | ||
SCCOL | nColEnd, | ||
Attrs && | rAttrs | ||
) |
Set an array of cell attributes to specified range of columns.
This call transfers the ownership of the ScAttrEntry array from the caller to the column.
Definition at line 601 of file documentimport.cxx.
References mpImpl, and ScTable::SetAttrEntries().
Referenced by XclImpXFRangeBuffer::Finalize(), and oox::xls::SheetDataBuffer::finalizeImport().
void ScDocumentImport::setAutoInput | ( | const ScAddress & | rPos, |
const OUString & | rStr, | ||
const ScSetStringParam * | pStringParam = nullptr |
||
) |
Definition at line 203 of file documentimport.cxx.
References ScTable::aCol, CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_STRING, CELLTYPE_VALUE, ScAddress::Col(), ScFormulaCell::GetCode(), ScCellValue::getDouble(), ScCellValue::getFormula(), ScCellValue::getSharedString(), ScCellValue::getType(), ScSetStringParam::mbCheckLinkFormula, sc::ColumnBlockPosition::miCellPos, mpImpl, ScCellValue::releaseEditText(), ScCellValue::releaseFormula(), ScAddress::Row(), and ScAddress::Tab().
Referenced by ScOrcusFactory::finalize(), and lcl_PutString().
void ScDocumentImport::setCellStyleToSheet | ( | SCTAB | nTab, |
const ScStyleSheet & | rStyle | ||
) |
Apply specified cell style to an entire sheet.
Definition at line 152 of file documentimport.cxx.
References ScTable::ApplyStyleArea(), getDoc(), and mpImpl.
Referenced by oox::xls::WorksheetGlobals::initializeWorksheetImport().
void ScDocumentImport::setDefaultNumericScript | ( | SvtScriptType | nScript | ) |
Definition at line 147 of file documentimport.cxx.
References mpImpl.
void ScDocumentImport::setEditCell | ( | const ScAddress & | rPos, |
std::unique_ptr< EditTextObject > | pEditText | ||
) |
Definition at line 281 of file documentimport.cxx.
References ScTable::aCol, ScAddress::Col(), sc::ColumnBlockPosition::miCellPos, mpImpl, ScAddress::Row(), and ScAddress::Tab().
Referenced by oox::xls::WorksheetGlobals::insertHyperlink(), lcl_PutString(), oox::xls::WorksheetHelper::putRichString(), ScXMLTableRowCellContext::PutTextCell(), and XclImpStringHelper::SetToDocument().
void ScDocumentImport::setFormulaCell | ( | const ScAddress & | rPos, |
const OUString & | rFormula, | ||
formula::FormulaGrammar::Grammar | eGrammar, | ||
const double * | pResult = nullptr |
||
) |
Definition at line 297 of file documentimport.cxx.
References ScTable::aCol, ScAddress::Col(), sc::ColumnBlockPosition::miCellPos, mpImpl, ScAddress::Row(), and ScAddress::Tab().
Referenced by ScOrcusFactory::finalize(), ImportExcel::Formula(), ScXMLTableRowCellContext::PutFormulaCell(), oox::xls::WorksheetHelper::putFormulaTokens(), ImportExcel::ReadBoolErr(), ImportExcel::Shrfmla(), and XclImpPCItem::WriteToSource().
void ScDocumentImport::setFormulaCell | ( | const ScAddress & | rPos, |
const OUString & | rFormula, | ||
formula::FormulaGrammar::Grammar | eGrammar, | ||
const OUString & | rResult | ||
) |
Definition at line 326 of file documentimport.cxx.
References ScTable::aCol, ScAddress::Col(), sc::ColumnBlockPosition::miCellPos, mpImpl, ScAddress::Row(), and ScAddress::Tab().
void ScDocumentImport::setFormulaCell | ( | const ScAddress & | rPos, |
ScFormulaCell * | pCell | ||
) |
Definition at line 373 of file documentimport.cxx.
References ScTable::aCol, ScAddress::Col(), sc::element_type_formula, ScFormulaCell::GetCode(), sc::ColumnBlockPosition::miCellPos, mpImpl, p, ScAddress::Row(), ScAddress::Tab(), and sc::SharedFormulaUtil::unshareFormulaCell().
void ScDocumentImport::setFormulaCell | ( | const ScAddress & | rPos, |
std::unique_ptr< ScTokenArray > | pArray | ||
) |
Definition at line 352 of file documentimport.cxx.
References ScTable::aCol, ScAddress::Col(), sc::ColumnBlockPosition::miCellPos, mpImpl, ScAddress::Row(), and ScAddress::Tab().
void ScDocumentImport::setMatrixCells | ( | const ScRange & | rRange, |
const ScTokenArray & | rArray, | ||
formula::FormulaGrammar::Grammar | eGrammar | ||
) |
Definition at line 400 of file documentimport.cxx.
References aArr, ScTable::aCol, ScRange::aEnd, ScRange::aStart, ScAddress::Col(), Formula, ScFormulaCell::GetCode(), ScSingleRefData::InitFlags(), utl::ConfigManager::IsFuzzing(), sc::ColumnBlockPosition::miCellPos, mpImpl, Reference, ScAddress::Row(), ScSingleRefData::SetAddress(), ScAddress::SetCol(), ScSingleRefData::SetColRel(), ScFormulaCell::SetMatColsRows(), ScAddress::SetRow(), ScSingleRefData::SetRowRel(), ScSingleRefData::SetTabRel(), t, and ScAddress::Tab().
Referenced by ScMyTables::AddMatrixRange(), ImportExcel::Array25(), ImportExcel::Array34(), and ScOrcusFactory::finalize().
void ScDocumentImport::setMergedCells | ( | SCTAB | nTab, |
SCCOL | nCol1, | ||
SCROW | nRow1, | ||
SCCOL | nCol2, | ||
SCROW | nRow2 | ||
) |
Definition at line 631 of file documentimport.cxx.
References mpImpl, and ScTable::SetMergedCells().
Referenced by ScOrcusSheetProperties::set_merge_cell_range().
void ScDocumentImport::setNumericCell | ( | const ScAddress & | rPos, |
double | fVal | ||
) |
Definition at line 247 of file documentimport.cxx.
References ScTable::aCol, ScAddress::Col(), sc::ColumnBlockPosition::miCellPos, mpImpl, ScAddress::Row(), and ScAddress::Tab().
Referenced by ScOrcusFactory::finalize(), lcl_PutString(), ImportExcel::Mulrk(), ScXMLTableRowCellContext::PutValueCell(), ImportExcel::ReadInteger(), ImportExcel::ReadNumber(), ImportExcel::ReadRk(), oox::xls::SheetDataBuffer::setValueCell(), and XclImpPCItem::WriteToSource().
void ScDocumentImport::setOriginDate | ( | sal_uInt16 | nYear, |
sal_uInt16 | nMonth, | ||
sal_uInt16 | nDay | ||
) |
Definition at line 190 of file documentimport.cxx.
References mpImpl.
Referenced by ScOrcusGlobalSettings::set_origin_date().
Definition at line 617 of file documentimport.cxx.
References bVisible, getDoc(), ScDocument::SetDrawPageSize(), ScDocument::ShowRows(), and ScDocument::UpdatePageBreaks().
Referenced by ScXMLTableRowContext::endFastElement().
void ScDocumentImport::setSheetName | ( | SCTAB | nTab, |
const OUString & | rName | ||
) |
Definition at line 185 of file documentimport.cxx.
References mpImpl.
Referenced by ScOrcusFactory::append_sheet().
void ScDocumentImport::setStringCell | ( | const ScAddress & | rPos, |
const OUString & | rStr | ||
) |
Definition at line 262 of file documentimport.cxx.
References ScTable::aCol, ScAddress::Col(), svl::SharedString::getData(), sc::ColumnBlockPosition::miCellPos, mpImpl, ScAddress::Row(), and ScAddress::Tab().
Referenced by ScOrcusFactory::finalize(), lcl_PutString(), ScXMLTableRowCellContext::PutTextCell(), oox::xls::SheetDataBuffer::setStringCell(), XclImpStringHelper::SetToDocument(), XclImpPCField::WriteFieldNameToSource(), and XclImpPCItem::WriteToSource().
void ScDocumentImport::setTableOpCells | ( | const ScRange & | rRange, |
const ScTabOpParam & | rParam | ||
) |
Definition at line 478 of file documentimport.cxx.
References ScTable::aCol, ScRange::aEnd, ScTabOpParam::aRefColCell, ScTabOpParam::aRefFormulaCell, ScTabOpParam::aRefFormulaEnd, ScTabOpParam::aRefRowCell, ScRange::aStart, ScAddress::Col(), ScRefAddress::Col(), ScTabOpParam::Column, ScRefAddress::GetAddress(), formula::FormulaCompiler::GetNativeSymbol(), ScRefAddress::GetRefString(), formula::FormulaGrammar::GRAM_NATIVE, ScTabOpParam::meMode, sc::ColumnBlockPosition::miCellPos, mpImpl, NONE, ocClose, ocOpen, ocSep, ocTableOp, ScAddress::Row(), ScRefAddress::Row(), ScTabOpParam::Row, ScRefAddress::Set(), and ScAddress::Tab().
Referenced by oox::xls::SheetDataBuffer::finalizeTableOperation(), and ImportExcel::TableOp().
|
private |
Definition at line 42 of file documentimport.hxx.
Referenced by appendSheet(), broadcastRecalcAfterImport(), fillDownCells(), finalize(), getDoc(), getSheetCount(), getSheetIndex(), initColumn(), initForSheets(), invalidateBlockPositionSet(), isLatinScript(), setAttrEntries(), setAutoInput(), setCellStyleToSheet(), setDefaultNumericScript(), setEditCell(), setFormulaCell(), setMatrixCells(), setMergedCells(), setNumericCell(), setOriginDate(), setSheetName(), setStringCell(), and setTableOpCells().