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

The HTML parser for data queries. More...

#include <htmlpars.hxx>

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

Public Member Functions

 ScHTMLQueryParser (EditEngine *pEditEngine, ScDocument *pDoc)
 
virtual ~ScHTMLQueryParser () override
 
virtual ErrCode Read (SvStream &rStrm, const OUString &rBaseURL) override
 
virtual const ScHTMLTableGetGlobalTable () const override
 Returns the "global table" which contains the entire HTML document. More...
 
- Public Member Functions inherited from ScHTMLParser
 ScHTMLParser (EditEngine *pEditEngine, ScDocument *pDoc)
 The destination document. More...
 
virtual ~ScHTMLParser () override
 
virtual ErrCode Read (SvStream &rStrm, const OUString &rBaseURL) override=0
 
ScHTMLStylesGetStyles ()
 
ScDocumentGetDoc ()
 
virtual const ScHTMLTableGetGlobalTable () const =0
 Returns the "global table" which contains the entire HTML document. More...
 
- Public Member Functions inherited from ScEEParser
 ScEEParser (EditEngine *)
 
virtual ~ScEEParser ()
 
virtual ErrCode Read (SvStream &, const OUString &rBaseURL)=0
 
const ColWidthsMapGetColWidths () const
 
ColWidthsMapGetColWidths ()
 
void GetDimensions (SCCOL &nCols, SCROW &nRows) const
 
size_t ListSize () const
 
ScEEParseEntryListEntry (size_t index)
 
const ScEEParseEntryListEntry (size_t index) const
 

Private Types

typedef ::std::unique_ptr< ScHTMLGlobalTableScHTMLGlobalTablePtr
 

Private Member Functions

void ProcessToken (const HtmlImportInfo &rInfo)
 Handles all possible tags in the HTML document. More...
 
void InsertText (const HtmlImportInfo &rInfo)
 Inserts a text portion into current entry. More...
 
void FontOn (const HtmlImportInfo &rInfo)
 Processes the <font> tag. More...
 
void MetaOn (const HtmlImportInfo &rInfo)
 Processes the <meta> tag. More...
 
void TitleOn ()
 Opens the title of the HTML document (<title> tag). More...
 
void TitleOff (const HtmlImportInfo &rInfo)
 Closes the title of the HTML document (</title> tag). More...
 
void TableOn (const HtmlImportInfo &rInfo)
 Opens a new table at the current position. More...
 
void TableOff (const HtmlImportInfo &rInfo)
 Closes the current table. More...
 
void PreOn (const HtmlImportInfo &rInfo)
 Opens a new table based on preformatted text. More...
 
void PreOff (const HtmlImportInfo &rInfo)
 Closes the current preformatted text table. More...
 
void CloseTable (const HtmlImportInfo &rInfo)
 Closes the current table, regardless on opening tag. More...
 
void ParseStyle (std::u16string_view rStrm)
 
 DECL_LINK (HTMLImportHdl, HtmlImportInfo &, void)
 

Private Attributes

OUStringBuffer maTitle
 
ScHTMLGlobalTablePtr mxGlobTable
 The title of the document. More...
 
ScHTMLTablempCurrTable
 Contains the entire imported document. More...
 
ScHTMLTableId mnUnusedId
 Pointer to current table (performance). More...
 
bool mbTitleOn
 First unused table identifier. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ScEEParser
void NewActEntry (const ScEEParseEntry *)
 
- Protected Attributes inherited from ScHTMLParser
sal_uInt32 maFontHeights [SC_HTML_FONTSIZES]
 
ScDocumentmpDoc
 
- Protected Attributes inherited from ScEEParser
EditEnginepEdit
 
rtl::Reference< SfxItemPoolpPool
 
rtl::Reference< SfxItemPoolpDocPool
 
std::vector< std::shared_ptr< ScEEParseEntry > > maList
 
std::shared_ptr< ScEEParseEntrymxActEntry
 
ColWidthsMap maColWidths
 
int nRtfLastToken
 
SCCOL nColCnt
 
SCROW nRowCnt
 
SCCOL nColMax
 
SCROW nRowMax
 

Detailed Description

The HTML parser for data queries.

Focuses on data import, not on layout.

Builds the table structure correctly, ignores extended formatting like pictures or column widths.

Definition at line 579 of file htmlpars.hxx.

Member Typedef Documentation

◆ ScHTMLGlobalTablePtr

typedef ::std::unique_ptr< ScHTMLGlobalTable > ScHTMLQueryParser::ScHTMLGlobalTablePtr
private

Definition at line 622 of file htmlpars.hxx.

Constructor & Destructor Documentation

◆ ScHTMLQueryParser()

ScHTMLQueryParser::ScHTMLQueryParser ( EditEngine pEditEngine,
ScDocument pDoc 
)
explicit

◆ ~ScHTMLQueryParser()

ScHTMLQueryParser::~ScHTMLQueryParser ( )
overridevirtual

Definition at line 2782 of file htmlpars.cxx.

Member Function Documentation

◆ CloseTable()

