LibreOffice Module sc (master) 1
|
Stores data for one table in an HTML document. More...
#include <htmlpars.hxx>
Public Member Functions | |
ScHTMLTable (ScHTMLTable &rParentTable, const HtmlImportInfo &rInfo, bool bPreFormText, const ScDocument &rDoc) | |
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... | |
const OUString & | GetTableCaption () const |
Returns the caption of the table, specified in the 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... | |
ScHTMLTable * | FindNestedTable (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... | |
ScHTMLTable * | TableOn (const HtmlImportInfo &rInfo) |
Starts a new table nested in this table (. More... | |
ScHTMLTable * | TableOff (const HtmlImportInfo &rInfo) |
Closes this table (tag). More... | |
void | CaptionOn () |
Processes the caption of the table ( tag). More... | |
void | CaptionOff () |
Processes the caption of the table ( tag). More... | |
ScHTMLTable * | PreOn (const HtmlImportInfo &rInfo) |
Starts a new table based on preformatted text (. More... | |
ScHTMLTable * | PreOff (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... | |
ScHTMLTable * | CloseTable (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 ScHTMLPos & | GetDocPos () 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... | |
SvNumberFormatter * | GetFormatTable () |
Protected Member Functions | |
ScHTMLTable (SfxItemPool &rPool, EditEngine &rEditEngine, std::vector< std::shared_ptr< ScEEParseEntry > > &rEEParseList, ScHTMLTableId &rnUnusedId, ScHTMLParser *pParser, const ScDocument &rDoc) | |
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< ScHTMLTableMap > | ScHTMLTableMapPtr |
typedef ::std::vector< SCCOLROW > | ScSizeVec |
typedef ::std::vector< ScHTMLEntry * > | ScHTMLEntryVector |
typedef ::std::unique_ptr< ScHTMLEntry > | ScHTMLEntryPtr |
Private Member Functions | |
bool | IsEmptyCell () const |
Returns true, if the current cell does not contain an entry yet. More... | |
const SfxItemSet & | GetCurrItemSet () 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... | |
ScHTMLTable * | GetExistingTable (ScHTMLTableId nTableId) const |
Tries to find a table from the table container. More... | |
ScHTMLTable * | InsertNestedTable (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 | |
ScHTMLTable * | mpParentTable |
ScHTMLTableMapPtr | mxNestedTables |
Pointer to parent table. More... | |
OUString | maTableName |
Table of nested HTML tables. More... | |
OUString | maCaption |
Table name from. More... | |
OUStringBuffer | maCaptionBuffer |
Caption name of the table from More... | |
ScHTMLTableAutoId | maTableId |
Caption buffer of the table from More... | |
SfxItemSet | maTableItemSet |
Unique identifier of this table. More... | |
std::optional< SfxItemSet > | moRowItemSet |
Items for the entire table. More... | |
std::optional< SfxItemSet > | moDataItemSet |
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... | |
EditEngine & | mrEditEngine |
List of all used cells. More... | |
std::vector< std::shared_ptr< ScEEParseEntry > > & | mrEEParseList |
Edit engine (from ScEEParser). More... | |
std::map< ScHTMLPos, ScHTMLEntryVector > | maEntryMap |
List that owns the parse entries (from ScEEParser). More... | |
ScHTMLEntryVector * | mpCurrEntryVector |
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... | |
ScHTMLParser * | mpParser |
Resulting base address in a Calc document. More... | |
const ScDocument & | mrDoc |
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... | |
bool | mbCaptionOn:1 |
true = Insert empty line before current entry. More... | |
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 326 of file htmlpars.hxx.
|
private |
Definition at line 455 of file htmlpars.hxx.
|
private |
Definition at line 454 of file htmlpars.hxx.
|
private |
Definition at line 452 of file htmlpars.hxx.
|
private |
Definition at line 453 of file htmlpars.hxx.
|
explicit |
Creates a new HTML table without content.
@descr Internally handles a current cell position. This position is invalid until first calls of RowOn() and DataOn().
rParentTable | Reference to the parent table that owns this table. |
bPreFormText | true = Table is based on preformatted text (tag). |
Definition at line 1810 of file htmlpars.cxx.
References CreateNewEntry(), ImplDataOn(), ImplRowOn(), maSize, maTableItemSet, maTableName, mbBorderOn, mbPreFormText, HtmlImportInfo::pParser, and ProcessFormatOptions().
|
virtual |
Definition at line 1882 of file htmlpars.cxx.
|
explicitprotected |
Creates a new HTML table without parent.
@descr This constructor is used to create the "global table".
Definition at line 1854 of file htmlpars.cxx.
References CreateEntry(), ImplDataOn(), ImplRowOn(), maSize, and mxCurrEntry.
void ScHTMLTable::AnchorOn | ( | ) |
Processes a hyperlink ( tag).
Definition at line 1957 of file htmlpars.cxx.
References mxCurrEntry.
Referenced by ScHTMLQueryParser::ProcessToken().
void ScHTMLTable::ApplyCellBorders | ( | ScDocument * | pDoc, |
const ScAddress & | rFirstPos | ||
) | const |
Applies border formatting to the passed document.
Definition at line 2240 of file htmlpars.cxx.
References ScDocument::ApplyAttr(), ATTR_BORDER(), ScAddress::Col(), GetDocPos(), GetDocSize(), SvxBorderLineWidth::Hairline, maSize, mbBorderOn, SvxBorderLineWidth::Medium, ScHTMLSize::mnCols, ScHTMLSize::mnRows, mxNestedTables, ScAddress::Row(), SvxBoxItem::SetLine(), ScAddress::Tab(), tdCol, and tdRow.
Referenced by ScHTMLImport::WriteToDocument().
void ScHTMLTable::BodyOff | ( | const HtmlImportInfo & | rInfo | ) |
Closes the body of the HTML document (</body> tag).
Definition at line 2159 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 2144 of file htmlpars.cxx.
References CreateNewEntry(), ImplDataOn(), ImplRowOn(), mbDataOn, mbRowOn, moDataItemSet, mpParentTable, ProcessFormatOptions(), and PushEntry().
Referenced by ScHTMLQueryParser::ProcessToken().
void ScHTMLTable::BreakOn | ( | ) |
Inserts a line break (
tag).
@descr Inserts the current entry regardless if it is empty.
Definition at line 1939 of file htmlpars.cxx.
References IsEmptyCell(), mbDataOn, mbPreFormText, and mbPushEmptyLine.
Referenced by ScHTMLQueryParser::ProcessToken().
|
private |
Calculates and sets the resulting size the cell needs in the document.
@descr Reduces the needed size in merged cells.
nCellPos | The first column/row position of the (merged) cell. |
nCellSpan | The cell spanning in the specified orientation. |
nRealDocSize | The raw document size of all entries of the cell. |
Definition at line 2567 of file htmlpars.cxx.
References GetDocSize(), and SetDocSize().
Referenced by RecalcDocSize().
void ScHTMLTable::CaptionOff | ( | ) |
Processes the caption of the table ( tag).
Definition at line 1982 of file htmlpars.cxx.
References maCaption, maCaptionBuffer, and mbCaptionOn.
Referenced by ScHTMLQueryParser::ProcessToken().
void ScHTMLTable::CaptionOn | ( | ) |
Processes the caption of the table ( tag).
Definition at line 1976 of file htmlpars.cxx.
References maCaptionBuffer, and mbCaptionOn.
Referenced by ScHTMLQueryParser::ProcessToken().
ScHTMLTable * ScHTMLTable::CloseTable | ( | const HtmlImportInfo & | rInfo | ) |
Closes this table (tag) or preformatted text ( tag).
@descr Used to close this table object regardless on opening tag type.
Definition at line 2170 of file htmlpars.cxx.
References CreateNewEntry(), GetTableId(), ImplDataOff(), ImplRowOff(), InsertLeadingEmptyLine(), mbDataOn, mbPreFormText, mpParentTable, PushEntry(), and PushTableEntry().
Referenced by ScHTMLQueryParser::CloseTable(), PreOff(), and TableOff().
|
private |
Creates and returns a new empty flying entry at position (0,0).
Definition at line 2299 of file htmlpars.cxx.
References GetCurrItemSet().
Referenced by CreateNewEntry(), FillEmptyCells(), PushEntry(), and ScHTMLTable().
|
private |
Creates a new flying entry.
rInfo | Contains the initial edit engine selection for the entry. |
Definition at line 2304 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).
@descr Cell address is invalid until next call of DataOn().
Definition at line 2136 of file htmlpars.cxx.
References CreateNewEntry(), ImplDataOff(), mbPreFormText, mpParentTable, and PushEntry().
Referenced by ScHTMLQueryParser::ProcessToken().
void ScHTMLTable::DataOn | ( | const HtmlImportInfo & | rInfo | ) |
Starts the next cell (or tag).
Definition at line 2069 of file htmlpars.cxx.
References ATTR_VALUE_FORMAT(), CreateNewEntry(), SvNumberFormatter::GetEntryKey(), GetFormatTable(), ScHTMLStyles::getPropertyValue(), ScHTMLParser::GetStyles(), ImplDataOn(), mbPreFormText, ScHTMLSize::mnCols, ScHTMLSize::mnRows, moDataItemSet, mpParentTable, mpParser, mxCurrEntry, NUMBERFORMAT_ENTRY_NOT_FOUND, HtmlImportInfo::pParser, ProcessFormatOptions(), PushEntry(), and SvNumberFormatter::PutEntry().
Referenced by ScHTMLQueryParser::ProcessToken().
|
protected |
Fills all empty cells in this and nested tables with dummy parse entries.
Definition at line 2583 of file htmlpars.cxx.
References ScRange::aEnd, ScAddress::Col(), CreateEntry(), ScRangeList::Find(), i, ImplPushEntryToVector(), ScAddress::IncCol(), ScRangeList::Join(), maEntryMap, maSize, maUsedCells, maVMergedCells, ScHTMLSize::mnCols, ScHTMLSize::mnRows, mxNestedTables, ScAddress::Row(), and ScRangeList::size().
Referenced by ScHTMLGlobalTable::Recalc().
ScHTMLTable * ScHTMLTable::FindNestedTable | ( | ScHTMLTableId | nTableId | ) | const |
Searches in all nested tables for the specified table.
nTableId | Unique identifier of the table. |
Definition at line 1903 of file htmlpars.cxx.
References mxNestedTables.
Referenced by ScHTMLTableMap::FindTable(), and ScHTMLImport::WriteToDocument().
|
private |
Returns the item set from cell, row, or table, depending on current state.
Definition at line 1886 of file htmlpars.cxx.
References maTableItemSet, moDataItemSet, and moRowItemSet.
Referenced by CreateEntry().
|
inline |
Returns the resulting Calc position of the top left edge of the table.
Definition at line 419 of file htmlpars.hxx.
References maDocBasePos.
Referenced by ApplyCellBorders(), GetDocPos(), ScHTMLGlobalTable::Recalc(), and RecalcDocPos().
Calculates the resulting Calc position of the specified HTML cell.
Definition at line 2222 of file htmlpars.cxx.
References GetDocPos(), ScHTMLPos::mnCol, ScHTMLPos::mnRow, tdCol, and tdRow.
SCCOLROW ScHTMLTable::GetDocPos | ( | ScHTMLOrient | eOrient, |
SCCOLROW | nCellPos | ||
) | const |
Calculates the resulting Calc position of the specified HTML column/row.
Definition at line 2217 of file htmlpars.cxx.
References ScHTMLPos::Get(), GetDocSize(), and maDocBasePos.
void ScHTMLTable::GetDocRange | ( | ScRange & | rRange | ) | const |
Calculates the current Calc document area of this table.
Definition at line 2229 of file htmlpars.cxx.
References ScRange::aEnd, ScRange::aStart, GetDocSize(), maDocBasePos, ScHTMLPos::MakeAddr(), ScAddress::Move(), mrDoc, tdCol, tdRow, and ScAddress::UNINITIALIZED.
Referenced by ScHTMLImport::WriteToDocument().
ScHTMLSize ScHTMLTable::GetDocSize | ( | const ScHTMLPos & | rCellPos | ) | const |
Returns the total document row/column count of the specified HTML cell.
Definition at line 2209 of file htmlpars.cxx.
References GetDocSize(), GetSpan(), ScHTMLPos::mnCol, ScHTMLSize::mnCols, ScHTMLPos::mnRow, ScHTMLSize::mnRows, tdCol, and tdRow.
SCCOLROW ScHTMLTable::GetDocSize | ( | ScHTMLOrient | eOrient | ) | const |
Returns the total document row/column count in the specified direction.
Definition at line 2203 of file htmlpars.cxx.
References maCumSizes.
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 2194 of file htmlpars.cxx.
References maCumSizes.
SCCOLROW ScHTMLTable::GetDocSize | ( | ScHTMLOrient | eOrient, |
SCCOLROW | nCellPos | ||
) | const |
Returns the resulting document row/column count of the specified HTML row/column.
Definition at line 2186 of file htmlpars.cxx.
References maCumSizes, and nIndex.
Referenced by ApplyCellBorders(), CalcNeededDocSize(), GetDocPos(), GetDocRange(), GetDocSize(), RecalcDocPos(), RecalcDocSize(), and ScHTMLImport::WriteToDocument().
|
private |
Tries to find a table from the table container.
@descr Assumes that the table is located in the current container or that the passed table identifier is 0.
nTableId | Unique identifier of the table or 0. |
Definition at line 2381 of file htmlpars.cxx.
References mxNestedTables, and SC_HTML_GLOBAL_TABLE.
Referenced by RecalcDocPos(), and RecalcDocSize().
SvNumberFormatter * ScHTMLTable::GetFormatTable | ( | ) |
Definition at line 2284 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 1892 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().
|
inline |
Returns the caption of the table, specified in the tag.
Definition at line 345 of file htmlpars.hxx.
References maCaption.
Referenced by ScHTMLImport::WriteToDocument().
|
inline |
Returns the unique identifier of the table.
Definition at line 347 of file htmlpars.hxx.
References maTableId, and ScHTMLTableAutoId::mnTableId.
Referenced by CloseTable(), ScHTMLTableMap::CreateTable(), and ScHTMLTableMap::FindTable().
|
inline |
Returns the name of the table, specified in the TABLE tag.
Definition at line 343 of file htmlpars.hxx.
References maTableName.
Referenced by ScHTMLImport::WriteToDocument().
void ScHTMLTable::HeadingOn | ( | ) |
Inserts a heading line (.
and <h*> tags).
Definition at line 1945 of file htmlpars.cxx.
References InsertLeadingEmptyLine().
Referenced by ScHTMLQueryParser::ProcessToken().
|
private |
Set internal states for leaving a table cell.
Definition at line 2485 of file htmlpars.cxx.
References maCurrCell, mbDataOn, ScHTMLPos::mnCol, moDataItemSet, and mpCurrEntryVector.
Referenced by BodyOff(), CloseTable(), DataOff(), ImplDataOn(), and ImplRowOff().
|
private |
Set internal states for entering a new table cell.
Definition at line 2473 of file htmlpars.cxx.
References ImplDataOff(), ImplRowOn(), InsertNewCell(), mbDataOn, mbPushEmptyLine, mbRowOn, moDataItemSet, and moRowItemSet.
Referenced by BodyOn(), DataOn(), and ScHTMLTable().
|
private |
Pushes the passed entry into the list of the current cell.
Definition at line 2311 of file htmlpars.cxx.
References mrEEParseList.
Referenced by FillEmptyCells(), PushEntry(), and RecalcDocPos().
|
private |
Set internal states for leaving a table row.
Definition at line 2461 of file htmlpars.cxx.
References ImplDataOff(), maCurrCell, mbDataOn, mbRowOn, ScHTMLPos::mnRow, and moRowItemSet.
Referenced by BodyOff(), CloseTable(), ImplRowOn(), and RowOff().
|
private |
Set internal states for a new table row.
Definition at line 2451 of file htmlpars.cxx.
References ImplRowOff(), maCurrCell, maTableItemSet, mbDataOn, mbRowOn, ScHTMLPos::mnCol, and moRowItemSet.
Referenced by BodyOn(), ImplDataOn(), RowOn(), and ScHTMLTable().
|
private |
Inserts an empty line in front of the next entry.
Definition at line 1951 of file htmlpars.cxx.
References IsEmptyCell(), mbDataOn, mbPreFormText, and mbPushEmptyLine.
Referenced by CloseTable(), HeadingOn(), InsertNestedTable(), and InsertPara().
|
private |
Inserts a nested table in the current cell at the specified position.
bPreFormText | true = New table is based on preformatted text (tag). |
Definition at line 2389 of file htmlpars.cxx.
References InsertLeadingEmptyLine(), mrDoc, and mxNestedTables.
|
private |
Inserts a new cell in an unused position, starting from current cell position.
Definition at line 2398 of file htmlpars.cxx.
References ScRange::aEnd, ScAddress::Col(), ScRangeList::Find(), ScRangeList::Join(), maCurrCell, maEntryMap, maHMergedCells, ScHTMLPos::MakeAddr(), maSize, maUsedCells, maVMergedCells, ScHTMLPos::mnCol, ScHTMLSize::mnCols, ScHTMLPos::mnRow, ScHTMLSize::mnRows, ScAddress::Move(), mpCurrEntryVector, mrDoc, ScRangeList::push_back(), ScAddress::Row(), ScAddress::SetRow(), and ScAddress::UNINITIALIZED.
Referenced by ImplDataOn().
void ScHTMLTable::InsertPara | ( | const HtmlImportInfo & | rInfo | ) |
Inserts a new line, if in preformatted text, else does nothing.
Definition at line 1930 of file htmlpars.cxx.
References CreateNewEntry(), InsertLeadingEmptyLine(), IsEmptyCell(), mbDataOn, mxCurrEntry, and PushEntry().
|
private |
Returns true, if the current cell does not contain an entry yet.
Definition at line 2289 of file htmlpars.cxx.
References mpCurrEntryVector.
Referenced by BreakOn(), InsertLeadingEmptyLine(), InsertPara(), and PushEntry().
|
staticprivate |
Returns true, if import info represents a space character.
Definition at line 2294 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).
Definition at line 1996 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).
Definition at line 1990 of file htmlpars.cxx.
References InsertNestedTable(), and PushEntry().
Referenced by ScHTMLQueryParser::PreOn().
|
staticprivate |
Inserts additional formatting options from import info into the item set.
Definition at line 2496 of file htmlpars.cxx.
References ATTR_BACKGROUND(), ATTR_FONT_WEIGHT(), ATTR_HOR_JUSTIFY(), ATTR_VER_JUSTIFY(), HtmlImportInfo::nToken, OOO_STRING_SVTOOLS_HTML_AL_center, OOO_STRING_SVTOOLS_HTML_AL_left, OOO_STRING_SVTOOLS_HTML_AL_right, OOO_STRING_SVTOOLS_HTML_VA_bottom, OOO_STRING_SVTOOLS_HTML_VA_middle, OOO_STRING_SVTOOLS_HTML_VA_top, HtmlImportInfo::pParser, SfxItemSet::Put(), and WEIGHT_BOLD.
Referenced by BodyOn(), DataOn(), RowOn(), and ScHTMLTable().
|
private |
Puts the current entry into the entry list, if it is not empty.
rInfo | The import info struct containing the end position of the current entry. |
bLastInCell | true = If cell is still empty, put this entry always. |
Definition at line 2347 of file htmlpars.cxx.
References IsEmptyCell(), mbPushEmptyLine, mrEditEngine, mxCurrEntry, and PushEntry().
|
private |
Tries to insert the entry into the current cell.
@descr If insertion is not possible (i.e., currently no cell open), the entry will be inserted into the parent table.
Definition at line 2319 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().
|
private |
Pushes a new entry into current cell which references a nested table.
Definition at line 2371 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 1908 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 1915 of file htmlpars.cxx.
References HtmlImportInfo::aText, IsSpaceCharInfo(), maCaptionBuffer, mbCaptionOn, and mxCurrEntry.
Referenced by ScHTMLQueryParser::InsertText().
|
protected |
Recalculates the position of all cell entries and nested tables.
rBasePos | The origin of the table in the Calc document. |
Definition at line 2668 of file htmlpars.cxx.
References GetDocPos(), GetDocSize(), GetExistingTable(), ScHTMLEntry::GetItemSet(), ScHTMLEntry::GetTableId(), ImplPushEntryToVector(), maDocBasePos, maEntryMap, ScHTMLPos::mnCol, ScHTMLSize::mnCols, ScHTMLPos::mnRow, ScHTMLSize::mnRows, mpParentTable, ScEEParseEntry::nCol, ScEEParseEntry::nColOverlap, ScEEParseEntry::nRow, ScEEParseEntry::nRowOverlap, SC_HTML_NO_TABLE, SCCOL_MAX, SCROW_MAX, tdCol, and tdRow.
Referenced by ScHTMLGlobalTable::Recalc().
|
protected |
Recalculates the size of all columns/rows in the table, regarding nested tables.
Definition at line 2619 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).
@descr Cell address is invalid until call of RowOn() and DataOn().
Definition at line 2012 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).
@descr Cell address is invalid until first call of DataOn().
Definition at line 2001 of file htmlpars.cxx.
References CreateNewEntry(), ImplRowOn(), mbPreFormText, moRowItemSet, mpParentTable, ProcessFormatOptions(), and PushEntry().
Referenced by ScHTMLQueryParser::ProcessToken().
|
private |
Updates the document column/row size of the specified column or row.
@descr Only increases the present count, never decreases.
Definition at line 2552 of file htmlpars.cxx.
References maCumSizes, and nIndex.
Referenced by CalcNeededDocSize().
ScHTMLTable * ScHTMLTable::TableOff | ( | const HtmlImportInfo & | rInfo | ) |
Closes this table (tag).
Definition at line 1971 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 (.
).
Definition at line 1965 of file htmlpars.cxx.
References InsertNestedTable(), and PushEntry().
Referenced by ScHTMLQueryParser::TableOn().
|
private |
Table name from.
.
Definition at line 529 of file htmlpars.hxx.
Referenced by CaptionOff(), and GetTableCaption().
|
private |
Caption name of the table from
Definition at line 530 of file htmlpars.hxx.
Referenced by CaptionOff(), CaptionOn(), and PutText().
|
private |
Working entry, not yet inserted in a list.
Definition at line 543 of file htmlpars.hxx.
Referenced by GetDocSize(), and SetDocSize().
|
private |
Size of the table.
Definition at line 545 of file htmlpars.hxx.
Referenced by ImplDataOff(), ImplRowOff(), ImplRowOn(), and InsertNewCell().
|
private |
Address of current cell to fill.
Definition at line 546 of file htmlpars.hxx.
Referenced by GetDocPos(), GetDocRange(), and RecalcDocPos().
|
private |
List that owns the parse entries (from ScEEParser).
Definition at line 540 of file htmlpars.hxx.
Referenced by FillEmptyCells(), InsertNewCell(), RecalcDocPos(), and RecalcDocSize().
|
private |
Items for the current cell.
Definition at line 535 of file htmlpars.hxx.
Referenced by GetSpan(), and InsertNewCell().
|
private |
Cumulated cell counts for each HTML table column/row.
Definition at line 544 of file htmlpars.hxx.
Referenced by ApplyCellBorders(), FillEmptyCells(), and InsertNewCell().
|
private |
Caption buffer of the table from
Definition at line 531 of file htmlpars.hxx.
Referenced by GetTableId().
|
private |
Unique identifier of this table.
Definition at line 532 of file htmlpars.hxx.
Referenced by GetCurrItemSet(), ImplRowOn(), PushTableEntry(), and ScHTMLTable().
|
private |
Table of nested HTML tables.
Definition at line 528 of file htmlpars.hxx.
Referenced by GetTableName(), and ScHTMLTable().
|
private |
List of all vertically merged cells.
Definition at line 537 of file htmlpars.hxx.
Referenced by FillEmptyCells(), and InsertNewCell().
|
private |
List of all horizontally merged cells.
Definition at line 536 of file htmlpars.hxx.
Referenced by FillEmptyCells(), GetSpan(), and InsertNewCell().
|
private |
Definition at line 549 of file htmlpars.hxx.
Referenced by ApplyCellBorders(), and ScHTMLTable().
|
private |
true = Insert empty line before current entry.
Definition at line 554 of file htmlpars.hxx.
Referenced by CaptionOff(), CaptionOn(), and PutText().
|
private |
true = Inside of .
Definition at line 552 of file htmlpars.hxx.
Referenced by BodyOn(), BreakOn(), CloseTable(), ImplDataOff(), ImplDataOn(), ImplRowOff(), ImplRowOn(), InsertLeadingEmptyLine(), and InsertPara().
|
private |
true = Table borders on.
Definition at line 550 of file htmlpars.hxx.
Referenced by BreakOn(), CloseTable(), DataOff(), DataOn(), InsertLeadingEmptyLine(), PreOff(), RowOff(), RowOn(), ScHTMLTable(), and TableOff().
|
private |
true = Inside of or .
Definition at line 553 of file htmlpars.hxx.
Referenced by BreakOn(), ImplDataOn(), InsertLeadingEmptyLine(), and PushEntry().
|
private |
true = Table from preformatted text (
tag).
Definition at line 551 of file htmlpars.hxx.
Referenced by BodyOn(), ImplDataOn(), ImplRowOff(), and ImplRowOn().
|
private |
Items for the current table row.
Definition at line 534 of file htmlpars.hxx.
Referenced by BodyOn(), DataOn(), GetCurrItemSet(), ImplDataOff(), and ImplDataOn().
|
private |
Items for the entire table.
Definition at line 533 of file htmlpars.hxx.
Referenced by GetCurrItemSet(), ImplDataOn(), ImplRowOff(), ImplRowOn(), and RowOn().
|
private |
List of entries for each cell.
Definition at line 541 of file htmlpars.hxx.
Referenced by ImplDataOff(), InsertNewCell(), IsEmptyCell(), and PushEntry().
|
private |
Definition at line 526 of file htmlpars.hxx.
Referenced by BodyOff(), BodyOn(), CloseTable(), DataOff(), DataOn(), PushEntry(), RecalcDocPos(), RowOff(), and RowOn().
|
private |
Resulting base address in a Calc document.
Definition at line 547 of file htmlpars.hxx.
Referenced by DataOn(), and GetFormatTable().
|
private |
Definition at line 548 of file htmlpars.hxx.
Referenced by GetDocRange(), InsertNestedTable(), and InsertNewCell().
|
private |
|
private |
Edit engine (from ScEEParser).
Definition at line 539 of file htmlpars.hxx.
Referenced by ImplPushEntryToVector().
|
private |
Current entry vector from map for faster access.
Definition at line 542 of file htmlpars.hxx.
Referenced by AnchorOn(), CreateNewEntry(), DataOn(), InsertPara(), PushEntry(), PutItem(), PutText(), and ScHTMLTable().
|
private |
Pointer to parent table.
Definition at line 527 of file htmlpars.hxx.
Referenced by ApplyCellBorders(), FillEmptyCells(), FindNestedTable(), GetExistingTable(), InsertNestedTable(), and RecalcDocSize().