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

Stores data for one table in an HTML document. More...

#include <htmlpars.hxx>

Inheritance diagram for ScHTMLTable:
[legend]
Collaboration diagram for ScHTMLTable:
[legend]

Public Member Functions

 ScHTMLTable (ScHTMLTable &rParentTable, const HtmlImportInfo &rInfo, bool bPreFormText)
 Creates a new HTML table without content. More...
 
virtual ~ScHTMLTable ()
 
const OUString & GetTableName () const
 Returns the name of the table, specified in the TABLE tag. More...
 
ScHTMLTableId GetTableId () const
 Returns the unique identifier of the table. More...
 
ScHTMLSize GetSpan (const ScHTMLPos &rCellPos) const
 Returns the cell spanning of the specified cell. More...
 
ScHTMLTableFindNestedTable (ScHTMLTableId nTableId) const
 Searches in all nested tables for the specified table. More...
 
void PutItem (const SfxPoolItem &rItem)
 Puts the item into the item set of the current entry. More...
 
void PutText (const HtmlImportInfo &rInfo)
 Inserts a text portion into current entry. More...
 
void InsertPara (const HtmlImportInfo &rInfo)
 Inserts a new line, if in preformatted text, else does nothing. More...
 
void BreakOn ()
 Inserts a line break (
tag). More...
 
void HeadingOn ()
 Inserts a heading line (. More...
 
void AnchorOn ()
 Processes a hyperlink ( tag). More...
 
ScHTMLTableTableOn (const HtmlImportInfo &rInfo)
 Starts a new table nested in this table (. More...
 
ScHTMLTableTableOff (const HtmlImportInfo &rInfo)
 Closes this table (tag). More...
 
ScHTMLTablePreOn (const HtmlImportInfo &rInfo)
 Starts a new table based on preformatted text (. More...
 
ScHTMLTablePreOff (const HtmlImportInfo &rInfo)
 Closes this table based on preformatted text ( tag). More...
 
void RowOn (const HtmlImportInfo &rInfo)
 Starts next row (tag). More...
 
void RowOff (const HtmlImportInfo &rInfo)
 Closes the current row (tag). More...
 
void DataOn (const HtmlImportInfo &rInfo)
 Starts the next cell (or tag). More...
 
void DataOff (const HtmlImportInfo &rInfo)
 Closes the current cell ( or tag). More...
 
void BodyOn (const HtmlImportInfo &rInfo)
 Starts the body of the HTML document (<body> tag). More...
 
void BodyOff (const HtmlImportInfo &rInfo)
 Closes the body of the HTML document (</body> tag). More...
 
ScHTMLTableCloseTable (const HtmlImportInfo &rInfo)
 Closes this table (tag) or preformatted text ( tag). More...
 
SCCOLROW GetDocSize (ScHTMLOrient eOrient, SCCOLROW nCellPos) const
 Returns the resulting document row/column count of the specified HTML row/column. More...
 
SCCOLROW GetDocSize (ScHTMLOrient eOrient, SCCOLROW nCellBegin, SCCOLROW nCellEnd) const
 Returns the resulting document row/column count in the half-open range [nCellBegin, nCellEnd). More...
 
SCCOLROW GetDocSize (ScHTMLOrient eOrient) const
 Returns the total document row/column count in the specified direction. More...
 
ScHTMLSize GetDocSize (const ScHTMLPos &rCellPos) const
 Returns the total document row/column count of the specified HTML cell. More...
 
const ScHTMLPosGetDocPos () const
 Returns the resulting Calc position of the top left edge of the table. More...
 
SCCOLROW GetDocPos (ScHTMLOrient eOrient, SCCOLROW nCellPos) const
 Calculates the resulting Calc position of the specified HTML column/row. More...
 
ScHTMLPos GetDocPos (const ScHTMLPos &rCellPos) const
 Calculates the resulting Calc position of the specified HTML cell. More...
 
void GetDocRange (ScRange &rRange) const
 Calculates the current Calc document area of this table. More...
 
void ApplyCellBorders (ScDocument *pDoc, const ScAddress &rFirstPos) const
 Applies border formatting to the passed document. More...
 
SvNumberFormatterGetFormatTable ()
 

Protected Member Functions

 ScHTMLTable (SfxItemPool &rPool, EditEngine &rEditEngine, std::vector< std::shared_ptr< ScEEParseEntry >> &rEEParseList, ScHTMLTableId &rnUnusedId, ScHTMLParser *pParser)
 Creates a new HTML table without parent. More...
 
void FillEmptyCells ()
 Fills all empty cells in this and nested tables with dummy parse entries. More...
 
void RecalcDocSize ()
 Recalculates the size of all columns/rows in the table, regarding nested tables. More...
 
void RecalcDocPos (const ScHTMLPos &rBasePos)
 Recalculates the position of all cell entries and nested tables. More...
 

Private Types

typedef ::std::unique_ptr< ScHTMLTableMapScHTMLTableMapPtr
 
typedef ::std::unique_ptr< SfxItemSetSfxItemSetPtr
 
typedef ::std::vector< SCCOLROWScSizeVec
 
typedef ::std::vector< ScHTMLEntry * > ScHTMLEntryVector
 
typedef ::std::unique_ptr< ScHTMLEntryScHTMLEntryPtr
 

Private Member Functions

bool IsEmptyCell () const
 Returns true, if the current cell does not contain an entry yet. More...
 
const SfxItemSetGetCurrItemSet () const
 Returns the item set from cell, row, or table, depending on current state. More...
 
ScHTMLEntryPtr CreateEntry () const
 Creates and returns a new empty flying entry at position (0,0). More...
 
void CreateNewEntry (const HtmlImportInfo &rInfo)
 Creates a new flying entry. More...
 
void InsertLeadingEmptyLine ()
 Inserts an empty line in front of the next entry. More...
 
void ImplPushEntryToVector (ScHTMLEntryVector &rEntryVector, ScHTMLEntryPtr &rxEntry)
 Pushes the passed entry into the list of the current cell. More...
 
bool PushEntry (ScHTMLEntryPtr &rxEntry)
 Tries to insert the entry into the current cell. More...
 
bool PushEntry (const HtmlImportInfo &rInfo, bool bLastInCell=false)
 Puts the current entry into the entry list, if it is not empty. More...
 
void PushTableEntry (ScHTMLTableId nTableId)
 Pushes a new entry into current cell which references a nested table. More...
 
ScHTMLTableGetExistingTable (ScHTMLTableId nTableId) const
 Tries to find a table from the table container. More...
 
ScHTMLTableInsertNestedTable (const HtmlImportInfo &rInfo, bool bPreFormText)
 Inserts a nested table in the current cell at the specified position. More...
 
void InsertNewCell (const ScHTMLSize &rSpanSize)
 Inserts a new cell in an unused position, starting from current cell position. More...
 
void ImplRowOn ()
 Set internal states for a new table row. More...
 
void ImplRowOff ()
 Set internal states for leaving a table row. More...
 
void ImplDataOn (const ScHTMLSize &rSpanSize)
 Set internal states for entering a new table cell. More...
 
void ImplDataOff ()
 Set internal states for leaving a table cell. More...
 
void SetDocSize (ScHTMLOrient eOrient, SCCOLROW nCellPos, SCCOLROW nSize)
 Updates the document column/row size of the specified column or row. More...
 
void CalcNeededDocSize (ScHTMLOrient eOrient, SCCOLROW nCellPos, SCCOLROW nCellSpan, SCCOLROW nRealDocSize)
 Calculates and sets the resulting size the cell needs in the document. More...
 

Static Private Member Functions

static bool IsSpaceCharInfo (const HtmlImportInfo &rInfo)
 Returns true, if import info represents a space character. More...
 
static void ProcessFormatOptions (SfxItemSet &rItemSet, const HtmlImportInfo &rInfo)
 Inserts additional formatting options from import info into the item set. More...
 

Private Attributes

ScHTMLTablempParentTable
 
ScHTMLTableMapPtr mxNestedTables
 Pointer to parent table. More...
 
OUString maTableName
 Table of nested HTML tables. More...
 
ScHTMLTableAutoId maTableId
 Table name from. More...
 
SfxItemSet maTableItemSet
 Unique identifier of this table. More...
 
SfxItemSetPtr mxRowItemSet
 Items for the entire table. More...
 
SfxItemSetPtr mxDataItemSet
 Items for the current table row. More...
 
ScRangeList maHMergedCells
 Items for the current cell. More...
 
ScRangeList maVMergedCells
 List of all horizontally merged cells. More...
 
ScRangeList maUsedCells
 List of all vertically merged cells. More...
 
EditEnginemrEditEngine
 List of all used cells. More...
 
std::vector< std::shared_ptr< ScEEParseEntry > > & mrEEParseList
 Edit engine (from ScEEParser). More...
 
std::map< ScHTMLPos, ScHTMLEntryVectormaEntryMap
 List that owns the parse entries (from ScEEParser). More...
 
ScHTMLEntryVectormpCurrEntryVector
 List of entries for each cell. More...
 
ScHTMLEntryPtr mxCurrEntry
 Current entry vector from map for faster access. More...
 
ScSizeVec maCumSizes [2]
 Working entry, not yet inserted in a list. More...
 
ScHTMLSize maSize
 Cumulated cell counts for each HTML table column/row. More...
 
ScHTMLPos maCurrCell
 Size of the table. More...
 
ScHTMLPos maDocBasePos
 Address of current cell to fill. More...
 
ScHTMLParsermpParser
 Resulting base address in a Calc document. More...
 
bool mbBorderOn:1
 
bool mbPreFormText:1
 true = Table borders on. More...
 
bool mbRowOn:1
 true = Table from preformatted text ( More...
 
bool mbDataOn:1
 true = Inside of . More...
 
bool mbPushEmptyLine:1
 true = Inside of or . More...
 

Detailed Description

Stores data for one table in an HTML document.

This class does the main work for importing an HTML document. It manages the correct insertion of parse entries into the correct cells and the creation of nested tables. Recalculation of resulting document size and position is done recursively in all nested tables.

Definition at line 324 of file htmlpars.hxx.

Member Typedef Documentation

typedef ::std::unique_ptr< ScHTMLEntry > ScHTMLTable::ScHTMLEntryPtr
private

Definition at line 446 of file htmlpars.hxx.

typedef ::std::vector< ScHTMLEntry* > ScHTMLTable::ScHTMLEntryVector
private

Definition at line 445 of file htmlpars.hxx.

typedef ::std::unique_ptr< ScHTMLTableMap > ScHTMLTable::ScHTMLTableMapPtr
private

Definition at line 442 of file htmlpars.hxx.

typedef ::std::vector< SCCOLROW > ScHTMLTable::ScSizeVec
private

Definition at line 444 of file htmlpars.hxx.

typedef ::std::unique_ptr< SfxItemSet > ScHTMLTable::SfxItemSetPtr
private

Definition at line 443 of file htmlpars.hxx.

Constructor & Destructor Documentation

ScHTMLTable::ScHTMLTable ( ScHTMLTable rParentTable,
const HtmlImportInfo rInfo,
bool  bPreFormText 
)
explicit

Creates a new HTML table without content.

Internally handles a current cell position. This position is invalid until first calls of RowOn() and DataOn().

Parameters
rParentTableReference to the parent table that owns this table.
bPreFormTexttrue = Table is based on preformatted text (
 tag).  

Definition at line 1819 of file htmlpars.cxx.

References CreateNewEntry(), ImplDataOn(), ImplRowOn(), maSize, maTableItemSet, maTableName, mbBorderOn, mbPreFormText, HtmlImportInfo::pParser, and ProcessFormatOptions().

ScHTMLTable::~ScHTMLTable ( )
virtual

Definition at line 1887 of file htmlpars.cxx.

ScHTMLTable::ScHTMLTable ( SfxItemPool rPool,
EditEngine rEditEngine,
std::vector< std::shared_ptr< ScEEParseEntry >> &  rEEParseList,
ScHTMLTableId rnUnusedId,
ScHTMLParser pParser 
)
explicitprotected

Creates a new HTML table without parent.

This constructor is used to create the "global table".

Definition at line 1861 of file htmlpars.cxx.

References CreateEntry(), ImplDataOn(), ImplRowOn(), maSize, and mxCurrEntry.

Member Function Documentation

void ScHTMLTable::AnchorOn ( )

Processes a hyperlink ( tag).

Definition at line 1959 of file htmlpars.cxx.

References mxCurrEntry.

Referenced by ScHTMLQueryParser::ProcessToken().

void ScHTMLTable::ApplyCellBorders ( ScDocument pDoc,
const ScAddress rFirstPos 
) const
void ScHTMLTable::BodyOff ( const HtmlImportInfo rInfo)

Closes the body of the HTML document (</body> tag).

Definition at line 2147 of file htmlpars.cxx.

References CreateNewEntry(), ImplDataOff(), ImplRowOff(), mpParentTable, and PushEntry().

Referenced by ScHTMLQueryParser::ProcessToken().

void ScHTMLTable::BodyOn ( const HtmlImportInfo rInfo)

Starts the body of the HTML document (<body> tag).

Definition at line 2132 of file htmlpars.cxx.

References CreateNewEntry(), ImplDataOn(), ImplRowOn(), mbDataOn, mbRowOn, mpParentTable, mxDataItemSet, ProcessFormatOptions(), and PushEntry().

Referenced by ScHTMLQueryParser::ProcessToken().

void ScHTMLTable::BreakOn ( )

Inserts a line break (
tag).

Inserts the current entry regardless if it is empty.

Definition at line 1941 of file htmlpars.cxx.

References IsEmptyCell(), mbDataOn, mbPreFormText, and mbPushEmptyLine.

Referenced by ScHTMLQueryParser::ProcessToken().

void ScHTMLTable::CalcNeededDocSize ( ScHTMLOrient  eOrient,
SCCOLROW  nCellPos,
SCCOLROW  nCellSpan,
SCCOLROW  nRealDocSize 
)
private

Calculates and sets the resulting size the cell needs in the document.

Reduces the needed size in merged cells.

Parameters
nCellPosThe first column/row position of the (merged) cell.
nCellSpanThe cell spanning in the specified orientation.
nRealDocSizeThe raw document size of all entries of the cell.

Definition at line 2555 of file htmlpars.cxx.

References GetDocSize(), and SetDocSize().

Referenced by RecalcDocSize().

ScHTMLTable * ScHTMLTable::CloseTable ( const HtmlImportInfo rInfo)

Closes this table (tag) or preformatted text ( tag).

Used to close this table object regardless on opening tag type.

Returns
Pointer to the parent table, or this, if no parent found.

Definition at line 2158 of file htmlpars.cxx.

References CreateNewEntry(), GetTableId(), ImplDataOff(), ImplRowOff(), InsertLeadingEmptyLine(), mbDataOn, mbPreFormText, mpParentTable, PushEntry(), and PushTableEntry().

Referenced by ScHTMLQueryParser::CloseTable(), PreOff(), and TableOff().

ScHTMLTable::ScHTMLEntryPtr ScHTMLTable::CreateEntry ( ) const
private

Creates and returns a new empty flying entry at position (0,0).

Definition at line 2287 of file htmlpars.cxx.

References GetCurrItemSet().

Referenced by CreateNewEntry(), FillEmptyCells(), PushEntry(), and ScHTMLTable().

void ScHTMLTable::CreateNewEntry ( const HtmlImportInfo rInfo)
private

Creates a new flying entry.

Parameters
rInfoContains the initial edit engine selection for the entry.

Definition at line 2292 of file htmlpars.cxx.

References HtmlImportInfo::aSelection, CreateEntry(), and mxCurrEntry.

Referenced by BodyOff(), BodyOn(), CloseTable(), DataOff(), DataOn(), InsertPara(), RowOff(), RowOn(), and ScHTMLTable().

void ScHTMLTable::DataOff ( const HtmlImportInfo rInfo)

Closes the current cell ( or tag).

Cell address is invalid until next call of DataOn().

Definition at line 2124 of file htmlpars.cxx.

References CreateNewEntry(), ImplDataOff(), mbPreFormText, mpParentTable, and PushEntry().

Referenced by ScHTMLQueryParser::ProcessToken().

void ScHTMLTable::DataOn ( const HtmlImportInfo rInfo)
void ScHTMLTable::FillEmptyCells ( )
protected
ScHTMLTable * ScHTMLTable::FindNestedTable ( ScHTMLTableId  nTableId) const

Searches in all nested tables for the specified table.

Parameters
nTableIdUnique identifier of the table.

Definition at line 1908 of file htmlpars.cxx.

References mxNestedTables.

Referenced by ScHTMLTableMap::FindTable(), and ScHTMLImport::WriteToDocument().

const SfxItemSet & ScHTMLTable::GetCurrItemSet ( ) const
private

Returns the item set from cell, row, or table, depending on current state.

Definition at line 1891 of file htmlpars.cxx.

References maTableItemSet, mxDataItemSet, and mxRowItemSet.

Referenced by CreateEntry().

const ScHTMLPos& ScHTMLTable::GetDocPos ( ) const
inline

Returns the resulting Calc position of the top left edge of the table.

Definition at line 410 of file htmlpars.hxx.

References maDocBasePos.

Referenced by ApplyCellBorders(), GetDocPos(), ScHTMLGlobalTable::Recalc(), and RecalcDocPos().

SCCOLROW ScHTMLTable::GetDocPos ( ScHTMLOrient  eOrient,
SCCOLROW  nCellPos 
) const

Calculates the resulting Calc position of the specified HTML column/row.

Definition at line 2205 of file htmlpars.cxx.

References ScHTMLPos::Get(), GetDocSize(), and maDocBasePos.

ScHTMLPos ScHTMLTable::GetDocPos ( const ScHTMLPos rCellPos) const

Calculates the resulting Calc position of the specified HTML cell.

Definition at line 2210 of file htmlpars.cxx.

References GetDocPos(), ScHTMLPos::mnCol, ScHTMLPos::mnRow, tdCol, and tdRow.

void ScHTMLTable::GetDocRange ( ScRange rRange) const

Calculates the current Calc document area of this table.

Definition at line 2217 of file htmlpars.cxx.

References ScRange::aEnd, assert(), ScRange::aStart, GetDocSize(), maDocBasePos, ScHTMLPos::MakeAddr(), ScAddress::Move(), tdCol, tdRow, and ScAddress::UNINITIALIZED.

Referenced by ScHTMLImport::WriteToDocument().

SCCOLROW ScHTMLTable::GetDocSize ( ScHTMLOrient  eOrient,
SCCOLROW  nCellPos 
) const

Returns the resulting document row/column count of the specified HTML row/column.

Definition at line 2174 of file htmlpars.cxx.

References maCumSizes, and nIndex.

Referenced by ApplyCellBorders(), CalcNeededDocSize(), GetDocPos(), GetDocRange(), GetDocSize(), RecalcDocPos(), RecalcDocSize(), and ScHTMLImport::WriteToDocument().

SCCOLROW ScHTMLTable::GetDocSize ( ScHTMLOrient  eOrient,
SCCOLROW  nCellBegin,
SCCOLROW  nCellEnd 
) const

Returns the resulting document row/column count in the half-open range [nCellBegin, nCellEnd).

Definition at line 2182 of file htmlpars.cxx.

References maCumSizes.

SCCOLROW ScHTMLTable::GetDocSize ( ScHTMLOrient  eOrient) const

Returns the total document row/column count in the specified direction.

Definition at line 2191 of file htmlpars.cxx.

References maCumSizes.

ScHTMLSize ScHTMLTable::GetDocSize ( const ScHTMLPos rCellPos) const

Returns the total document row/column count of the specified HTML cell.

Definition at line 2197 of file htmlpars.cxx.

References GetDocSize(), GetSpan(), ScHTMLPos::mnCol, ScHTMLSize::mnCols, ScHTMLPos::mnRow, ScHTMLSize::mnRows, tdCol, and tdRow.

ScHTMLTable * ScHTMLTable::GetExistingTable ( ScHTMLTableId  nTableId) const
private

Tries to find a table from the table container.

Assumes that the table is located in the current container or that the passed table identifier is 0.

Parameters
nTableIdUnique identifier of the table or 0.

Definition at line 2369 of file htmlpars.cxx.

References mxNestedTables, and SC_HTML_GLOBAL_TABLE.

Referenced by RecalcDocPos(), and RecalcDocSize().

SvNumberFormatter * ScHTMLTable::GetFormatTable ( )

Definition at line 2272 of file htmlpars.cxx.

References ScHTMLParser::GetDoc(), ScDocument::GetFormatTable(), and mpParser.

Referenced by DataOn().

ScHTMLSize ScHTMLTable::GetSpan ( const ScHTMLPos rCellPos) const

Returns the cell spanning of the specified cell.

Definition at line 1897 of file htmlpars.cxx.

References ScRange::aEnd, ScRange::aStart, ScAddress::Col(), ScRangeList::Find(), maHMergedCells, ScHTMLPos::MakeAddr(), maVMergedCells, ScAddress::Row(), and ScHTMLSize::Set().

Referenced by GetDocSize(), and RecalcDocSize().

ScHTMLTableId ScHTMLTable::GetTableId ( ) const
inline

Returns the unique identifier of the table.

Definition at line 342 of file htmlpars.hxx.

References maTableId, and ScHTMLTableAutoId::mnTableId.

Referenced by CloseTable(), ScHTMLTableMap::CreateTable(), and ScHTMLTableMap::FindTable().

const OUString& ScHTMLTable::GetTableName ( ) const
inline

Returns the name of the table, specified in the TABLE tag.

Definition at line 340 of file htmlpars.hxx.

References maTableName.

Referenced by ScHTMLImport::WriteToDocument().

void ScHTMLTable::HeadingOn ( )

Inserts a heading line (.

and <h*> tags).

Definition at line 1947 of file htmlpars.cxx.

References InsertLeadingEmptyLine().

Referenced by ScHTMLQueryParser::ProcessToken().

void ScHTMLTable::ImplDataOff ( )
private

Set internal states for leaving a table cell.

Definition at line 2473 of file htmlpars.cxx.

References maCurrCell, mbDataOn, ScHTMLPos::mnCol, mpCurrEntryVector, and mxDataItemSet.

Referenced by BodyOff(), CloseTable(), DataOff(), ImplDataOn(), and ImplRowOff().

void ScHTMLTable::ImplDataOn ( const ScHTMLSize rSpanSize)
private

Set internal states for entering a new table cell.

Definition at line 2461 of file htmlpars.cxx.

References ImplDataOff(), ImplRowOn(), InsertNewCell(), mbDataOn, mbPushEmptyLine, mbRowOn, mxDataItemSet, and mxRowItemSet.

Referenced by BodyOn(), DataOn(), and ScHTMLTable().

void ScHTMLTable::ImplPushEntryToVector ( ScHTMLEntryVector rEntryVector,
ScHTMLEntryPtr rxEntry 
)
private

Pushes the passed entry into the list of the current cell.

Definition at line 2299 of file htmlpars.cxx.

References mrEEParseList.

Referenced by FillEmptyCells(), PushEntry(), and RecalcDocPos().

void ScHTMLTable::ImplRowOff ( )
private

Set internal states for leaving a table row.

Definition at line 2449 of file htmlpars.cxx.

References ImplDataOff(), maCurrCell, mbDataOn, mbRowOn, ScHTMLPos::mnRow, and mxRowItemSet.

Referenced by BodyOff(), CloseTable(), ImplRowOn(), and RowOff().

void ScHTMLTable::ImplRowOn ( )
private

Set internal states for a new table row.

Definition at line 2439 of file htmlpars.cxx.

References ImplRowOff(), maCurrCell, maTableItemSet, mbDataOn, mbRowOn, ScHTMLPos::mnCol, and mxRowItemSet.

Referenced by BodyOn(), ImplDataOn(), RowOn(), and ScHTMLTable().

void ScHTMLTable::InsertLeadingEmptyLine ( )
private

Inserts an empty line in front of the next entry.

Definition at line 1953 of file htmlpars.cxx.

References IsEmptyCell(), mbDataOn, mbPreFormText, and mbPushEmptyLine.

Referenced by CloseTable(), HeadingOn(), InsertNestedTable(), and InsertPara().

ScHTMLTable * ScHTMLTable::InsertNestedTable ( const HtmlImportInfo rInfo,
bool  bPreFormText 
)
private

Inserts a nested table in the current cell at the specified position.

Parameters
bPreFormTexttrue = New table is based on preformatted text (
 tag).  

Definition at line 2377 of file htmlpars.cxx.

References InsertLeadingEmptyLine(), and mxNestedTables.

Referenced by PreOn(), and TableOn().

void ScHTMLTable::InsertNewCell ( const ScHTMLSize rSpanSize)
private
void ScHTMLTable::InsertPara ( const HtmlImportInfo rInfo)

Inserts a new line, if in preformatted text, else does nothing.

Definition at line 1932 of file htmlpars.cxx.

References CreateNewEntry(), InsertLeadingEmptyLine(), IsEmptyCell(), mbDataOn, mxCurrEntry, and PushEntry().

bool ScHTMLTable::IsEmptyCell ( ) const
private

Returns true, if the current cell does not contain an entry yet.

Definition at line 2277 of file htmlpars.cxx.

References mpCurrEntryVector.

Referenced by BreakOn(), InsertLeadingEmptyLine(), InsertPara(), and PushEntry().

bool ScHTMLTable::IsSpaceCharInfo ( const HtmlImportInfo rInfo)
staticprivate

Returns true, if import info represents a space character.

Definition at line 2282 of file htmlpars.cxx.

References HtmlImportInfo::aText, and HtmlImportInfo::nToken.

Referenced by PutText().

ScHTMLTable * ScHTMLTable::PreOff ( const HtmlImportInfo rInfo)

Closes this table based on preformatted text ( tag).

Returns
Pointer to the parent table.

Definition at line 1984 of file htmlpars.cxx.

References CloseTable(), and mbPreFormText.

Referenced by ScHTMLQueryParser::PreOff().

ScHTMLTable * ScHTMLTable::PreOn ( const HtmlImportInfo rInfo)

Starts a new table based on preformatted text (.

 tag).

Returns
Pointer to the new table.

Definition at line 1978 of file htmlpars.cxx.

References InsertNestedTable(), and PushEntry().

Referenced by ScHTMLQueryParser::PreOn().

void ScHTMLTable::ProcessFormatOptions ( SfxItemSet rItemSet,
const HtmlImportInfo rInfo 
)
staticprivate
bool ScHTMLTable::PushEntry ( ScHTMLEntryPtr rxEntry)
private

Tries to insert the entry into the current cell.

If insertion is not possible (i.e., currently no cell open), the entry will be inserted into the parent table.

Returns
true = Entry has been pushed into the current cell; false = Entry dropped.

Definition at line 2307 of file htmlpars.cxx.

References CreateEntry(), ImplPushEntryToVector(), mbPushEmptyLine, mpCurrEntryVector, mpParentTable, and PushEntry().

Referenced by BodyOff(), BodyOn(), CloseTable(), DataOff(), DataOn(), InsertPara(), PreOn(), PushEntry(), PushTableEntry(), RowOff(), RowOn(), and TableOn().

bool ScHTMLTable::PushEntry ( const HtmlImportInfo rInfo,
bool  bLastInCell = false 
)
private

Puts the current entry into the entry list, if it is not empty.

Parameters
rInfoThe import info struct containing the end position of the current entry.
bLastInCelltrue = If cell is still empty, put this entry always.
Returns
true = Entry as been pushed into the current cell; false = Entry dropped.

Definition at line 2335 of file htmlpars.cxx.

References IsEmptyCell(), mbPushEmptyLine, mrEditEngine, mxCurrEntry, and PushEntry().

void ScHTMLTable::PushTableEntry ( ScHTMLTableId  nTableId)
private

Pushes a new entry into current cell which references a nested table.

Definition at line 2359 of file htmlpars.cxx.

References maTableItemSet, PushEntry(), and SC_HTML_GLOBAL_TABLE.

Referenced by CloseTable().

void ScHTMLTable::PutItem ( const SfxPoolItem rItem)

Puts the item into the item set of the current entry.

Definition at line 1913 of file htmlpars.cxx.

References mxCurrEntry.

Referenced by ScHTMLQueryParser::FontOn(), and ScHTMLQueryParser::ProcessToken().

void ScHTMLTable::PutText ( const HtmlImportInfo rInfo)

Inserts a text portion into current entry.

Definition at line 1920 of file htmlpars.cxx.

References IsSpaceCharInfo(), and mxCurrEntry.

Referenced by ScHTMLQueryParser::InsertText().

void ScHTMLTable::RecalcDocPos ( const ScHTMLPos rBasePos)
protected
void ScHTMLTable::RecalcDocSize ( )
protected

Recalculates the size of all columns/rows in the table, regarding nested tables.

Definition at line 2607 of file htmlpars.cxx.

References CalcNeededDocSize(), GetDocSize(), GetExistingTable(), GetSpan(), maEntryMap, ScHTMLSize::mnCols, ScHTMLSize::mnRows, mxNestedTables, tdCol, and tdRow.

Referenced by ScHTMLGlobalTable::Recalc().

void ScHTMLTable::RowOff ( const HtmlImportInfo rInfo)

Closes the current row (tag).

Cell address is invalid until call of RowOn() and DataOn().

Definition at line 2000 of file htmlpars.cxx.

References CreateNewEntry(), ImplRowOff(), mbPreFormText, mpParentTable, and PushEntry().

Referenced by ScHTMLQueryParser::ProcessToken().

void ScHTMLTable::RowOn ( const HtmlImportInfo rInfo)

Starts next row (tag).

Cell address is invalid until first call of DataOn().

Definition at line 1989 of file htmlpars.cxx.

References CreateNewEntry(), ImplRowOn(), mbPreFormText, mpParentTable, mxRowItemSet, ProcessFormatOptions(), and PushEntry().

Referenced by ScHTMLQueryParser::ProcessToken().

void ScHTMLTable::SetDocSize ( ScHTMLOrient  eOrient,
SCCOLROW  nCellPos,
SCCOLROW  nSize 
)
private

Updates the document column/row size of the specified column or row.

Only increases the present count, never decreases.

Definition at line 2540 of file htmlpars.cxx.

References maCumSizes, and nIndex.

Referenced by CalcNeededDocSize().

ScHTMLTable * ScHTMLTable::TableOff ( const HtmlImportInfo rInfo)

Closes this table (tag).

Returns
Pointer to the parent table.

Definition at line 1973 of file htmlpars.cxx.

References CloseTable(), and mbPreFormText.

Referenced by ScHTMLQueryParser::TableOff().

ScHTMLTable * ScHTMLTable::TableOn ( const HtmlImportInfo rInfo)

Starts a new table nested in this table (.

).

Returns
Pointer to the new table.

Definition at line 1967 of file htmlpars.cxx.

References InsertNestedTable(), and PushEntry().

Referenced by ScHTMLQueryParser::TableOn().

Member Data Documentation

ScSizeVec ScHTMLTable::maCumSizes[2]
private

Working entry, not yet inserted in a list.

Definition at line 532 of file htmlpars.hxx.

Referenced by GetDocSize(), and SetDocSize().

ScHTMLPos ScHTMLTable::maCurrCell
private

Size of the table.

Definition at line 534 of file htmlpars.hxx.

Referenced by ImplDataOff(), ImplRowOff(), ImplRowOn(), and InsertNewCell().

ScHTMLPos ScHTMLTable::maDocBasePos
private

Address of current cell to fill.

Definition at line 535 of file htmlpars.hxx.

Referenced by GetDocPos(), GetDocRange(), and RecalcDocPos().

std::map< ScHTMLPos, ScHTMLEntryVector > ScHTMLTable::maEntryMap
private

List that owns the parse entries (from ScEEParser).

Definition at line 529 of file htmlpars.hxx.

Referenced by FillEmptyCells(), InsertNewCell(), RecalcDocPos(), and RecalcDocSize().

ScRangeList ScHTMLTable::maHMergedCells
private

Items for the current cell.

Definition at line 524 of file htmlpars.hxx.

Referenced by GetSpan(), and InsertNewCell().

ScHTMLSize ScHTMLTable::maSize
private

Cumulated cell counts for each HTML table column/row.

Definition at line 533 of file htmlpars.hxx.

Referenced by ApplyCellBorders(), FillEmptyCells(), and InsertNewCell().

ScHTMLTableAutoId ScHTMLTable::maTableId
private

Table name from.

.

Definition at line 520 of file htmlpars.hxx.

Referenced by GetTableId().

SfxItemSet ScHTMLTable::maTableItemSet
private

Unique identifier of this table.

Definition at line 521 of file htmlpars.hxx.

Referenced by GetCurrItemSet(), ImplRowOn(), PushTableEntry(), and ScHTMLTable().

OUString ScHTMLTable::maTableName
private

Table of nested HTML tables.

Definition at line 519 of file htmlpars.hxx.

Referenced by GetTableName(), and ScHTMLTable().

ScRangeList ScHTMLTable::maUsedCells
private

List of all vertically merged cells.

Definition at line 526 of file htmlpars.hxx.

Referenced by FillEmptyCells(), and InsertNewCell().

ScRangeList ScHTMLTable::maVMergedCells
private

List of all horizontally merged cells.

Definition at line 525 of file htmlpars.hxx.

Referenced by FillEmptyCells(), GetSpan(), and InsertNewCell().

bool ScHTMLTable::mbBorderOn
private

Definition at line 537 of file htmlpars.hxx.

Referenced by ApplyCellBorders(), and ScHTMLTable().

bool ScHTMLTable::mbDataOn
private

true = Inside of .

Definition at line 540 of file htmlpars.hxx.

Referenced by BodyOn(), BreakOn(), CloseTable(), ImplDataOff(), ImplDataOn(), ImplRowOff(), ImplRowOn(), InsertLeadingEmptyLine(), and InsertPara().

bool ScHTMLTable::mbPreFormText
private

true = Table borders on.

Definition at line 538 of file htmlpars.hxx.

Referenced by BreakOn(), CloseTable(), DataOff(), DataOn(), InsertLeadingEmptyLine(), PreOff(), RowOff(), RowOn(), ScHTMLTable(), and TableOff().

bool ScHTMLTable::mbPushEmptyLine
private

true = Inside of or .

Definition at line 541 of file htmlpars.hxx.

Referenced by BreakOn(), ImplDataOn(), InsertLeadingEmptyLine(), and PushEntry().

bool ScHTMLTable::mbRowOn
private

true = Table from preformatted text (

 tag). 

Definition at line 539 of file htmlpars.hxx.

Referenced by BodyOn(), ImplDataOn(), ImplRowOff(), and ImplRowOn().

ScHTMLEntryVector* ScHTMLTable::mpCurrEntryVector
private

List of entries for each cell.

Definition at line 530 of file htmlpars.hxx.

Referenced by ImplDataOff(), InsertNewCell(), IsEmptyCell(), and PushEntry().

ScHTMLTable* ScHTMLTable::mpParentTable
private
ScHTMLParser* ScHTMLTable::mpParser
private

Resulting base address in a Calc document.

Definition at line 536 of file htmlpars.hxx.

Referenced by DataOn(), and GetFormatTable().

EditEngine& ScHTMLTable::mrEditEngine
private

List of all used cells.

Definition at line 527 of file htmlpars.hxx.

Referenced by PushEntry().

std::vector<std::shared_ptr<ScEEParseEntry> >& ScHTMLTable::mrEEParseList
private

Edit engine (from ScEEParser).

Definition at line 528 of file htmlpars.hxx.

Referenced by ImplPushEntryToVector().

ScHTMLEntryPtr ScHTMLTable::mxCurrEntry
private

Current entry vector from map for faster access.

Definition at line 531 of file htmlpars.hxx.

Referenced by AnchorOn(), CreateNewEntry(), DataOn(), InsertPara(), PushEntry(), PutItem(), PutText(), and ScHTMLTable().

SfxItemSetPtr ScHTMLTable::mxDataItemSet
private

Items for the current table row.

Definition at line 523 of file htmlpars.hxx.

Referenced by BodyOn(), DataOn(), GetCurrItemSet(), ImplDataOff(), and ImplDataOn().

ScHTMLTableMapPtr ScHTMLTable::mxNestedTables
private

Pointer to parent table.

Definition at line 518 of file htmlpars.hxx.

Referenced by ApplyCellBorders(), FillEmptyCells(), FindNestedTable(), GetExistingTable(), InsertNestedTable(), and RecalcDocSize().

SfxItemSetPtr ScHTMLTable::mxRowItemSet
private

Items for the entire table.

Definition at line 522 of file htmlpars.hxx.

Referenced by GetCurrItemSet(), ImplDataOn(), ImplRowOff(), ImplRowOn(), and RowOn().


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