61 OSL_FAIL(
"Don't try SwMultiPortion::Paint, try SwTextPainter::PaintMultiPortion" );
112 const sal_uInt16 nAdd = ( nTmp -
Height() ) / 2;
140 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwMultiPortion"));
147 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwLineLayout"));
152 pPor->
dumpAsXml(pWriter, rText, nOffset);
155 (
void)xmlTextWriterEndElement(pWriter);
159 (
void)xmlTextWriterEndElement(pWriter);
247 if( pPor->InTextGrp() )
248 nBlanks = nBlanks + static_cast<SwTextPortion*>(pPor)->GetSpaceCnt( rInf, nNull );
249 else if ( pPor->IsMultiPortion() &&
251 nBlanks = nBlanks + static_cast<SwBidiPortion*>(pPor)->GetSpaceCnt( rInf );
372 ( nSpaceAdd > 0 ?
CalcSpacing( nSpaceAdd, rInf ) : 0 ) );
376 aBlank.
Width( nChWidth );
382 aTmpFnt.SetActual( nAct );
383 aTmpFnt.SetProportion( 100 );
385 aBlank.
Paint( rInf );
411 nMaxWidth -= rInf.
X();
426 aTmpFnt.SetActual( nActualScr );
427 if( nMaxWidth > aSize.
Width() )
430 nMaxWidth -= aSize.
Width();
431 rInf.
X( rInf.
X() + aSize.
Width() );
448 const sal_uInt16 nTmpAsc = rInf.
GetAscent();
456 if( nMaxWidth > aSize.
Width() )
459 nMaxWidth -= aSize.
Width();
469 nMaxWidth += rInf.
X();
485 m_nBlank1 =
m_nBlank1 + static_cast<SwTextPortion*>(pPor)->GetSpaceCnt( rInf, nNull );
499 m_nBlank2 =
m_nBlank2 + static_cast<SwTextPortion*>(pPor)->GetSpaceCnt( rInf, nNull );
538 nMultiSpace /= sal_Int32(nMyBlank);
544 pVec->insert( pVec->begin(), nMultiSpace );
566 , m_nRubyOffset( rRuby.GetRubyOffset() )
567 , m_nAdjustment( rRuby.GetAdjustment() )
608 std::unique_ptr<SwFont> pRubyFont;
612 pRubyFont.reset(
new SwFont( rFnt ));
613 pRubyFont->SetDiffFnt( &rSet, &rIDocumentSettingAccess );
619 OUString
aStr = rRuby.GetText().copy( sal_Int32(nOffs) );
668 nLineDiff = -nLineDiff;
677 sal_uInt16 nLeft = 0;
678 sal_uInt16 nRight = 0;
682 case css::text::RubyAdjust_CENTER: nRight = o3tl::narrowing<sal_uInt16>(nLineDiff / 2);
684 case css::text::RubyAdjust_RIGHT: nLeft = o3tl::narrowing<sal_uInt16>(nLineDiff - nRight);
break;
687 case css::text::RubyAdjust_INDENT_BLOCK:
694 static_cast<SwTextPortion*>(pPor)->GetSpaceCnt( rInf, nCharCnt );
697 if( nCharCnt > nSub )
699 SwTwips nCalc = nLineDiff / sal_Int32(nCharCnt - nSub);
701 if( nCalc < SHRT_MAX )
702 nTmp = -short(nCalc);
707 nLineDiff -= nCalc * (sal_Int32(nCharCnt) - 1);
711 nRight = o3tl::narrowing<sal_uInt16>(nLineDiff / 2);
712 nLeft = o3tl::narrowing<sal_uInt16>(nLineDiff - nRight);
716 default: OSL_FAIL(
"New ruby adjustment" );
718 if( nLeft || nRight )
759 pField = static_cast<const SwFieldPortion*>(pPor);
785 else if( static_cast<const SvxTwoLinesItem*>(pItem)->GetEndBracket() !=
817 else if( static_cast<const SvxCharRotateItem*>(pItem)->GetValue() !=
839 class MergedAttrIterMulti
840 :
public MergedAttrIterBase
845 MergedAttrIterMulti(
SwTextFrame const& rFrame) : MergedAttrIterBase(rFrame) {}
848 void Assign(MergedAttrIterMulti
const& rOther)
850 assert(m_pMerged == rOther.m_pMerged);
851 assert(m_pNode == rOther.m_pNode);
852 m_CurrentExtent = rOther.m_CurrentExtent;
853 m_CurrentHint = rOther.m_CurrentHint;
854 m_First = rOther.m_First;
866 ? !m_pMerged->extents.empty()
867 ? m_pMerged->extents[0].pNode
868 : m_pMerged->pFirstNode
874 const auto nExtentsSize = m_pMerged->extents.size();
875 while (m_CurrentExtent < nExtentsSize)
877 sw::Extent const& rExtent(m_pMerged->extents[m_CurrentExtent]);
878 if (
SwpHints const*
const pHints = rExtent.pNode->GetpSwpHints())
880 auto nHintsCount = pHints->Count();
881 while (m_CurrentHint < nHintsCount)
883 SwTextAttr const*
const pHint(pHints->Get(m_CurrentHint));
884 if (rExtent.nEnd < pHint->GetStart())
889 if (rExtent.nStart <= pHint->GetStart())
891 rpNode = rExtent.pNode;
897 if (m_CurrentExtent < nExtentsSize &&
898 rExtent.pNode != m_pMerged->extents[m_CurrentExtent].pNode)
901 rpNode = m_pMerged->extents[m_CurrentExtent].pNode;
909 SwpHints const*
const pHints(m_pNode->GetpSwpHints());
912 if (m_CurrentHint < pHints->
Count())
914 SwTextAttr const*
const pHint(pHints->Get(m_CurrentHint));
943 OSL_ENSURE( pMulti->
IsBidi(),
"Nested MultiPortion is not BidiPortion" );
945 nCurrLevel =
static_cast<SwBidiPortion const *
>(pMulti)->GetLevel();
953 bool bFieldBidi =
false;
960 nNextLevel = rSI.
DirType( rPos );
968 aRet.
pItem =
nullptr;
969 aRet.
pAttr =
nullptr;
972 aRet.
nLevel = nCurrLevel + 1;
986 SwTextAttr const* pActiveTwoLinesHint(
nullptr);
989 sw::MergedAttrIterMulti iterAtStartOfNode(*
m_pFrame);
993 for (sw::MergedAttrIterMulti iter = *
m_pFrame; ; )
996 SwTextAttr const*
const pAttr = iter.NextAttr(pNode);
1003 assert(pNode->
GetIndex() <= startPos.first->GetIndex());
1004 if (startPos.first->GetIndex() <= pNode->
GetIndex())
1006 if (startPos.first->GetIndex() != pNode->
GetIndex()
1007 || startPos.second < pAttr->
GetStart())
1011 if (startPos.second < pAttr->
GetAnyEnd())
1021 pActiveRotateHint = bRot ? pAttr :
nullptr;
1022 pActiveRotateItem = pRoTmp;
1027 pActiveTwoLinesHint = bTwo ? pAttr :
nullptr;
1028 pActiveTwoLinesItem = p2Tmp;
1036 if (startPos.first->GetIndex() < pNode->
GetIndex())
1040 if (startPos.first->GetIndex() == pNode->
GetIndex())
1042 iterAtStartOfNode.Assign(iter);
1044 if (pNodeRotateItem && pNodeRotateItem->
GetValue())
1046 pActiveRotateItem = pNodeRotateItem;
1048 pNodeTwoLinesItem = startPos.first->GetSwAttrSet().GetItemIfSet(
1050 if (pNodeTwoLinesItem && pNodeTwoLinesItem->
GetValue())
1052 pActiveTwoLinesItem = pNodeTwoLinesItem;
1057 if (!pRuby && !pActiveTwoLinesItem && !pActiveRotateItem)
1065 aRet.
pItem =
nullptr;
1072 if (pActiveTwoLinesHint ||
1073 (pNodeTwoLinesItem && pNodeTwoLinesItem == pActiveTwoLinesItem &&
1080 std::deque<TextFrameIndex> aEnd;
1087 if (pActiveTwoLinesHint)
1089 aRet.
pItem =
nullptr;
1090 aRet.
pAttr = pActiveTwoLinesHint;
1092 if (pNodeTwoLinesItem)
1107 aRet.
pItem = pNodeTwoLinesItem;
1108 aRet.
pAttr =
nullptr;
1135 for (sw::MergedAttrIterMulti iter = iterAtStartOfNode; ; )
1138 SwTextAttr const*
const pTmp = iter.NextAttr(pNode);
1143 assert(startPos.first->GetIndex() <= pNode->
GetIndex());
1149 if (nTmpEnd <= rPos)
1159 assert(rPos <= nTmpEnd);
1162 if (rPos < nTmpStart)
1169 if (!bOn || aEnd.back() < nTmpStart)
1176 while( !aEnd.empty() && aEnd.back() <= rPos )
1185 aEnd.push_front( rPos );
1198 if (aEnd.back() < nTmpEnd)
1199 aEnd.back() = nTmpEnd;
1207 if (nTmpEnd < aEnd.back())
1208 aEnd.push_back( nTmpEnd );
1209 else if( aEnd.size() > 1 )
1212 aEnd.back() = nTmpEnd;
1216 if( bOn && !aEnd.empty() )
1220 if (pActiveRotateHint ||
1221 (pNodeRotateItem && pNodeRotateItem == pActiveRotateItem &&
1229 std::deque<TextFrameIndex> aEnd;
1233 bool bOn = pNodeTwoLinesItem !=
nullptr;
1239 for (sw::MergedAttrIterMulti iter = iterAtStartOfNode; ; )
1242 SwTextAttr const*
const pTmp = iter.NextAttr(pNode);
1247 assert(startPos.first->GetIndex() <= pNode->
GetIndex());
1253 if (nTmpEnd <= n2Start)
1263 assert(n2Start <= nTmpEnd);
1266 if (n2Start < nTmpStart)
1268 if (bOn || aEnd.back() < nTmpStart)
1270 n2Start = nTmpStart;
1271 while( !aEnd.empty() && aEnd.back() <= n2Start )
1278 aEnd.push_front( n2Start );
1294 if (aEnd.back() < nTmpEnd)
1295 aEnd.back() = nTmpEnd;
1300 if (nTmpEnd < aEnd.back())
1301 aEnd.push_back( nTmpEnd );
1302 else if( aEnd.size() > 1 )
1305 aEnd.back() = nTmpEnd;
1309 if( !bOn && !aEnd.empty() )
1310 n2Start = aEnd.back();
1316 if (pActiveRotateHint)
1318 aRet.
pItem =
nullptr;
1319 aRet.
pAttr = pActiveRotateHint;
1321 if (pNodeRotateItem)
1324 bOn = pNodeRotateItem->
GetValue() ==
1325 pActiveRotateItem->GetValue();
1334 aRet.
pItem = pNodeRotateItem;
1335 aRet.
pAttr =
nullptr;
1339 for (sw::MergedAttrIterMulti iter = iterAtStartOfNode; ; )
1342 SwTextAttr const*
const pTmp = iter.NextAttr(pNode);
1347 assert(startPos.first->GetIndex() <= pNode->
GetIndex());
1353 if (nTmpEnd <= rPos)
1363 assert(rPos <= nTmpEnd);
1366 if (rPos < nTmpStart)
1368 if (!bOn || aEnd.back() < nTmpStart)
1371 while( !aEnd.empty() && aEnd.back() <= rPos )
1378 aEnd.push_front( rPos );
1393 if (aEnd.back() < nTmpEnd)
1394 aEnd.back() = nTmpEnd;
1399 if (nTmpEnd < aEnd.back())
1400 aEnd.push_back( nTmpEnd );
1401 else if( aEnd.size() > 1 )
1404 aEnd.back() = nTmpEnd;
1408 if( bOn && !aEnd.empty() )
1410 if( rPos > n2Start )
1425 class SwSpaceManipulator
1429 std::vector<tools::Long>* m_pOldSpaceAdd;
1430 sal_uInt16 m_nOldSpaceIndex;
1437 ~SwSpaceManipulator();
1439 tools::Long GetSpaceAdd()
const {
return m_nSpaceAdd; }
1449 m_pOldSpaceAdd = m_rInfo.GetpSpaceAdd();
1450 m_nOldSpaceIndex = m_rInfo.GetSpaceIdx();
1451 m_nOldDir = m_rInfo.GetDirection();
1452 m_rInfo.SetDirection(m_rMulti.GetDirection());
1453 m_bSpaceChg =
false;
1455 if (m_rMulti.IsDouble())
1457 m_nSpaceAdd = (m_pOldSpaceAdd && !m_rMulti.HasTabulator()) ? m_rInfo.GetSpaceAdd() : 0;
1458 if (m_rMulti.GetRoot().IsSpaceAdd())
1460 m_rInfo.SetpSpaceAdd(m_rMulti.GetRoot().GetpLLSpaceAdd());
1461 m_rInfo.ResetSpaceIdx();
1462 m_bSpaceChg = m_rMulti.ChgSpaceAdd(&m_rMulti.GetRoot(), m_nSpaceAdd);
1464 else if (m_rMulti.HasTabulator())
1465 m_rInfo.SetpSpaceAdd(
nullptr);
1467 else if (!m_rMulti.IsBidi())
1469 m_rInfo.SetpSpaceAdd(m_rMulti.GetRoot().GetpLLSpaceAdd());
1470 m_rInfo.ResetSpaceIdx();
1474 void SwSpaceManipulator::SecondLine()
1478 m_rInfo.RemoveFirstSpaceAdd();
1479 m_bSpaceChg =
false;
1485 m_rInfo.ResetSpaceIdx();
1486 m_bSpaceChg = m_rMulti.ChgSpaceAdd(pLay, m_nSpaceAdd);
1490 m_rInfo.SetpSpaceAdd((!m_rMulti.IsDouble() || m_rMulti.HasTabulator()) ?
nullptr
1492 m_rInfo.SetSpaceIdx(m_nOldSpaceIndex);
1496 SwSpaceManipulator::~SwSpaceManipulator()
1500 m_rInfo.RemoveFirstSpaceAdd();
1501 m_bSpaceChg =
false;
1503 m_rInfo.SetpSpaceAdd(m_pOldSpaceAdd);
1504 m_rInfo.SetSpaceIdx(m_nOldSpaceIndex);
1505 m_rInfo.SetDirection(m_nOldDir);
1516 sal_uInt16 nRubyHeight = 0;
1517 bool bRubyTop =
true;
1526 const bool bRubyInGrid = bHasGrid && rMulti.
IsRuby();
1528 const sal_uInt16 nOldHeight = rMulti.
Height();
1539 bool bEnvDir =
false;
1540 bool bThisDir =
false;
1541 bool bFrameDir =
false;
1546 OSL_ENSURE( ! pEnvPor || pEnvPor->
IsBidi(),
1547 "Oh no, I expected a BidiPortion" );
1549 bEnvDir = pEnvPor ? ((
static_cast<const SwBidiPortion*
>(pEnvPor)->GetLevel() % 2) != 0) : bFrameDir;
1550 bThisDir = (
static_cast<SwBidiPortion&
>(rMulti).GetLevel() % 2) != 0;
1553 #if OSL_DEBUG_LEVEL > 1
1555 if( rMulti.
Width() > 1 && ! pEnvPor )
1560 rMulti.
Height( nOldHeight );
1573 SwSpaceManipulator aManip(
GetInfo(), rMulti );
1575 std::unique_ptr<SwFontSave> pFontSave;
1576 std::unique_ptr<SwFont> pTmpFnt;
1590 pFontSave =
nullptr;
1597 GetInfo().
SetIdx(static_cast<SwDoubleLinePortion&>(rMulti).GetBrackets()->nStart);
1616 nOfst = nTmpX + rMulti.
Width();
1624 else if ( rMulti.
IsBidi() )
1628 if ( bEnvDir != bThisDir )
1634 if ( bFrameDir == bThisDir )
1643 aLayoutModeModifier.
Modify( bThisDir );
1648 bool bRest = pLay->
IsRest();
1651 OSL_ENSURE(
nullptr ==
GetInfo().GetUnderFnt() || rMulti.
IsBidi(),
1652 " Only BiDi portions are allowed to use the common underlining font" );
1663 const sal_uInt16 nAdjustment = ( pLay->
Height() - pPor->
Height() ) / 2 +
1666 GetInfo().
X( nOfst - nAdjustment );
1668 GetInfo().
X( nOfst + nAdjustment );
1676 if ( bRubyTop != ( pLay == &rMulti.
GetRoot() ) )
1679 else if ( bRubyTop )
1681 nAdjustment = nRubyHeight - pPor->
Height();
1705 bool bSeeked =
true;
1710 if( static_cast<SwFieldPortion*>(pPor)->HasFont() )
1737 if ( pUnderLineFnt )
1754 OSL_ENSURE( rMulti.
IsBidi(),
"Only nesting of bidi portions is allowed" );
1760 bFirst &= !pPor->
GetLen();
1767 if( !pPor && pLay->
GetNext() )
1772 aManip.SecondLine();
1791 else if ( bHasGrid && rMulti.
IsRuby() )
1798 nOfst += nRubyHeight;
1836 GetInfo().
SetIdx(static_cast<SwDoubleLinePortion&>(rMulti).GetBrackets()->nStart);
1840 aManip.GetSpaceAdd(),
false );
1860 bool bRet = rpField !=
nullptr;
1863 if( static_cast<SwFieldPortion*>(rpField)->IsFollow() )
1893 rInf.
SetIdx( nStartIdx );
1908 rInf.
SetIdx( static_cast<SwDoubleLinePortion&>(rMulti).GetBrackets()->nStart );
1916 std::unique_ptr<SwFontSave> xFontSave;
1917 std::unique_ptr<SwFont> xTmpFont;
1926 xFontSave.reset(
new SwFontSave(rInf, xTmpFont.get(),
this));
1948 OSL_ENSURE( pPage,
"No page in frame!");
1954 while ( pUpperFrame && !pUpperFrame->
IsCellFrame() )
1955 pUpperFrame = pUpperFrame->
GetUpper();
1956 assert(pUpperFrame);
1962 pUpperFrame = pPage;
1967 nMaxWidth = pUpperFrame ?
1981 SwTwips nMinWidth = nTmpX + 1;
1982 SwTwips nActWidth = nMaxWidth;
1996 pSecondRest =
nullptr;
2008 nMultiLen = nMultiLen - rInf.
GetIdx();
2012 const OUString* pOldText = &(rInf.
GetText());
2014 std::shared_ptr<const vcl::text::TextLayoutCache>
const pOldCachedVclData(rInf.
GetCachedVclData());
2017 OUString
const aMultiStr( rInf.
GetText().copy(0, sal_Int32(nMultiLen + rInf.
GetIdx())) );
2031 bool bRubyTop =
false;
2043 aInf.Width( sal_uInt16(nActWidth) );
2044 aInf.RealWidth( sal_uInt16(nActWidth) );
2045 aInf.SetFirstMulti( bFirstMulti );
2056 auto const pBookmark(static_cast<SwBookmarkPortion*>(rInf.
GetLast()));
2057 auto *
const pPrevious = pBookmark->FindPrevPortion(rInf.
GetRoot());
2058 assert(!pPrevious || pPrevious->GetNextPortion() == pBookmark);
2061 pPrevious->SetNextPortion(
nullptr);
2070 OSL_ENSURE( pFirstRest->
InFieldGrp(),
"BuildMulti: Fieldrest expected");
2073 static_cast<SwFieldPortion*>(pFirstRest)->GetExp() );
2074 pField->SetFollow(
true );
2075 aInf.SetRest( pField );
2077 aInf.SetRuby( rMulti.
IsRuby() && rMulti.
OnTop() );
2081 if ( bHasGrid && aInf.IsRuby() && bRubyTop )
2082 aInf.SetSnapToGrid(
false );
2085 if( pFirstRest || !aInf.IsRuby() )
2088 aInf.SetSnapToGrid( bOldGridModeAllowed );
2095 pNextFirst = aInf.GetRest();
2114 pNextFirst = aInf.GetRest();
2117 OSL_ENSURE( pSecondRest->
InFieldGrp(),
"Fieldrest expected");
2119 static_cast<SwFieldPortion*>(pSecondRest)->GetExp() );
2120 pField->SetFollow(
true );
2123 if( !rMulti.
OnTop() && nFirstLen < nMultiLen )
2127 aTmp.
SetRest( aInf.GetRest() );
2128 aInf.SetRest(
nullptr );
2131 if ( bHasGrid && aTmp.
IsRuby() && ! bRubyTop )
2172 nMinWidth = nActWidth;
2173 nActWidth = ( 3 * nMaxWidth + nMinWidth + 3 ) / 4;
2177 bFirstMulti =
false;
2178 if( nActWidth <= nMinWidth )
2187 if( nActWidth > nTmpX + rMulti.
Width() + 6 )
2188 nActWidth = nTmpX + rMulti.
Width() + 6;
2189 nMaxWidth = nActWidth;
2190 nActWidth = ( 3 * nMaxWidth + nMinWidth + 3 ) / 4;
2191 if( nActWidth >= nMaxWidth )
2197 pNextFirst =
nullptr;
2212 if( static_cast<SwDoubleLinePortion&>(rMulti).GetLineDiff() )
2215 if( static_cast<SwDoubleLinePortion&>(rMulti).GetLineDiff() > 0 )
2235 rInf.
SetIdx( nStartIdx );
2237 if( static_cast<SwDoubleLinePortion&>(rMulti).GetBrackets() )
2262 rMulti.
Height( sal_uInt16(nH) );
2267 else if ( rMulti.
IsBidi() )
2269 bRet = rMulti.
GetLen() < nMultiLen || pNextFirst;
2275 OSL_ENSURE( !pNextFirst || pNextFirst->
InFieldGrp(),
2276 "BuildMultiPortion: Surprising restportion, field expected" );
2280 nMultiLen + rInf.
GetIdx() );
2281 else if( rMulti.
IsRuby() )
2283 OSL_ENSURE( !pNextSecond || pNextSecond->
InFieldGrp(),
2284 "BuildMultiPortion: Surprising restportion, field expected" );
2289 pTmp =
new SwRubyPortion( static_cast<SwRubyPortion&>(rMulti),
2290 nMultiLen + rInf.
GetIdx() );
2295 pTmp->GetRoot().GetNext()->SetNextPortion( pNextSecond );
2297 pTmp->SetFollowField();
2351 if( pNextFirst && pTmp )
2353 pTmp->SetFollowField();
2354 pTmp->GetRoot().SetNextPortion( pNextFirst );
2367 rInf.
SetStop( aInf.IsStop() );
2401 if( pPor->
GetLen() && !pHelpMulti )
2403 nMultiPos = nMultiPos + pPor->
GetLen();
2404 pTmpMulti =
nullptr;
2409 pTmpMulti =
nullptr;
2414 OSL_ENSURE( !pHelpMulti || pHelpMulti->
IsBidi(),
2415 "Nested multiportions are forbidden." );
2425 if( !pPor && pTmpMulti )
2430 if( !pHelpMulti->
IsRuby() )
2432 pTmpMulti =
nullptr;
2438 pHelpMulti = pTmpMulti;
2439 nMultiPos = nMultiPos - pHelpMulti->
GetLen();
2460 static_cast<SwFieldPortion*>(pRest)->TakeNextOffset( pField );
2471 nPosition = nMultiPos + pHelpMulti->
GetLen();
2476 OSL_ENSURE( !pHelpMulti->
GetLen(),
"Multiportion without attribute?" );
2485 if( pRest || nMultiPos > nPosition || ( pHelpMulti->
IsRuby() &&
2491 else if( pHelpMulti->
IsBidi() )
2493 else if( pHelpMulti->
IsRuby() )
2497 nMultiPos,
static_cast<const SwRubyPortion*
>(pHelpMulti)->GetRubyOffset(),
2532 : pTextCursor(pCursor),
2533 pCurr(pCursor->m_pCurr),
2534 nStart(pCursor->m_nStart)
2567 if ( nX && pMulti->
IsBidi() )
virtual void Height(const SwTwips nNew, const bool bText=true) override
void Move(SwTextPaintInfo &rInf)
Represents the visualization of a paragraph.
SwFontScript WhichFont(TextFrameIndex nIdx) const
virtual tools::Long CalcSpacing(tools::Long nSpaceAdd, const SwTextSizeInfo &rInf) const override
void FormatReset(SwTextFormatInfo &rInf)
void SetUnderFnt(SwUnderlineFont *pNew)
void CalcSize(SwTextFormatter &rLine, SwTextFormatInfo &rInf)
void SetSnapToGrid(const bool bN)
SwRubyPortion(const SwRubyPortion &rRuby, TextFrameIndex nEnd)
virtual ~SwMultiPortion() override
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
virtual ~SwDoubleLinePortion() override
sal_uInt16 BracketWidth()
void CalcNewBlock(SwLineLayout *pCurr, const SwLinePortion *pStopAt, SwTwips nReal=0, bool bSkipKashida=false)
SwExpandPortion * NewFieldPortion(SwTextFormatInfo &rInf, const SwTextAttr *pHt) const
SwTwips GetPaintOfst() const
SwTextAttr * GetAttr(TextFrameIndex nPos) const
Returns the attribute for a position.
sal_Unicode GetStartBracket() const
TextFrameIndex GetStart() const
bool IsInFootnote() const
static bool lcl_HasRotation(const SwTextAttr &rAttr, const SvxCharRotateItem *&rpRef, bool &rValue)
virtual sal_Int32 Len() const override
void SetPropFont(const sal_uInt8 nNew)
void dumpAsXmlAttributes(xmlTextWriterPtr writer, std::u16string_view rText, TextFrameIndex nOffset) const
const SwRect & getFramePrintArea() const
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
void SetFlyInContent(bool bNew)
void SetLast(SwLinePortion *pNewLast)
void CalcLine(SwTextFormatter &rLine, SwTextFormatInfo &rInf)
const SwLineLayout & GetRoot() const
void SetLen(TextFrameIndex const nLen)
bool GetRubyTextBelow() const
virtual tools::Long CalcSpacing(tools::Long nSpaceAdd, const SwTextSizeInfo &rInf) const override
SwTableLine is one table row in the document model.
bool SeekAndChg(SwTextSizeInfo &rInf)
bool IsBottomToTop() const
SwTextCursor * pTextCursor
const SwLineLayout * Next()
Dialog to specify the properties of date form field.
void SetText(const OUString &rNew)
void SetMulti(const bool bNew)
Of course Writer needs its own rectangles.
sal_Int32 GetAnyEnd() const
end (if available), else start
SwPosSize GetTextSize(OutputDevice *pOut, const SwScriptInfo *pSI, const OUString &rText, TextFrameIndex nIdx, TextFrameIndex nLen) const
static bool lcl_Check2Lines(const SfxPoolItem *const pItem, const SvxTwoLinesItem *&rpRef, bool &rValue)
sal_uInt8 GetDirection() const
virtual void Text(TextFrameIndex nLength, PortionType nType, sal_Int32 nHeight=0, sal_Int32 nWidth=0)=0
(empty) destructor
css::chart::ChartAxisLabelPosition ePos
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
Degree10 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
virtual void Paint(const SwTextPaintInfo &rInf) const override
sal_uInt8 DirType(const TextFrameIndex nPos) const
tools::Long GetLLSpaceAdd(sal_uInt16 nIdx)
constexpr TypedWhichId< SvxTwoLinesItem > RES_CHRATR_TWO_LINES(34)
SwTextFormatInfo & GetInfo()
bool IsMarginPortion() const
virtual void HandlePortion(SwPortionHandler &rPH) const override
#define CH_TXTATR_BREAKWORD
void PaintBracket(SwTextPaintInfo &rInf, tools::Long nSpaceAdd, bool bOpen) const
SwRotatedPortion(TextFrameIndex const nEnd, sal_uInt8 nDir)
Degree10 GetValue() const
sal_uInt16 GetLLSpaceAddCount() const
sal_Unicode GetEndBracket() const
virtual void Paint(const SwTextPaintInfo &rInf) const =0
bool BuildMultiPortion(SwTextFormatInfo &rInf, SwMultiPortion &rMulti)
void FormatBrackets(SwTextFormatInfo &rInf, SwTwips &nMaxWidth)
bool IsBreakPortion() const
const SfxPoolItem * pItem
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
sal_Unicode GetChar(TextFrameIndex const nPos) const
void SetFollow(bool bNew)
SwTextPaintInfo & GetInfo()
void Adjust_(SwTextFormatInfo &rInf)
sal_Int32 GetStart() const
bool IsSquaredMode() const
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich, const Color *pColor=nullptr) const
void Width(tools::Long nNew)
TextFrameIndex m_nRubyOffset
constexpr TypedWhichId< SwFormatRuby > RES_TXTATR_CJK_RUBY(53)
static void lcl_TruncateMultiPortion(SwMultiPortion &rMulti, SwTextFormatInfo &rInf, TextFrameIndex const nStartIdx)
TextFrameIndex GetLineStart() const
void SetPaintOfst(const SwTwips nNew)
void SetNumDone(const bool bNew)
static bool lcl_Has2Lines(const SwTextAttr &rAttr, const SvxTwoLinesItem *&rpRef, bool &rValue)
static SwTextPortion * CopyLinePortion(const SwLinePortion &rPortion)
TextFrameIndex NextDirChg(const TextFrameIndex nPos, const sal_uInt8 *pLevel=nullptr) const
virtual void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &rOffset) const
Describes a part of a single text node, which will be part of a text frame, even when redlines are hi...
const SwViewOption & GetOpt() const
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
virtual SwLinePortion * Append(SwLinePortion *pPortion)
void PaintMultiPortion(const SwRect &rPaint, SwMultiPortion &rMulti, const SwMultiPortion *pEnvPor=nullptr)
Reference< XAnimationNode > Clone(const Reference< XAnimationNode > &xSourceNode, const SdPage *pSource, const SdPage *pTarget)
Collection of SwLinePortion instances, representing one line of text.
static bool lcl_ExtractFieldFollow(SwLineLayout *pLine, SwLinePortion *&rpField)
SwMultiPortion * m_pMulti
static void ResetSpaceAdd(SwLineLayout *pCurr)
void SetStop(const bool bNew)
SwPageFrame * FindPageFrame()
SwParaPortion * GetParaPortion()
css::text::RubyAdjust m_nAdjustment
SwTextGridItem const * GetGridItem(SwPageFrame const *const)
void SetVertical(Degree10 nDir, const bool bVertLayout=false, const bool bVertLayoutLRBT=false)
SwNodeOffset GetIndex() const
SwLinePortion * GetFirstPortion() const
bool IsParagraph(bool bHard=false) const
void SetCachedVclData(std::shared_ptr< const vcl::text::TextLayoutCache > const &pCachedVclData)
TextFrameIndex GetSpaceCnt(const SwTextSizeInfo &rInf) const
SwLayoutFrame * GetUpper()
SwTextCursorSave(SwTextCursor *pTextCursor, SwMultiPortion *pMulti, SwTwips nY, SwTwips &nX, TextFrameIndex nCurrStart, tools::Long nSpaceAdd)
void BuildPortions(SwTextFormatInfo &rInf)
virtual bool ChgSpaceAdd(SwLineLayout *pCurr, tools::Long nSpaceAdd) const override
Provides access to settings of a document.
SwFrameFormat * GetFrameFormat()
void Modify(bool bChgToRTL)
Non-breaking space or non-breaking hyphen.
TextFrameIndex GetIdx() const
TextFrameIndex GetSmallerSpaceCnt() const
T static_txtattr_cast(S *s)
void CalcBlanks(SwTextFormatInfo &rInf)
void PrePaint(const SwTextPaintInfo &rInf, const SwLinePortion *pLast) const
void SetRuby(const bool bNew)
vcl::Font GetFont(vcl::Font const &rFont, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
TextFrameIndex GetLen() const
void SetPos(const Point &rPoint)
A page of the document layout.
SwTextFrame * GetTextFrame()
sal_uInt16 PreWidth() const
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(TextFrameIndex nIndex) const
map position in potentially merged text frame to SwPosition
const OUString & GetText() const
bool IsHolePortion() const
std::unique_ptr< SwBracket > m_pBracket
SwUnderlineFont * GetUnderFnt() const
const Point & GetPos() const
bool IsMultiPortion() const
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(60)
Base class for anything that can be part of a line in the Writer layout.
bool SeekAndChgBefore(SwTextSizeInfo &rInf)
SwTextNode is a paragraph in the document model.
An SwTextAttr container, stores all directly formatted text portions for a text node.
void SetLen(const TextFrameIndex nNew)
TextFrameIndex m_nBlank1
Number of blanks in the first line.
sal_uInt8 GetPropFont() const
void SetNext(SwLineLayout *pNew)
PortionType GetWhichPor() const
void SetDirection(sal_uInt8 nNew)
void SetFootnoteDone(const bool bNew)
sal_uInt16 PostWidth() const
SwLinePortion * GetRest()
TextFrameIndex MapModelToView(SwTextNode const *pNode, sal_Int32 nIndex) const
SwLinePortion * FindLastPortion()
TextFrameIndex GetSpaceCnt() const
virtual void Paint(const SwTextPaintInfo &rInf) const override
void RemoveFirstLLSpaceAdd()
IDocumentSettingAccess const & getIDocumentSettingAccess() const
SvxAdjust GetAdjust() const
void ActualizeTabulator()
SwTextSizeInfo & GetInfo()
virtual bool ChgSpaceAdd(SwLineLayout *pCurr, tools::Long nSpaceAdd) const override
bool IsRightToLeft() const
virtual tools::Long CalcSpacing(tools::Long nSpaceAdd, const SwTextSizeInfo &rInf) const override
TextFrameIndex GetLen() const
const sal_Int32 * End() const
void CreateSpaceAdd(const tools::Long nInit=0)
void SetDirection(const sal_uInt8 nNew)
void AddPrtWidth(const SwTwips nNew)
double getLength(const B2DPolygon &rCandidate)
SwLinePortion * GetLast()
void SetRealHeight(SwTwips nNew)
RubyPosition GetRubyPosition() const
void SetNextPortion(SwLinePortion *pNew)
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
constexpr sal_Int32 COMPLETE_STRING
void SetBrackets(const SwDoubleLinePortion &rDouble)
SwLinePortion * MakeRestPortion(const SwLineLayout *pLine, TextFrameIndex nPos)
TextFrameIndex nStartOfAttr
#define SPACING_PRECISION_FACTOR
void SetNextOffset(TextFrameIndex nNew)
struct _xmlTextWriter * xmlTextWriterPtr
constexpr TypedWhichId< SvxCharRotateItem > RES_CHRATR_ROTATE(32)
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
std::optional< SwMultiCreator > GetMultiCreator(TextFrameIndex &rPos, SwMultiPortion const *pM) const
SwTextGrid GetGridType() const
bool HasTabulator() const
TextFrameIndex m_nBlank2
Number of blanks in the second line.
void SetRubyPosition(RubyPosition eNew)
SwTextFrame * GetTextFrame()
bool IsFlyInCntBase() const
SwTwips GetLineHeight() const
virtual void FormatEOL(SwTextFormatInfo &rInf)
void CheckSpecialUnderline(const SwLinePortion *pPor, tools::Long nAdjustBaseLine=0)
Frame is variable in Var-direction.
std::vector< tools::Long > * GetpLLSpaceAdd() const
void SetProportion(const sal_uInt8 nNewPropr)
SwLinePortion * GetNextPortion() const
void SetIdx(const TextFrameIndex nNew)
virtual bool ChgSpaceAdd(SwLineLayout *pCurr, tools::Long nSpaceAdd) const
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...
void SetRest(SwLinePortion *pNewRest)
SwBidiPortion(TextFrameIndex nEnd, sal_uInt8 nLv)
void Height(tools::Long nNew)
TextFrameIndex GetNextOffset() const
sal_uInt16 GetRubyHeight() const
SwRedlineItr * GetRedln()
SwBracket * GetBrackets() const
bool IsFootnoteDone() const
SwDoubleLinePortion(SwDoubleLinePortion &rDouble, TextFrameIndex nEnd)
const std::shared_ptr< const vcl::text::TextLayoutCache > & GetCachedVclData() const
const SwFormatRuby & GetRuby() const
SwTwips AdjustBaseLine(const SwLineLayout &rLine, const SwLinePortion *pPor, SwTwips nPorHeight=0, SwTwips nAscent=0, const bool bAutoToCentered=false) const
static bool lcl_CheckRotation(const SfxPoolItem *const pItem, const SvxCharRotateItem *&rpRef, bool &rValue)
SwRowFrame is one table row in the document layout.
sal_uInt16 GetAscent() const
void SetLLSpaceAdd(tools::Long nNew, sal_uInt16 nIdx)
bool m_bDetectedRangeSegmentation false
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &nOffset) const override
void SetAscent(const SwTwips nNewAsc)