20#include <config_wasm_strip.h>
63#include <lineinfo.hxx>
84 : m_pMerged(rFrame.GetMergedPara())
85 , m_pNode(m_pMerged ? nullptr : rFrame.GetTextNodeFirst())
95 while (m_CurrentExtent < m_pMerged->extents.size())
100 while (m_CurrentHint < pHints->
Count())
116 *ppNode = rExtent.
pNode;
123 if (m_CurrentExtent < m_pMerged->extents.size() &&
136 if (m_CurrentHint < pHints->
Count())
152 : m_pNode(rFrame.GetMergedPara() ? nullptr : rFrame.GetTextNodeFirst())
161 m_Hints.emplace_back(pNode, pHint);
173 if (m_CurrentHint < pHints->
Count())
222 pHints->SortIfNeedBe();
254 *ppNode = rExtent.
pNode;
297 SwNodeOffset const nFirst(pMerged->pFirstNode->GetIndex());
298 SwNodeOffset const nLast(pMerged->pLastNode->GetIndex());
299 return (nFirst <= nNodeIndex && nNodeIndex <= nLast);
353 std::pair<SwTextNode *, SwTextNode *>
363 return std::make_pair(pMerged->pFirstNode,
const_cast<SwTextNode*
>(pMerged->pLastNode));
367 return std::make_pair(pTextNode, pTextNode);
373 rNode.SwContentNode::GetAttr(rFormatSet);
377 if (
sw::MergedPara const*
const pMerged = pFrame ? pFrame->GetMergedPara() :
nullptr)
379 if (pMerged->pFirstNode != &rNode)
384 "first-node items must be adjacent");
386 pMerged->pFirstNode->SwContentNode::GetAttr(firstSet);
387 rFormatSet.
Put(firstSet);
390 if (pMerged->pParaPropsNode != &rNode)
406 propsSet(*rFormatSet.
GetPool());
407 pMerged->pParaPropsNode->SwContentNode::GetAttr(propsSet);
408 rFormatSet.
Put(propsSet);
409 return *pMerged->pParaPropsNode;
428 aPrt.
Pos().setX( aPrt.
Pos().Y() );
432 aPrt.
Pos().setY( nPrtOfstX );
442 aPrt.
Pos().setY( aPrt.
Pos().X() );
446 aPrt.
Pos().setX( nPrtOfstY );
463 aFrm.
Height( nFrameWidth );
523 rRect.
Width( nHeight );
538 "SwTextFrame::SwitchHorizontalToVertical, IsVertLRBT, not swapped");
539 Point aPoint(rPoint);
571 Point aTmp( 0, nLimit );
613 rRect.
Width( nWidth );
662 Point aTmp( nLimit, 0 );
668 : pFrame( pTextFrame ), bUndo( false )
691 rRect.
Width( nWidth );
702 m_rOut( rOutp ), m_nOldLayoutMode( rOutp.GetLayoutMode() )
725 rOut( rOutp ), nOldLanguageType( rOutp.GetDigitLanguage() )
752 OSL_ENSURE( !
IsLocked(),
"+SwTextFrame::Init: this is locked." );
769 , mnFlyAnchorOfst( 0 )
770 , mnFlyAnchorOfstNoWrap( 0 )
771 , mnFlyAnchorVertOfstNoWrap( 0 )
772 , mnFootnoteLine( 0 )
773 , mnHeightOfLastLine( 0 )
774 , mnAdditionalFirstLineOffset( 0 )
776 , mnCacheIndex( USHRT_MAX )
779 , mbJustWidow( false )
781 , mbInFootnoteConnect( false )
782 , mbFootnote( false )
784 , mbHasRotatedPortions( false )
785 , mbFieldFollow( false )
786 , mbHasAnimation( false )
787 , mbIsSwapped( false )
788 , mbFollowFormatAllowed( true )
806 std::vector<std::pair<sal_Int32, sal_Int32>>
const*
const pExtents)
808 if (pExtents && pExtents->empty())
818 while (
nPos && rTextNode == (rFootnoteIdxs[
nPos ]->GetTextNode()))
820 if (
nPos || rTextNode != (rFootnoteIdxs[
nPos ]->GetTextNode()))
831 while ((*pExtents)[iter].second <= pTextFootnote->GetStart())
834 if (iter == pExtents->size())
839 if (pTextFootnote->
GetStart() < (*pExtents)[iter].first)
863 if (e.pNode != pNode)
886 pView->GetEditWin().GetFrameControlsManager().RemoveControls(
this);
902 bool const isRealInsert,
903 SwTextNode const& rNode, sal_Int32
const nIndex, sal_Int32
const nLen)
905 assert(!isRealInsert || nLen);
914 sal_Int32 nTFIndex(0);
915 sal_Int32 nInserted(0);
916 bool bInserted(
false);
917 bool bFoundNode(
false);
918 auto itInsert(rMerged.
extents.end());
919 for (
auto it = rMerged.
extents.begin(); it != rMerged.
extents.end(); ++it)
921 if (it->pNode == &rNode)
926 if (it->nStart <=
nIndex && nIndex <= it->nEnd)
935 else if (nIndex < it->nStart)
937 if (itInsert == rMerged.
extents.end())
947 assert(it == rMerged.
extents.begin() || (it-1)->pNode != &rNode || (it-1)->nEnd <
nIndex);
948 if (
nIndex + nLen < it->nStart)
953 if (nIndex < it->nStart)
955 text.insert(nTFIndex,
957 nInserted += it->nStart -
nIndex;
961 assert(it->nStart <=
nIndex);
962 if (nIndex <= it->nEnd)
964 nTFIndex += it->nEnd - it->nStart;
965 while (it->nEnd <
nIndex + nLen)
968 (it+1) != rMerged.
extents.end() && (it+1)->pNode == it->pNode
971 if (pNext && pNext->nStart <=
nIndex + nLen)
973 text.insert(nTFIndex,
974 rNode.
GetText().subView(it->nEnd, pNext->nStart - it->nEnd));
975 nTFIndex += pNext->nStart - it->nEnd;
976 nInserted += pNext->nStart - it->nEnd;
977 pNext->nStart = it->nStart;
978 it = rMerged.
extents.erase(it);
982 text.insert(nTFIndex,
983 rNode.
GetText().subView(it->nEnd,
nIndex + nLen - it->nEnd));
984 nTFIndex +=
nIndex + nLen - it->nEnd;
985 nInserted +=
nIndex + nLen - it->nEnd;
994 else if (rNode.
GetIndex() < it->pNode->GetIndex() || bFoundNode)
996 if (itInsert == rMerged.
extents.end())
1002 if (itInsert == rMerged.
extents.end())
1004 nTFIndex += it->nEnd - it->nStart;
1013 if (rMerged.
extents.size() == 1
1033 bool const isRealDelete,
1034 SwTextNode const& rNode, sal_Int32 nIndex, sal_Int32
const nLen)
1039 sal_Int32 nTFIndex(0);
1040 sal_Int32 nToDelete(nLen);
1041 sal_Int32 nDeleted(0);
1042 size_t nFoundNode(0);
1044 auto it = rMerged.
extents.begin();
1045 for (; it != rMerged.
extents.end(); )
1048 if (it->pNode == &rNode)
1051 if (
nIndex + nToDelete < it->nStart)
1063 if (nIndex < it->nStart)
1066 nToDelete -= it->nStart -
nIndex;
1070 if (it->nStart <=
nIndex && nIndex < it->nEnd)
1072 sal_Int32
const nDeleteHere(
nIndex + nToDelete <= it->nEnd
1075 text.remove(nTFIndex + (
nIndex - it->nStart), nDeleteHere);
1076 bErase = nDeleteHere == it->nEnd - it->nStart;
1080 assert(it->nStart ==
nIndex);
1081 it = rMerged.
extents.erase(it);
1083 else if (isRealDelete)
1085 it->nStart -= (nLen - nToDelete);
1086 it->nEnd -= (nLen - nToDelete + nDeleteHere);
1087 if (it != rMerged.
extents.begin()
1088 && (it-1)->pNode == &rNode
1089 && (it-1)->nEnd == it->nStart)
1091 nTFIndex += it->nEnd - it->nStart;
1092 (it-1)->nEnd = it->nEnd;
1093 it = rMerged.
extents.erase(it);
1099 if (
nIndex + nDeleteHere == it->nEnd)
1101 it->nEnd -= nDeleteHere;
1105 if (
nIndex == it->nStart)
1107 it->nStart += nDeleteHere;
1111 sal_Int32
const nOldEnd(it->nEnd);
1113 it = rMerged.
extents.emplace(it+1,
1114 it->pNode,
nIndex + nDeleteHere, nOldEnd);
1116 assert(nDeleteHere == nToDelete);
1119 nDeleted += nDeleteHere;
1120 nToDelete -= nDeleteHere;
1122 if (!isRealDelete && nToDelete == 0)
1129 else if (nFoundNode != 0)
1135 nTFIndex += it->nEnd - it->nStart;
1145 if (nErased && nErased == nFoundNode)
1153 : rMerged.
extents.front().pNode;
1163std::pair<SwTextNode*, sal_Int32>
1166 sal_Int32
nIndex(i_nIndex);
1168 for (
const auto& rExt : rMerged.
extents)
1177 assert(
nIndex == 0 &&
"view index out of bounds");
1179 ? std::make_pair(pExtent->
pNode, pExtent->
nEnd)
1188 bool bFoundNode(
false);
1189 for (
auto const& e : rMerged.
extents)
1191 if (pNode->
GetIndex() < e.pNode->GetIndex())
1195 if (e.pNode == pNode)
1201 else if (
nIndex < e.nStart)
1208 else if (bFoundNode)
1212 nRet += e.nEnd - e.nStart;
1217 assert(nIndex <= pNode->Len());
1220 else if (rMerged.
extents.empty())
1222 assert(nIndex <= pNode->Len());
1230std::pair<SwTextNode*, sal_Int32>
1241 return std::make_pair(
static_cast<SwTextNode*
>(
const_cast<sw::BroadcastingModify*
>(
1321 return pMerged->
extents.empty()
1323 : pMerged->
extents.front().pNode;
1344 sal_uInt16
const nScript,
bool const bNoChar)
const
1348 return pos.first->GetLang(
pos.second, bNoChar ? 0 : 1, nScript);
1356 pPara->ResetPreps();
1370 bool bHiddenCharsHidePara(
false);
1371 bool bHiddenParaField(
false);
1379 nHiddenStart, nHiddenEnd);
1386 nHiddenStart, nHiddenEnd);
1391 bHiddenCharsHidePara =
true;
1395 int nNewResultWeight = 0;
1403 if (nCurWeight > nNewResultWeight)
1405 nNewResultWeight = nCurWeight;
1408 else if (nCurWeight == nNewResultWeight && bHiddenParaField)
1425 if ( pVsh && ( bHiddenCharsHidePara || bHiddenParaField ) )
1429 ( bHiddenParaField &&
1432 ( bHiddenCharsHidePara &&
1439 bool isAllHidden(
true);
1441 pNext !=
nullptr; pNext = pNext->
FindNextCnt(
true))
1443 if (!pNext->IsTextFrame()
1446 isAllHidden =
false;
1452 SAL_INFO(
"sw.core",
"unhiding one body paragraph");
1467 "HideHidden on visible frame of hidden frame has follow" );
1514 if (_eAnchorType == RndStdIds::FLY_AT_CHAR)
1527 ? rNode.
GetText()[nObjAnchorPos]
1536 static_cast<const SwTextFlyCnt*
>(pHint)->GetFlyCnt().GetFrameFormat();
1547 aRectFnSet.
SetWidth( aLastCharRect, 1 );
1583 if ((eAnchorType != RndStdIds::FLY_AT_CHAR) ||
1596 const bool bShouldBeHidden = !pVsh || !pVsh->
GetWin() ||
1609 if (eAnchorType == RndStdIds::FLY_AT_PARA)
1613 else if ((eAnchorType == RndStdIds::FLY_AT_CHAR) ||
1614 (eAnchorType == RndStdIds::FLY_AS_CHAR))
1616 sal_Int32 nHiddenStart;
1617 sal_Int32 nHiddenEnd;
1633 OSL_FAIL(
"<SwTextFrame::HideAndShowObjects()> - object not anchored at/inside paragraph!?" );
1642 OSL_ENSURE(pMaster,
"SwTextFrame without master");
1658 sal_Int32 nFound = sal_Int32(nStart);
1659 const sal_Int32 nEndLine =
std::min(sal_Int32(nEnd), sal_Int32(aText.size()) - 1);
1662 while( nFound <= nEndLine &&
' ' == aText[nFound] )
1671 while( nFound <= nEndLine &&
' ' != aText[nFound] )
1684#if defined __GNUC__ && !defined __clang__
1685#pragma GCC diagnostic push
1686#pragma GCC diagnostic ignored "-Wstrict-overflow"
1689#if defined __GNUC__ && !defined __clang__
1690#pragma GCC diagnostic pop
1707 return pPara && (
nPos <= nMax + pPara->
GetLen() );
1737 if(aRange != rReformat) {
1741 rReformat += aRange;
1753 "SwTextFrame::CalcLineSpace with swapped frame!" );
1822 sal_Int32
const nPos, sal_Int32
const nCnt,
bool const bMove)
1824 if ( !rFrame.IsFollow() )
1852 const sal_Int32 nEnd =
nPos + (nCnt > 0 ? nCnt : 1 );
1909 bool & o_rbRecalcFootnoteFlag,
1912 sal_Int32
const nDestStart,
1913 sal_Int32
const nSourceStart,
1914 sal_Int32
const nLen)
1916 std::vector<std::pair<sal_Int32, sal_Int32>> deleted;
1917 sal_Int32
const nSourceEnd(nSourceStart + nLen);
1918 sal_Int32 nLastEnd(0);
1919 for (
const auto& rExt : rMerged.
extents)
1921 if (rExt.pNode == &rNode)
1923 sal_Int32
const nStart(std::max(nLastEnd, nSourceStart));
1924 sal_Int32
const nEnd(
std::min(rExt.nStart, nSourceEnd));
1927 deleted.emplace_back(nStart, nEnd);
1929 nLastEnd = rExt.nEnd;
1930 if (nSourceEnd <= rExt.nEnd)
1935 else if (rNode.
GetIndex() < rExt.pNode->GetIndex())
1940 if (nLastEnd != rNode.
Len())
1942 if (nLastEnd < nSourceEnd)
1944 deleted.emplace_back(std::max(nLastEnd, nSourceStart), nSourceEnd);
1947 if (deleted.empty())
1950 o_rbRecalcFootnoteFlag =
true;
1951 for (
auto const& it : deleted)
1953 sal_Int32
const nStart(it.first - nSourceStart + nDestStart);
1955 rDestNode, nStart, it.second - it.first);
1961 lcl_SetWrong(rTextFrame, rDestNode, nStart, it.first - it.second,
false);
1963 lcl_ModifyOfst(rTextFrame, nIndex, nDeleted, &o3tl::operator-<sal_Int32, Tag_TextFrameIndex>);
1974#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1982 for( sal_uInt16 nWhich : rWhichFmtAttr )
2007 sal_uInt16 nWhich = 0;
2008 if (rHint.
GetId() == SfxHintId::SwLegacyModify)
2011 pOld = pHint->m_pOld;
2012 pNew = pHint->m_pNew;
2013 nWhich = pHint->GetWhich();
2015 else if (rHint.
GetId() == SfxHintId::SwInsertText)
2019 else if (rHint.
GetId() == SfxHintId::SwDeleteText)
2023 else if (rHint.
GetId() == SfxHintId::SwDeleteChar)
2027 else if (rHint.
GetId() == SfxHintId::SwDocPosUpdateAtIndex)
2036 &pDocPosAt->m_rNode,
2037 pDocPosAt->m_nIndex));
2041 else if (
auto const pHt =
dynamic_cast<sw::MoveText const*
>(&rHint))
2047 pRedlineDelText = pHynt;
2051 pRedlineUnDelText = pHnt;
2055 assert(!
"unexpected hint");
2074 if (pAttrNode != &rModify)
2113 bool bSetFieldsDirty =
false;
2114 bool bRecalcFootnoteFlag =
false;
2116 if (pRedlineDelText)
2120 sal_Int32
const nNPos = pRedlineDelText->
nStart;
2121 sal_Int32
const nNLen = pRedlineDelText->
nLen;
2125 const sal_Int32
m = -nNLen;
2134 bSetFieldsDirty = bRecalcFootnoteFlag =
true;
2139 else if (pRedlineUnDelText)
2143 sal_Int32
const nNPos = pRedlineUnDelText->
nStart;
2144 sal_Int32
const nNLen = pRedlineUnDelText->
nLen;
2162 bSetFieldsDirty =
true;
2175 bRecalcFootnoteFlag,
2187 else if (pInsertText)
2191 bool isHidden(
false);
2224 bSetFieldsDirty =
true;
2229 else if (pDeleteText)
2240 const sal_Int32
m = -pDeleteText->
nLen;
2252 bSetFieldsDirty = bRecalcFootnoteFlag =
true;
2256 else if (pDeleteChar)
2272 bSetFieldsDirty = bRecalcFootnoteFlag =
true;
2276 else switch (nWhich)
2288 sal_Int32
const nNPos = pNewUpdate->
getStart();
2289 sal_Int32
const nNLen = pNewUpdate->
getEnd() - nNPos;
2308 lcl_SetWrong( *
this, rNode, nNPos, nNPos + nNLen,
false );
2313#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2354 sal_Int32
const nNPos =
static_cast<const SwFormatField*
>(pNew)->GetTextField()->GetStart();
2368 bSetFieldsDirty =
true;
2381 assert(rNode ==
static_cast<const SwFormatFootnote*
>(pNew)->GetTextFootnote()->GetTextNode());
2383 static_cast<const SwFormatFootnote*
>(pNew)->GetTextFootnote()->GetStart());
2417 if( pItem == pOldItem )
2428 bool bLineSpace = SfxItemState::SET == rNewSet.
GetItemState(
2432 if ( bLineSpace || bRegister )
2488 if( !pFly->IsFlyInContentFrame() )
2491 pFly->GetAttrSet()->GetBackground();
2503 pFly->SetCompletePaint();
2504 pFly->InvalidatePage();
2511 if ( SfxItemState::SET ==
2517 else if ( SfxItemState::SET ==
2519 SfxItemState::SET ==
2521 SfxItemState::SET ==
2524 else if ( SfxItemState::SET ==
2526 SfxItemState::SET ==
2528 SfxItemState::SET ==
2531 else if ( SfxItemState::SET ==
2591 if ( 0x04 & nClear )
2604 if ( 0x08 & nClear )
2618#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2634 bSetFieldsDirty =
true;
2649 if (
nullptr != pNxt )
2655 if( bSetFieldsDirty )
2658 if ( bRecalcFootnoteFlag )
2690 OSL_ENSURE(
GetFollow() && nNeed,
"+SwTextFrame::Prepare: lost all friends");
2697 sal_uInt16 nHave = nNeed;
2753 if( pFrame->HasFollow() )
2764#if defined __GNUC__ && !defined __clang__
2765# pragma GCC diagnostic push
2766# pragma GCC diagnostic ignored "-Wstrict-overflow"
2771 bool bParaPossiblyInvalid =
false;
2799 if( aTextFly.
IsOn() )
2802 if ( aTextFly.
Relax() || IsUndersized() )
2816 return bParaPossiblyInvalid;
2831 OSL_ENSURE( !
IsLocked(),
"SwTextFrame::Prepare: three of a perfect pair" );
2836 return bParaPossiblyInvalid;
2878 return bParaPossiblyInvalid;
2880 PrepWidows( *
static_cast<const sal_uInt16 *
>(pVoid), bNotify );
2960 const sal_uInt16 nWhich = pHt->Which();
2967 if( IsUndersized() )
2986 bool bFormat = pPara->
HasFly();
3001 for (
size_t i = 0;
i < nCnt; ++
i )
3007 == RndStdIds::FLY_AT_CHAR )
3018 if( aTextFly.
IsOn() )
3021 const bool bRelaxed = aTextFly.
Relax();
3022 bFormat = bRelaxed || IsUndersized();
3056 return bParaPossiblyInvalid;
3058 if (bParaPossiblyInvalid)
3074 bParaPossiblyInvalid =
true;
3080 if (
nullptr != pNxt )
3095 OSL_ENSURE(
GetFollow(),
"PrepareHint::FootnoteInvalidationGone may only be called by Follow" );
3102 return bParaPossiblyInvalid;
3119 return bParaPossiblyInvalid;
3150 return bParaPossiblyInvalid;
3158 return bParaPossiblyInvalid;
3160#if defined __GNUC__ && !defined __clang__
3161# pragma GCC diagnostic pop
3183 : pFrame( pTextFrame )
3196 aRectFnSet.
SetHeight( aFrm, nMaxHeight );
3218 aRectFnSet.
SetPosY(aPrt, nUpper );
3229 OSL_ENSURE( !
pFrame->
IsSwapped(),
"A frame is swapped before Format_" );
3242 OSL_ENSURE( !
pFrame->
IsSwapped(),
"A frame is swapped after Format_" );
3287 "SwTextFrame::WouldFit with swapped frame" );
3305 if( rMaxHeight < nHeight )
3309 rMaxHeight -= nHeight;
3316 OSL_ENSURE(
HasPara() ||
IsHiddenNow(),
"WouldFit: GetFormatted() and then !HasPara()" );
3365 bSplit = !aFrameBreak.
IsInside( aLine );
3375 }
while ( aLine.
Next() );
3384 "SwTextFrame::GetParHeight with swapped frame" );
3390 if( IsUndersized() )
3393 nRet = o3tl::narrowing<sal_uInt16>(
EmptyHeight());
3409 while ( pLineLayout && pLineLayout->
GetNext() )
3411 pLineLayout = pLineLayout->
GetNext();
3432 Calc(pRenderContext);
3439 if( bFormat && !
FormatQuick( bForceQuickFormat ) )
3468 aFrm.
Width( nPageWidth );
3473 aPrt.
Width( nPageWidth );
3480 aFrm.
Pos().AdjustX(nOldFrameWidth - nPageWidth );
3495 aFrm.
Width( nOldFrameWidth );
3500 aFrm.
Pos() = aOldFramePos;
3506 aPrt.
Width( nOldPrtWidth );
3544 pTextNode->
GetNumRule()->
Get( o3tl::narrowing<sal_uInt16>(nListLevel) );
3573 nNumberPortionWidth += pPortion->
Width();
3584 else if ( rNumFormat.
GetNumAdjust() == SvxAdjust::Center )
3614 OSL_ENSURE( pVsh,
"<SwTextFrame::_GetHeightOfLastLineForPropLineSpacing()> - no SwViewShell" );
3630 OSL_ENSURE(
pOut,
"<SwTextFrame::_GetHeightOfLastLineForPropLineSpacing()> - no OutputDevice" );
3654 assert(
pLastFont &&
"coverity[var_deref_model] - pLastFont should be set in SwSubFont::ChgFnt");
3665 assert(
pLastFont &&
"coverity[var_deref_model] - pLastFont should be set in SwSubFont::ChgFnt");
3668 pOut->SetFont( aOldFont );
3676 if ( IsUndersized() )
3682 bool bCalcHeightOfLastLine =
true;
3686 bCalcHeightOfLastLine =
false;
3689 if ( bCalcHeightOfLastLine )
3692 "<SwTextFrame::CalcHeightOfLastLine()> - missing paragraph portions." );
3694 while ( pLineLayout && pLineLayout->
GetNext() )
3697 pLineLayout = pLineLayout->
GetNext();
3701 SwTwips nAscent, nDescent, nDummy1, nDummy2;
3712 const SwTwips nNewHeightOfLastLine = nAscent + nDescent;
3716 if ( nNewHeightOfLastLine == 0 )
3753 case SvxInterLineSpaceRule::Prop:
3755 if ( _bNoPropLineSpace )
3774 case SvxInterLineSpaceRule::Fix:
3803 sal_uInt16 nHeight(0);
3806 nHeight += pLine->Height();
3807 bool hasNonFly(
false);
3808 for (
SwLinePortion const* pPortion = pLine->GetFirstPortion();
3811 switch (pPortion->GetWhichPor())
3838 sal_uInt16 nRet = 0;
3860 sal_uInt32 nNew = 0;
3892 while( pNxt && pNxt->
IsInTab() )
3895 if(
nullptr != pNxt )
3929 else if ( bRestart &&
FindPageFrame()->FindFirstBodyContent() ==
this )
3950 if ( nOld == nNewNum )
4014 if ( 0 != aRectFnSet.
GetWidth(aRect) )
4019 aRectFnSet.
GetRight(aFlyRect) >= 0 )
4022aFlyRect, aRectFnSet.
GetLeft(aRect) );
4023 nRet = aRectFnSet.
GetLeft(aRect);
4030 if ( aRectFnSet.
GetLeft(aFlyRect) -
4031 aRectFnSet.
GetLeft(aRect) >= 0 )
4034aFlyRect, aRectFnSet.
GetRight(aRect) + 1 );
4044 while ( aRectFnSet.
GetWidth(aFlyRect) > 0 );
4052 "SwTextFrame::CalcBasePosForFly with swapped frame!" );
4064 SwTwips nFlyAnchorVertOfstNoWrap = 0;
4072 nFlyAnchorVertOfstNoWrap += pLay->
Height();
4077 nLineHeight = pLay->
Height();
4120 SwRect aRec( pFrame->GetPaintArea() );
@ CONSIDER_WRAP_ON_OBJECT_POSITION
@ USE_FORMER_TEXT_WRAPPING
@ ADD_VERTICAL_FLY_OFFSETS
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
virtual OutputDevice * getReferenceDevice(bool bCreate) const =0
Returns the current reference device.
virtual bool SetFieldsDirty(bool b, const SwNode *pChk, SwNodeOffset nLen)=0
Provides access to settings of a document.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
SdrObjUserCall * GetUserCall() const
void Broadcast(const SfxHint &rHint)
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr tools::Long Height() const
void setHeight(tools::Long nHeight)
const Color & GetColor() const
SvxGraphicPosition GetGraphicPos() const
sal_uInt16 GetPropLineSpace() const
SvxInterLineSpaceRule GetInterLineSpaceRule() const
short GetInterLineSpace() const
wrapper class for the positioning of Writer fly frames and drawing objects
virtual SwFrameFormat & GetFrameFormat()=0
virtual const SwFlyFrame * DynCastFlyFrame() const
void ClearItem(sal_uInt16 nWhichL)
const SwFormatLineNumber & GetLineNumber(bool=true) const
const SvxLineSpacingItem & GetLineSpacing(bool=true) const
tools::Long CalcLeft(const SwFrame *pCaller) const
tools::Long CalcRight(const SwFrame *pCaller) const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
SwContentFrame * GetPrevContentFrame() const
virtual void DestroyImpl() override
SwContentFrame * GetNextContentFrame() const
SwTextFrame * FindMaster() const
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
LanguageType nOldLanguageType
SwDigitModeModifier(const OutputDevice &rOutp, LanguageType eCurLang)
const OutputDevice & rOut
const SwFootnoteInfo & GetFootnoteInfo() const
bool FieldHidesPara(const SwField &rField) const
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
const SwLineNumberInfo & GetLineNumberInfo() const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
SwFootnoteIdxs & GetFootnoteIdxs()
IDocumentSettingAccess const & getIDocumentSettingAccess() const
int FieldCanHideParaWeight(SwFieldIds eFieldId) const
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
SwFrameControlsManager & GetFrameControlsManager()
SwFieldType * GetTyp() const
void SetDevFont(const SwViewShell *pSh, OutputDevice &rOut)
To take Asian or other languages into consideration, an SwFont object consists of 3 SwSubFonts (Latin...
void SetFntChg(const bool bNew)
void ChgPhysFnt(SwViewShell const *pSh, OutputDevice &rOut)
tools::Long GetHeight() const
const SwNodeIndex * GetContentIdx() const
void setSwRect(const SwRect &rNew)
void setSwRect(const SwRect &rNew)
const SwRect & getFrameArea() const
bool isFrameAreaDefinitionValid() const
const SwRect & getFramePrintArea() const
bool isFramePrintAreaValid() const
bool isFrameAreaSizeValid() const
A container for the Header/Footer, PageBreak, and Outline Content Visibility controls.
void SetOutlineContentVisibilityButton(const SwContentFrame *pContentFrame)
Helper class which can be used instead of the macros if a function has too many returns.
SwFrameSwapper(const SwTextFrame *pFrame, bool bSwapIfNotSwapped)
const SwTextFrame * pFrame
Base class of the Writer layout elements.
void InvalidateLineNum_()
void SetDerivedR2L(bool bNew)
void CheckDirChange()
checks the layout direction and invalidates the lower frames recursively, if necessary.
SwSectionFrame * FindSctFrame()
SwContentFrame * FindPrevCnt()
SwTabFrame * FindTabFrame()
bool IsInFootnote() const
virtual void Calc(vcl::RenderContext *pRenderContext) const
const SwSortedObjs * GetDrawObjs() const
static SwCache & GetCache()
bool IsRightToLeft() const
void InvalidateNextPrtArea()
method to invalidate printing area of next frame #i11859#
SwLayoutFrame * GetUpper()
void InvalidatePage(const SwPageFrame *pPage=nullptr) const
Invalidates the page in which the Frame is currently placed.
SwRootFrame * getRootFrame()
bool IsNoTextFrame() const
void SetCompletePaint() const
SwContentFrame * FindNextCnt(const bool _bInSameFootnote=false)
void SetInvalidVert(bool bNew)
SwPageFrame * FindPageFrame()
sw::BroadcastingModify * GetDep()
use these so we can grep for SwFrame's GetRegisteredIn accesses beware that SwTextFrame may return sw...
bool IsLayoutFrame() const
void MoveGrammar(sal_Int32 nPos, sal_Int32 nDiff)
const SwFrame * ContainsAny(const bool _bInvestigateFootnoteForSections=false) const
Method <ContainsAny()> doesn't investigate content of footnotes by default.
const OutputDevice & m_rOut
SwLayoutModeModifier(const OutputDevice &rOutp)
void Modify(bool bChgToRTL)
vcl::text::ComplexTextLayoutFlags m_nOldLayoutMode
Collection of SwLinePortion instances, representing one line of text.
SwLinePortion * GetFirstPortion() const
virtual void Height(const SwTwips nNew, const bool bText=true) override
void MaxAscentDescent(SwTwips &_orAscent, SwTwips &_orDescent, SwTwips &_orObjAscent, SwTwips &_orObjDescent, const SwLinePortion *_pDontConsiderPortion=nullptr, const bool _bNoFlyCntPorAndLinePor=false) const
determine ascent and descent for positioning of as-character anchored object
SwTwips GetRealHeight() const
< purpose of derivation from SwClient: character style for displaying the numbers.
bool IsRestartEachPage() const
bool IsCountBlankLines() const
Base class for anything that can be part of a line in the Writer layout.
SwLinePortion * GetNextPortion() const
TextFrameIndex GetLen() const
virtual void HandlePortion(SwPortionHandler &rPH) const
bool IsFootnoteNumPortion() const
Marks a node in the document model.
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
bool IsNoTextNode() const
Merge GetRedlineMergeFlag() const
const SwNumFormat & Get(sal_uInt16 i) const
A page of the document layout.
void InvalidateWordCount() const
void InvalidateAutoCompleteWords() const
sal_uInt16 GetPhyPageNum() const
void InvalidateSmartTags() const
void InvalidateSpelling() const
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
bool IsPrepMustFit() const
TextFrameIndex GetParLen() const
SwCharRange & GetReformat()
void SetDelta(tools::Long nDelta)
bool IsFollowField() const
void SetPrepMustFit(const bool bNew)
bool IsFootnoteNum() const
bool IsFixLineHeight() const
bool UpdateQuoVadis(std::u16string_view rQuo)
Is called in SwTextFrame::Prepare()
tools::Long GetDelta() const
SwScriptInfo & GetScriptInfo()
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
virtual void LineBreak()=0
line break.
virtual void Skip(TextFrameIndex nLength)=0
skip characters.
virtual void Finish()=0
end of paragraph.
tools::Long GetHeight(const SwRect &rRect) const
void SetWidth(SwRect &rRect, tools::Long nNew) const
void SetPosX(SwRect &rRect, tools::Long nNew) const
void SetRight(SwRect &rRect, tools::Long nNew) const
tools::Long GetWidth(const SwRect &rRect) const
void SetHeight(SwRect &rRect, tools::Long nNew) const
tools::Long GetTop(const SwRect &rRect) const
void SetPosY(SwRect &rRect, tools::Long nNew) const
void SetTopAndHeight(SwRect &rRect, tools::Long nTop, tools::Long nHeight) const
tools::Long GetBottomMargin(const SwFrame &rFrame) const
tools::Long GetLeft(const SwRect &rRect) const
tools::Long GetBottom(const SwRect &rRect) const
tools::Long GetRight(const SwRect &rRect) const
void SetLeft(SwRect &rRect, tools::Long nNew) const
Of course Writer needs its own rectangles.
void Height(tools::Long nNew)
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)
void Left(const tools::Long nLeft)
void Width(tools::Long nNew)
The root element of a Writer document layout.
SwViewShell * GetCurrShell() const
bool HasMergedParas() const
void SetNeedGrammarCheck(bool bVal)
static bool GetBoundsOfHiddenRange(const SwTextNode &rNode, sal_Int32 nPos, sal_Int32 &rnStartPos, sal_Int32 &rnEndPos, std::vector< sal_Int32 > *pList=nullptr)
Hidden text range information - static and non-version.
void InitScriptInfo(const SwTextNode &rNode, sw::MergedPara const *pMerged, bool bRTL)
void SetInvalidityA(const TextFrameIndex nPos)
static SwSmartTagMgr & Get()
class for collecting anchored objects
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
sal_Int32 GetAnyEnd() const
end (if available), else start
virtual const sal_Int32 * GetEnd() const
end position
sal_Int32 GetStart() const
The purpose of this class is to be the universal interface between formatting/text output and the pos...
void SetIgnoreObjsInHeaderFooter(const bool bNew)
void SetIgnoreContour(bool bNew)
void SetIgnoreCurrentFrame(bool bNew)
bool Relax(const SwRect &rRect)
If there is no flying object frame standing in rRect (usually the current row), then we are turning o...
SwRect GetFrame(const SwRect &rPortion) const
void SetIgnoreFly(const bool bNew)
SwTwips CalcFitToContent_()
bool IsBreakNow(SwTextMargin &rLine)
bool IsKeepAlways() const
bool IsInside(SwTextMargin const &rLine) const
BP 18.6.93: Widows.
Represents the visualization of a paragraph.
void Init()
This is public, as it needs to be called by some methods in order to save the Prepare USE WITH CAUTIO...
TextFrameIndex CalcFlyPos(SwFrameFormat const *pSearch)
Calculates the position of FlyInContentFrames.
SwTextFrame * GetFormatted(bool bForceQuickFormat=false)
In case the SwLineLayout was cleared out of the s_pTextCache, recreate it.
bool IsFootnoteNumFrame() const
Am I a FootnoteFrame, with a number at the start of the paragraph?
sal_uLong GetThisLines() const
void SwitchVerticalToHorizontal(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from vertical to horizontal layout.
bool TestFormat(const SwFrame *pPrv, SwTwips &nMaxHeight, bool &bSplit)
The WouldFit equivalent for temporarily rewired TextFrames nMaxHeight returns the required size here ...
void SetOffset(TextFrameIndex nNewOfst)
SwTextFrame * GetFollow()
void CalcFootnoteFlag(TextFrameIndex nStop=TextFrameIndex(COMPLETE_STRING))
Does the Frame have a local footnote (in this Frame or Follow)?
void HideAndShowObjects()
Hides respectively shows objects, which are anchored at paragraph, at/as a character of the paragraph...
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
LanguageType GetLangOfChar(TextFrameIndex nIndex, sal_uInt16 nScript, bool bNoChar=false) const
TextFrameIndex GetOffset() const
void UpdateOutlineContentVisibilityButton(SwWrtShell *pWrtSh) const
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(TextFrameIndex nIndex) const
map position in potentially merged text frame to SwPosition
void InvalidateRange(const SwCharRange &, const tools::Long=0)
void SwitchLTRtoRTL(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from LTR to RTL layout.
void SetMergedPara(std::unique_ptr< sw::MergedPara > p)
bool FormatQuick(bool bForceQuickFormat)
SwTwips GetBaseVertOffsetForFly(bool bIgnoreFlysAnchoredAtThisFrame) const
void HideHidden()
Removes Textfrm's attachments, when it's hidden.
void CalcBaseOfstForFly()
SwTextNode const * GetTextNodeForFirstText() const
SwTwips mnHeightOfLastLine
virtual bool WouldFit(SwTwips &nMaxHeight, bool &bSplit, bool bTst, bool bMoveBwd) override
nMaxHeight is the required height bSplit indicates, that the paragraph has to be split bTst indicates...
bool IsIdxInside(TextFrameIndex nPos, TextFrameIndex nLen) const
sal_uLong GetAllLines() const
For displaying the line numbers.
void ClearPara()
Removes the Line information from the Cache but retains the entry itself.
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
Calculates the frame area size and the print area, in case they are invalid.
void PrepWidows(const sal_uInt16 nNeed, bool bNotify)
sw::MergedPara * GetMergedPara()
void SetWidow(const bool bNew)
void SetPara(SwParaPortion *pNew, bool bDelete=true)
void CalcHeightOfLastLine(const bool _bUseFont=false)
method to determine height of last line, needed for proportional line spacing
static void repaintTextFrames(const SwTextNode &rNode)
Repaint all text frames of the given text node.
SwTwips EmptyHeight() const
void CalcAdditionalFirstLineOffset()
Simulate format for a list item paragraph, whose list level attributes are in LABEL_ALIGNMENT mode,...
SwTwips GetParHeight() const
Returns the sum of line height in pLine.
SwParaPortion * GetPara()
TextFrameIndex MapModelToView(SwTextNode const *pNode, sal_Int32 nIndex) const
virtual bool GetInfo(SfxPoolItem &) const override
void SetHasRotatedPortions(bool bHasRotatedPortions)
SwTwips mnFlyAnchorOfstNoWrap
SwTwips CalcFitToContent()
Simulates a formatting as if there were not right margin or Flys or other obstacles and returns the w...
void InvalidateRange_(const SwCharRange &, const tools::Long=0)
void SwitchHorizontalToVertical(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from horizontal to vertical layout.
void VisitPortions(SwPortionHandler &rPH) const
Visit all portions for Accessibility.
std::unique_ptr< sw::MergedPara > m_pMergedPara
redline merge data
tools::Long GetLineSpace(const bool _bNoPropLineSpacing=false) const
Returns the additional line spacing for the next paragraph.
void SetFieldFollow(const bool bNew)
void HideFootnotes(TextFrameIndex nStart, TextFrameIndex nEnd)
SwTextFrame(SwTextNode *const, SwFrame *, sw::FrameMode eMode)
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
SwTwips mnFlyAnchorVertOfstNoWrap
The y position for wrap-through flys anchored at this paragraph.
static TextFrameIndex FindBrk(std::u16string_view aText, TextFrameIndex nStart, TextFrameIndex nEnd)
Returns the first possible break point in the current line.
bool IsHiddenNow() const
Hidden.
void Format_(SwTextFormatter &rLine, SwTextFormatInfo &rInf, const bool bAdjust=false)
sal_uInt16 GetLineCount(TextFrameIndex nPos)
Determines the line count.
const SwScriptInfo * GetScriptInfo() const
Returns the script info stored at the paraportion.
sal_uInt16 GetCacheIdx() const
SwTextNode * GetTextNodeFirst()
void RemoveFromCache()
Removes this frame completely from the Cache.
void SetOffset_(TextFrameIndex nNewOfst)
virtual bool Prepare(const PrepareHint ePrep=PrepareHint::Clear, const void *pVoid=nullptr, bool bNotify=true) override
SwContentFrame: the shortcut for the Frames If the void* casts wrongly, it's its own fault!...
virtual ~SwTextFrame() override
SwTwips GetHeightOfLastLine() const
void ManipOfst(TextFrameIndex const nNewOfst)
void SwapWidthAndHeight()
Swaps width and height of the text frame.
sal_uInt16 FirstLineHeight() const
Returns the first line height.
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
SwTwips mnAdditionalFirstLineOffset
SwTextNode const * GetTextNodeForParaProps() const
virtual void SwClientNotify(SwModify const &rModify, SfxHint const &rHint) override
virtual void DestroyImpl() override
const SwLineLayout * NextLine()
TextFrameIndex GetEnd() const
void TruncLines(bool bNoteFollow=false)
const SwLineLayout * PrevLine()
SwTwips GetLineHeight() const
const SwLineLayout * Next()
void CharToLine(TextFrameIndex)
const SwLineLayout * GetCurr() const
sal_uInt16 GetLineNr() const
SwParaPortion * GetPara()
sal_uInt16 GetDropLines() const
SwTextNode is a paragraph in the document model.
void SetWrongDirty(sw::WrongState eNew) const
virtual sal_Int32 Len() const override
bool IsSmartTagDirty() const
SwWrongList * GetSmartTags()
void SetWordCountDirty(bool bNew) const
void SetGrammarCheckDirty(bool bNew) const
void SetSmartTags(std::unique_ptr< SwWrongList > pNew)
void SetSmartTagDirty(bool bNew) const
void SetAutoCompleteWordDirty(bool bNew) const
bool IsCountedInList() const
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
int GetActualListLevel(SwListRedlineType eRedline=SwListRedlineType::SHOW) const
Returns the actual list level of this text node, when it is a list item.
bool IsNumbered(SwRootFrame const *pLayout=nullptr) const
Returns is this text node is numbered.
SwGrammarMarkUp * GetGrammarCheck()
bool IsWrongDirty() const
SwpHints * GetpSwpHints()
void SetWrong(std::unique_ptr< SwWrongList > pNew)
const OUString & GetText() const
void RemoveFromListRLHidden()
SwTextAttr * GetTextAttrForCharAt(const sal_Int32 nIndex, const sal_uInt16 nWhich=RES_TXTATR_END) const
get the text attribute at position nIndex which owns the dummy character CH_TXTATR_* at that position...
const std::vector< sal_uInt16 > & getFmtAttrs() const
sal_uInt16 getWhichAttr() const
sal_Int32 getStart() const
bool IsShowOutlineContentVisibilityButton() const
bool IsShowHiddenPara() const
bool getBrowseMode() const
bool IsShowHiddenChar(bool bHard=false) const
vcl::RenderContext * GetOut() const
const SwViewOption * GetViewOptions() const
void InvalidateAccessibleParaAttrs(const SwTextFrame &rTextFrame)
invalidate attributes for paragraphs and paragraph's characters
vcl::Window * GetWin() const
void InvalidateWindows(const SwRect &rRect)
void SetInfo(const SwPageFrame *pPg, const SwFrame *pF)
const SwPageFrame * GetOrigPage() const
const SwPageFrame * GetPage() const
void Invalidate(sal_Int32 nBegin, sal_Int32 nEnd)
void SetInvalid(sal_Int32 nBegin, sal_Int32 nEnd)
void Move(sal_Int32 nPos, sal_Int32 nDiff)
Change all values after the given position.
Used by the UI to modify the document model.
const SwView & GetView() const
An SwTextAttr container, stores all directly formatted text portions for a text node.
SwTextAttr * Get(size_t nPos) const
void SortIfNeedBe() const
Trigger the sorting if necessary.
SwTextAttr * GetSortedByEnd(size_t nPos) const
sal_uInt16 GetOrphansLines() const
bool WouldFit(SwTextMargin &rLine, SwTwips &rMaxHeight, bool bTest, bool bMoveBwd)
const bool isInsideFieldmarkResult
const bool isInsideFieldmarkCommand
iterate SwTextAttr in potentially merged text frame
sw::MergedPara const *const m_pMerged
MergedAttrIterBase(SwTextFrame const &rFrame)
SwTextNode const *const m_pNode
SwTextAttr const * NextAttr(SwTextNode const *&rpNode)
SwTextNode const *const m_pNode
MergedAttrIterByEnd(SwTextFrame const &rFrame)
std::vector< std::pair< SwTextNode const *, SwTextAttr const * > > m_Hints
SwTextAttr const * PrevAttr(SwTextNode const **ppNode=nullptr)
MergedAttrIterReverse(SwTextFrame const &rFrame)
SwTextAttr const * NextAttr(SwTextNode const **ppNode=nullptr)
text is moved into pDestNode