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() )
249 else if ( pPor->IsMultiPortion() &&
372 ( nSpaceAdd > 0 ?
CalcSpacing( nSpaceAdd, rInf ) : 0 ) );
376 aBlank.
Width( nChWidth );
385 aBlank.
Paint( rInf );
411 nMaxWidth -= rInf.
X();
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();
538 nMultiSpace /= sal_Int32(nMyBlank);
544 pVec->insert( pVec->begin(), nMultiSpace );
566 , m_nRubyOffset( rRuby.GetRubyOffset() )
567 , m_nAdjustment( rRuby.GetAdjustment() )
607 static_txtattr_cast<SwTextRuby const*>(rCreate.
pAttr)->GetCharFormat();
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 )
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);
1047 pActiveRotateItem = pNodeRotateItem;
1051 pNodeRotateItem =
nullptr;
1053 if (SfxItemState::SET == startPos.first->GetSwAttrSet().GetItemState(
1057 pActiveTwoLinesItem = pNodeTwoLinesItem;
1061 pNodeTwoLinesItem =
nullptr;
1066 if (!pRuby && !pActiveTwoLinesItem && !pActiveRotateItem)
1074 aRet.
pItem =
nullptr;
1081 if (pActiveTwoLinesHint ||
1082 (pNodeTwoLinesItem && pNodeTwoLinesItem == pActiveTwoLinesItem &&
1089 std::deque<TextFrameIndex> aEnd;
1096 if (pActiveTwoLinesHint)
1098 aRet.
pItem =
nullptr;
1099 aRet.
pAttr = pActiveTwoLinesHint;
1101 if (pNodeTwoLinesItem)
1116 aRet.
pItem = pNodeTwoLinesItem;
1117 aRet.
pAttr =
nullptr;
1144 for (sw::MergedAttrIterMulti iter = iterAtStartOfNode; ; )
1147 SwTextAttr const*
const pTmp = iter.NextAttr(pNode);
1152 assert(startPos.first->GetIndex() <= pNode->
GetIndex());
1158 if (nTmpEnd <= rPos)
1168 assert(rPos <= nTmpEnd);
1171 if (rPos < nTmpStart)
1178 if (!bOn || aEnd.back() < nTmpStart)
1185 while( !aEnd.empty() && aEnd.back() <= rPos )
1194 aEnd.push_front( rPos );
1207 if (aEnd.back() < nTmpEnd)
1208 aEnd.back() = nTmpEnd;
1216 if (nTmpEnd < aEnd.back())
1217 aEnd.push_back( nTmpEnd );
1218 else if( aEnd.size() > 1 )
1221 aEnd.back() = nTmpEnd;
1225 if( bOn && !aEnd.empty() )
1229 if (pActiveRotateHint ||
1230 (pNodeRotateItem && pNodeRotateItem == pActiveRotateItem &&
1238 std::deque<TextFrameIndex> aEnd;
1242 bool bOn = pNodeTwoLinesItem !=
nullptr;
1248 for (sw::MergedAttrIterMulti iter = iterAtStartOfNode; ; )
1251 SwTextAttr const*
const pTmp = iter.NextAttr(pNode);
1256 assert(startPos.first->GetIndex() <= pNode->
GetIndex());
1262 if (nTmpEnd <= n2Start)
1272 assert(n2Start <= nTmpEnd);
1275 if (n2Start < nTmpStart)
1277 if (bOn || aEnd.back() < nTmpStart)
1279 n2Start = nTmpStart;
1280 while( !aEnd.empty() && aEnd.back() <= n2Start )
1287 aEnd.push_front( n2Start );
1303 if (aEnd.back() < nTmpEnd)
1304 aEnd.back() = nTmpEnd;
1309 if (nTmpEnd < aEnd.back())
1310 aEnd.push_back( nTmpEnd );
1311 else if( aEnd.size() > 1 )
1314 aEnd.back() = nTmpEnd;
1318 if( !bOn && !aEnd.empty() )
1319 n2Start = aEnd.back();
1325 if (pActiveRotateHint)
1327 aRet.
pItem =
nullptr;
1328 aRet.
pAttr = pActiveRotateHint;
1330 if (pNodeRotateItem)
1333 bOn = pNodeRotateItem->
GetValue() ==
1343 aRet.
pItem = pNodeRotateItem;
1344 aRet.
pAttr =
nullptr;
1348 for (sw::MergedAttrIterMulti iter = iterAtStartOfNode; ; )
1351 SwTextAttr const*
const pTmp = iter.NextAttr(pNode);
1356 assert(startPos.first->GetIndex() <= pNode->
GetIndex());
1362 if (nTmpEnd <= rPos)
1372 assert(rPos <= nTmpEnd);
1375 if (rPos < nTmpStart)
1377 if (!bOn || aEnd.back() < nTmpStart)
1380 while( !aEnd.empty() && aEnd.back() <= rPos )
1387 aEnd.push_front( rPos );
1402 if (aEnd.back() < nTmpEnd)
1403 aEnd.back() = nTmpEnd;
1408 if (nTmpEnd < aEnd.back())
1409 aEnd.push_back( nTmpEnd );
1410 else if( aEnd.size() > 1 )
1413 aEnd.back() = nTmpEnd;
1417 if( bOn && !aEnd.empty() )
1419 if( rPos > n2Start )
1434class SwSpaceManipulator
1438 std::vector<tools::Long>* m_pOldSpaceAdd;
1439 sal_uInt16 m_nOldSpaceIndex;
1446 ~SwSpaceManipulator();
1448 tools::Long GetSpaceAdd()
const {
return m_nSpaceAdd; }
1458 m_pOldSpaceAdd = m_rInfo.GetpSpaceAdd();
1459 m_nOldSpaceIndex = m_rInfo.GetSpaceIdx();
1460 m_nOldDir = m_rInfo.GetDirection();
1461 m_rInfo.SetDirection(m_rMulti.GetDirection());
1462 m_bSpaceChg =
false;
1464 if (m_rMulti.IsDouble())
1466 m_nSpaceAdd = (m_pOldSpaceAdd && !m_rMulti.HasTabulator()) ? m_rInfo.GetSpaceAdd() : 0;
1467 if (m_rMulti.GetRoot().IsSpaceAdd())
1469 m_rInfo.SetpSpaceAdd(m_rMulti.GetRoot().GetpLLSpaceAdd());
1470 m_rInfo.ResetSpaceIdx();
1471 m_bSpaceChg = m_rMulti.ChgSpaceAdd(&m_rMulti.GetRoot(), m_nSpaceAdd);
1473 else if (m_rMulti.HasTabulator())
1474 m_rInfo.SetpSpaceAdd(
nullptr);
1476 else if (!m_rMulti.IsBidi())
1478 m_rInfo.SetpSpaceAdd(m_rMulti.GetRoot().GetpLLSpaceAdd());
1479 m_rInfo.ResetSpaceIdx();
1483void SwSpaceManipulator::SecondLine()
1487 m_rInfo.RemoveFirstSpaceAdd();
1488 m_bSpaceChg =
false;
1494 m_rInfo.ResetSpaceIdx();
1495 m_bSpaceChg = m_rMulti.ChgSpaceAdd(pLay, m_nSpaceAdd);
1499 m_rInfo.SetpSpaceAdd((!m_rMulti.IsDouble() || m_rMulti.HasTabulator()) ?
nullptr
1501 m_rInfo.SetSpaceIdx(m_nOldSpaceIndex);
1505SwSpaceManipulator::~SwSpaceManipulator()
1509 m_rInfo.RemoveFirstSpaceAdd();
1510 m_bSpaceChg =
false;
1512 m_rInfo.SetpSpaceAdd(m_pOldSpaceAdd);
1513 m_rInfo.SetSpaceIdx(m_nOldSpaceIndex);
1514 m_rInfo.SetDirection(m_nOldDir);
1525 sal_uInt16 nRubyHeight = 0;
1526 bool bRubyTop =
true;
1535 const bool bRubyInGrid = bHasGrid && rMulti.
IsRuby();
1537 const sal_uInt16 nOldHeight = rMulti.
Height();
1548 bool bEnvDir =
false;
1549 bool bThisDir =
false;
1550 bool bFrameDir =
false;
1555 OSL_ENSURE( ! pEnvPor || pEnvPor->
IsBidi(),
1556 "Oh no, I expected a BidiPortion" );
1558 bEnvDir = pEnvPor ? ((
static_cast<const SwBidiPortion*
>(pEnvPor)->GetLevel() % 2) != 0) : bFrameDir;
1559 bThisDir = (
static_cast<SwBidiPortion&
>(rMulti).GetLevel() % 2) != 0;
1562#if OSL_DEBUG_LEVEL > 1
1564 if( rMulti.
Width() > 1 && ! pEnvPor )
1569 rMulti.
Height( nOldHeight );
1582 SwSpaceManipulator aManip(
GetInfo(), rMulti );
1584 std::optional<SwFontSave> oFontSave;
1585 std::unique_ptr<SwFont> pTmpFnt;
1595 oFontSave.emplace(
GetInfo(), pTmpFnt.get(),
this );
1624 nOfst = nTmpX + rMulti.
Width();
1632 else if ( rMulti.
IsBidi() )
1636 if ( bEnvDir != bThisDir )
1642 if ( bFrameDir == bThisDir )
1651 aLayoutModeModifier.
Modify( bThisDir );
1656 bool bRest = pLay->
IsRest();
1659 OSL_ENSURE(
nullptr ==
GetInfo().GetUnderFnt() || rMulti.
IsBidi(),
1660 " Only BiDi portions are allowed to use the common underlining font" );
1671 const sal_uInt16 nAdjustment = ( pLay->
Height() - pPor->
Height() ) / 2 +
1674 GetInfo().
X( nOfst - nAdjustment );
1676 GetInfo().
X( nOfst + nAdjustment );
1684 if ( bRubyTop != ( pLay == &rMulti.
GetRoot() ) )
1687 else if ( bRubyTop )
1689 nAdjustment = nRubyHeight - pPor->
Height();
1713 bool bSeeked =
true;
1745 if ( pUnderLineFnt )
1762 OSL_ENSURE( rMulti.
IsBidi(),
"Only nesting of bidi portions is allowed" );
1768 bFirst &= !pPor->
GetLen();
1775 if( !pPor && pLay->
GetNext() )
1780 aManip.SecondLine();
1799 else if ( bHasGrid && rMulti.
IsRuby() )
1806 nOfst += nRubyHeight;
1848 aManip.GetSpaceAdd(), false );
1868 bool bRet = rpField !=
nullptr;
1901 rInf.
SetIdx( nStartIdx );
1924 std::optional<SwFontSave> oFontSave;
1925 std::unique_ptr<SwFont> xTmpFont;
1934 oFontSave.emplace(rInf, xTmpFont.get(),
this);
1956 OSL_ENSURE( pPage,
"No page in frame!");
1962 while ( pUpperFrame && !pUpperFrame->
IsCellFrame() )
1963 pUpperFrame = pUpperFrame->
GetUpper();
1964 assert(pUpperFrame);
1970 pUpperFrame = pPage;
1975 nMaxWidth = pUpperFrame ?
1989 SwTwips nMinWidth = nTmpX + 1;
1990 SwTwips nActWidth = nMaxWidth;
2004 pSecondRest =
nullptr;
2016 nMultiLen = nMultiLen - rInf.
GetIdx();
2020 const OUString* pOldText = &(rInf.
GetText());
2022 std::shared_ptr<const vcl::text::TextLayoutCache>
const pOldCachedVclData(rInf.
GetCachedVclData());
2025 OUString
const aMultiStr( rInf.
GetText().copy(0, sal_Int32(nMultiLen + rInf.
GetIdx())) );
2039 bool bRubyTop =
false;
2051 aInf.
Width( sal_uInt16(nActWidth) );
2052 aInf.
RealWidth( sal_uInt16(nActWidth) );
2065 auto *
const pPrevious = pBookmark->FindPrevPortion(rInf.
GetRoot());
2066 assert(!pPrevious || pPrevious->GetNextPortion() == pBookmark);
2069 pPrevious->SetNextPortion(
nullptr);
2078 OSL_ENSURE( pFirstRest->
InFieldGrp(),
"BuildMulti: Fieldrest expected");
2089 if ( bHasGrid && aInf.
IsRuby() && bRubyTop )
2093 if( pFirstRest || !aInf.
IsRuby() )
2125 OSL_ENSURE( pSecondRest->
InFieldGrp(),
"Fieldrest expected");
2131 if( !rMulti.
OnTop() && nFirstLen < nMultiLen )
2139 if ( bHasGrid && aTmp.
IsRuby() && ! bRubyTop )
2180 nMinWidth = nActWidth;
2181 nActWidth = ( 3 * nMaxWidth + nMinWidth + 3 ) / 4;
2185 bFirstMulti =
false;
2186 if( nActWidth <= nMinWidth )
2195 if( nActWidth > nTmpX + rMulti.
Width() + 6 )
2196 nActWidth = nTmpX + rMulti.
Width() + 6;
2197 nMaxWidth = nActWidth;
2198 nActWidth = ( 3 * nMaxWidth + nMinWidth + 3 ) / 4;
2199 if( nActWidth >= nMaxWidth )
2205 pNextFirst =
nullptr;
2243 rInf.
SetIdx( nStartIdx );
2270 rMulti.
Height( sal_uInt16(nH) );
2275 else if ( rMulti.
IsBidi() )
2277 bRet = rMulti.
GetLen() < nMultiLen || pNextFirst;
2283 OSL_ENSURE( !pNextFirst || pNextFirst->
InFieldGrp(),
2284 "BuildMultiPortion: Surprising restportion, field expected" );
2288 nMultiLen + rInf.
GetIdx() );
2289 else if( rMulti.
IsRuby() )
2291 OSL_ENSURE( !pNextSecond || pNextSecond->
InFieldGrp(),
2292 "BuildMultiPortion: Surprising restportion, field expected" );
2298 nMultiLen + rInf.
GetIdx() );
2359 if( pNextFirst && pTmp )
2409 if( pPor->
GetLen() && !pHelpMulti )
2411 nMultiPos = nMultiPos + pPor->
GetLen();
2412 pTmpMulti =
nullptr;
2417 pTmpMulti =
nullptr;
2422 OSL_ENSURE( !pHelpMulti || pHelpMulti->
IsBidi(),
2423 "Nested multiportions are forbidden." );
2433 if( !pPor && pTmpMulti )
2438 if( !pHelpMulti->
IsRuby() )
2440 pTmpMulti =
nullptr;
2446 pHelpMulti = pTmpMulti;
2447 nMultiPos = nMultiPos - pHelpMulti->
GetLen();
2479 nPosition = nMultiPos + pHelpMulti->
GetLen();
2484 OSL_ENSURE( !pHelpMulti->
GetLen(),
"Multiportion without attribute?" );
2493 if( pRest || nMultiPos > nPosition || ( pHelpMulti->
IsRuby() &&
2499 else if( pHelpMulti->
IsBidi() )
2501 else if( pHelpMulti->
IsRuby() )
2540 : pTextCursor(pCursor),
2541 pCurr(pCursor->m_pCurr),
2542 nStart(pCursor->m_nStart)
2575 if ( nX && pMulti->
IsBidi() )
css::chart::ChartAxisLabelPosition ePos
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...
Provides access to settings of a document.
constexpr tools::Long X() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Degree10 GetValue() const
bool IsBottomToTop() const
sal_Unicode GetStartBracket() const
sal_Unicode GetEndBracket() const
SwRedlineItr * GetRedln()
void SetPropFont(const sal_uInt8 nNew)
sal_uInt8 GetPropFont() const
SwTextAttr * GetAttr(TextFrameIndex nPos) const
Returns the attribute for a position.
SwBidiPortion(TextFrameIndex nEnd, sal_uInt8 nLv)
virtual bool ChgSpaceAdd(SwLineLayout *pCurr, tools::Long nSpaceAdd) const override
virtual tools::Long CalcSpacing(tools::Long nSpaceAdd, const SwTextSizeInfo &rInf) const override
TextFrameIndex GetSpaceCnt(const SwTextSizeInfo &rInf) const
sal_uInt8 GetLevel() const
Non-breaking space or non-breaking hyphen.
virtual void Paint(const SwTextPaintInfo &rInf) const override
for showing bookmark starts and ends; note that in contrast to SwControlCharPortion these do not have...
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
IDocumentSettingAccess const & getIDocumentSettingAccess() const
TextFrameIndex GetSmallerSpaceCnt() const
virtual ~SwDoubleLinePortion() override
void SetBrackets(const SwDoubleLinePortion &rDouble)
TextFrameIndex m_nBlank1
Number of blanks in the first line.
SwTwips GetLineDiff() const
static void ResetSpaceAdd(SwLineLayout *pCurr)
std::unique_ptr< SwBracket > m_pBracket
void PaintBracket(SwTextPaintInfo &rInf, tools::Long nSpaceAdd, bool bOpen) const
virtual tools::Long CalcSpacing(tools::Long nSpaceAdd, const SwTextSizeInfo &rInf) const override
virtual bool ChgSpaceAdd(SwLineLayout *pCurr, tools::Long nSpaceAdd) const override
SwDoubleLinePortion(SwDoubleLinePortion &rDouble, TextFrameIndex nEnd)
sal_uInt16 PreWidth() const
void FormatBrackets(SwTextFormatInfo &rInf, SwTwips &nMaxWidth)
sal_uInt16 BracketWidth()
TextFrameIndex m_nBlank2
Number of blanks in the second line.
void CalcBlanks(SwTextFormatInfo &rInf)
TextFrameIndex GetSpaceCnt() const
SwBracket * GetBrackets() const
sal_uInt16 PostWidth() const
TextFrameIndex GetNextOffset() const
void SetNextOffset(TextFrameIndex nNew)
const OUString & GetExp() const
void SetFollow(bool bNew)
To take Asian or other languages into consideration, an SwFont object consists of 3 SwSubFonts (Latin...
void SetVertical(Degree10 nDir, const bool bVertLayout=false, const bool bVertLayoutLRBT=false)
Degree10 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
void SetProportion(const sal_uInt8 nNewPropr)
SwFontScript GetActual() const
void SetActual(SwFontScript nNew)
const SwRect & getFramePrintArea() const
bool IsInFootnote() const
bool IsRightToLeft() const
SwLayoutFrame * GetUpper()
SwPageFrame * FindPageFrame()
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
void Modify(bool bChgToRTL)
Collection of SwLinePortion instances, representing one line of text.
sal_uInt16 GetLLSpaceAddCount() const
void CreateSpaceAdd(const tools::Long nInit=0)
void RemoveFirstLLSpaceAdd()
SwLinePortion * GetFirstPortion() const
void SetLLSpaceAdd(tools::Long nNew, sal_uInt16 nIdx)
void CalcLine(SwTextFormatter &rLine, SwTextFormatInfo &rInf)
tools::Long GetLLSpaceAdd(sal_uInt16 nIdx)
virtual void Height(const SwTwips nNew, const bool bText=true) override
void SetRealHeight(SwTwips nNew)
void SetNext(SwLineLayout *pNew)
std::vector< tools::Long > * GetpLLSpaceAdd() const
Base class for anything that can be part of a line in the Writer layout.
void dumpAsXmlAttributes(xmlTextWriterPtr writer, std::u16string_view rText, TextFrameIndex nOffset) const
virtual void FormatEOL(SwTextFormatInfo &rInf)
bool IsMarginPortion() const
SwLinePortion * GetNextPortion() const
void SetAscent(const SwTwips nNewAsc)
PortionType GetWhichPor() const
void SetNextPortion(SwLinePortion *pNew)
virtual void Paint(const SwTextPaintInfo &rInf) const =0
virtual SwLinePortion * Append(SwLinePortion *pPortion)
TextFrameIndex GetLen() const
void Move(SwTextPaintInfo &rInf)
SwLinePortion * FindLastPortion()
void AddPrtWidth(const SwTwips nNew)
bool IsBreakPortion() const
virtual void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &rOffset) const
void SetLen(TextFrameIndex const nLen)
bool IsMultiPortion() const
bool IsHolePortion() const
void PrePaint(const SwTextPaintInfo &rInf, const SwLinePortion *pLast) const
virtual void Paint(const SwTextPaintInfo &rInf) const override
void ActualizeTabulator()
virtual void HandlePortion(SwPortionHandler &rPH) const override
virtual tools::Long CalcSpacing(tools::Long nSpaceAdd, const SwTextSizeInfo &rInf) const override
void CalcSize(SwTextFormatter &rLine, SwTextFormatInfo &rInf)
void SetFlyInContent(bool bNew)
void SetRubyPosition(RubyPosition eNew)
RubyPosition GetRubyPosition() const
virtual bool ChgSpaceAdd(SwLineLayout *pCurr, tools::Long nSpaceAdd) const
bool HasTabulator() const
const SwLineLayout & GetRoot() const
virtual ~SwMultiPortion() override
sal_uInt8 GetDirection() const
void SetDirection(sal_uInt8 nNew)
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &nOffset) const override
SwNodeOffset GetIndex() const
A page of the document layout.
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
virtual void Text(TextFrameIndex nLength, PortionType nType)=0
(empty) destructor
Of course Writer needs its own rectangles.
void Height(tools::Long nNew)
void Width(tools::Long nNew)
SwRotatedPortion(TextFrameIndex const nEnd, sal_uInt8 nDir)
SwRowFrame is one table row in the document layout.
SwRubyPortion(const SwRubyPortion &rRuby, TextFrameIndex nEnd)
void Adjust_(SwTextFormatInfo &rInf)
TextFrameIndex GetRubyOffset() const
TextFrameIndex m_nRubyOffset
css::text::RubyAdjust m_nAdjustment
TextFrameIndex NextDirChg(const TextFrameIndex nPos, const sal_uInt8 *pLevel=nullptr) const
SwFontScript WhichFont(TextFrameIndex nIdx) const
sal_uInt8 DirType(const TextFrameIndex nPos) const
SwTableLine is one table row in the document model.
SwFrameFormat * GetFrameFormat()
void CalcNewBlock(SwLineLayout *pCurr, const SwLinePortion *pStopAt, SwTwips nReal=0, bool bSkipKashida=false)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
sal_Int32 GetAnyEnd() const
end (if available), else start
const sal_Int32 * End() const
sal_Int32 GetStart() const
const SwFormatRuby & GetRuby() const
SwTextCursor * pTextCursor
SwTextCursorSave(SwTextCursor *pTextCursor, SwMultiPortion *pMulti, SwTwips nY, SwTwips &nX, TextFrameIndex nCurrStart, tools::Long nSpaceAdd)
SwTwips AdjustBaseLine(const SwLineLayout &rLine, const SwLinePortion *pPor, SwTwips nPorHeight=0, SwTwips nAscent=0, const bool bAutoToCentered=false) const
SwLinePortion * GetLast()
void SetStop(const bool bNew)
void SetRest(SwLinePortion *pNewRest)
sal_uInt16 RealWidth() const
TextFrameIndex GetLineStart() const
void SetLast(SwLinePortion *pNewLast)
SwLinePortion * GetRest()
bool IsFootnoteDone() const
void SetNumDone(const bool bNew)
void SetFootnoteDone(const bool bNew)
bool IsFlyInCntBase() const
SwExpandPortion * NewFieldPortion(SwTextFormatInfo &rInf, const SwTextAttr *pHt) const
void FormatReset(SwTextFormatInfo &rInf)
SwLinePortion * MakeRestPortion(const SwLineLayout *pLine, TextFrameIndex nPos)
void BuildPortions(SwTextFormatInfo &rInf)
SwMultiPortion * m_pMulti
bool BuildMultiPortion(SwTextFormatInfo &rInf, SwMultiPortion &rMulti)
SwTextFormatInfo & GetInfo()
Represents the visualization of a paragraph.
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(TextFrameIndex nIndex) const
map position in potentially merged text frame to SwPosition
TextFrameIndex MapModelToView(SwTextNode const *pNode, sal_Int32 nIndex) const
bool GetRubyTextBelow() const
bool IsSquaredMode() const
sal_uInt16 GetRubyHeight() const
SwTextGrid GetGridType() const
SwParaPortion * GetParaPortion()
bool SeekAndChgBefore(SwTextSizeInfo &rInf)
TextFrameIndex GetStart() const
SwTwips GetLineHeight() const
const SwLineLayout * Next()
SwTextFrame * GetTextFrame()
bool SeekAndChg(SwTextSizeInfo &rInf)
SwTextSizeInfo & GetInfo()
SvxAdjust GetAdjust() const
SwTextNode is a paragraph in the document model.
virtual sal_Int32 Len() const override
void SetPaintOfst(const SwTwips nNew)
SwTwips GetPaintOfst() const
const Point & GetPos() const
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich, const Color *pColor=nullptr) const
void PaintMultiPortion(const SwRect &rPaint, SwMultiPortion &rMulti, const SwMultiPortion *pEnvPor=nullptr)
SwTextPaintInfo & GetInfo()
void CheckSpecialUnderline(const SwLinePortion *pPor, tools::Long nAdjustBaseLine=0)
This portion represents a part of the paragraph string.
static SwTextPortion * CopyLinePortion(const SwLinePortion &rPortion)
SwTextFrame * GetTextFrame()
void SetMulti(const bool bNew)
void SetUnderFnt(SwUnderlineFont *pNew)
void SetLen(const TextFrameIndex nNew)
void SetSnapToGrid(const bool bN)
const std::shared_ptr< const vcl::text::TextLayoutCache > & GetCachedVclData() const
void SetCachedVclData(std::shared_ptr< const vcl::text::TextLayoutCache > const &pCachedVclData)
void SetIdx(const TextFrameIndex nNew)
SwPosSize GetTextSize(OutputDevice *pOut, const SwScriptInfo *pSI, const OUString &rText, TextFrameIndex nIdx, TextFrameIndex nLen) const
SwUnderlineFont * GetUnderFnt() const
void SetDirection(const sal_uInt8 nNew)
void SetFirstMulti(const bool bNew)
void SetRuby(const bool bNew)
sal_uInt16 GetAscent() const
sal_Unicode GetChar(TextFrameIndex const nPos) const
void SetText(const OUString &rNew)
TextFrameIndex GetLen() const
std::optional< SwMultiCreator > GetMultiCreator(TextFrameIndex &rPos, SwMultiPortion const *pM) const
const OUString & GetText() const
TextFrameIndex GetIdx() const
void SetPos(const Point &rPoint)
An SwTextAttr container, stores all directly formatted text portions for a text node.
struct _xmlTextWriter * xmlTextWriterPtr
@ Variable
Frame is variable in Var-direction.
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(60)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
constexpr TypedWhichId< SvxCharRotateItem > RES_CHRATR_ROTATE(32)
constexpr TypedWhichId< SvxTwoLinesItem > RES_CHRATR_TWO_LINES(34)
constexpr TypedWhichId< SwFormatRuby > RES_TXTATR_CJK_RUBY(53)
#define CH_TXTATR_BREAKWORD
double getLength(const B2DPolygon &rCandidate)
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
Dialog to specify the properties of date form field.
vcl::Font GetFont(vcl::Font const &rFont, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
SwTextGridItem const * GetGridItem(SwPageFrame const *const)
static bool lcl_CheckRotation(const SfxPoolItem *const pItem, const SvxCharRotateItem *&rpRef, bool &rValue)
static bool lcl_ExtractFieldFollow(SwLineLayout *pLine, SwLinePortion *&rpField)
static bool lcl_Has2Lines(const SwTextAttr &rAttr, const SvxTwoLinesItem *&rpRef, bool &rValue)
static bool lcl_Check2Lines(const SfxPoolItem *const pItem, const SvxTwoLinesItem *&rpRef, bool &rValue)
static bool lcl_HasRotation(const SwTextAttr &rAttr, const SvxCharRotateItem *&rpRef, bool &rValue)
static void lcl_TruncateMultiPortion(SwMultiPortion &rMulti, SwTextFormatInfo &rInf, TextFrameIndex const nStartIdx)
#define SPACING_PRECISION_FACTOR
const SfxPoolItem * pItem
TextFrameIndex nStartOfAttr
Describes a part of a single text node, which will be part of a text frame, even when redlines are hi...
constexpr sal_Int32 COMPLETE_STRING