LibreOffice Module sc (master) 1
|
#include <htmlpars.hxx>
Public Member Functions | |
ScHTMLLayoutParser (EditEngine *, OUString aBaseURL, const Size &aPageSize, ScDocument *) | |
virtual | ~ScHTMLLayoutParser () override |
virtual ErrCode | Read (SvStream &, const OUString &rBaseURL) override |
virtual const ScHTMLTable * | GetGlobalTable () 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 |
ScHTMLStyles & | GetStyles () |
ScDocument & | GetDoc () |
virtual const ScHTMLTable * | GetGlobalTable () 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 ColWidthsMap & | GetColWidths () const |
ColWidthsMap & | GetColWidths () |
void | GetDimensions (SCCOL &nCols, SCROW &nRows) const |
size_t | ListSize () const |
ScEEParseEntry * | ListEntry (size_t index) |
const ScEEParseEntry * | ListEntry (size_t index) const |
Private Member Functions | |
DECL_LINK (HTMLImportHdl, HtmlImportInfo &, void) | |
void | NewActEntry (const ScEEParseEntry *) |
void | ProcToken (HtmlImportInfo *) |
void | CloseEntry (const HtmlImportInfo *) |
void | NextRow (const HtmlImportInfo *) |
void | SkipLocked (ScEEParseEntry *, bool bJoin=true) |
void | Colonize (ScEEParseEntry *) |
sal_uInt16 | GetWidth (const ScEEParseEntry *) |
void | SetWidths () |
void | Adjust () |
sal_uInt16 | GetWidthPixel (const HTMLOption &) |
bool | IsAtBeginningOfText (const HtmlImportInfo *) |
void | TableOn (HtmlImportInfo *) |
void | ColOn (HtmlImportInfo *) |
void | TableRowOn (const HtmlImportInfo *) |
void | TableRowOff (const HtmlImportInfo *) |
void | TableDataOn (HtmlImportInfo *) |
void | TableDataOff (const HtmlImportInfo *) |
void | TableOff (const HtmlImportInfo *) |
void | Image (HtmlImportInfo *) |
void | AnchorOn (HtmlImportInfo *) |
void | FontOn (HtmlImportInfo *) |
Static Private Member Functions | |
static void | EntryEnd (ScEEParseEntry *, const ESelection &) |
static bool | SeekOffset (const ScHTMLColOffset *, sal_uInt16 nOffset, SCCOL *pCol, sal_uInt16 nOffsetTol) |
static void | MakeCol (ScHTMLColOffset *, sal_uInt16 &nOffset, sal_uInt16 &nWidth, sal_uInt16 nOffsetTol, sal_uInt16 nWidthTol) |
static void | MakeColNoRef (ScHTMLColOffset *, sal_uInt16 nOffset, sal_uInt16 nWidth, sal_uInt16 nOffsetTol, sal_uInt16 nWidthTol) |
static void | ModifyOffset (ScHTMLColOffset *, sal_uInt16 &nOldOffset, sal_uInt16 &nNewOffset, sal_uInt16 nOffsetTol) |
Private Attributes | |
Size | aPageSize |
OUString | aBaseURL |
::std::stack< std::unique_ptr< ScHTMLTableStackEntry > > | aTableStack |
OUString | aString |
ScRangeListRef | xLockedList |
std::unique_ptr< OuterMap > | pTables |
ScHTMLColOffset | maColOffset |
ScHTMLColOffset * | pLocalColOffset |
sal_uLong | nFirstTableCell |
short | nTableLevel |
sal_uInt16 | nTable |
sal_uInt16 | nMaxTable |
SCCOL | nColCntStart |
SCCOL | nMaxCol |
sal_uInt16 | nTableWidth |
sal_uInt16 | nColOffset |
sal_uInt16 | nColOffsetStart |
sal_uInt16 | nOffsetTolerance |
bool | bFirstRow |
bool | bTabInTabCell:1 |
bool | bInCell:1 |
bool | bInTitle:1 |
Additional Inherited Members | |
Protected Member Functions inherited from ScEEParser | |
void | NewActEntry (const ScEEParseEntry *) |
Protected Attributes inherited from ScHTMLParser | |
sal_uInt32 | maFontHeights [SC_HTML_FONTSIZES] |
ScDocument * | mpDoc |
Protected Attributes inherited from ScEEParser | |
EditEngine * | pEdit |
rtl::Reference< SfxItemPool > | pPool |
rtl::Reference< SfxItemPool > | pDocPool |
std::vector< std::shared_ptr< ScEEParseEntry > > | maList |
std::shared_ptr< ScEEParseEntry > | mxActEntry |
ColWidthsMap | maColWidths |
int | nRtfLastToken |
SCCOL | nColCnt |
SCROW | nRowCnt |
SCCOL | nColMax |
SCROW | nRowMax |
Definition at line 152 of file htmlpars.hxx.
ScHTMLLayoutParser::ScHTMLLayoutParser | ( | EditEngine * | pEditP, |
OUString | aBaseURL, | ||
const Size & | aPageSize, | ||
ScDocument * | pDocP | ||
) |
Definition at line 205 of file htmlpars.cxx.
References maColOffset, MakeColNoRef(), and pLocalColOffset.
|
overridevirtual |
Definition at line 232 of file htmlpars.cxx.
References aTableStack, pLocalColOffset, pS, and pTables.
|
private |
Definition at line 476 of file htmlpars.cxx.
References aPageSize, maColOffset, MakeCol(), ScEEParser::maList, ScEEParser::nColMax, nCount, nOffsetTolerance, nPos, ScEEParser::nRowMax, pE, pS, pTables, SCCOL_MAX, SeekOffset(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size(), SkipLocked(), Size::Width(), and xLockedList.
Referenced by Read().
|
private |
Definition at line 1392 of file htmlpars.cxx.
References ScEEParser::mxActEntry, and HtmlImportInfo::pParser.
Referenced by ProcToken().
|
private |
Definition at line 818 of file htmlpars.cxx.
References aPageSize, HtmlImportInfo::aSelection, bInCell, bTabInTabCell, Colonize(), EntryEnd(), EditEngine::GetTextLen(), ESelection::HasRange(), ScEEParser::maList, ScEEParser::mxActEntry, ScEEParser::nColCnt, ScEEParser::nColMax, ESelection::nEndPara, ESelection::nEndPos, NewActEntry(), nMaxCol, ESelection::nStartPara, ScEEParser::pEdit, and Size::Width().
Referenced by NextRow(), ProcToken(), TableDataOff(), TableDataOn(), TableOff(), and TableOn().
|
private |
Definition at line 1358 of file htmlpars.cxx.
References GetWidthPixel(), MakeCol(), nColOffset, pLocalColOffset, and HtmlImportInfo::pParser.
Referenced by ProcToken().
|
private |
Definition at line 790 of file htmlpars.cxx.
References GetWidth(), MakeCol(), ScEEParser::nColCnt, nColCntStart, nColOffset, nColOffsetStart, nCount, nOffsetTolerance, ScEEParser::nRowCnt, nTableWidth, pE, pLocalColOffset, SCCOL_MAX, SCROW_MAX, o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size(), and SkipLocked().
Referenced by CloseEntry(), and TableOn().
|
private |
|
staticprivate |
Definition at line 317 of file htmlpars.cxx.
References ESelection::nEndPara, ESelection::nEndPos, ESelection::nStartPara, and pE.
Referenced by CloseEntry(), and TableOn().
|
private |
Definition at line 1410 of file htmlpars.cxx.
References ATTR_FONT(), ATTR_FONT_COLOR(), ATTR_FONT_HEIGHT(), FAMILY_DONTKNOW, o3tl::getToken(), IsAtBeginningOfText(), ScHTMLParser::maFontHeights, ScEEParser::mxActEntry, nPos, PITCH_DONTKNOW, HtmlImportInfo::pParser, SC_HTML_FONTSIZES, and comphelper::string::strip().
Referenced by ProcToken().
|
overridevirtual |
Returns the "global table" which contains the entire HTML document.
Implements ScHTMLParser.
Definition at line 297 of file htmlpars.cxx.
|
private |
Definition at line 618 of file htmlpars.cxx.
References nColCntStart, nPos, pE, pLocalColOffset, and o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size().
Referenced by Colonize(), SetWidths(), and TableOn().
|
private |
Definition at line 1372 of file htmlpars.cxx.
References aPageSize, HTMLOption::GetNumber(), HTMLOption::GetString(), nTableWidth, and Size::Width().
Referenced by ColOn(), TableDataOn(), and TableOn().
|
private |
Definition at line 1266 of file htmlpars.cxx.
References aBaseURL, ScHTMLImage::aFilterName, ScHTMLImage::aSize, ScHTMLImage::aSpace, ScHTMLImage::aURL, ERRCODE_NONE, INetURLObject::GetAbsURL(), Application::GetDefaultDevice(), GraphicFilter::GetGraphicFilter(), GraphicFilter::GetImportFormatName(), Size::Height(), GraphicFilter::LoadGraphic(), OutputDevice::LogicToPixel(), ScEEParser::mxActEntry, nHorizontal, nVertical, ScHTMLImage::oGraphic, HtmlImportInfo::pParser, Size::setHeight(), Size::setWidth(), Point::setX(), Point::setY(), Size::Width(), and Point::X().
Referenced by ProcToken().
|
private |
Definition at line 1402 of file htmlpars.cxx.
References HtmlImportInfo::aSelection, EditEngine::GetTextLen(), ScEEParser::mxActEntry, ESelection::nEndPara, ESelection::nStartPara, and ScEEParser::pEdit.
Referenced by FontOn(), and ProcToken().
|
staticprivate |
Definition at line 369 of file htmlpars.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), nPos, and SeekOffset().
Referenced by Adjust(), ColOn(), Colonize(), and SetWidths().
|
staticprivate |
Definition at line 387 of file htmlpars.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), nPos, and SeekOffset().
Referenced by ScHTMLLayoutParser(), SetWidths(), and TableOn().
|
staticprivate |
Definition at line 403 of file htmlpars.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), nPos, SeekOffset(), and o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size().
Referenced by TableOff().
|
private |
Definition at line 302 of file htmlpars.cxx.
References ScEEParser::mxActEntry, ScEEParser::NewActEntry(), and pE.
Referenced by CloseEntry(), and TableOn().
|
private |
Definition at line 333 of file htmlpars.cxx.
References bFirstRow, bInCell, CloseEntry(), ScEEParser::nColCnt, nColCntStart, nColOffset, nColOffsetStart, ScEEParser::nRowCnt, and ScEEParser::nRowMax.
Referenced by TableOn(), TableRowOff(), and TableRowOn().
|
private |
Definition at line 1465 of file htmlpars.cxx.
References AnchorOn(), aString, HtmlImportInfo::aText, ATTR_FONT_HEIGHT(), ATTR_FONT_POSTURE(), ATTR_FONT_UNDERLINE(), ATTR_FONT_WEIGHT(), bInCell, bInTitle, CloseEntry(), ColOn(), FontOn(), ScDocument::GetDocumentShell(), SfxObjectShell::GetHeaderAttributes(), SfxObjectShell::GetModel(), Image(), IsAtBeginningOfText(), ITALIC_NORMAL, LINESTYLE_SINGLE, ScHTMLParser::maFontHeights, ScHTMLParser::mpDoc, ScEEParser::mxActEntry, HtmlImportInfo::nToken, nVertical, HTMLParser::ParseMetaOptions(), HtmlImportInfo::pParser, TableDataOff(), TableDataOn(), TableOff(), TableOn(), TableRowOff(), TableRowOn(), and WEIGHT_BOLD.
Implements ScHTMLParser.
Definition at line 250 of file htmlpars.cxx.
References Adjust(), tools::SvRef< typename T >::get(), Application::GetDefaultDevice(), ScDocument::GetDocumentShell(), SfxObjectShell::GetHeaderAttributes(), EditEngine::GetHtmlImportHdl(), SfxObjectShell::IsLoading(), LINK, maColOffset, ScEEParser::maColWidths, ScHTMLParser::mpDoc, nCount, OOO_STRING_SVTOOLS_HTML_META_content_type, ScEEParser::pEdit, OutputDevice::PixelToLogic(), EditEngine::Read(), EditEngine::SetHtmlImportHdl(), Size::setWidth(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size(), and Size::Width().
|
staticprivate |
Definition at line 344 of file htmlpars.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::begin(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::end(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::find(), nCount, nPos, and o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size().
Referenced by Adjust(), MakeCol(), MakeColNoRef(), and ModifyOffset().
|
private |
Definition at line 632 of file htmlpars.cxx.
References aPageSize, o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::back(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::begin(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::clear(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::empty(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::end(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::front(), GetWidth(), i, o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), maColOffset, MakeCol(), MakeColNoRef(), ScEEParser::maList, nColCntStart, nColOffsetStart, nFirstTableCell, nMaxCol, nOffsetTolerance, nTable, nTableLevel, nTableWidth, pE, pLocalColOffset, Size::setWidth(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size(), and Size::Width().
Referenced by TableOff().
|
private |
Definition at line 440 of file htmlpars.cxx.
References ScRange::aEnd, ScRange::aStart, ScAddress::Col(), i, ScRange::Intersects(), ScDocument::MaxCol(), ScHTMLParser::mpDoc, pE, ScAddress::SetCol(), ScDocument::ValidCol(), and xLockedList.
Referenced by Adjust(), and Colonize().
|
private |
Definition at line 1005 of file htmlpars.cxx.
References bInCell, and CloseEntry().
Referenced by ProcToken().
|
private |
Definition at line 900 of file htmlpars.cxx.
References ATTR_BACKGROUND(), ATTR_HOR_JUSTIFY(), ATTR_VER_JUSTIFY(), bInCell, CloseEntry(), GetWidthPixel(), ScEEParser::mxActEntry, ScEEParser::nColCnt, ScEEParser::nRowCnt, nTable, nTableLevel, 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, and TableOn().
Referenced by ProcToken().
|
private |
Definition at line 1111 of file htmlpars.cxx.
References aTableStack, bFirstRow, bInCell, bTabInTabCell, CloseEntry(), ModifyOffset(), ScEEParser::mxActEntry, ScEEParser::nColCnt, nColCntStart, nColOffset, nColOffsetStart, nFirstTableCell, nMaxCol, nMaxTable, nOffsetTolerance, ScEEParser::nRowCnt, nTable, nTableLevel, nTableWidth, pE, pLocalColOffset, pS, pTables, SetWidths(), TableRowOff(), and xLockedList.
Referenced by ProcToken().
|
private |
Definition at line 1011 of file htmlpars.cxx.
References HtmlImportInfo::aSelection, aTableStack, bFirstRow, bInCell, bTabInTabCell, CloseEntry(), Colonize(), EntryEnd(), GetWidth(), GetWidthPixel(), MakeColNoRef(), ScEEParser::maList, ScEEParser::mxActEntry, ScEEParser::nColCnt, nColCntStart, nColOffset, nColOffsetStart, NewActEntry(), NextRow(), nFirstTableCell, nMaxCol, nMaxTable, nOffsetTolerance, ScEEParser::nRowCnt, nTable, nTableLevel, nTableWidth, HtmlImportInfo::nToken, pLocalColOffset, HtmlImportInfo::pParser, SC_HTML_OFFSET_TOLERANCE_LARGE, and xLockedList.
Referenced by ProcToken(), and TableDataOn().
|
private |
Definition at line 1000 of file htmlpars.cxx.
References NextRow().
Referenced by ProcToken(), and TableOff().
|
private |
Definition at line 993 of file htmlpars.cxx.
References ScEEParser::nColCnt, nColCntStart, nColOffset, nColOffsetStart, and NextRow().
Referenced by ProcToken().
|
private |
Definition at line 156 of file htmlpars.hxx.
Referenced by Image().
|
private |
Definition at line 155 of file htmlpars.hxx.
Referenced by Adjust(), CloseEntry(), GetWidthPixel(), and SetWidths().
|
private |
Definition at line 159 of file htmlpars.hxx.
Referenced by ProcToken().
|
private |
Definition at line 158 of file htmlpars.hxx.
Referenced by TableOff(), TableOn(), and ~ScHTMLLayoutParser().
|
private |
Definition at line 174 of file htmlpars.hxx.
Referenced by NextRow(), TableOff(), and TableOn().
|
private |
Definition at line 176 of file htmlpars.hxx.
Referenced by CloseEntry(), NextRow(), ProcToken(), TableDataOff(), TableDataOn(), TableOff(), and TableOn().
|
private |
Definition at line 177 of file htmlpars.hxx.
Referenced by ProcToken().
|
private |
Definition at line 175 of file htmlpars.hxx.
Referenced by CloseEntry(), TableOff(), and TableOn().
|
private |
Definition at line 162 of file htmlpars.hxx.
Referenced by Adjust(), Read(), ScHTMLLayoutParser(), and SetWidths().
|
private |
Definition at line 168 of file htmlpars.hxx.
Referenced by Colonize(), GetWidth(), NextRow(), SetWidths(), TableOff(), TableOn(), and TableRowOn().
|
private |
Definition at line 171 of file htmlpars.hxx.
Referenced by ColOn(), Colonize(), NextRow(), TableOff(), TableOn(), and TableRowOn().
|
private |
Definition at line 172 of file htmlpars.hxx.
Referenced by Colonize(), NextRow(), SetWidths(), TableOff(), TableOn(), and TableRowOn().
|
private |
Definition at line 164 of file htmlpars.hxx.
Referenced by SetWidths(), TableOff(), and TableOn().
|
private |
Definition at line 169 of file htmlpars.hxx.
Referenced by CloseEntry(), SetWidths(), TableOff(), and TableOn().
|
private |
Definition at line 167 of file htmlpars.hxx.
Referenced by TableOff(), and TableOn().
|
private |
Definition at line 173 of file htmlpars.hxx.
Referenced by Adjust(), Colonize(), SetWidths(), TableOff(), and TableOn().
|
private |
Definition at line 166 of file htmlpars.hxx.
Referenced by SetWidths(), TableDataOn(), TableOff(), and TableOn().
|
private |
Definition at line 165 of file htmlpars.hxx.
Referenced by SetWidths(), TableDataOn(), TableOff(), and TableOn().
|
private |
Definition at line 170 of file htmlpars.hxx.
Referenced by Colonize(), GetWidthPixel(), SetWidths(), TableOff(), and TableOn().
|
private |
Definition at line 163 of file htmlpars.hxx.
Referenced by ColOn(), Colonize(), GetWidth(), ScHTMLLayoutParser(), SetWidths(), TableOff(), TableOn(), and ~ScHTMLLayoutParser().
|
private |
Definition at line 161 of file htmlpars.hxx.
Referenced by Adjust(), TableOff(), and ~ScHTMLLayoutParser().
|
private |
Definition at line 160 of file htmlpars.hxx.
Referenced by Adjust(), SkipLocked(), TableOff(), and TableOn().