40#include <osl/diagnose.h>
83 while ( (!pLayLeaf->
IsSctFrame() || pLayLeaf ==
this ) &&
87 if( pLayLeaf->
IsSctFrame() && pLayLeaf != this )
103 else if ( pLayLeaf->
Lower() )
138 const bool bNoFootnote =
IsSctFrame() && !_bInvestigateFootnoteForSections;
142 || pLayLeaf ==
this ) &&
147 && pLayLeaf != this )
153 else if ( pLayLeaf->
Lower() )
157 if( bNoFootnote && pLayLeaf && pLayLeaf->
IsInFootnote() )
178 if (!pFrame->IsLayoutFrame())
241 pUp =
static_cast<const SwFlyFrame*
>(pUp)->GetAnchorFrame();
262 OSL_ENSURE( !
IsRootFrame() ,
"<IsBefore> called at a <SwRootFrame>.");
263 OSL_ENSURE( !_pCheckRefLayFrame->
IsRootFrame() ,
"<IsBefore> called with a <SwRootFrame>.");
270 if( pMyPage != pCheckRefPage )
295 !pUpNext->
IsAnLower( _pCheckRefLayFrame ) )
299 bReturn = pUpNext !=
nullptr;
313 auto pFlyFrame =
static_cast<const SwFlyFrame*
>(pFrame);
314 if (pFlyFrame->IsFlySplitAllowed())
318 pRet = bNext ? pFlyAtContent->GetFollow() : pFlyAtContent->GetPrecede();
322 pRet = bNext ? pFlyFrame->GetNextLink() : pFlyFrame->GetPrevLink();
353 bool bGoingUp = !bFwd;
358 bool bGoingFwdOrBwd =
false;
360 bool bGoingDown = !bGoingUp;
364 bGoingDown =
nullptr !=
p;
372 bGoingFwdOrBwd =
nullptr !=
p;
373 if ( !bGoingFwdOrBwd )
384 p =
const_cast<SwFlyFrame*
>(pFlyFrame)->FindAnchorCharFrame();
393 bGoingUp =
nullptr !=
p;
403 bGoingUp = !bGoingFwdOrBwd && !bGoingDown;
408 }
while( (
p && !
p->IsFlowFrame() ) ||
430 bool bGoingUp =
false;
433 bool bGoingFwdOrBwd =
false;
435 bool bGoingDown = !bGoingUp;
439 bGoingDown =
nullptr !=
p;
444 bGoingFwdOrBwd =
nullptr !=
p;
445 if ( !bGoingFwdOrBwd )
448 bGoingUp =
nullptr !=
p;
456 bGoingUp = !(bGoingFwdOrBwd || bGoingDown);
458 if (!bFwd && bGoingDown)
460 while (
p->GetNext() )
467 return pContentFrame;
480 const auto pFly(
static_cast<SwFlyFrame*
>(pRet));
481 pRet = pFly->GetPageFrame();
483 pRet = pFly->AnchorFrame();
512 bool bMoveToPageFrame =
false;
515 if (bFootnotes && pSectframe
523 bMoveToPageFrame = !bFAtEnd && !bNoBalance;
535 if (
static_cast<SwFlyFrame*
>(pRet)->GetPageFrame() )
536 pRet =
static_cast<SwFlyFrame*
>(pRet)->GetPageFrame();
538 pRet =
static_cast<SwFlyFrame*
>(pRet)->AnchorFrame();
547 OSL_ENSURE( pSct,
"FindFootnoteBossFrame: Single column outside section?" );
643 pRet =
static_cast<SwFlyFrame*
>(pRet)->AnchorFrame();
666 aRect.
SSize( *pSize );
681 OSL_ENSURE(
GetPageNum() <=
maPageRects.size(),
"number of pages differs from page rect array size" );
684 while ( pPage && !pRet )
688 if ( (!pSize && rBoundRect.
Contains(rPt)) ||
689 (pSize && rBoundRect.
Overlaps(aRect)) )
707 if (pPage ==
nullptr)
735 return toEdge <= constMargin;
766 return &
static_cast<const SwTextFrame*
>(
this)->GetTextNodeForParaProps()->GetSwAttrSet();
803 return static_cast< const SwLayoutFrame*
>(
this)->
GetFormat()->supportsFullDrawingLayerFillAttributeSet();
828 bool bGoingUp =
false;
832 bool bGoingFwd =
false;
837 bGoingDown =
nullptr !=
p;
842 bGoingFwd =
nullptr !=
p;
846 bGoingUp =
nullptr !=
p;
853 bGoingUp = !(bGoingFwd || bGoingDown);
855 }
while (
nullptr == (pRet = ( ( pFrame->
IsContentFrame() || ( !bGoingUp &&
862 bool bIgnoreTab =
false;
870 if (
static_cast<SwTabFrame*
>(
this)->GetFollow() )
871 return static_cast<SwTabFrame*
>(
this)->GetFollow();
873 pThis =
static_cast<SwTabFrame*
>(
this)->FindLastContentOrTable();
905 if ( !bIgnoreTab && pThis->
IsInTab() )
910 assert(pUp &&
"Content flag says it's in table but it's not in cell.");
913 pNxt =
static_cast<SwCellFrame*
>(pNxt)->ContainsContent();
967 while ( pCntUp && pCntUp->
GetUpper() &&
997 if (
static_cast<SwTabFrame*
>(
this)->GetFollow() )
1003 pThis =
static_cast<SwTabFrame*
>(
this)->FindLastContentOrTable();
1030 if ( bBody || (
bFootnote && !_bInSameFootnote ) )
1042 else if (
bFootnote && _bInSameFootnote )
1048 OSL_ENSURE( pFootnoteFrameOfCurr,
1049 "<SwFrame::FindNextCnt_() - unknown layout situation: current frame has to have an upper footnote frame." );
1050 if ( pFootnoteFrameOfNext == pFootnoteFrameOfCurr )
1054 else if ( pFootnoteFrameOfCurr->
GetFollow() )
1062 pFollowFootnoteFrameOfCurr = pFollowFootnoteFrameOfCurr->
GetFollow();
1064 }
while ( !pNxtCnt && pFollowFootnoteFrameOfCurr->
GetFollow() );
1086 while ( pCntUp && pCntUp->
GetUpper() &&
1089 if ( pCntUp == pUp )
1118 if ( pCurrContentFrame && pCurrContentFrame->IsFollow() )
1121 pPrevContentFrame = pCurrContentFrame->
FindMaster();
1126 if ( pTabFrame->IsFollow() )
1141 if ( pSectFrame->IsFollow() )
1156 if ( !pPrevContentFrame && pCurrContentFrame )
1159 if ( pPrevContentFrame )
1161 if ( pCurrContentFrame->
IsInFly() )
1169 const bool bInDocBody = pCurrContentFrame->
IsInDocBody();
1170 const bool bInFootnote = pCurrContentFrame->
IsInFootnote();
1176 while ( pPrevContentFrame )
1178 if ( ( bInDocBody && pPrevContentFrame->
IsInDocBody() ) ||
1186 else if ( bInFootnote )
1192 if ( pFootnoteFrameOfPrev != pFootnoteFrameOfCurr )
1194 if ( pFootnoteFrameOfCurr->
GetMaster() )
1198 pPrevContentFrame =
nullptr;
1201 pMasterFootnoteFrameOfCurr = pMasterFootnoteFrameOfCurr->
GetMaster();
1203 }
while ( !pPrevContentFrame &&
1204 pMasterFootnoteFrameOfCurr->
GetMaster() );
1210 pPrevContentFrame =
nullptr;
1225 "<SwFrame::FindPrevCnt_()> - unknown layout situation: current frame should be in page header or page footer" );
1226 OSL_ENSURE( !pPrevContentFrame->
IsInFly(),
1227 "<SwFrame::FindPrevCnt_()> - unknown layout situation: found previous frame should *not* be inside a fly frame." );
1231 pPrevContentFrame =
nullptr;
1238 return pPrevContentFrame;
1243 bool bIgnoreTab =
false;
1251 if (
static_cast<SwTabFrame*
>(
this)->IsFollow() )
1252 return static_cast<SwTabFrame*
>(
this)->FindMaster();
1254 pThis =
static_cast<SwTabFrame*
>(
this)->ContainsContent();
1263 if ( !bIgnoreTab && pThis->
IsInTab() )
1268 assert(pUp &&
"Content flag says it's in table but it's not in cell.");
1285 :
static_cast<SwFrame*
>(pPrvCnt);
1294 :
static_cast<SwFrame*
>(pPrvCnt);
1304 while ( pCntUp && pCntUp->
GetUpper() )
1306 if ( pCntUp == pUp )
1309 :
static_cast<SwFrame*
>(pPrvCnt);
1321 if (
nullptr == pFrame )
1333 else if( !bNoFootnote )
1373 while ( pNextFrame &&
1379 pNextFrame = pNextFrame->
FindNext();
1399 SwFrame* pFstContentOfSctFrame =
1401 if ( pFstContentOfSctFrame )
1416 bool bSeenColumn =
false;
1429 bool bAllowOutsideHeaderFooter = !pSection->Growable() || pSection->GetPrecede();
1430 return bSeenColumn || (!pHeaderFooter && bAllowOutsideHeaderFooter);
1449 bool bRetVal =
false;
1451 if ( !_pLayoutFrame )
1462 else if ( _pLayoutFrame->
IsInFly() ||
1479 if ( _pLayoutFrame->
IsInFly() )
1493 const SwFrame* pCol = _pLayoutFrame;
1499 if ( pCol && pCol->
GetNext() )
1564 OSL_ENSURE( pAsk !=
this,
"Autsch! Stack overflow is about to happen" );
1600 OSL_ENSURE( pAsk !=
this,
"Oops! Stack overflow is about to happen" );
1617 SAL_WARN_IF(!pTmpFrame,
"sw.core",
"SwFrame::GetNextCellLeaf() without cell");
1618 return pTmpFrame ?
static_cast<SwCellFrame*
>(pTmpFrame)->GetFollowCell() :
nullptr;
1627 SAL_WARN_IF(!pTmpFrame,
"sw.core",
"SwFrame::GetNextPreviousLeaf() without cell");
1628 return pTmpFrame ?
static_cast<SwCellFrame*
>(pTmpFrame)->GetPreviousCell() :
nullptr;
1640 while ( pCell != &rOrigCell && !pCell->
IsAnLower( &rOrigCell ) )
1646 assert(pCell && pCorrCell &&
"lcl_FindCorrespondingCellFrame does not work");
1648 if ( pCell != &rOrigCell )
1652 "lcl_FindCorrespondingCellFrame does not work");
1655 while ( !pRow->
IsAnLower( &rOrigCell ) )
1709 while ( pRow->
GetNext() && ++nMax < nRowSpan )
1747 if ( pTab && pTab->IsFollow() )
1750 const bool bIsInFirstLine = ( pTmp == pRow );
1752 if ( bIsInFirstLine )
1774 if ( !bStart && pTableFrame && pTableFrame->IsFollow() && pTableFrame->
IsInHeadline( *
this ) )
1777 OSL_ENSURE( pTableFrame &&
1778 ( (bStart &&
GetTabBox()->getRowSpan() < 1) ||
1780 "SwCellFrame::FindStartRowSpanCell: No rowspan, no table, no cookies" );
1786 sal_uInt16 nMax = USHRT_MAX;
1788 const bool bDoNotEnterHeadline = bStart && pTableFrame->IsFollow() &&
1794 while ( bStart ? pCurrentRow->
GetPrev() : pCurrentRow->
GetNext() )
1799 if ( bDoNotEnterHeadline && pTableFrame->IsFollow() &&
1803 pCurrentRow = pCurrentRow->
GetPrev();
1806 pCurrentRow = pCurrentRow->
GetNext();
1822 if ( pMasterCell->GetTabBox() == &rMasterBox )
1824 const SwTabFrame* pMasterTable =
static_cast<const SwTabFrame*
>(pMasterCell->GetUpper()->GetUpper());
1826 if ( pMasterTable == pTableFrame )
1828 return *pMasterCell;
1834 SAL_WARN(
"sw.core",
"SwCellFrame::FindStartRowSpanCell: No result");
1843 OSL_ENSURE(
IsInTab(),
"IsInSplitTableRow should only be called for frames in tables" );
1851 if ( !pRow )
return nullptr;
1861 *(
static_cast<const SwRowFrame*
>(pRow)->GetTabLine()) ) ||
1869 OSL_ENSURE( pFollowRow,
"SwFrame::IsInSplitTableRow() does not work" );
1876 OSL_ENSURE(
IsInTab(),
"IsInSplitTableRow should only be called for frames in tables" );
1883 if ( !pRow )
return nullptr;
1895 const bool bIsInFirstLine = ( pTmp == pRow );
1897 if ( !bIsInFirstLine )
1911 if ( pSectionFrame )
@ FOOTNOTE_IN_COLUMN_TO_PAGEEND
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
constexpr tools::Long Y() const
constexpr tools::Long X() 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.
Flys that are anchored to content (at-para, at-char) but not in content (as-char).
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.