LibreOffice Module sc (master)  1
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
oox::xls::WorkbookHelper Class Reference

Helper class to provide access to global workbook data. More...

#include <workbookhelper.hxx>

Inheritance diagram for oox::xls::WorkbookHelper:
[legend]
Collaboration diagram for oox::xls::WorkbookHelper:
[legend]

Public Member Functions

 WorkbookHelper (WorkbookGlobals &rBookGlob)
 
virtual ~WorkbookHelper ()
 
 WorkbookHelper (WorkbookHelper const &)=default
 
 WorkbookHelper (WorkbookHelper &&)=default
 
WorkbookHelperoperator= (WorkbookHelper const &)=delete
 
WorkbookHelperoperator= (WorkbookHelper &&)=delete
 
::oox::core::FilterBasegetBaseFilter () const
 Returns the base filter object (base class of all filters). More...
 
SegmentProgressBargetProgressBar () const
 Returns the filter progress bar. More...
 
sal_Int16 getCurrentSheetIndex () const
 Returns the index of the current Calc sheet, if filter currently processes a sheet. More...
 
bool isGeneratorKnownGood () const
 Returns true when reading a file generated by a known good generator. More...
 
void setVbaProjectStorage (const StorageRef &rxVbaPrjStrg)
 Sets the VBA project storage used to import VBA source code and forms. More...
 
void setCurrentSheetIndex (SCTAB nSheet)
 Sets the index of the current Calc sheet, if filter currently processes a sheet. More...
 
void finalizeWorkbookImport ()
 Final conversion after importing the workbook. More...
 
void useInternalChartDataTable (bool bInternal)
 
ScDocumentgetScDocument ()
 
const ScDocumentgetScDocument () const
 
ScDocumentImportgetDocImport ()
 
const ScDocumentImportgetDocImport () const
 
ScEditEngineDefaultergetEditEngine () const
 
const css::uno::Reference< css::sheet::XSpreadsheetDocument > & getDocument () const
 Returns a reference to the source/target spreadsheet document model. More...
 
css::uno::Reference< css::sheet::XSpreadsheet > getSheetFromDoc (sal_Int32 nSheet) const
 Returns a reference to the specified spreadsheet in the document model. More...
 
css::uno::Reference< css::sheet::XSpreadsheet > getSheetFromDoc (const OUString &rSheet) const
 Returns a reference to the specified spreadsheet in the document model. More...
 
css::uno::Reference< css::table::XCellRange > getCellRangeFromDoc (const ScRange &rRange) const
 Returns the XCellRange interface for the passed cell range address. More...
 
css::uno::Reference< css::container::XNameContainer > getCellStyleFamily () const
 Returns the cell styles container from the Calc document. More...
 
css::uno::Reference< css::style::XStyle > getStyleObject (const OUString &rStyleName, bool bPageStyle) const
 Returns the specified cell or page style from the Calc document. More...
 
ScRangeDatacreateNamedRangeObject (OUString &orName, const css::uno::Sequence< css::sheet::FormulaToken > &rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags) const
 Creates and returns a defined name on-the-fly in the Calc document. More...
 
ScRangeDatacreateLocalNamedRangeObject (OUString &orName, const css::uno::Sequence< css::sheet::FormulaToken > &rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab) const
 Creates and returns a defined name on-the-fly in the sheet. More...
 
css::uno::Reference< css::sheet::XDatabaseRange > createDatabaseRangeObject (OUString &orName, const ScRange &rRangeAddr) const
 Creates and returns a database range on-the-fly in the Calc document. More...
 
css::uno::Reference< css::sheet::XDatabaseRange > createUnnamedDatabaseRangeObject (const ScRange &rRangeAddr) const
 Creates and returns an unnamed database range on-the-fly in the Calc document. More...
 
ScDBDatafindDatabaseRangeByIndex (sal_uInt16 nIndex) const
 Finds the (already existing) database range of the given formula token index. More...
 
css::uno::Reference< css::style::XStyle > createStyleObject (OUString &orStyleName, bool bPageStyle) const
 Creates and returns a com.sun.star.style.Style object for cells or pages. More...
 
FormulaBuffergetFormulaBuffer () const
 
WorkbookSettingsgetWorkbookSettings () const
 Returns the global workbook settings object. More...
 
ViewSettingsgetViewSettings () const
 Returns the workbook and sheet view settings object. More...
 
WorksheetBuffergetWorksheets () const
 Returns the worksheet buffer containing sheet names and properties. More...
 
ThemeBuffergetTheme () const
 Returns the office theme object read from the theme substorage. More...
 
StylesBuffergetStyles () const
 Returns all cell formatting objects read from the styles substream. More...
 
SharedStringsBuffergetSharedStrings () const
 Returns the shared strings read from the shared strings substream. More...
 
ExternalLinkBuffergetExternalLinks () const
 Returns the external links read from the external links substream. More...
 
DefinedNamesBuffergetDefinedNames () const
 Returns the defined names read from the workbook globals. More...
 
TableBuffergetTables () const
 Returns the tables collection (equivalent to Calc's database ranges). More...
 
ScenarioBuffergetScenarios () const
 Returns the scenarios collection. More...
 
ConnectionsBuffergetConnections () const
 Returns the collection of external data connections. More...
 
PivotCacheBuffergetPivotCaches () const
 Returns the collection of pivot caches. More...
 
PivotTableBuffergetPivotTables () const
 Returns the collection of pivot tables. More...
 
FormulaParsergetFormulaParser () const
 Returns a shared import formula parser (import filter only!). More...
 
FormulaParsercreateFormulaParser () const
 Returns an unshared import formula parser (import filter only!). More...
 
UnitConvertergetUnitConverter () const
 Returns the measurement unit converter. More...
 
AddressConvertergetAddressConverter () const
 Returns the converter for string to cell address/range conversion. More...
 
oox::drawingml::chart::ChartConvertergetChartConverter () const
 Returns the chart object converter. More...
 
PageSettingsConvertergetPageSettingsConverter () const
 Returns the page and print settings converter. More...
 
::oox::core::XmlFilterBasegetOoxFilter () const
 Returns the base OOXML/BIFF12 filter object. More...
 
bool importOoxFragment (const rtl::Reference< oox::core::FragmentHandler > &rxHandler)
 Imports a fragment using the passed fragment handler, which contains the full path to the fragment stream. More...
 
bool importOoxFragment (const rtl::Reference< oox::core::FragmentHandler > &rxHandler, oox::core::FastParser &rParser)
 
rtl_TextEncoding getTextEncoding () const
 Returns the text encoding used to import/export byte strings. More...
 

Static Public Member Functions

static WorkbookGlobalsRef constructGlobals (ExcelFilter &rFilter)
 

Private Attributes

WorkbookGlobalsmrBookGlob
 

Detailed Description

Helper class to provide access to global workbook data.

All classes derived from this helper class will have access to a singleton object of type WorkbookGlobals containing global workbook settings, buffers, converters, etc. Nearly all classes in this filter implementation are derived directly or indirectly from this class.

This class contains just a simple reference to the WorkbookGlobals object to prevent circular references, as the WorkbookGlobals object contains a lot of objects derived from this class.

Definition at line 100 of file workbookhelper.hxx.

Constructor & Destructor Documentation

oox::xls::WorkbookHelper::WorkbookHelper ( WorkbookGlobals rBookGlob)
inline

Definition at line 103 of file workbookhelper.hxx.

oox::xls::WorkbookHelper::~WorkbookHelper ( )
virtual

Definition at line 637 of file workbookhelper.cxx.

oox::xls::WorkbookHelper::WorkbookHelper ( WorkbookHelper const &  )
default
oox::xls::WorkbookHelper::WorkbookHelper ( WorkbookHelper &&  )
default

Member Function Documentation

WorkbookGlobalsRef oox::xls::WorkbookHelper::constructGlobals ( ExcelFilter rFilter)
static

Definition at line 641 of file workbookhelper.cxx.

Referenced by oox::xls::ExcelFilter::importDocument().

Reference< XDatabaseRange > oox::xls::WorkbookHelper::createDatabaseRangeObject ( OUString &  orName,
const ScRange rRangeAddr 
) const

Creates and returns a database range on-the-fly in the Calc document.

The range will not be buffered in the global table buffer.

Parameters
orName(in/out-parameter) Returns the resulting used name.

Definition at line 874 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::createDatabaseRangeObject(), and mrBookGlob.

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

FormulaParser * oox::xls::WorkbookHelper::createFormulaParser ( ) const

Returns an unshared import formula parser (import filter only!).

Definition at line 973 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::createFormulaParser(), and mrBookGlob.

Referenced by oox::xls::SheetDataContext::SheetDataContext().

ScRangeData * oox::xls::WorkbookHelper::createLocalNamedRangeObject ( OUString &  orName,
const css::uno::Sequence< css::sheet::FormulaToken > &  rTokens,
sal_Int32  nIndex,
sal_Int32  nNameFlags,
sal_Int32  nTab 
) const

Creates and returns a defined name on-the-fly in the sheet.

The name will not be buffered in the global defined names buffer.

Parameters
orName(in/out-parameter) Returns the resulting used name.

Definition at line 869 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::createLocalNamedRangeObject(), and mrBookGlob.

Referenced by oox::xls::DefinedName::createNameObject().

ScRangeData * oox::xls::WorkbookHelper::createNamedRangeObject ( OUString &  orName,
const css::uno::Sequence< css::sheet::FormulaToken > &  rTokens,
sal_Int32  nIndex,
sal_Int32  nNameFlags 
) const

Creates and returns a defined name on-the-fly in the Calc document.

The name will not be buffered in the global defined names buffer.

Parameters
orName(in/out-parameter) Returns the resulting used name.

Definition at line 864 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::createNamedRangeObject(), and mrBookGlob.

Referenced by oox::xls::DefinedName::createNameObject().

Reference< XStyle > oox::xls::WorkbookHelper::createStyleObject ( OUString &  orStyleName,
bool  bPageStyle 
) const

Creates and returns a com.sun.star.style.Style object for cells or pages.

Definition at line 889 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::createStyleObject(), and mrBookGlob.

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

Reference< XDatabaseRange > oox::xls::WorkbookHelper::createUnnamedDatabaseRangeObject ( const ScRange rRangeAddr) const

Creates and returns an unnamed database range on-the-fly in the Calc document.

The range will not be buffered in the global table buffer.

Definition at line 879 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::createUnnamedDatabaseRangeObject(), and mrBookGlob.

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

void oox::xls::WorkbookHelper::finalizeWorkbookImport ( )
ScDBData * oox::xls::WorkbookHelper::findDatabaseRangeByIndex ( sal_uInt16  nIndex) const

Finds the (already existing) database range of the given formula token index.

Definition at line 884 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::findDatabaseRangeByIndex(), and mrBookGlob.

Referenced by oox::xls::Table::applyTableColumns().

AddressConverter & oox::xls::WorkbookHelper::getAddressConverter ( ) const

Returns the converter for string to cell address/range conversion.

Definition at line 983 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::getAddressConverter(), and mrBookGlob.

Referenced by oox::xls::ShapeAnchor::calcAnchorRectEmu(), oox::xls::WorksheetGlobals::convertColumnFormat(), oox::xls::DefinedName::convertFormula(), oox::xls::FormulaProcessorBase::extractCellRangeList(), oox::xls::QueryTable::finalizeImport(), oox::xls::Comment::finalizeImport(), oox::xls::Scenario::finalizeImport(), oox::xls::SheetViewSettings::finalizeImport(), oox::xls::SheetDataBuffer::finalizeImport(), oox::xls::PivotTable::finalizeImport(), oox::xls::PivotCache::finalizeInternalSheetSource(), oox::xls::SheetDataBuffer::finalizeTableOperation(), oox::xls::ExternalSheetDataContext::importCell(), oox::xls::CondFormat::importCondFormatting(), oox::xls::CondFormat::importConditionalFormatting(), oox::xls::DataValidationsContextBase::importDataValidation(), oox::xls::ExcelFilter::importDocument(), oox::xls::WorksheetFragment::importHyperlink(), oox::xls::WorksheetFragment::importMergeCell(), oox::xls::ViewSettings::importOleSize(), oox::xls::SheetViewSettings::importPane(), oox::xls::PivotCache::importPCRecord(), oox::xls::WorksheetSettings::importProtectedRange(), oox::xls::SheetViewSettings::importSelection(), oox::xls::SheetViewSettings::importSheetView(), oox::xls::PivotCache::prepareSourceDataSheet(), oox::xls::ExternalSheetDataContext::setCellValue(), oox::xls::WorksheetGlobals::setColumnModel(), oox::xls::ExternalName::setResultSize(), oox::xls::WorksheetGlobals::setRowModel(), oox::xls::DataValidationsContextBase::SetValidation(), and oox::xls::PivotCache::writeSourceHeaderCells().

FilterBase & oox::xls::WorkbookHelper::getBaseFilter ( ) const
Reference< XCellRange > oox::xls::WorkbookHelper::getCellRangeFromDoc ( const ScRange rRange) const

Returns the XCellRange interface for the passed cell range address.

Definition at line 840 of file workbookhelper.cxx.

References ScRange::aEnd, ScRange::aStart, ScAddress::Col(), Exception, getSheetFromDoc(), ScAddress::Row(), and ScAddress::Tab().

Referenced by oox::xls::ViewSettings::finalizeImport(), and oox::xls::PivotTable::finalizeImport().

Reference< XNameContainer > oox::xls::WorkbookHelper::getCellStyleFamily ( ) const

Returns the cell styles container from the Calc document.

Definition at line 854 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::getStyleFamily(), and mrBookGlob.

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

oox::drawingml::chart::ChartConverter * oox::xls::WorkbookHelper::getChartConverter ( ) const

Returns the chart object converter.

Definition at line 988 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::getChartConverter(), and mrBookGlob.

Referenced by oox::xls::ExcelFilter::getChartConverter().

ConnectionsBuffer & oox::xls::WorkbookHelper::getConnections ( ) const
sal_Int16 oox::xls::WorkbookHelper::getCurrentSheetIndex ( ) const

Returns the index of the current Calc sheet, if filter currently processes a sheet.

Definition at line 661 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::getCurrentSheetIndex(), and mrBookGlob.

Referenced by oox::xls::ExcelChartConverter::createDataSequence(), and oox::xls::WorksheetGlobals::finalizeValidationRanges().

DefinedNamesBuffer & oox::xls::WorkbookHelper::getDefinedNames ( ) const
ScDocumentImport & oox::xls::WorkbookHelper::getDocImport ( )
const ScDocumentImport & oox::xls::WorkbookHelper::getDocImport ( ) const

Definition at line 797 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::getDocImport(), and mrBookGlob.

const Reference< XSpreadsheetDocument > & oox::xls::WorkbookHelper::getDocument ( ) const
ScEditEngineDefaulter & oox::xls::WorkbookHelper::getEditEngine ( ) const
ExternalLinkBuffer & oox::xls::WorkbookHelper::getExternalLinks ( ) const
FormulaBuffer & oox::xls::WorkbookHelper::getFormulaBuffer ( ) const
FormulaParser & oox::xls::WorkbookHelper::getFormulaParser ( ) const
XmlFilterBase & oox::xls::WorkbookHelper::getOoxFilter ( ) const

Returns the base OOXML/BIFF12 filter object.

Must not be called, if current filter is not the OOXML/BIFF12 filter.

Definition at line 1005 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::getOoxFilter(), and mrBookGlob.

Referenced by oox::xls::WorkbookSettings::getNullDate(), and oox::xls::DrawingFragment::onEndElement().

PageSettingsConverter & oox::xls::WorkbookHelper::getPageSettingsConverter ( ) const

Returns the page and print settings converter.

Definition at line 998 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::getPageSettingsConverter(), and mrBookGlob.

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

PivotCacheBuffer & oox::xls::WorkbookHelper::getPivotCaches ( ) const
PivotTableBuffer & oox::xls::WorkbookHelper::getPivotTables ( ) const

Returns the collection of pivot tables.

Definition at line 961 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::getPivotTables(), and mrBookGlob.

Referenced by finalizeWorkbookImport().

SegmentProgressBar & oox::xls::WorkbookHelper::getProgressBar ( ) const
ScDocument & oox::xls::WorkbookHelper::getScDocument ( )
const ScDocument & oox::xls::WorkbookHelper::getScDocument ( ) const

Definition at line 787 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::getScDocument(), and mrBookGlob.

ScenarioBuffer & oox::xls::WorkbookHelper::getScenarios ( ) const

Returns the scenarios collection.

Definition at line 946 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::getScenarios(), and mrBookGlob.

SharedStringsBuffer & oox::xls::WorkbookHelper::getSharedStrings ( ) const
Reference< XSpreadsheet > oox::xls::WorkbookHelper::getSheetFromDoc ( sal_Int32  nSheet) const
Reference< XSpreadsheet > oox::xls::WorkbookHelper::getSheetFromDoc ( const OUString &  rSheet) const

Returns a reference to the specified spreadsheet in the document model.

Definition at line 826 of file workbookhelper.cxx.

References Exception, and getDocument().

Reference< XStyle > oox::xls::WorkbookHelper::getStyleObject ( const OUString &  rStyleName,
bool  bPageStyle 
) const

Returns the specified cell or page style from the Calc document.

Definition at line 859 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::getStyleObject(), and mrBookGlob.

Referenced by finalizeWorkbookImport().

StylesBuffer & oox::xls::WorkbookHelper::getStyles ( ) const
TableBuffer & oox::xls::WorkbookHelper::getTables ( ) const
rtl_TextEncoding oox::xls::WorkbookHelper::getTextEncoding ( ) const

Returns the text encoding used to import/export byte strings.

Definition at line 1022 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::getTextEncoding(), and mrBookGlob.

Referenced by oox::xls::Font::fillToItemSet().

ThemeBuffer & oox::xls::WorkbookHelper::getTheme ( ) const
UnitConverter & oox::xls::WorkbookHelper::getUnitConverter ( ) const
ViewSettings & oox::xls::WorkbookHelper::getViewSettings ( ) const
WorkbookSettings & oox::xls::WorkbookHelper::getWorkbookSettings ( ) const
WorksheetBuffer & oox::xls::WorkbookHelper::getWorksheets ( ) const
bool oox::xls::WorkbookHelper::importOoxFragment ( const rtl::Reference< oox::core::FragmentHandler > &  rxHandler)
bool oox::xls::WorkbookHelper::importOoxFragment ( const rtl::Reference< oox::core::FragmentHandler > &  rxHandler,
oox::core::FastParser rParser 
)
bool oox::xls::WorkbookHelper::isGeneratorKnownGood ( ) const

Returns true when reading a file generated by a known good generator.

Definition at line 666 of file workbookhelper.cxx.

References oox::xls::WorkbookGlobals::isGeneratorKnownGood(), and mrBookGlob.

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

WorkbookHelper& oox::xls::WorkbookHelper::operator= ( WorkbookHelper const &  )
delete
WorkbookHelper& oox::xls::WorkbookHelper::operator= ( WorkbookHelper &&  )
delete
void oox::xls::WorkbookHelper::setCurrentSheetIndex ( SCTAB  nSheet)

Sets the index of the current Calc sheet, if filter currently processes a sheet.

Definition at line 676 of file workbookhelper.cxx.

References mrBookGlob, and oox::xls::WorkbookGlobals::setCurrentSheetIndex().

Referenced by oox::xls::WorksheetGlobals::finalizeDrawingImport(), and oox::xls::WorksheetGlobals::initializeWorksheetImport().

void oox::xls::WorkbookHelper::setVbaProjectStorage ( const StorageRef rxVbaPrjStrg)

Sets the VBA project storage used to import VBA source code and forms.

Definition at line 671 of file workbookhelper.cxx.

References mrBookGlob, and oox::xls::WorkbookGlobals::setVbaProjectStorage().

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

void oox::xls::WorkbookHelper::useInternalChartDataTable ( bool  bInternal)

Member Data Documentation

WorkbookGlobals& oox::xls::WorkbookHelper::mrBookGlob
private

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