void ScHTMLQueryParser::CloseTable ( const HtmlImportInfo rInfo)
private

Closes the current table, regardless on opening tag.

Definition at line 3020 of file htmlpars.cxx.

References ScHTMLTable::CloseTable(), and mpCurrTable.

◆ DECL_LINK()

ScHTMLQueryParser::DECL_LINK ( HTMLImportHdl  ,
HtmlImportInfo ,
void   
)
private

◆ FontOn()

void ScHTMLQueryParser::FontOn ( const HtmlImportInfo rInfo)
private

◆ GetGlobalTable()

const ScHTMLTable * ScHTMLQueryParser::GetGlobalTable ( ) const
overridevirtual

Returns the "global table" which contains the entire HTML document.

Implements ScHTMLParser.

Definition at line 2824 of file htmlpars.cxx.

References mxGlobTable.

◆ InsertText()

void ScHTMLQueryParser::InsertText ( const HtmlImportInfo rInfo)
private

Inserts a text portion into current entry.

Definition at line 2914 of file htmlpars.cxx.

References HtmlImportInfo::aText, maTitle, mbTitleOn, mpCurrTable, and ScHTMLTable::PutText().

Referenced by ProcessToken(), and TitleOff().

◆ MetaOn()

void ScHTMLQueryParser::MetaOn ( const HtmlImportInfo rInfo)
private

◆ ParseStyle()

void ScHTMLQueryParser::ParseStyle ( std::u16string_view  rStrm)
private

Definition at line 3099 of file htmlpars.cxx.

References aStr, ScHTMLParser::GetStyles(), OUStringToOString(), rStrm, and SAL_WARN.

Referenced by ProcessToken().

◆ PreOff()

void ScHTMLQueryParser::PreOff ( const HtmlImportInfo rInfo)
private

Closes the current preformatted text table.

Definition at line 3015 of file htmlpars.cxx.

References mpCurrTable, and ScHTMLTable::PreOff().

Referenced by ProcessToken().

◆ PreOn()

void ScHTMLQueryParser::PreOn ( const HtmlImportInfo rInfo)
private

Opens a new table based on preformatted text.

Definition at line 3010 of file htmlpars.cxx.

References mpCurrTable, and ScHTMLTable::PreOn().

Referenced by ProcessToken().

◆ ProcessToken()

void ScHTMLQueryParser::ProcessToken ( const HtmlImportInfo rInfo)
private

◆ Read()

ErrCode ScHTMLQueryParser::Read ( SvStream rStrm,
const OUString &  rBaseURL 
)
overridevirtual

◆ TableOff()

void ScHTMLQueryParser::TableOff ( const HtmlImportInfo rInfo)
private

Closes the current table.

Definition at line 3005 of file htmlpars.cxx.

References mpCurrTable, and ScHTMLTable::TableOff().

Referenced by ProcessToken().

◆ TableOn()

void ScHTMLQueryParser::TableOn ( const HtmlImportInfo rInfo)
private

Opens a new table at the current position.

Definition at line 3000 of file htmlpars.cxx.

References mpCurrTable, and ScHTMLTable::TableOn().

Referenced by ProcessToken().

◆ TitleOff()

void ScHTMLQueryParser::TitleOff ( const HtmlImportInfo rInfo)
private

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

Definition at line 2983 of file htmlpars.cxx.

References ScDocument::GetDocumentShell(), SfxObjectShell::GetModel(), InsertText(), maTitle, mbTitleOn, and ScHTMLParser::mpDoc.

Referenced by ProcessToken().

◆ TitleOn()

void ScHTMLQueryParser::TitleOn ( )
private

Opens the title of the HTML document (<title> tag).

Definition at line 2977 of file htmlpars.cxx.

References maTitle, and mbTitleOn.

Referenced by ProcessToken().

Member Data Documentation

◆ maTitle

OUStringBuffer ScHTMLQueryParser::maTitle
private

Definition at line 624 of file htmlpars.hxx.

Referenced by InsertText(), TitleOff(), and TitleOn().

◆ mbTitleOn

bool ScHTMLQueryParser::mbTitleOn
private

First unused table identifier.

Definition at line 628 of file htmlpars.hxx.

Referenced by InsertText(), TitleOff(), and TitleOn().

◆ mnUnusedId

ScHTMLTableId ScHTMLQueryParser::mnUnusedId
private

Pointer to current table (performance).

Definition at line 627 of file htmlpars.hxx.

Referenced by ScHTMLQueryParser().

◆ mpCurrTable

ScHTMLTable* ScHTMLQueryParser::mpCurrTable
private

Contains the entire imported document.

Definition at line 626 of file htmlpars.hxx.

Referenced by CloseTable(), FontOn(), InsertText(), PreOff(), PreOn(), ProcessToken(), ScHTMLQueryParser(), TableOff(), and TableOn().

◆ mxGlobTable

ScHTMLGlobalTablePtr ScHTMLQueryParser::mxGlobTable
private

The title of the document.

Definition at line 625 of file htmlpars.hxx.

Referenced by GetGlobalTable(), Read(), and ScHTMLQueryParser().


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