40#include <osl/diagnose.h>
82 while ( (!pLayLeaf->
IsSctFrame() || pLayLeaf ==
this ) &&
86 if( pLayLeaf->
IsSctFrame() && pLayLeaf != this )
102 else if ( pLayLeaf->
Lower() )
137 const bool bNoFootnote =
IsSctFrame() && !_bInvestigateFootnoteForSections;
141 || pLayLeaf ==
this ) &&
146 && pLayLeaf != this )
152 else if ( pLayLeaf->
Lower() )
156 if( bNoFootnote && pLayLeaf && pLayLeaf->
IsInFootnote() )
177 if (!pFrame->IsLayoutFrame())
240 pUp =
static_cast<const SwFlyFrame*
>(pUp)->GetAnchorFrame();
261 OSL_ENSURE( !
IsRootFrame() ,
"<IsBefore> called at a <SwRootFrame>.");
262 OSL_ENSURE( !_pCheckRefLayFrame->
IsRootFrame() ,
"<IsBefore> called with a <SwRootFrame>.");
269 if( pMyPage != pCheckRefPage )
294 !pUpNext->
IsAnLower( _pCheckRefLayFrame ) )
298 bReturn = pUpNext !=
nullptr;
311 pRet = bNext ?
static_cast<const SwFlyFrame*
>(pFrame)->GetNextLink() :
static_cast<const SwFlyFrame*
>(pFrame)->GetPrevLink();
340 bool bGoingUp = !bFwd;
343 bool bGoingFwdOrBwd =
false;
345 bool bGoingDown = !bGoingUp;
349 bGoingDown =
nullptr !=
p;
357 bGoingFwdOrBwd =
nullptr !=
p;
358 if ( !bGoingFwdOrBwd )
373 bGoingUp =
nullptr !=
p;
383 bGoingUp = !bGoingFwdOrBwd && !bGoingDown;
388 }
while( (
p && !
p->IsFlowFrame() ) ||
410 bool bGoingUp =
false;
413 bool bGoingFwdOrBwd =
false;
415 bool bGoingDown = !bGoingUp;
419 bGoingDown =
nullptr !=
p;
424 bGoingFwdOrBwd =
nullptr !=
p;
425 if ( !bGoingFwdOrBwd )
428 bGoingUp =
nullptr !=
p;
436 bGoingUp = !(bGoingFwdOrBwd || bGoingDown);
438 if (!bFwd && bGoingDown)
440 while (
p->GetNext() )
447 return pContentFrame;
460 const auto pFly(
static_cast<SwFlyFrame*
>(pRet));
461 pRet = pFly->GetPageFrame();
463 pRet = pFly->AnchorFrame();
492 bool bMoveToPageFrame =
false;
495 if (bFootnotes && pSectframe
503 bMoveToPageFrame = !bFAtEnd && !bNoBalance;
515 if (
static_cast<SwFlyFrame*
>(pRet)->GetPageFrame() )
516 pRet =
static_cast<SwFlyFrame*
>(pRet)->GetPageFrame();
518 pRet =
static_cast<SwFlyFrame*
>(pRet)->AnchorFrame();
527 OSL_ENSURE( pSct,
"FindFootnoteBossFrame: Single column outside section?" );
623 pRet =
static_cast<SwFlyFrame*
>(pRet)->AnchorFrame();
646 aRect.
SSize( *pSize );
661 OSL_ENSURE(
GetPageNum() <=
maPageRects.size(),
"number of pages differs from page rect array size" );
664 while ( pPage && !pRet )
668 if ( (!pSize && rBoundRect.
Contains(rPt)) ||
669 (pSize && rBoundRect.
Overlaps(aRect)) )
687 if (pPage ==
nullptr)
715 return toEdge <= constMargin;
746 return &
static_cast<const SwTextFrame*
>(
this)->GetTextNodeForParaProps()->GetSwAttrSet();
783 return static_cast< const SwLayoutFrame*
>(
this)->
GetFormat()->supportsFullDrawingLayerFillAttributeSet();
808 bool bGoingUp =
false;
812 bool bGoingFwd =
false;
817 bGoingDown =
nullptr !=
p;
822 bGoingFwd =
nullptr !=
p;
826 bGoingUp =
nullptr !=
p;
833 bGoingUp = !(bGoingFwd || bGoingDown);
835 }
while (
nullptr == (pRet = ( ( pFrame->
IsContentFrame() || ( !bGoingUp &&
842 bool bIgnoreTab =
false;
850 if (
static_cast<SwTabFrame*
>(
this)->GetFollow() )
851 return static_cast<SwTabFrame*
>(
this)->GetFollow();
853 pThis =
static_cast<SwTabFrame*
>(
this)->FindLastContentOrTable();
885 if ( !bIgnoreTab && pThis->
IsInTab() )
890 assert(pUp &&
"Content flag says it's in table but it's not in cell.");
893 pNxt =
static_cast<SwCellFrame*
>(pNxt)->ContainsContent();
947 while ( pCntUp && pCntUp->
GetUpper() &&
977 if (
static_cast<SwTabFrame*
>(
this)->GetFollow() )
983 pThis =
static_cast<SwTabFrame*
>(
this)->FindLastContentOrTable();
1010 if ( bBody || (
bFootnote && !_bInSameFootnote ) )
1022 else if (
bFootnote && _bInSameFootnote )
1028 OSL_ENSURE( pFootnoteFrameOfCurr,
1029 "<SwFrame::FindNextCnt_() - unknown layout situation: current frame has to have an upper footnote frame." );
1030 if ( pFootnoteFrameOfNext == pFootnoteFrameOfCurr )
1034 else if ( pFootnoteFrameOfCurr->
GetFollow() )
1042 pFollowFootnoteFrameOfCurr = pFollowFootnoteFrameOfCurr->
GetFollow();
1044 }
while ( !pNxtCnt && pFollowFootnoteFrameOfCurr->
GetFollow() );
1066 while ( pCntUp && pCntUp->
GetUpper() &&
1069 if ( pCntUp == pUp )
1098 if ( pCurrContentFrame && pCurrContentFrame->IsFollow() )
1101 pPrevContentFrame = pCurrContentFrame->
FindMaster();
1106 if ( pTabFrame->IsFollow() )
1121 if ( pSectFrame->IsFollow() )
1136 if ( !pPrevContentFrame && pCurrContentFrame )
1139 if ( pPrevContentFrame )
1141 if ( pCurrContentFrame->
IsInFly() )
1149 const bool bInDocBody = pCurrContentFrame->
IsInDocBody();
1150 const bool bInFootnote = pCurrContentFrame->
IsInFootnote();
1156 while ( pPrevContentFrame )
1158 if ( ( bInDocBody && pPrevContentFrame->
IsInDocBody() ) ||
1166 else if ( bInFootnote )
1172 if ( pFootnoteFrameOfPrev != pFootnoteFrameOfCurr )
1174 if ( pFootnoteFrameOfCurr->
GetMaster() )
1178 pPrevContentFrame =
nullptr;
1181 pMasterFootnoteFrameOfCurr = pMasterFootnoteFrameOfCurr->
GetMaster();
1183 }
while ( !pPrevContentFrame &&
1184 pMasterFootnoteFrameOfCurr->
GetMaster() );
1190 pPrevContentFrame =
nullptr;
1205 "<SwFrame::FindPrevCnt_()> - unknown layout situation: current frame should be in page header or page footer" );
1206 OSL_ENSURE( !pPrevContentFrame->
IsInFly(),
1207 "<SwFrame::FindPrevCnt_()> - unknown layout situation: found previous frame should *not* be inside a fly frame." );
1211 pPrevContentFrame =
nullptr;
1218 return pPrevContentFrame;
1223 bool bIgnoreTab =
false;
1231 if (
static_cast<SwTabFrame*
>(
this)->IsFollow() )
1232 return static_cast<SwTabFrame*
>(
this)->FindMaster();
1234 pThis =
static_cast<SwTabFrame*
>(
this)->ContainsContent();
1243 if ( !bIgnoreTab && pThis->
IsInTab() )
1248 assert(pUp &&
"Content flag says it's in table but it's not in cell.");
1265 :
static_cast<SwFrame*
>(pPrvCnt);
1274 :
static_cast<SwFrame*
>(pPrvCnt);
1284 while ( pCntUp && pCntUp->
GetUpper() )
1286 if ( pCntUp == pUp )
1289 :
static_cast<SwFrame*
>(pPrvCnt);
1301 if (
nullptr == pFrame )
1313 else if( !bNoFootnote )
1353 while ( pNextFrame &&
1359 pNextFrame = pNextFrame->
FindNext();
1379 SwFrame* pFstContentOfSctFrame =
1381 if ( pFstContentOfSctFrame )
1396 bool bSeenColumn =
false;
1409 bool bAllowOutsideHeaderFooter = !pSection->Growable() || pSection->GetPrecede();
1410 return bSeenColumn || (!pHeaderFooter && bAllowOutsideHeaderFooter);
1429 bool bRetVal =
false;
1431 if ( !_pLayoutFrame )
1442 else if ( _pLayoutFrame->
IsInFly() ||
1459 if ( _pLayoutFrame->
IsInFly() )
1473 const SwFrame* pCol = _pLayoutFrame;
1479 if ( pCol && pCol->
GetNext() )
1544 OSL_ENSURE( pAsk !=
this,
"Autsch! Stack overflow is about to happen" );
1580 OSL_ENSURE( pAsk !=
this,
"Oops! Stack overflow is about to happen" );
1597 SAL_WARN_IF(!pTmpFrame,
"sw.core",
"SwFrame::GetNextCellLeaf() without cell");
1598 return pTmpFrame ?
static_cast<SwCellFrame*
>(pTmpFrame)->GetFollowCell() :
nullptr;
1607 SAL_WARN_IF(!pTmpFrame,
"sw.core",
"SwFrame::GetNextPreviousLeaf() without cell");
1608 return pTmpFrame ?
static_cast<SwCellFrame*
>(pTmpFrame)->GetPreviousCell() :
nullptr;
1620 while ( pCell != &rOrigCell && !pCell->
IsAnLower( &rOrigCell ) )
1626 assert(pCell && pCorrCell &&
"lcl_FindCorrespondingCellFrame does not work");
1628 if ( pCell != &rOrigCell )
1632 "lcl_FindCorrespondingCellFrame does not work");
1635 while ( !pRow->
IsAnLower( &rOrigCell ) )
1689 while ( pRow->
GetNext() && ++nMax < nRowSpan )
1727 if ( pTab && pTab->IsFollow() )
1730 const bool bIsInFirstLine = ( pTmp == pRow );
1732 if ( bIsInFirstLine )
1754 if ( !bStart && pTableFrame && pTableFrame->IsFollow() && pTableFrame->
IsInHeadline( *
this ) )
1757 OSL_ENSURE( pTableFrame &&
1758 ( (bStart &&
GetTabBox()->getRowSpan() < 1) ||
1760 "SwCellFrame::FindStartRowSpanCell: No rowspan, no table, no cookies" );
1766 sal_uInt16 nMax = USHRT_MAX;
1768 const bool bDoNotEnterHeadline = bStart && pTableFrame->IsFollow() &&
1774 while ( bStart ? pCurrentRow->
GetPrev() : pCurrentRow->
GetNext() )
1779 if ( bDoNotEnterHeadline && pTableFrame->IsFollow() &&
1783 pCurrentRow = pCurrentRow->
GetPrev();
1786 pCurrentRow = pCurrentRow->
GetNext();
1802 if ( pMasterCell->GetTabBox() == &rMasterBox )
1804 const SwTabFrame* pMasterTable =
static_cast<const SwTabFrame*
>(pMasterCell->GetUpper()->GetUpper());
1806 if ( pMasterTable == pTableFrame )
1808 return *pMasterCell;
1814 SAL_WARN(
"sw.core",
"SwCellFrame::FindStartRowSpanCell: No result");
1823 OSL_ENSURE(
IsInTab(),
"IsInSplitTableRow should only be called for frames in tables" );
1831 if ( !pRow )
return nullptr;
1841 *(
static_cast<const SwRowFrame*
>(pRow)->GetTabLine()) ) ||
1849 OSL_ENSURE( pFollowRow,
"SwFrame::IsInSplitTableRow() does not work" );
1856 OSL_ENSURE(
IsInTab(),
"IsInSplitTableRow should only be called for frames in tables" );
1863 if ( !pRow )
return nullptr;
1875 const bool bIsInFirstLine = ( pTmp == pRow );
1877 if ( !bIsInFirstLine )
1891 if ( pSectionFrame )
@ FOOTNOTE_IN_COLUMN_TO_PAGEEND
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
const SwFrame * GetAnchorFrame() const
const SvxFormatBreakItem & GetBreak(bool=true) const
const SwFormatPageDesc & GetPageDesc(bool=true) const
Container of body content (i.e.
SwCellFrame is one table cell in the document layout.
const SwCellFrame & FindStartEndOfRowSpanCell(bool bStart) const
tools::Long GetLayoutRowSpan() const
SwCellFrame * GetFollowCell() const
SwCellFrame * GetPreviousCell() const
const SwTableBox * GetTabBox() const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
SwContentFrame * GetPrevContentFrame() const
const SwContentFrame * GetFollow() const
const SwContentFrame * ImplGetNextContentFrame(bool bFwd) const
Walk back inside the tree: grab the subordinate Frame if one exists and the last step was not moving ...
SwContentFrame * GetNextContentFrame() const
SwTextFrame * FindMaster() const
virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
general base class for all free-flowing frames
bool IsFlySplitAllowed() const
Is this fly allowed to split across pages? (Disabled by default.)
SwFlyFrame * GetNextLink() const
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
const SwRect & getFrameArea() const
Base class of the Writer layout elements.
bool IsInBalancedSection() const
const SwLayoutFrame * ImplGetNextLayoutLeaf(bool bFwd) const
Finds the next layout leaf.
SwSectionFrame * ImplFindSctFrame()
bool IsFootnoteContFrame() const
SwTextFrame * DynCastTextFrame()
SwFlyFrame * FindFlyFrame()
SwSectionFrame * FindSctFrame()
SwContentFrame * FindPrevCnt()
SwTabFrame * FindTabFrame()
void SetDirFlags(bool bVert)
Updates the vertical or the righttoleft-flags.
bool supportsFullDrawingLayerFillAttributeSet() const
SwTabFrame * ImplFindTabFrame()
bool IsColumnFrame() const
const SwBodyFrame * ImplFindBodyFrame() const
SwFrameType GetType() const
bool IsInFootnote() const
bool IsHeaderFrame() const
bool IsRightToLeft() const
SwRowFrame * FindRowFrame()
virtual bool IsDeleteForbidden() const
SwFlyFrame * ImplFindFlyFrame()
const SwAttrSet * GetAttrSet() const
WARNING: this may not return correct RES_PAGEDESC/RES_BREAK items for SwTextFrame,...
void InvalidateNextPrtArea()
method to invalidate printing area of next frame #i11859#
const SwRowFrame * IsInFollowFlowRow() const
bool IsMoveable(const SwLayoutFrame *_pLayoutFrame=nullptr) const
determine, if frame is moveable in given environment
SwLayoutFrame * GetNextCellLeaf()
SwFootnoteFrame * ImplFindFootnoteFrame()
bool IsFooterFrame() const
bool IsFootnoteFrame() const
SwLayoutFrame * GetUpper()
const SwLayoutFrame * GetNextLayoutLeaf() const
bool IsNoTextFrame() const
virtual const SvxFormatBreakItem & GetBreakItem() const
bool IsContentFrame() const
virtual void CheckDirection(bool bVert)
bool IsFootnoteBossFrame() const
SwContentFrame * FindNextCnt(const bool _bInSameFootnote=false)
SwPageFrame * ImplFindPageFrame()
SwPageFrame * FindPageFrame()
void ImplInvalidateNextPos(bool bNoFootnote)
const SwRowFrame * IsInSplitTableRow() const
drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const
SwFrame * FindFooterOrHeader()
SwFootnoteFrame * FindFootnoteFrame()
virtual const SwFormatPageDesc & GetPageDescItem() const
SwFootnoteBossFrame * FindFootnoteBossFrame(bool bFootnotes=false)
SwContentFrame * FindPrevCnt_()
method to determine previous content frame in the same environment for a flow frame (content frame,...
bool IsLayoutFrame() const
SwContentFrame * FindNextCnt_(const bool _bInSameFootnote)
method to determine next content frame in the same environment for a flow frame (content frame,...
SwLayoutFrame * GetPrevCellLeaf()
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
const SwCellFrame * FirstCell() const
Calls ContainsAny first to reach the innermost cell.
bool IsAnLower(const SwFrame *) const
bool ContainsDeleteForbiddenLayFrame() const
virtual const SwFrameFormat * GetFormat() const
const SwFrame * ContainsAny(const bool _bInvestigateFootnoteForSections=false) const
Method <ContainsAny()> doesn't investigate content of footnotes by default.
bool IsBefore(const SwLayoutFrame *_pCheckRefLayFrame) const
method to check relative position of layout frame to a given layout frame.
const SwFrame * GetLastLower() const
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
const SwFrame * Lower() const
A page of the document layout.
SwContentFrame * FindLastBodyContent()
Searches the last ContentFrame in BodyText below the page.
sal_uInt16 GetPhyPageNum() const
SwContentFrame * FindFirstBodyContent()
Of course Writer needs its own rectangles.
void Top(const tools::Long nTop)
void Right(const tools::Long nRight)
void Bottom(const tools::Long nBottom)
void Pos(const Point &rNew)
void SSize(const Size &rNew)
bool Contains(const Point &rPOINT) const
bool Overlaps(const SwRect &rRect) const
void Left(const tools::Long nLeft)
bool IsBetweenPages(const Point &rPt) const
Point rPt: The point to test.
SwViewShell * GetCurrShell() const
const SwPageFrame * GetPageAtPos(const Point &rPt, const Size *pSize=nullptr, bool bExtend=false) const
Point rPt: The point that should be used to find the page Size pSize: If given, we return the (first)...
std::vector< SwRect > maPageRects
sal_uInt16 GetPageNum() const
SwRowFrame is one table row in the document layout.
bool IsRowSpanLine() const
SwRowFrame * GetFollowRow() const
SwContentFrame * FindLastContent(SwFindMode nMode=SwFindMode::None)
bool IsBalancedSection() const
SwSectionFrame * FindMaster() const
bool IsFootnoteAtEnd() const
const SwSectionFrame * GetFollow() const
SwSectionFormat * GetFormat()
SwTabFrame is one table in the document layout, containing rows (which contain cells).
SwContentFrame * FindLastContent()
SwTabFrame * FindMaster(bool bFirstMaster=false) const
const SwTabFrame * GetFollow() const
SwRowFrame * GetFirstNonHeadlineRow() const
const SwTable * GetTable() const
bool IsInHeadline(const SwFrame &rFrame) const
bool HasFollowFlowLine() const
SwTableBox is one table cell in the document model.
sal_Int32 getRowSpan() const
SwTableBox & FindStartOfRowSpan(const SwTable &, sal_uInt16 nMaxStep=USHRT_MAX)
SwTableBox::FindStartOfRowSpan(..) returns the "master" cell, the cell which overlaps the given cell,...
SwFrameFormat * GetFrameFormat()
SwTableBox & FindEndOfRowSpan(const SwTable &, sal_uInt16 nMaxStep)
SwTableBox::FindEndOfRowSpan(..) returns the last overlapped cell if there is any.
SwTable is one table in the document model, containing rows (which contain cells).
bool IsHeadline(const SwTableLine &rLine) const
const SwFormatFootnote & GetFootnote() const
Represents the visualization of a paragraph.
virtual const SvxFormatBreakItem & GetBreakItem() const override
virtual const SwFormatPageDesc & GetPageDescItem() const override
bool IsHiddenNow() const
Hidden.
SwTextNode * GetTextNodeFirst()
bool IsWhitespaceHidden() const
const SwViewOption * GetViewOptions() const
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
static bool lcl_IsInSectionDirectly(const SwFrame *pUp)
static const SwFrame * lcl_FindLayoutFrame(const SwFrame *pFrame, bool bNext)
static const SwFrame * lcl_GetLower(const SwFrame *pFrame, bool bFwd)
static SwFrame * lcl_NextFrame(SwFrame *pFrame)
static SwCellFrame * lcl_FindCorrespondingCellFrame(const SwRowFrame &rOrigRow, const SwCellFrame &rOrigCell, const SwRowFrame &rCorrRow, bool bInFollow)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwNodeOffset abs(const SwNodeOffset &a)
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.