LibreOffice Module sc (master) 1
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ScDocumentImport Class Reference

Accessor class to ScDocument. More...

#include <documentimport.hxx>

Classes

struct  Attrs
 

Public Member Functions

 ScDocumentImport ()=delete
 
 ScDocumentImport (ScDocument &rDoc)
 
 ScDocumentImport (const ScDocumentImport &)=delete
 
const ScDocumentImportoperator= (const ScDocumentImport &)=delete
 
 ~ScDocumentImport ()
 
ScDocumentgetDoc ()
 
const ScDocumentgetDoc () 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< ScDocumentImportImplmpImpl
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ScDocumentImport() [1/3]

ScDocumentImport::ScDocumentImport ( )
delete

◆ ScDocumentImport() [2/3]

ScDocumentImport::ScDocumentImport ( ScDocument rDoc)

Definition at line 126 of file documentimport.cxx.

◆ ScDocumentImport() [3/3]

ScDocumentImport::ScDocumentImport ( const ScDocumentImport )
delete

◆ ~ScDocumentImport()

ScDocumentImport::~ScDocumentImport ( )

Definition at line 128 of file documentimport.cxx.

Member Function Documentation

◆ appendSheet()

bool ScDocumentImport::appendSheet ( const OUString &  rName)

Definition at line 175 of file documentimport.cxx.

References mpImpl, and ValidTab().

Referenced by ScOrcusFactory::append_sheet().

◆ broadcastRecalcAfterImport()

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().

◆ broadcastRecalcAfterImportColumn()

void ScDocumentImport::broadcastRecalcAfterImportColumn ( ScColumn rCol)
staticprivate

Definition at line 832 of file documentimport.cxx.

References ScColumn::maCells.

Referenced by broadcastRecalcAfterImport().

◆ fillDownCells()

void ScDocumentImport::fillDownCells ( const ScAddress rPos,
SCROW  nFillSize 
)

◆ finalize()

void ScDocumentImport::finalize ( )

◆ getDoc() [1/2]

ScDocument & ScDocumentImport::getDoc ( )

◆ getDoc() [2/2]

const ScDocument & ScDocumentImport::getDoc ( ) const

Definition at line 137 of file documentimport.cxx.

References mpImpl.

◆ getSheetCount()

SCTAB ScDocumentImport::getSheetCount ( ) const

◆ getSheetIndex()

SCTAB ScDocumentImport::getSheetIndex ( const OUString &  rName) const
Parameters
rNamesheet name.
Returns
0-based sheet index, or -1 in case no sheet is found by specified name.

Definition at line 161 of file documentimport.cxx.

References mpImpl.

Referenced by ScOrcusFactory::get_sheet().

◆ initColumn()

void ScDocumentImport::initColumn ( ScColumn rCol)
private

◆ initForSheets()

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.

◆ invalidateBlockPositionSet()

void ScDocumentImport::invalidateBlockPositionSet ( SCTAB  nTab)

Definition at line 198 of file documentimport.cxx.

References mpImpl.

Referenced by oox::xls::SheetDataBuffer::finalizeImport().

◆ isLatinScript() [1/2]

bool ScDocumentImport::isLatinScript ( const ScPatternAttr rPatAttr)

Definition at line 839 of file documentimport.cxx.

References ScPatternAttr::GetNumberFormat(), isLatinScript(), and mpImpl.

◆ isLatinScript() [2/2]

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().

◆ operator=()

const ScDocumentImport & ScDocumentImport::operator= ( const ScDocumentImport )
delete

References finalize().

◆ setAttrEntries()

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().

◆ setAutoInput()

void ScDocumentImport::setAutoInput ( const ScAddress rPos,
const OUString &  rStr,
const ScSetStringParam pStringParam = nullptr 
)

◆ setCellStyleToSheet()

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().

◆ setDefaultNumericScript()

void ScDocumentImport::setDefaultNumericScript ( SvtScriptType  nScript)

Definition at line 147 of file documentimport.cxx.

References mpImpl.

◆ setEditCell()

void ScDocumentImport::setEditCell ( const ScAddress rPos,
std::unique_ptr< EditTextObject pEditText 
)

◆ setFormulaCell() [1/4]

void ScDocumentImport::setFormulaCell ( const ScAddress rPos,
const OUString &  rFormula,
formula::FormulaGrammar::Grammar  eGrammar,
const double *  pResult = nullptr 
)

◆ setFormulaCell() [2/4]

void ScDocumentImport::setFormulaCell ( const ScAddress rPos,
const OUString &  rFormula,
formula::FormulaGrammar::Grammar  eGrammar,
const OUString &  rResult 
)

◆ setFormulaCell() [3/4]

void ScDocumentImport::setFormulaCell ( const ScAddress rPos,
ScFormulaCell pCell 
)

◆ setFormulaCell() [4/4]

void ScDocumentImport::setFormulaCell ( const ScAddress rPos,
std::unique_ptr< ScTokenArray pArray 
)

◆ setMatrixCells()

void ScDocumentImport::setMatrixCells ( const ScRange rRange,
const ScTokenArray rArray,
formula::FormulaGrammar::Grammar  eGrammar 
)

◆ setMergedCells()

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().

◆ setNumericCell()

void ScDocumentImport::setNumericCell ( const ScAddress rPos,
double  fVal 
)

◆ setOriginDate()

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().

◆ setRowsVisible()

void ScDocumentImport::setRowsVisible ( SCTAB  nTab,
SCROW  nRowStart,
SCROW  nRowEnd,
bool  bVisible 
)

◆ setSheetName()

void ScDocumentImport::setSheetName ( SCTAB  nTab,
const OUString &  rName 
)

Definition at line 185 of file documentimport.cxx.

References mpImpl.

Referenced by ScOrcusFactory::append_sheet().

◆ setStringCell()

void ScDocumentImport::setStringCell ( const ScAddress rPos,
const OUString &  rStr 
)

◆ setTableOpCells()

void ScDocumentImport::setTableOpCells ( const ScRange rRange,
const ScTabOpParam rParam 
)

Member Data Documentation

◆ mpImpl

std::unique_ptr<ScDocumentImportImpl> ScDocumentImport::mpImpl
private

The documentation for this class was generated from the following files: