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 nCol, Attrs &&rAttrs)
 Set an array of cell attributes to specified column. More...
 
void setRowsVisible (SCTAB nTab, SCROW nRowStart, SCROW nRowEnd, bool bVisible)
 
void setMergedCells (SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
 
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::ScDocumentImport ( )
delete
ScDocumentImport::ScDocumentImport ( ScDocument rDoc)

Definition at line 117 of file documentimport.cxx.

ScDocumentImport::ScDocumentImport ( const ScDocumentImport )
delete
ScDocumentImport::~ScDocumentImport ( )

Definition at line 119 of file documentimport.cxx.

Member Function Documentation

bool ScDocumentImport::appendSheet ( const OUString &  rName)

Definition at line 166 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 797 of file documentimport.cxx.

References ScTable::aCol, broadcastRecalcAfterImportColumn(), and ScColContainer::size().

Referenced by oox::xls::WorkbookFragment::recalcFormulaCells().

void ScDocumentImport::broadcastRecalcAfterImportColumn ( ScColumn rCol)
staticprivate

Definition at line 814 of file documentimport.cxx.

References ScColumn::maCells.

Referenced by broadcastRecalcAfterImport().

void ScDocumentImport::fillDownCells ( const ScAddress rPos,
SCROW  nFillSize 
)
void ScDocumentImport::finalize ( )
ScDocument & ScDocumentImport::getDoc ( )
const ScDocument & ScDocumentImport::getDoc ( ) const

Definition at line 128 of file documentimport.cxx.

References mpImpl.

SCTAB ScDocumentImport::getSheetCount ( ) const
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 152 of file documentimport.cxx.

References mpImpl.

Referenced by ScOrcusFactory::get_sheet().

void ScDocumentImport::initColumn ( ScColumn rCol)
private
void ScDocumentImport::initForSheets ( )

Initialize the storage for all sheets after all the sheet instances have been created in the document.

Definition at line 133 of file documentimport.cxx.

References mpImpl.

bool ScDocumentImport::isLatinScript ( sal_uInt32  nFormat)

small cache for hot call during import

Definition at line 828 of file documentimport.cxx.

References sc::NumFmtUtil::isLatinScript().

Referenced by oox::xls::Xf::applyPatternToAttrList(), and isLatinScript().

bool ScDocumentImport::isLatinScript ( const ScPatternAttr rPatAttr)

Definition at line 821 of file documentimport.cxx.

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

const ScDocumentImport& ScDocumentImport::operator= ( const ScDocumentImport )
delete
void ScDocumentImport::setAttrEntries ( SCTAB  nTab,
SCCOL  nCol,
Attrs &&  rAttrs 
)

Set an array of cell attributes to specified column.

This call transfers the ownership of the ScAttrEntry array from the caller to the column.

Definition at line 582 of file documentimport.cxx.

References ScTable::FetchColumn(), mpImpl, and ScColumn::pAttrArray.

Referenced by XclImpXFRangeBuffer::Finalize(), and oox::xls::SheetDataBuffer::finalizeImport().

void ScDocumentImport::setAutoInput ( const ScAddress rPos,
const OUString &  rStr,
const ScSetStringParam pStringParam = nullptr 
)
void ScDocumentImport::setCellStyleToSheet ( SCTAB  nTab,
const ScStyleSheet rStyle 
)

Apply specified cell style to an entire sheet.

Definition at line 143 of file documentimport.cxx.

References ScTable::ApplyStyleArea(), getDoc(), and mpImpl.

Referenced by oox::xls::WorksheetGlobals::initializeWorksheetImport().

void ScDocumentImport::setDefaultNumericScript ( SvtScriptType  nScript)

Definition at line 138 of file documentimport.cxx.

References mpImpl.

void ScDocumentImport::setEditCell ( const ScAddress rPos,
std::unique_ptr< EditTextObject pEditText 
)
void ScDocumentImport::setFormulaCell ( const ScAddress rPos,
const OUString &  rFormula,
formula::FormulaGrammar::Grammar  eGrammar,
const double *  pResult = nullptr 
)
void ScDocumentImport::setFormulaCell ( const ScAddress rPos,
const OUString &  rFormula,
formula::FormulaGrammar::Grammar  eGrammar,
const OUString &  rResult 
)
void ScDocumentImport::setFormulaCell ( const ScAddress rPos,
std::unique_ptr< ScTokenArray pArray 
)
void ScDocumentImport::setFormulaCell ( const ScAddress rPos,
ScFormulaCell pCell 
)
void ScDocumentImport::setMatrixCells ( const ScRange rRange,
const ScTokenArray rArray,
formula::FormulaGrammar::Grammar  eGrammar 
)
void ScDocumentImport::setMergedCells ( SCTAB  nTab,
SCCOL  nCol1,
SCROW  nRow1,
SCCOL  nCol2,
SCROW  nRow2 
)

Definition at line 613 of file documentimport.cxx.

References mpImpl, and ScTable::SetMergedCells().

Referenced by ScOrcusSheetProperties::set_merge_cell_range().

void ScDocumentImport::setNumericCell ( const ScAddress rPos,
double  fVal 
)
void ScDocumentImport::setOriginDate ( sal_uInt16  nYear,
sal_uInt16  nMonth,
sal_uInt16  nDay 
)

Definition at line 181 of file documentimport.cxx.

References mpImpl.

Referenced by ScOrcusGlobalSettings::set_origin_date().

void ScDocumentImport::setRowsVisible ( SCTAB  nTab,
SCROW  nRowStart,
SCROW  nRowEnd,
bool  bVisible 
)
void ScDocumentImport::setSheetName ( SCTAB  nTab,
const OUString &  rName 
)

Definition at line 176 of file documentimport.cxx.

References mpImpl.

Referenced by ScOrcusFactory::append_sheet().

void ScDocumentImport::setStringCell ( const ScAddress rPos,
const OUString &  rStr 
)
void ScDocumentImport::setTableOpCells ( const ScRange rRange,
const ScTabOpParam rParam 
)

Member Data Documentation

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

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