20#include <com/sun/star/text/HoriOrientation.hpp>
21#include <com/sun/star/text/VertOrientation.hpp>
31#include <osl/diagnose.h>
50 std::unique_ptr<SwPosition>
52 std::shared_ptr<HTMLAttrTable>
81 std::shared_ptr<HTMLAttrTable>
const &
GetAttrTab(
bool bCreate =
false);
106 m_xAttrTab = std::make_shared<HTMLAttrTable>();
122 m_aClass(
std::move( aClass )),
124 m_nTextFormatColl( nPoolId ),
127 m_nFirstLineIndent( 0 ),
131 m_bLRSpaceChanged( false ),
132 m_bULSpaceChanged( false ),
133 m_bDefaultTextFormatColl( bDfltColl ),
134 m_bSpansSection( false ),
135 m_bPopStack( false ),
136 m_bFinishPREListingXMP( false ),
137 m_bRestartPRE( false ),
138 m_bRestartXMP( false ),
139 m_bRestartListing( false ),
140 m_bHeaderOrFooter( false )
145 m_nTextFormatColl( 0 ),
148 m_nFirstLineIndent( 0 ),
152 m_bLRSpaceChanged( false ),
153 m_bULSpaceChanged( false ),
154 m_bDefaultTextFormatColl( false ),
155 m_bSpansSection( false ),
156 m_bPopStack( false ),
157 m_bFinishPREListingXMP( false ),
158 m_bRestartPRE( false ),
159 m_bRestartXMP( false ),
160 m_bRestartListing( false ),
161 m_bHeaderOrFooter( false )
179 "Danger: there are non-final paragraph attributes");
191 bool bMoveBack =
false;
203 sal_uInt16 nWhich = pAttr->
m_pItem->Which();
301 std::shared_ptr<HTMLAttrTable> xSaveAttrTab = pSave->
GetAttrTab(
true);
339 std::shared_ptr<HTMLAttrTable> xSaveAttrTab = pSave->
GetAttrTab();
379 std::unique_ptr<HTMLAttrContext> xCntxt(
PopContext());
380 OSL_ENSURE(xCntxt.get() != pContext,
381 "Context still on the stack" );
382 if (xCntxt.get() == pContext)
409 FinishPREListingXMP();
424 for(
auto pAttr : rAttrs )
435 "Area can no longer be exited" );
438 "Frame can no longer be exited" );
444 if (SIZE_MAX != pSave->GetContextStMin())
447 if (SIZE_MAX != pSave->GetContextStAttrMin())
456 FinishPREListingXMP();
490 SetSpace(
Size(0,0), rItemSet, rPropInfo, aFrameItemSet );
498 rPropInfo.
m_aId.clear();
520 rPropInfo, *pFrameItemSet );
522 SetFixSize( aDummy, aDummy,
false,
false, rPropInfo, *pFrameItemSet );
523 SetSpace( aDummy, rItemSet, rPropInfo, *pFrameItemSet );
540 SvxAdjust::Left == rPropInfo.
m_eFloat )
564 "SwHTMLParser::InsertAttrs: Context already on the Stack");
574 switch( pItem->Which() )
600 sal_uInt16 nOldLeft = 0, nOldRight = 0;
601 short nOldIndent = 0;
608 sal_uInt16 nLeft = nOldLeft, nRight = nOldRight;
609 short nIndent = nOldIndent;
610 pContext->
GetMargins( nLeft, nRight, nIndent );
621 "left margin does not match with item" );
626 nLeft = nOldLeft +
static_cast< sal_uInt16
>(rPropInfo.
m_nLeftMargin);
633 "right margin does not match with item" );
638 nRight = nOldRight +
static_cast< sal_uInt16
>(rPropInfo.
m_nRightMargin);
644 pContext->
SetMargins( nLeft, nRight, nIndent );
663 switch( pItem->Which() )
669 sal_uInt16 nUpper = 0, nLower = 0;
720 else if( pContext->
GetToken() != HtmlTokenId::TABLEHEADER_ON &&
721 pContext->
GetToken() != HtmlTokenId::TABLEDATA_ON )
756 rAttrs.push_back( *ppAttr );
760 if( !rPropInfo.
m_aId.isEmpty() )
779 rAttrs.push_back( *ppAttr );
792 if( IsReadListing() )
795 FinishPREListingXMP();
void SetContextStMin(size_t nMin)
std::shared_ptr< HTMLAttrTable > m_xAttrTab
bool GetStripTrailingPara() const
void SetContextStAttrMin(size_t nMin)
SwHTMLNumRuleInfo m_aNumRuleInfo
size_t GetContextStMin() const
void SetKeepNumRules(bool bSet)
void SetPos(const SwPosition &rPos)
size_t m_nContextStAttrMin
const SwPosition * GetPos() const
bool m_bStripTrailingPara
void SetFixFooterDist(bool bSet)
bool GetFixHeaderDist() const
void SetFixHeaderDist(bool bSet)
std::shared_ptr< HTMLAttrTable > const & GetAttrTab(bool bCreate=false)
void SetNumInfo(const SwHTMLNumRuleInfo &rInf)
const SwHTMLNumRuleInfo & GetNumInfo() const
void SetStripTrailingPara(bool bSet)
size_t GetContextStAttrMin() const
std::unique_ptr< SwPosition > m_pPos
bool GetFixFooterDist() const
bool GetKeepNumRules() const
HTMLAttrContext_SaveDoc()
void ClearSaveDocContext()
void SetULSpace(sal_uInt16 nUpper, sal_uInt16 nLower)
HTMLAttrContext_SaveDoc * GetSaveDocContext(bool bCreate=false)
bool GetSpansSection() const
void SetPopStack(bool bSet)
const HTMLAttrs & GetAttrs() const
SwHTMLAppendMode GetAppendMode() const
bool IsRestartXMP() const
void SetRestartXMP(bool bSet)
void SetMargins(sal_uInt16 nLeft, sal_uInt16 nRight, short nIndent)
void SetRestartPRE(bool bSet)
HtmlTokenId GetToken() const
std::unique_ptr< HTMLAttrContext_SaveDoc > m_pSaveDocContext
bool IsFinishPREListingXMP() const
bool IsRestartPRE() const
void SetRestartListing(bool bSet)
const SfxItemSet * GetFrameItemSet() const
void SetFinishPREListingXMP(bool bSet)
bool IsRestartListing() const
HTMLAttrContext(HtmlTokenId nTokn, sal_uInt16 nPoolId, OUString aClass, bool bDfltColl=false)
bool HasSaveDocContext() const
std::unique_ptr< SfxItemSet > m_pFrameItemSet
void GetMargins(sal_uInt16 &nLeft, sal_uInt16 &nRight, short &nIndent) const
sal_Int32 m_nStartContent
HTMLAttr * GetPrev() const
HTMLAttr * GetNext() const
SwNodeOffset GetStartParagraphIdx() const
std::unique_ptr< SfxPoolItem > m_pItem
const SwNodeIndex & GetStartParagraph() const
void InsertPrev(HTMLAttr *pPrv)
sal_Int32 GetStartContent() const
HTMLAttr * Clone(const SwNode &rEndPara, sal_Int32 nEndCnt) const
static void ResetFrameFormatAttrs(SfxItemSet &rFrameSet)
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
tools::Long m_nRightMargin
tools::Long m_nLeftMargin
short GetTextFirstLineOffset() const
tools::Long GetRight() const
tools::Long GetTextLeft() const
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
sal_uInt16 GetUpper() const
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
sal_uInt16 GetLower() const
static bool MayBePositioned(const SvxCSS1PropertyInfo &rPropInfo, bool bAutoWidth=false)
const SwAttrPool & GetAttrPool() const
void Set(const SwHTMLNumRuleInfo &rInf)
bool EndSection(bool bLFStripped=false)
size_t m_nContextStAttrMin
std::unique_ptr< HTMLAttrContext > PopContext(HtmlTokenId nToken=HtmlTokenId::NONE)
void SetAnchorAndAdjustment(sal_Int16 eVertOri, sal_Int16 eHoriOri, const SvxCSS1PropertyInfo &rPropInfo, SfxItemSet &rFrameSet)
void InsertAttrs(std::deque< std::unique_ptr< HTMLAttr > > rAttrs)
void InsertBookmark(const OUString &rName)
bool CreateContainer(std::u16string_view rClass, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, HTMLAttrContext *pContext)
HTMLAttrContexts m_aContexts
void InsertAttr(const SfxPoolItem &rItem, bool bInsAtStart)
static void SetSpace(const Size &rPixSpace, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, SfxItemSet &rFlyItemSet)
void SaveAttrTab(std::shared_ptr< HTMLAttrTable > const &rNewAttrTab)
std::shared_ptr< HTMLAttrTable > m_xAttrTab
void SetAttr(bool bChkEnd=true, bool bBeforeTable=false, std::deque< std::unique_ptr< HTMLAttr > > *pPostIts=nullptr)
void ClearContext(HTMLAttrContext *pContext)
void SaveDocContext(HTMLAttrContext *pCntxt, HtmlContextFlags nFlags, const SwPosition *pNewPos)
void EndContextAttrs(HTMLAttrContext *pContext)
bool DoPositioning(SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, HTMLAttrContext *pContext)
void DeleteAttr(HTMLAttr *pAttr)
void InsertFlyFrame(const SfxItemSet &rItemSet, HTMLAttrContext *pCntxt, const OUString &rId)
HTMLAttr ** GetAttrTabEntry(sal_uInt16 nWhich)
SwHTMLNumRuleInfo & GetNumInfo()
static void SetFixSize(const Size &rPixSize, const Size &rTwipDfltSize, bool bPercentWidth, bool bPercentHeight, SvxCSS1PropertyInfo const &rPropInfo, SfxItemSet &rFlyItemSet)
void NewAttr(const std::shared_ptr< HTMLAttrTable > &rAttrTab, HTMLAttr **ppAttr, const SfxPoolItem &rItem)
rtl::Reference< SwDoc > m_xDoc
void RestoreDocContext(HTMLAttrContext *pCntxt)
std::unique_ptr< SwCSS1Parser > m_pCSS1Parser
void SplitPREListingXMP(HTMLAttrContext *pCntxt)
bool AppendTextNode(SwHTMLAppendMode eMode=AM_NORMAL, bool bUpdateNum=true)
void GetMarginsFromContext(sal_uInt16 &nLeft, sal_uInt16 &nRight, short &nIndent, bool bIgnoreCurrent=false) const
void EndContext(HTMLAttrContext *pContext)
void FixHeaderFooterDistance(bool bHeader, const SwPosition *pOldPos)
void SplitAttrTab(const SwPosition &rNewPos)
static void SetFrameFormatAttrs(SfxItemSet &rItemSet, HtmlFrameFormatFlags nFlags, SfxItemSet &rFrameItemSet)
bool EndAttr(HTMLAttr *pAttr, bool bChkEmpty=true)
void GetULSpaceFromContext(sal_uInt16 &rUpper, sal_uInt16 &rLower) const
static void SetVarSize(SvxCSS1PropertyInfo const &rPropInfo, SfxItemSet &rFlyItemSet, SwTwips nDfltWidth=MINLAY, sal_uInt8 nDefaultPercentWidth=0)
void RestoreAttrTab(std::shared_ptr< HTMLAttrTable > const &rNewAttrTab)
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * GetPoint() const
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
constexpr TypedWhichId< SvxFirstLineIndentItem > RES_MARGIN_FIRSTLINE(91)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr TypedWhichId< SvxRightMarginItem > RES_MARGIN_RIGHT(93)
constexpr TypedWhichId< SvxTextLeftMarginItem > RES_MARGIN_TEXTLEFT(92)
constexpr TypedWhichId< SvxBoxItem > RES_CHRATR_BOX(40)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
SwMoveFnCollection const & fnMoveBackward
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Marks a position in the document model.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
std::deque< HTMLAttr * > HTMLAttrs