20#include <config_wasm_strip.h>
61#include <objectformatter.hxx>
66#include <osl/diagnose.h>
76 , SwFlowFrame( static_cast<
SwFrame&>(*this) )
79 , m_bCalcLowers(false)
80 , m_bLowersFormatted(false)
81 , m_bLockBackMove(false)
82 , m_bResizeHTMLTable(false)
83 , m_bONECalcLowers(false)
84 , m_bHasFollowFlowLine(false)
85 , m_bIsRebuildLastLine(false)
86 , m_bRestrictTableGrowth(false)
87 , m_bRemoveFollowFlowLinePending(false)
88 , m_bConsiderObjsForMinCellHeight(true)
89 , m_bObjsDoesFit(true)
90 , m_bInRecalcLowerRow(false)
101 for (
size_t i = 0;
i < rLines.
size(); ++
i )
104 if ( bHiddenRedlines && rLines[
i]->IsDeleted(nRedlinePos) )
121 , SwFlowFrame( static_cast<
SwFrame&>(*this) )
122 , m_pTable( rTab.GetTable() )
124 , m_bCalcLowers(false)
125 , m_bLowersFormatted(false)
126 , m_bLockBackMove(false)
127 , m_bResizeHTMLTable(false)
128 , m_bONECalcLowers(false)
129 , m_bHasFollowFlowLine(false)
130 , m_bIsRebuildLastLine(false)
131 , m_bRestrictTableGrowth(false)
132 , m_bRemoveFollowFlowLinePending(false)
133 , m_bConsiderObjsForMinCellHeight(true)
134 , m_bObjsDoesFit(true)
135 , m_bInRecalcLowerRow(false)
141 rTab.SetFollow(
this );
160 if ( pFoll->HasFollow() )
190 bool _bOnlyRowsAndCells =
false );
196 const bool _bConsiderObjs );
208 while ( pStart &&
nCount > 0 )
221 OSL_ENSURE( rTmpRow.
IsRowFrame(),
"No row frame to copy for FollowFlowLine" );
229 return pFollowFlowLine;
236 const bool _bMoveObjsOutOfRange =
false,
243 OSL_ENSURE( _pPageFrame,
244 "<lcl_InvalidateLowerObjs(..)> - missing page frame -> no move of lower objects out of range" );
253 while ( pLowerFrame )
258 _bMoveObjsOutOfRange, _pPageFrame );
275 if ( _bMoveObjsOutOfRange )
281 pAnchoredObj->
SetObjLeft( _pPageFrame->getFrameArea().Right() );
288 == RndStdIds::FLY_AS_CHAR )
294 if ( pFly !=
nullptr )
302 if ( pFly !=
nullptr )
308 pLowerFrame = pLowerFrame->
GetNext();
318 bool bAllCellsCollapsed =
true;
319 while ( pCurrMasterCell )
335 bool bAllLowersCollapsed =
true;
351 bool bAllRowsCollapsed =
true;
358 bAllRowsCollapsed =
false;
363 if (bAllRowsCollapsed)
370 aRectFnSet.
SetTop(aPrt, 0);
374 bAllLowersCollapsed =
false;
380 aRectFnSet.
SetTop(aPrt, 0);
385 bAllLowersCollapsed =
false;
398 if (bAllLowersCollapsed)
405 aRectFnSet.
SetTop(aPrt, 0);
409 bAllCellsCollapsed =
false;
414 if (bAllCellsCollapsed)
421 aRectFnSet.
SetTop(aPrt, 0);
435 while ( pCurrSourceCell )
440 while ( pTmpSourceRow )
451 while ( pTmpDestRow->
GetNext() )
513 while ( pCurrLastLineCell )
524 while ( pTmpLastLineRow->
GetNext() && nTmpCut > nCurrentHeight )
526 nTmpCut -= nCurrentHeight;
537 bool bTableLayoutTooComplex =
false;
560 bTableLayoutTooComplex =
true;
579 if ( nTmpCut > nCurrentHeight ||
581 !bTableLayoutTooComplex && nMinHeight < nTmpCut ) )
588 pNewRow->
InsertBehind( pCurrFollowFlowLineCell,
nullptr );
593 while ( pTmpLastLineRow )
598 pTmpLastLineRow->
InsertBefore( pCurrFollowFlowLineCell,
nullptr );
601 pTmpLastLineRow = pTmp;
606 pCurrFollowFlowLineCell =
static_cast<SwCellFrame*
>(pCurrFollowFlowLineCell->
GetNext());
614 while ( pCurrMasterCell )
616 if ( pCurrMasterCell->
Lower() &&
623 OSL_ENSURE( pRowFrame->
GetFollowRow(),
"Deleting row frame without follow" );
683 rTab.
Shrink(nAlreadyFree + nCurLastLineHeight - nRemainingSpaceForLastRow + 1);
686 bool bUnlockMaster =
false;
687 SwFlowFrame * pFollow =
nullptr;
689 if ( pMaster && !pMaster->IsJoinLocked() )
691 bUnlockMaster =
true;
708 rLastLine.
Calc(pRenderContext);
730 const SwTwips nDistanceToUpperPrtBottom =
743 pFootnote !=
nullptr;
758 nFollowFootnotes += aRectFnSet.
GetHeight(pFootnote->getFrameArea());
764 if (nDistanceToUpperPrtBottom + nFollowFootnotes < 0 || !rTab.
DoesObjsFit())
775 while ( pCurrMasterCell )
834 if ( nLayoutRowSpan > 1 )
858 bool bNextRow =
false;
860 while ( pCurrentRowFrame )
874 pCurrentRowFrame = bNextRow ?
896 pLastLine,
"There should be a flowline in the follow" );
899 if ( !pFollowFlowLine || !pLastLine )
903 SAL_WARN(
"sw.layout",
"Cannot remove in-use Follow Flow Line");
920 if ( nRowsToMove > 1 )
927 while ( pRow && nRowsToMove-- > 1 )
939 pInsertBehind = pRow;
947 pFirstRow = pFirstRow->
GetNext();
954 bool bJoin = !pFollowFlowLine->
GetNext();
955 pFollowFlowLine->
Cut();
990 if (!pSectionLower->IsColumnFrame())
996 for (
const SwFrame* pFrame = pSectionLower; pFrame; pFrame = pFrame->
GetNext())
998 if (pFrame->IsTabFrame())
1013 pTmpFrame = pTmpFrame->
GetNext();
1043 sal_uInt16 nRowCount = 0;
1045 SwTwips nRemainingSpaceForLastRow =
1047 nRemainingSpaceForLastRow -= aRectFnSet.
GetTopMargin(*
this);
1070 bool bSplitRowAllowed =
true;
1078 bSplitRowAllowed =
false;
1087 bTryToSplit =
false;
1099 if (nMinHeight > nRemainingSpaceForLastRow)
1101 bSplitRowAllowed =
false;
1110 bool bKeepNextRow =
false;
1111 if ( nRowCount < nRepeat )
1118 OSL_ENSURE( !
GetIndPrev(),
"Table is supposed to be at beginning" );
1125 bKeepNextRow =
true;
1127 else if ( !
GetIndPrev() && nRepeat == nRowCount )
1132 if ( bTryToSplit && bSplitRowAllowed )
1137 while ( pLowerCell )
1145 bKeepNextRow =
true;
1153 bKeepNextRow =
true;
1177 bSplitRowAllowed = bSplitRowAllowed && bTryToSplit &&
1182 if ( !bSplitRowAllowed && bTableRowKeep )
1187 nRowCount > nRepeat )
1204 if ( !bSplitRowAllowed )
1207 if ( pRow == pFirstNonHeadlineRow )
1217 if ( !pTmpRow || pRow == pTmpRow )
1253 for ( nRowCount = 0; nRowCount < nRepeat; ++nRowCount )
1265 if( !pSpzs->
empty() )
1274 ?
static_cast<SwTextFrame*
>(pFrame)->GetTextNodeFirst()->GetIndex()
1289 if ( bSplitRowAllowed )
1307 while ( pCellFrame )
1341 pInsertBehind = pRow;
1360 pRow->
Paste( pFoll, pPasteBefore );
1378 if (!bRet && !bSplitRowAllowed)
1396 if (pFoll->IsJoinLocked())
1401 SAL_WARN(
"sw.layout",
"Delete Forbidden");
1415 if (!pFoll || !CanDeleteFollow(pFoll))
1497 if ( pToInvalidate->
Lower() )
1544 int nLoopControlRuns = 0;
1545 const int nLoopControlMax = 10;
1546 const sw::BroadcastingModify* pLoopControlCond =
nullptr;
1548 while (pCnt && rDontLeave.
IsAnLower(pCnt))
1553 const bool bFormatPossible = !pCnt->IsJoinLocked() &&
1559 bool bSkipContent =
false;
1560 if ( bSkipRowSpanCells && pCnt->
IsInTab() )
1566 bSkipContent =
true;
1569 if ( bFormatPossible && !bSkipContent )
1575 pCnt->
Calc(pRenderContext);
1581 "<SwContentFrame::CalcLowers(..)> - text frame invalid and not locked." );
1590 static_cast<SwTextFrame*
>(pCnt)->GetTextNodeFirst());
1591 if (pTextNode == pLoopControlCond)
1595 nLoopControlRuns = 0;
1596 pLoopControlCond = pTextNode;
1599 if ( nLoopControlRuns < nLoopControlMax )
1606 SAL_WARN(
"sw.layout",
"LoopControl in SwContentFrame::CalcLowers");
1627 bool _bOnlyRowsAndCells )
1648 pFrame->
Calc(pRenderContext);
1660 rToCalc.
Calc(pRenderContext);
1661 if ( rToCalc.
Lower() )
1677 int nLoopControlRuns_1 = 0;
1678 sal_uInt16 nLoopControlStage_1 = 0;
1679 const int nLoopControlMax = 10;
1685 int nLoopControlRuns_2 = 0;
1686 sal_uInt16 nLoopControlStage_2 = 0;
1690 if ( ++nLoopControlRuns_2 > nLoopControlMax )
1692 SAL_WARN_IF(nLoopControlStage_2 == 0,
"sw.layout",
"LoopControl_2 in lcl_RecalcRow: Stage 1!");
1693 SAL_WARN_IF(nLoopControlStage_2 == 1,
"sw.layout",
"LoopControl_2 in lcl_RecalcRow: Stage 2!!");
1694 SAL_WARN_IF(nLoopControlStage_2 >= 2,
"sw.layout",
"LoopControl_2 in lcl_RecalcRow: Stage 3!!!");
1696 nLoopControlRuns_2 = 0;
1697 if( nLoopControlStage_2 > 2 )
1713 for (
int i = 0;
i < 2; ++
i )
1716 while ( pCellFrame )
1718 const bool bCalc = 0 ==
i ?
1736 if ( ++nLoopControlRuns_1 > nLoopControlMax )
1738 SAL_WARN_IF(nLoopControlStage_1 == 0,
"sw.layout",
"LoopControl_1 in lcl_RecalcRow: Stage 1!");
1739 SAL_WARN_IF(nLoopControlStage_1 == 1,
"sw.layout",
"LoopControl_1 in lcl_RecalcRow: Stage 2!!");
1740 SAL_WARN_IF(nLoopControlStage_1 >= 2,
"sw.layout",
"LoopControl_1 in lcl_RecalcRow: Stage 3!!!");
1742 nLoopControlRuns_1 = 0;
1743 if( nLoopControlStage_1 > 2 )
1778 bool bSkippedDirectPrevEmptySection(
false );
1787 bSkippedDirectPrevEmptySection =
true;
1795 if ( ( !bSkippedDirectPrevEmptySection && !rFrame.
GetIndPrev() ) ||
1796 ( bSkippedDirectPrevEmptySection &&
1822#define KEEPTAB ( !GetFollow() && !IsFollow() )
1855 pNxt->
Calc(pRenderContext);
1862 bool AreAllRowsKeepWithNext(
const SwRowFrame* pFirstRowFrame,
const bool bCheckParents =
true )
1864 bool bRet = pFirstRowFrame !=
nullptr &&
1867 while ( bRet && pFirstRowFrame->
GetNext() !=
nullptr )
1870 bRet = pFirstRowFrame !=
nullptr &&
1909 OSL_ENSURE( !pFollowFrame->IsJoinLocked() || !pFollowFrame->
IsRebuildLastLine(),
1910 "SwTabFrame::MakeAll for master while follow is in RebuildLastLine()" );
1957 bool bMakePage =
true;
1959 bool bMovedBwd =
false;
1962 bool bMovedFwd =
false;
1964 bool bSplit =
false;
1968 std::optional<SwBorderAttrAccess> oAccess(std::in_place,
SwFrame::GetCache(),
this);
1972 bool bDontSplit = !IsFollow() &&
1980 bool bTryToSplit =
true;
1987 if (pFly->IsFlySplitAllowed())
1990 bTableRowKeep =
false;
1992 else if (!pFly->GetNextLink())
2007 bool bLastRowHasToMoveToFollow =
false;
2008 bool bLastRowMoveNoMoreTries =
false;
2011 const bool bEmulateTableKeep = !bLargeTable && bTableRowKeep
2062 else if (!
MoveFwd(bMakePage,
false))
2068 int nUnSplitted = 5;
2069 int nThrowAwayValidLayoutLimit = 5;
2075 !(bMovedFwd && bEmulateTableKeep) )
2076 if ( CheckMoveFwd( bMakePage, bKeep &&
KEEPTAB, bEmulateTableKeep ) )
2105 if ( bKeep || (
nullptr != (pPre =
FindPrev()) &&
2137 pAttrs = oAccess->Get();
2158 if ( !bMovedFwd && (bMoveable || bFly) &&
lcl_NoPrev( *
this ) )
2176 std::optional<SfxDeleteListener> oDeleteListener;
2178 oDeleteListener.emplace(*pOldBoss);
2180 if ( MoveBwd( bReformat ) )
2182 SAL_WARN_IF(oDeleteListener && oDeleteListener->WasDeleted(),
"sw.layout",
"SwFootnoteBossFrame unexpectedly deleted");
2187 if (bFootnotesInDoc && !oDeleteListener->WasDeleted())
2189 if ( bReformat || bKeep )
2209 pAttrs = oAccess->Get();
2247 SwTwips nDistanceToUpperPrtBottom =
2253 if ( nDistanceToUpperPrtBottom < 0 && bBrowseMode )
2265 if (pUpper->IsFlySplitAllowed())
2276 nRequest += aRectFnSet.
GetHeight(pFollow->getFrameArea());
2279 pUpper->Grow(nRequest);
2290 if( nDistanceToUpperPrtBottom >= 0 && !bLastRowHasToMoveToFollow )
2327 if ( !pRow || !pRow->
GetNext() )
2349 while ( pRowToMove && nRowsToMove-- > 0 )
2351 const bool bMoveFootnotes = bFootnotesInDoc && !
GetFollow()->IsJoinLocked();
2354 if ( bMoveFootnotes )
2367 pRowToMove->
Paste(
this );
2371 if ( bMoveFootnotes )
2375 pRowToMove = pNextRow;
2387 bool bFormat =
false;
2390 else if ( bTableRowKeep && !bLastRowMoveNoMoreTries )
2394 bLastRowMoveNoMoreTries =
true;
2410 pAttrs = oAccess->Get();
2436 bLastRowHasToMoveToFollow =
true;
2482 bLastRowHasToMoveToFollow =
false;
2504 const bool bAllowSplitOfRow = bTableRowKeep && !pIndPrev && AreAllRowsKeepWithNext(pFirstNonHeadlineRow);
2507 const bool bEmulateTableKeepSplitAllowed = bEmulateTableKeep && !IsKeepFwdMoveAllowed(
true);
2509 if ( pFirstNonHeadlineRow && nUnSplitted > 0 &&
2510 ( bEmulateTableKeepSplitAllowed || bAllowSplitOfRow ||
2511 ( ( !bTableRowKeep || pFirstNonHeadlineRow->
GetNext() ||
2513 ) && ( !bDontSplit || !pIndPrev )
2525 bTryToSplit =
false;
2530 if ( pFirstNonHeadlineRow->
GetNext() || bTryToSplit )
2533 bool bFlySplit =
false;
2541 nDeadLine = aRectFnSet.
YInc( nDeadLine,
2562 bLastRowHasToMoveToFollow =
false;
2573 if ( pTmpRow && !
static_cast<const SwRowFrame*
>(pTmpRow)->IsRowSplitAllowed() )
2577 sal_uInt16 nMinNumOfLines = nRepeat;
2579 if ( bTableRowKeep )
2600 if( aRectFnSet.
YDiff(nDeadLine, nBreakLine) >=0
2601 || !pIndPrev || bEmulateTableKeepSplitAllowed )
2609 if (!nThrowAwayValidLayoutLimit)
2615 if (bInitialLoopEndCondition && !bFinalLoopEndCondition)
2617 --nThrowAwayValidLayoutLimit;
2622 const bool bSplitError = !
Split( nDeadLine, bTryToSplit, ( bTableRowKeep && !(bAllowSplitOfRow || bEmulateTableKeepSplitAllowed) ) );
2625 if (bSplitError && nRepeat >
GetTable()->GetRowsToRepeat())
2631 if (!bTryToSplit && !bSplitError)
2651 if ( bSplitError && bTryToSplit )
2655 bTryToSplit =
false;
2659 bTryToSplit = !bSplitError;
2689 const bool bOldJoinLock =
GetFollow()->IsJoinLocked();
2696 if ( !bOldJoinLock )
2708 bool bCalcNxt =
true;
2723 pNxt->
Calc(pRenderContext);
2739 bLastRowHasToMoveToFollow =
false;
2759 else if (!
MoveFwd(bMakePage,
false))
2780 pTab->
Calc(pRenderContext);
2805 SwTwips nDistToUpperPrtBottom =
2807 if ( nDistToUpperPrtBottom >= 0 || bTryToSplit )
2815#if OSL_DEBUG_LEVEL > 0
2818 OSL_FAIL(
"debug assertion: <SwTabFrame::MakeAll()> - format of table lowers suppressed by fix i44910" );
2837 if ( bMovedFwd || bMovedBwd || !bOldValidPos )
2848 if (pContentFrame == &rAnchorFrame)
2860 SwTwips *
const pSpaceBelowBottom)
const
2862 bool bInvalidatePrtArea =
false;
2874 return bInvalidatePrtArea;
2877 const bool bConsiderWrapOnObjPos
2880 nPrtPos = aRectFnSet.
YInc(nPrtPos, rUpper);
2882 if (pSpaceBelowBottom)
2903 const SwRect aFlyRect = pFly->GetObjRectWithSpaces();
2920 const SwTextFrame* pAnchorCharFrame = pFly->FindAnchorCharFrame();
2923 bool bIgnoreFlyValidity
2928 (pFly->isFrameAreaDefinitionValid() || bIgnoreFlyValidity)
2930 && pFly->IsFlyAtContentFrame()
2935 && (pSpaceBelowBottom
2938 && !pFly->IsAnLower(
this)
2947 && pPage->
GetPhyPageNum() >= pFly->GetAnchorFrame()->FindPageFrame()->GetPhyPageNum()
2949 && (!pAnchorCharFrame ||
2957 if (pFlyHeaderFooterFrame != pThisHeaderFooterFrame
2961 && (!bConsiderWrapOnObjPos ||
nullptr != pThisHeaderFooterFrame
2967 text::WrapTextMode nSurround = pFly->GetFormat()->GetSurround().GetSurround();
2970 bool bWrapThrough = nSurround == text::WrapTextMode_THROUGH;
2974 if (!bWrapThrough && nSurround == text::WrapTextMode_THROUGH)
2975 nSurround = text::WrapTextMode_PARALLEL;
2977 bool bShiftDown = css::text::WrapTextMode_NONE == nSurround;
2978 if (!bShiftDown && bAddVerticalFlyOffsets)
2980 if (nSurround == text::WrapTextMode_PARALLEL
2993 const SwRect aFlyRectWithoutSpaces = pFly->GetObjRect();
2995 aRectFnSet.
GetRight(aFlyRectWithoutSpaces));
3000 bShiftDown = aTabRange.
overlaps(aFlyRange);
3020 *
static_cast<SwTextFrame*
>(pFly->GetAnchorFrameContainingAnchPos())))
3022 if (aRectFnSet.
YDiff(nPrtPos, nBottom) < 0)
3026 if (pSpaceBelowBottom && aRectFnSet.
YDiff(aRectFnSet.
GetBottom(aRect), nBottom) < 0)
3028 if (aRectFnSet.
YDiff(aRectFnSet.
GetTop(aRect), aRectFnSet.
GetTop(aFlyRect)) < 0)
3037 bInvalidatePrtArea =
true;
3041 if ((css::text::WrapTextMode_RIGHT == nSurround
3042 || css::text::WrapTextMode_PARALLEL == nSurround)
3047 aRectFnSet.
GetLeft(pFly->GetAnchorFrame()->getFrameArea()));
3048 rLeftOffset = std::max(rLeftOffset, nWidth);
3049 bInvalidatePrtArea =
true;
3051 if ((css::text::WrapTextMode_LEFT == nSurround
3052 || css::text::WrapTextMode_PARALLEL == nSurround)
3056 = aRectFnSet.
XDiff(aRectFnSet.
GetRight(pFly->GetAnchorFrame()->getFrameArea()),
3057 aRectFnSet.
GetLeft(aFlyRect));
3058 rRightOffset = std::max(rRightOffset, nWidth);
3059 bInvalidatePrtArea =
true;
3063 if (pSpaceBelowBottom)
3065 *pSpaceBelowBottom = aRectFnSet.
GetHeight(aRect);
3068 return bInvalidatePrtArea;
3075 OSL_ENSURE( pAttrs,
"TabFrame::Format, pAttrs is 0." );
3085 aRectFnSet.
AddRight( aFrm, nDiff );
3093 SwTwips nUpper = CalcUpperSpace( pAttrs );
3139 bool bCheckBrowseWidth =
false;
3144 switch (
GetFormat()->GetHoriOrient().GetHoriOrient() )
3146 case text::HoriOrientation::LEFT:
3149 nLeftSpacing = nLeftLine + nLeftOffset;
3155 const SwTwips nWishRight = nMax - nWishedTableWidth - nLeftOffset;
3156 if ( nRightOffset > 0 )
3161 nRightSpacing = nRightLine + std::max(
SwTwips(nRightOffset), nWishRight );
3170 nRightSpacing = nRightLine +
3171 ( ( (nWishRight+nLeftOffset) < 0 ) ?
3172 (nWishRight+nLeftOffset) :
3173 std::max(
SwTwips(0), nWishRight ) );
3177 case text::HoriOrientation::RIGHT:
3180 nRightSpacing = nRightLine + nRightOffset;
3186 const SwTwips nWishLeft = nMax - nWishedTableWidth - nRightOffset;
3187 if ( nLeftOffset > 0 )
3192 nLeftSpacing = nLeftLine + std::max(
SwTwips(nLeftOffset), nWishLeft );
3201 nLeftSpacing = nLeftLine +
3202 ( ( (nWishLeft+nRightOffset) < 0 ) ?
3203 (nWishLeft+nRightOffset) :
3204 std::max(
SwTwips(0), nWishLeft ) );
3208 case text::HoriOrientation::CENTER:
3211 const SwTwips nCenterSpacing = ( nMax - nWishedTableWidth ) / 2;
3212 nLeftSpacing = nLeftLine +
3213 ( (nLeftOffset > 0) ?
3214 std::max( nCenterSpacing,
SwTwips(nLeftOffset) ) :
3216 nRightSpacing = nRightLine +
3217 ( (nRightOffset > 0) ?
3218 std::max( nCenterSpacing,
SwTwips(nRightOffset) ) :
3222 case text::HoriOrientation::FULL:
3227 bCheckBrowseWidth =
true;
3228 nLeftSpacing = nLeftLine + nLeftOffset;
3229 nRightSpacing = nRightLine + nRightOffset;
3234 nLeftSpacing = pAttrs->
CalcLeft(
this );
3241 nLeftSpacing = std::max( nLeftSpacing,
SwTwips( nLeftOffset + nLeftLine ) );
3244 nRightSpacing = pAttrs->
CalcRight(
this );
3251 nRightSpacing = std::max( nRightSpacing,
SwTwips( nRightOffset + nRightLine ) );
3255 case text::HoriOrientation::LEFT_AND_WIDTH:
3260 nLeftSpacing = pAttrs->
CalcLeft(
this );
3271 nMax - (nLeftSpacing-pAttrs->
CalcLeftLine()) - nWishedTableWidth;
3272 nRightSpacing = nRightLine +
3273 ( (nRightOffset > 0) ?
3274 std::max( nWishRight,
SwTwips(nRightOffset) ) :
3279 OSL_FAIL(
"Invalid orientation for table." );
3290 if( (nMax -
MINLAY) < (nLeftSpacing + nRightSpacing) )
3293 aRectFnSet.
SetXMargins( *
this, nLeftSpacing, nRightSpacing );
3296 if ( bCheckBrowseWidth &&
3324 SwTwips nRemaining = 0, nDiff;
3332 nRemaining += nUpper + nLower;
3337 else if ( nDiff < 0 )
3345 if( nHeight > 0 && nDist > (
LONG_MAX - nHeight ) )
3357 while ( pFrame &&
GetFollow() != pFrame )
3363 if ( nReal < nDist )
3370 nDist = nTmp < 0 ? 0 : nTmp;
3381#if !ENABLE_WASM_STRIP_ACCESSIBILITY
3453 if(pPage && pPage->
GetUpper() && !IsFollow())
3462 if(rHint.
GetId() == SfxHintId::SwTableHeadingChange)
3467 else if (rHint.
GetId() != SfxHintId::SwLegacyModify)
3471 bool bAttrSetChg = pLegacy->m_pNew &&
RES_ATTRSET_CHG == pLegacy->m_pNew->Which();
3475 auto& rOldSetChg = *
static_cast<const SwAttrSetChg*
>(pLegacy->m_pOld);
3476 auto& rNewSetChg = *
static_cast<const SwAttrSetChg*
>(pLegacy->m_pNew);
3485 UpdateAttr_(pOItem, pNItem, eInvFlags, &aOldSet, &aNewSet);
3493 UpdateAttr_(pLegacy->m_pOld, pLegacy->m_pNew, eInvFlags);
3512 for(sal_uInt16 nIdx = 0; nIdx < nNewRepeat; ++nIdx)
3519 pHeadline->
Paste(
this, pLowerRow);
3529 const sal_uInt16 nWhich = pOld ? pOld->
Which() : pNew ? pNew->
Which() : 0;
3546 if (
GetFormat()->GetPageDesc().GetNumOffset())
3579 if ( pOldSet || pNewSet )
3645#if OSL_DEBUG_LEVEL > 0
3647 OSL_ENSURE( pSect,
"Where does this column come from?");
3648 OSL_ENSURE(
IsAnLower( pSect ),
"Split cell?" );
3656 OSL_ENSURE( pRet->
IsCellFrame(),
"SwTabFrame::FindLastContent failed" );
3706 if ( SwFlowFrame::IsMoveBwdJump() || !IsPrevObjMove() )
3724 bool bMoveAnyway =
false;
3728 if ( !SwFlowFrame::IsMoveBwdJump() )
3734 if(
std::abs( nNewWidth - nOldWidth ) < 2 )
3736 bMoveAnyway = BwdMoveNecessary( pOldPage,
getFrameArea() ) > 1;
3742 while ( pPrevFrame && pPrevFrame !=
this )
3745 pPrevFrame = pPrevFrame->
GetNext();
3747 bMoveAnyway = BwdMoveNecessary( pNewPage, aRect) > 1;
3763 if (0 < nSpace && GetPrecede())
3766 tools::Long nLeftOffsetDummy(0), nRightOffsetDummy(0);
3769 nUpperDummy, nLeftOffsetDummy, nRightOffsetDummy, &nSpace);
3785 bool bFits = nSpace > 0;
3789 bFits = nSpace >= 0;
3809 return nTmpHeight <= nSpace;
3817 OSL_ENSURE(
GetUpper(),
"Cut without Upper()." );
3833 if( !pSct->IsFollow() )
3845 if (
nullptr != pFrame )
3862 if( !pSct->IsFollow() )
3902 bSplitFly = pFlyAtContent->IsFollow();
3904 if (pUp == pFly && bSplitFly)
3917 pTmp->InvalidatePrt_();
3935 if ( pPage && !IsFollow() && pPage->
GetUpper() )
3941 OSL_ENSURE( pParent,
"No parent for pasting." );
3942 OSL_ENSURE( pParent->
IsLayoutFrame(),
"Parent is ContentFrame." );
3943 OSL_ENSURE( pParent !=
this,
"I'm the parent myself." );
3944 OSL_ENSURE( pSibling !=
this,
"I'm my own neighbour." );
3946 "I'm still registered somewhere." );
3985 if ( !pPage || IsFollow() )
4009 , m_pTabLine( &rLine )
4010 , m_pFollowRow( nullptr )
4012 , mnTopMarginForLowers( 0 )
4013 , mnBottomMarginForLowers( 0 )
4014 , mnBottomLineSize( 0 )
4016 , m_bIsFollowFlowRow( false )
4018 , m_bIsRepeatedHeadline( false )
4019 , m_bIsRowSpanLine( false )
4020 , m_bForceRowSplitAllowed( false )
4021 , m_bIsInSplit( false )
4031 for (
size_t i = 0;
i < rBoxes.size(); ++
i )
4034 if ( bHiddenRedlines && RedlineType::Delete == rBoxes[
i]->GetRedlineType() )
4045 sw::BroadcastingModify* pMod =
GetFormat();
4048 pMod->Remove(
this );
4049 if( !pMod->HasWriterListeners() )
4073 if(bInFirstNonHeadlineRow)
4075 if(bInFirstNonHeadlineRow || !
GetNext())
4078 const sw::BroadcastingModify aMod;
4086 if(
GetTabLine() != &pNewFormatHint->m_rTabLine)
4097 bool bInFollowFlowRow =
false;
4099 if(bInFirstNonHeadlineRow ||
4104 if(bInFirstNonHeadlineRow || bInFollowFlowRow)
4114 if(
GetTabLine() != &pMoveTableLineHint->m_rTableLine)
4121 if (rHint.
GetId() != SfxHintId::SwLegacyModify)
4124 if(!pLegacy->m_pNew)
4130 switch(pLegacy->m_pNew->Which())
4164 (void)xmlTextWriterStartElement(writer,
reinterpret_cast<const xmlChar*
>(
"row"));
4167 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"infos"));
4169 (void)xmlTextWriterEndElement(writer);
4172 (void)xmlTextWriterEndElement(writer);
4180 static_cast<const SwSectionFrame*
>(pFrame)->ContainsContent() : pFrame;
4185 bool bIsFollow(
false );
4217 pAnchoredObj->FindAnchorCharFrame() != pTmp )
4225 const SwFrameFormat& rFrameFormat = pAnchoredObj->GetFrameFormat();
4227 bool bIsFarAway = pAnchoredObj->GetObjRect().Top() !=
FAR_AWAY;
4229 bool bIsAnchoredToTmpFrm =
false;
4230 if ( pPageFrm && pPageFrm->
IsPageFrame() && pAnchoredObj->GetPageFrame())
4231 bIsAnchoredToTmpFrm = pAnchoredObj->GetPageFrame() == pPageFrm ||
4233 const bool bConsiderObj =
4236 bFollowTextFlow && bIsAnchoredToTmpFrm;
4238 bool bInBackground = !rFrameFormat.
GetOpaque().GetValue();
4240 bool bConsiderFollowTextFlow = bInBackground
4243 if (pFrame->
IsInTab() && bFollowTextFlow && bWrapThrough && bConsiderFollowTextFlow)
4256 const SwTwips nDistOfFlyBottomToAnchorTop =
4257 aRectFnSet.
GetHeight(pAnchoredObj->GetObjRect()) +
4259 pAnchoredObj->GetCurrRelPos().X() :
4260 pAnchoredObj->GetCurrRelPos().Y() );
4267 nHeight = std::max( nHeight, nDistOfFlyBottomToAnchorTop + nFrameDiff -
4277 const SwTwips nDistOfFlyBottomToAnchorTop2 = aRectFnSet.
YDiff(
4278 aRectFnSet.
GetBottom(pAnchoredObj->GetObjRect()),
4281 nHeight = std::max( nHeight,
tools::Long(nDistOfFlyBottomToAnchorTop2 ));
4290 if( !
static_cast<const SwSectionFrame*
>(pFrame)->IsAnLower( pTmp ) )
4305 nTopSpace =
static_cast<const SwRowFrame*
>(rCell.
GetUpper())->GetTopMarginForLowers();
4306 nBottomSpace =
static_cast<const SwRowFrame*
>(rCell.
GetUpper())->GetBottomMarginForLowers();
4312 nTopSpace = rAttrs.
CalcLeft( &rCell );
4313 nBottomSpace = rAttrs.
CalcRight( &rCell );
4322 return nTopSpace + nBottomSpace;
4329 const bool _bConsiderObjs,
4349 nHeight += nLowHeight;
4351 if ( _bConsiderObjs )
4353 nFlyAdd = std::max(
tools::Long(0), nFlyAdd - nLowHeight );
4366 if ( _pCell->
Lower() )
4383 const bool _bConsiderObjs )
4398 bool bSplitFly =
false;
4440 if ( 1 == nRowSpan )
4444 else if ( -1 == nRowSpan )
4452 while ( pMasterRow && pMasterRow != _pRow )
4455 pMasterRow = pMasterRow->
GetNext();
4475 sal_uInt16 nTopSpace = 0;
4477 pCurrLower =
static_cast<const SwCellFrame*
>(pCurrLower->GetNext()) )
4479 sal_uInt16 nTmpTopSpace = 0;
4480 if ( pCurrLower->Lower() && pCurrLower->Lower()->IsRowFrame() )
4488 nTopSpace = std::max( nTopSpace, nTmpTopSpace );
4496 sal_uInt16 nTopLineDist = 0;
4498 pCurrLower =
static_cast<const SwCellFrame*
>(pCurrLower->GetNext()) )
4500 sal_uInt16 nTmpTopLineDist = 0;
4501 if ( pCurrLower->Lower() && pCurrLower->Lower()->IsRowFrame() )
4509 nTopLineDist = std::max( nTopLineDist, nTmpTopLineDist );
4511 return nTopLineDist;
4517 sal_uInt16 nBottomLineSize = 0;
4519 pCurrLower =
static_cast<const SwCellFrame*
>(pCurrLower->GetNext()) )
4521 sal_uInt16 nTmpBottomLineSize = 0;
4522 if ( pCurrLower->Lower() && pCurrLower->Lower()->IsRowFrame() )
4524 const SwFrame* pRow = pCurrLower->GetLastLower();
4534 nBottomLineSize = std::max( nBottomLineSize, nTmpBottomLineSize );
4536 return nBottomLineSize;
4542 sal_uInt16 nBottomLineDist = 0;
4544 pCurrLower =
static_cast<const SwCellFrame*
>(pCurrLower->GetNext()) )
4546 sal_uInt16 nTmpBottomLineDist = 0;
4547 if ( pCurrLower->Lower() && pCurrLower->Lower()->IsRowFrame() )
4549 const SwFrame* pRow = pCurrLower->GetLastLower();
4558 nBottomLineDist = std::max( nBottomLineDist, nTmpBottomLineDist );
4560 return nBottomLineDist;
4580 if (!pLine || !pTab || !pTab->IsFollow())
4586 if (pCurRow != &rRow && pCurRow->
GetTabLine() == pLine)
4597 if (pCurTab && pCurTab->IsAnFollow(pTab))
4601 nResult += aRectFnSet.
GetHeight(pCurRow->getFrameArea());
4611 OSL_ENSURE( pAttrs,
"SwRowFrame::Format without Attrs." );
4651 while ( pTmpRow && !pPrevTabLine )
4658 while ( rLines[ nIdx ] != pTmpRow->
GetTabLine() )
4664 pPrevTabLine = rLines[ nIdx - 1 ];
4686 if ( pRow->GetTabLine() == pPrevTabLine &&
4687 !pRow->IsRepeatedHeadline() )
4689 pPreviousRow = pRow;
4695 sal_uInt16 nTopPrtMargin = nTopSpace;
4698 const sal_uInt16 nTmpPrtMargin = pPreviousRow->
GetBottomLineSize() + nTopLineDist;
4699 if ( nTmpPrtMargin > nTopPrtMargin )
4700 nTopPrtMargin = nTmpPrtMargin;
4733#if OSL_DEBUG_LEVEL > 0
4750 Shrink( nDiff,
false,
true );
4751 else if ( nDiff < 0 )
4766 pSibling = pSibling->
GetNext();
4767 }
while ( pSibling );
4783#if !ENABLE_WASM_STRIP_ACCESSIBILITY
4815 SwFrame* pToAdjustRow =
nullptr;
4822 pToAdjustRow = pToAdjust->
GetUpper();
4826 pToAdjust = pCellFrame;
4827 pToAdjustRow =
this;
4833 while ( pToAdjustRow )
4836 nSumRowHeight += pToAdjustRow ==
this ?
4840 if ( nRowSpan-- == 1 )
4843 pToAdjustRow = pToAdjustRow->
GetNext();
4846 if ( pToAdjustRow && pToAdjustRow !=
this )
4852#if !ENABLE_WASM_STRIP_ACCESSIBILITY
4857 pNotify = pToAdjust;
4862#if !ENABLE_WASM_STRIP_ACCESSIBILITY
4902 bool bRestrictTableGrowth;
4908 bRestrictTableGrowth = pFollowFlowRow && !pFollowFlowRow->
IsRowSpanLine();
4913 bRestrictTableGrowth =
GetFollowRow() && bHasFollowFlowLine;
4914 OSL_ENSURE( !bRestrictTableGrowth || !
GetNext(),
4915 "GetFollowRow for row frame that has a Next" );
4918 const SwTwips nAdditionalSpace =
4920 if ( bRestrictTableGrowth && nAdditionalSpace > 0 )
4922 nReal =
std::min( nAdditionalSpace, nDist );
4932 if ( bRestrictTableGrowth )
4973 const bool bShrinkAnyway = bInfo;
4992 OSL_ENSURE(
FindTabFrame(),
"<SwRowFrame::ShrinkFrame(..)> - no table frame -> crash." );
4993 const bool bConsiderObjs(
FindTabFrame()->IsConsiderObjsForMinCellHeight() );
5000 if ( nRealDist < 0 )
5010 aRectFnSet.
SetHeight( aFrm, nHeight - nReal );
5014 aFrm.
Pos().AdjustX(nReal );
5020 if ( !bShrinkAnyway && !
GetNext() && nTmp != nReal )
5029 aRectFnSet.
SetHeight( aFrm, nHeight + nReal );
5033 aFrm.
Pos().AdjustX( -nReal );
5098 static_cast<const SwTextFrame*
>(pText)->GetTextNodeForParaProps()->GetSwAttrSet().GetKeep(bCheckParents).GetValue();
5103 , m_pTabBox( &rBox )
5107 if ( !bInsertContent )
5120 for (
size_t i = 0;
i < rLines.
size(); ++
i )
5131 sw::BroadcastingModify* pMod =
GetFormat();
5136#if !ENABLE_WASM_STRIP_ACCESSIBILITY
5145 pMod->Remove(
this );
5146 if( !pMod->HasWriterListeners() )
5165 if( nFrameTop != lYStart )
5173 aRectFnSet.
SubTop( aFrm, -lDiff );