20 #include <com/sun/star/text/HoriOrientation.hpp>
21 #include <com/sun/star/text/VertOrientation.hpp>
31 #include <osl/diagnose.h>
48 std::unique_ptr<SwPosition>
50 std::shared_ptr<HTMLAttrTable>
66 nContextStMin( SIZE_MAX ), nContextStAttrMin( SIZE_MAX ),
79 std::shared_ptr<HTMLAttrTable>
const &
GetAttrTab(
bool bCreate =
false);
104 xAttrTab = std::make_shared<HTMLAttrTable>();
122 m_nTextFormatColl( nPoolId ),
125 m_nFirstLineIndent( 0 ),
129 m_bLRSpaceChanged( false ),
130 m_bULSpaceChanged( false ),
131 m_bDefaultTextFormatColl( bDfltColl ),
132 m_bSpansSection( false ),
133 m_bPopStack( false ),
134 m_bFinishPREListingXMP( false ),
135 m_bRestartPRE( false ),
136 m_bRestartXMP( false ),
137 m_bRestartListing( false ),
138 m_bHeaderOrFooter( false )
143 m_nTextFormatColl( 0 ),
146 m_nFirstLineIndent( 0 ),
150 m_bLRSpaceChanged( false ),
151 m_bULSpaceChanged( false ),
152 m_bDefaultTextFormatColl( false ),
153 m_bSpansSection( false ),
154 m_bPopStack( false ),
155 m_bFinishPREListingXMP( false ),
156 m_bRestartPRE( false ),
157 m_bRestartXMP( false ),
158 m_bRestartListing( false ),
159 m_bHeaderOrFooter( false )
177 "Danger: there are non-final paragraph attributes");
182 auto const nOld(pOldEndPara->
GetIndex());
189 bool bMoveBack =
false;
201 sal_uInt16 nWhich = pAttr->
m_pItem->Which();
227 HTMLAttr *pSetAttr = pAttr->
Clone( *pOldEndPara, nOldEndCnt );
299 std::shared_ptr<HTMLAttrTable> xSaveAttrTab = pSave->
GetAttrTab(
true);
337 std::shared_ptr<HTMLAttrTable> xSaveAttrTab = pSave->
GetAttrTab();
377 std::unique_ptr<HTMLAttrContext> xCntxt(
PopContext());
378 OSL_ENSURE(xCntxt.get() != pContext,
379 "Context still on the stack" );
380 if (xCntxt.get() == pContext)
407 FinishPREListingXMP();
422 for(
auto pAttr : rAttrs )
433 "Area can no longer be exited" );
436 "Frame can no longer be exited" );
442 if (SIZE_MAX != pSave->GetContextStMin())
445 if (SIZE_MAX != pSave->GetContextStAttrMin())
454 FinishPREListingXMP();
489 SetSpace(
Size(0,0), rItemSet, rPropInfo, aFrameItemSet );
497 rPropInfo.
m_aId.clear();
510 if( rClass.equalsIgnoreAsciiCase(
"sd-abs-pos" ) &&
519 rPropInfo, *pFrameItemSet );
521 SetFixSize( aDummy, aDummy,
false,
false, rPropInfo, *pFrameItemSet );
522 SetSpace( aDummy, rItemSet, rPropInfo, *pFrameItemSet );
539 SvxAdjust::Left == rPropInfo.
m_eFloat )
563 "SwHTMLParser::InsertAttrs: Context already on the Stack");
567 for (
const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
571 switch( pItem->Which() )
581 sal_uInt16 nOldLeft = 0, nOldRight = 0;
582 short nOldIndent = 0;
589 sal_uInt16 nLeft = nOldLeft, nRight = nOldRight;
590 short nIndent = nOldIndent;
591 pContext->
GetMargins( nLeft, nRight, nIndent );
601 "left margin does not match with item" );
606 nLeft = nOldLeft +
static_cast< sal_uInt16
>(rPropInfo.
m_nLeftMargin);
612 "right margin does not match with item" );
617 nRight = nOldRight +
static_cast< sal_uInt16
>(rPropInfo.
m_nRightMargin);
623 pContext->
SetMargins( nLeft, nRight, nIndent );
638 sal_uInt16 nUpper = 0, nLower = 0;
640 SvxULSpaceItem aULSpace( *static_cast<const SvxULSpaceItem *>(pItem) );
661 if( static_cast<const SvxFontHeightItem *>(pItem)->GetProp() == 100 )
666 if( static_cast<const SvxFontHeightItem *>(pItem)->GetProp() == 100 )
671 if( static_cast<const SvxFontHeightItem *>(pItem)->GetProp() == 100 )
679 SvxBrushItem aBrushItem( *static_cast<const SvxBrushItem *>(pItem) );
689 else if( pContext->
GetToken() != HtmlTokenId::TABLEHEADER_ON &&
690 pContext->
GetToken() != HtmlTokenId::TABLEDATA_ON )
699 SvxBoxItem aBoxItem( *static_cast<const SvxBoxItem *>(pItem) );
725 rAttrs.push_back( *ppAttr );
729 if( !rPropInfo.
m_aId.isEmpty() )
748 rAttrs.push_back( *ppAttr );
761 if( IsReadListing() )
764 FinishPREListingXMP();
bool EndSection(bool bLFStripped=false)
static void SetSpace(const Size &rPixSpace, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, SfxItemSet &rFlyItemSet)
void SetAnchorAndAdjustment(sal_Int16 eVertOri, sal_Int16 eHoriOri, const SvxCSS1PropertyInfo &rPropInfo, SfxItemSet &rFrameSet)
bool GetKeepNumRules() const
void SplitPREListingXMP(HTMLAttrContext *pCntxt)
bool IsFinishPREListingXMP() const
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
size_t GetContextStAttrMin() const
bool HasSaveDocContext() const
Marks a position in the document model.
std::unique_ptr< HTMLAttrContext_SaveDoc > m_pSaveDocContext
void SetAttr(bool bChkEnd=true, bool bBeforeTable=false, std::deque< std::unique_ptr< HTMLAttr >> *pPostIts=nullptr)
sal_Int32 GetSttCnt() const
sal_uInt16 GetLower() const
void SetContextStAttrMin(size_t nMin)
void FixHeaderFooterDistance(bool bHeader, const SwPosition *pOldPos)
void SaveAttrTab(std::shared_ptr< HTMLAttrTable > const &rNewAttrTab)
void InsertBookmark(const OUString &rName)
void Set(const SwHTMLNumRuleInfo &rInf)
tools::Long GetRight() const
std::unique_ptr< SfxItemSet > m_pFrameItemSet
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
HTMLAttr * GetNext() const
void NewAttr(const std::shared_ptr< HTMLAttrTable > &rAttrTab, HTMLAttr **ppAttr, const SfxPoolItem &rItem)
void SetRestartListing(bool bSet)
constexpr sal_uInt16 RES_FRMATR_END(133)
HTMLAttrContexts m_aContexts
const SfxItemSet * GetFrameItemSet() const
const SwNodeIndex & GetSttPara() const
constexpr TypedWhichId< SvxBoxItem > RES_CHRATR_BOX(40)
void SplitAttrTab(const SwPosition &rNewPos)
void SetULSpace(sal_uInt16 nUpper, sal_uInt16 nLower)
void SetMargins(sal_uInt16 nLeft, sal_uInt16 nRight, short nIndent)
static void ResetFrameFormatAttrs(SfxItemSet &rFrameSet)
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
void RestoreDocContext(HTMLAttrContext *pCntxt)
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
std::shared_ptr< HTMLAttrTable > const & GetAttrTab(bool bCreate=false)
void GetMarginsFromContext(sal_uInt16 &nLeft, sal_uInt16 &nRight, short &nIndent, bool bIgnoreCurrent=false) const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void InsertAttrs(std::deque< std::unique_ptr< HTMLAttr >> rAttrs)
const HTMLAttrs & GetAttrs() const
sal_uLong GetIndex() const
const SwPosition * GetPos() const
bool IsRestartListing() const
bool CreateContainer(const OUString &rClass, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, HTMLAttrContext *pContext)
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
void InsertAttr(const SfxPoolItem &rItem, bool bInsAtStart)
static void SetFrameFormatAttrs(SfxItemSet &rItemSet, HtmlFrameFormatFlags nFlags, SfxItemSet &rFrameItemSet)
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
tools::Long GetTextLeft() const
void DeleteAttr(HTMLAttr *pAttr)
std::deque< HTMLAttr * > HTMLAttrs
HTMLAttr * GetPrev() const
void SetKeepNumRules(bool bSet)
void EndContextAttrs(HTMLAttrContext *pContext)
const SwPosition * GetPoint() const
sal_Int32 m_nStartContent
std::shared_ptr< HTMLAttrTable > xAttrTab
std::unique_ptr< SwCSS1Parser > m_pCSS1Parser
void SetContextStMin(size_t nMin)
HTMLAttrContext(HtmlTokenId nTokn, sal_uInt16 nPoolId, const OUString &rClass, bool bDfltColl=false)
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
void EndContext(HTMLAttrContext *pContext)
std::unique_ptr< SwPosition > pPos
std::unique_ptr< HTMLAttrContext > PopContext(HtmlTokenId nToken=HtmlTokenId::NONE)
tools::Long m_nRightMargin
size_t GetContextStMin() const
bool DoPositioning(SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, HTMLAttrContext *pContext)
void SetStripTrailingPara(bool bSet)
short GetTextFirstLineOffset() const
Marks a node in the document model.
const SwHTMLNumRuleInfo & GetNumInfo() const
HTMLAttr * Clone(const SwNodeIndex &rEndPara, sal_Int32 nEndCnt) const
bool IsRestartPRE() const
void InsertFlyFrame(const SfxItemSet &rItemSet, HTMLAttrContext *pCntxt, const OUString &rId)
void GetMargins(sal_uInt16 &nLeft, sal_uInt16 &nRight, short &nIndent) const
HTMLAttrContext_SaveDoc * GetSaveDocContext(bool bCreate=false)
bool IsRestartXMP() const
void SetFixFooterDist(bool bSet)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
SwHTMLNumRuleInfo aNumRuleInfo
tools::Long m_nLeftMargin
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
void SetNumInfo(const SwHTMLNumRuleInfo &rInf)
void SetPopStack(bool bSet)
bool GetStripTrailingPara() const
HtmlTokenId GetToken() const
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
void GetULSpaceFromContext(sal_uInt16 &rUpper, sal_uInt16 &rLower) const
void ClearContext(HTMLAttrContext *pContext)
sal_Int32 GetIndex() const
SwHTMLNumRuleInfo & GetNumInfo()
void SetPos(const SwPosition &rPos)
bool EndAttr(HTMLAttr *pAttr, bool bChkEmpty=true)
HTMLAttr ** GetAttrTabEntry(sal_uInt16 nWhich)
bool GetFixHeaderDist() const
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
static void SetVarSize(SvxCSS1PropertyInfo const &rPropInfo, SfxItemSet &rFlyItemSet, SwTwips nDfltWidth=MINLAY, sal_uInt8 nDefaultPercentWidth=0)
void SetFinishPREListingXMP(bool bSet)
void SetRestartXMP(bool bSet)
size_t m_nContextStAttrMin
void RestoreAttrTab(std::shared_ptr< HTMLAttrTable > const &rNewAttrTab)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
SwMoveFnCollection const & fnMoveBackward
bool GetFixFooterDist() const
HTMLAttrContext_SaveDoc()
void SetRestartPRE(bool bSet)
std::shared_ptr< HTMLAttrTable > m_xAttrTab
void ClearSaveDocContext()
bool AppendTextNode(SwHTMLAppendMode eMode=AM_NORMAL, bool bUpdateNum=true)
SwHTMLAppendMode GetAppendMode() const
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
rtl::Reference< SwDoc > m_xDoc
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
void SaveDocContext(HTMLAttrContext *pCntxt, HtmlContextFlags nFlags, const SwPosition *pNewPos)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
void SetFixHeaderDist(bool bSet)
std::unique_ptr< SfxPoolItem > m_pItem
sal_uInt32 GetSttParaIdx() const
void InsertPrev(HTMLAttr *pPrv)
bool GetSpansSection() const
static void SetFixSize(const Size &rPixSize, const Size &rTwipDfltSize, bool bPercentWidth, bool bPercentHeight, SvxCSS1PropertyInfo const &rPropInfo, SfxItemSet &rFlyItemSet)
static bool MayBePositioned(const SvxCSS1PropertyInfo &rPropInfo, bool bAutoWidth=false)
const SwAttrPool & GetAttrPool() const
sal_uInt16 GetUpper() const