22 #include <string_view>
33 #include <unicode/uchar.h>
34 #include <com/sun/star/i18n/ScriptType.hpp>
35 #include <com/sun/star/i18n/CharacterIteratorMode.hpp>
36 #include <com/sun/star/i18n/CTLScriptType.hpp>
37 #include <com/sun/star/i18n/WordType.hpp>
38 #include <com/sun/star/i18n/XBreakIterator.hpp>
65 #include <unicode/ubidi.h>
69 #define IS_JOINING_GROUP(c, g) ( u_getIntPropertyValue( (c), UCHAR_JOINING_GROUP ) == U_JG_##g )
70 #define isAinChar(c) IS_JOINING_GROUP((c), AIN)
71 #define isAlefChar(c) IS_JOINING_GROUP((c), ALEF)
72 #define isDalChar(c) IS_JOINING_GROUP((c), DAL)
73 #if U_ICU_VERSION_MAJOR_NUM >= 58
74 #define isFehChar(c) (IS_JOINING_GROUP((c), FEH) || IS_JOINING_GROUP((c), AFRICAN_FEH))
76 #define isFehChar(c) IS_JOINING_GROUP((c), FEH)
78 #define isGafChar(c) IS_JOINING_GROUP((c), GAF)
79 #define isHehChar(c) IS_JOINING_GROUP((c), HEH)
80 #define isKafChar(c) IS_JOINING_GROUP((c), KAF)
81 #define isLamChar(c) IS_JOINING_GROUP((c), LAM)
82 #if U_ICU_VERSION_MAJOR_NUM >= 58
83 #define isQafChar(c) (IS_JOINING_GROUP((c), QAF) || IS_JOINING_GROUP((c), AFRICAN_QAF))
85 #define isQafChar(c) IS_JOINING_GROUP((c), QAF)
87 #define isRehChar(c) IS_JOINING_GROUP((c), REH)
88 #define isTahChar(c) IS_JOINING_GROUP((c), TAH)
89 #define isTehMarbutaChar(c) IS_JOINING_GROUP((c), TEH_MARBUTA)
90 #define isWawChar(c) IS_JOINING_GROUP((c), WAW)
91 #define isSeenOrSadChar(c) (IS_JOINING_GROUP((c), SAD) || IS_JOINING_GROUP((c), SEEN))
97 switch (u_getIntPropertyValue(cCh, UCHAR_JOINING_GROUP))
101 #if U_ICU_VERSION_MAJOR_NUM >= 58
102 case U_JG_AFRICAN_NOON:
107 case U_JG_BURUSHASKI_YEH_BARREE:
122 switch (u_getIntPropertyValue(cCh, UCHAR_JOINING_GROUP))
126 case U_JG_YEH_BARREE:
127 case U_JG_BURUSHASKI_YEH_BARREE:
128 case U_JG_YEH_WITH_TAIL:
141 return u_getIntPropertyValue( cCh, UCHAR_JOINING_TYPE ) == U_JT_TRANSPARENT;
154 const int32_t nJoiningType = u_getIntPropertyValue( cPrevCh, UCHAR_JOINING_TYPE );
155 bool bRet = nJoiningType != U_JT_RIGHT_JOINING && nJoiningType != U_JT_NON_JOINING;
164 static bool lcl_HasStrongLTR ( std::u16string_view rText, sal_Int32 nStart, sal_Int32 nEnd )
166 for( sal_Int32 nCharIdx = nStart; nCharIdx < nEnd; ++nCharIdx )
168 const UCharDirection nCharDir = u_charDirection ( rText[ nCharIdx ] );
169 if ( nCharDir == U_LEFT_TO_RIGHT ||
170 nCharDir == U_LEFT_TO_RIGHT_EMBEDDING ||
171 nCharDir == U_LEFT_TO_RIGHT_OVERRIDE )
186 std::vector<SwLineLayout*> aNexts;
190 aNexts.push_back(pNext);
196 for (
auto a : aNexts)
204 m_nTextHeight = nNew;
215 m_pLLSpaceAdd.reset();
230 SetBlinking(
false );
235 SetNextPortion( pIns );
240 return mpNextPortion->SwLinePortion::Insert( pIns );
250 return mpNextPortion->SwLinePortion::Append( pIns );
268 SwMarginPortion *pLeft = (GetNextPortion() && GetNextPortion()->IsMarginPortion()) ?
269 static_cast<SwMarginPortion *>(GetNextPortion()) :
nullptr;
270 if( !GetNextPortion() )
276 SetNextPortion( pLeft );
294 pLeft->
Join( static_cast<SwGluePortion*>(pPos) );
296 if( GetpKanaComp() && !GetKanaComp().empty() )
297 GetKanaComp().pop_front();
307 if ( !m_pLLSpaceAdd )
310 SetLLSpaceAdd( 0, 0 );
315 m_pLLSpaceAdd.reset(
new std::vector<tools::Long> );
316 SetLLSpaceAdd( nInit, 0 );
322 bool bBlankOnly =
true;
323 while ( nStt < nEnd )
325 const sal_Unicode cChar = rText[ sal_Int32(nStt++) ];
340 sal_uInt16 nFlyAscent = 0;
341 sal_uInt16 nFlyHeight = 0;
342 sal_uInt16 nFlyDescent = 0;
343 bool bOnlyPostIts =
true;
346 bool bTmpDummy = !
GetLen();
356 const bool bIgnoreBlanksAndTabsForLineHeightCalculation =
360 bool bHasBlankPortion =
false;
361 bool bHasOnlyBlankPortions =
true;
366 if( mpNextPortion->IsBreakPortion() )
368 SetLen( mpNextPortion->GetLen() );
374 const sal_uInt16 nLineHeight =
Height();
375 Init( GetNextPortion() );
378 sal_uInt16 nMaxDescent = 0;
385 "sw.core",
"SwLineLayout::CalcLine: don't use SwLinePortions !" );
400 delete pLast->
Cut( pPos );
406 mnLineLength += pPos->
GetLen();
407 AddPrtWidth( pPos->
Width() );
410 if ( bIgnoreBlanksAndTabsForLineHeightCalculation )
418 bHasBlankPortion =
true;
433 bHasOnlyBlankPortions =
false;
437 sal_uInt16 nPosHeight = pPos->
Height();
438 sal_uInt16 nPosAscent = pPos->
GetAscent();
441 "sw.core",
"SwLineLayout::CalcLine: bad ascent or height" );
456 if( bTmpDummy && !mnLineLength )
460 if( nFlyHeight < nPosHeight )
461 nFlyHeight = nPosHeight;
462 if( nFlyAscent < nPosAscent )
463 nFlyAscent = nPosAscent;
464 if( nFlyDescent < nPosHeight - nPosAscent )
465 nFlyDescent = nPosHeight - nPosAscent;
473 if( nTmp > nPosAscent )
475 nPosHeight += nTmp - nPosAscent;
480 if( nTmp > nPosHeight )
483 Height( nPosHeight,
false );
484 mnAscent = nPosAscent;
485 nMaxDescent = nPosHeight - nPosAscent;
490 if(
Height() < nPosHeight )
493 if (bIgnoreBlanksAndTabsForLineHeightCalculation && pPos->
IsFlyCntPortion())
495 Height(std::max(nPosHeight, nLineHeight),
false);
502 pAsFly = static_cast<SwFlyCntPortion*>(pPos);
514 if( mnAscent < nPosAscent )
515 mnAscent = nPosAscent;
516 if( nMaxDescent < nPosHeight - nPosAscent )
517 nMaxDescent = nPosHeight - nPosAscent;
529 if( pPos->
GetExpText( rInf, aText ) && !aText.isEmpty() )
548 if(
Height() > nMaxDescent + mnAscent )
551 mnAscent =
Height() - nMaxDescent;
553 mnAscent = (
Height() + mnAscent - nMaxDescent ) / 2;
559 if( bTmpDummy && nFlyHeight )
561 mnAscent = nFlyAscent;
562 if( nFlyDescent > nFlyHeight - nFlyAscent )
563 Height( nFlyHeight + nFlyDescent,
false );
565 Height( nFlyHeight,
false );
567 else if( nMaxDescent >
Height() - mnAscent )
568 Height( nMaxDescent + mnAscent,
false );
570 if( bOnlyPostIts && !( bHasBlankPortion && bHasOnlyBlankPortions ) )
579 SetContent( !bTmpDummy );
582 if ( bIgnoreBlanksAndTabsForLineHeightCalculation &&
585 bHasBlankPortion =
true;
590 if ( bHasBlankPortion && bHasOnlyBlankPortions )
592 sal_uInt16 nTmpAscent = GetAscent();
593 sal_uInt16 nTmpHeight =
Height();
595 SetAscent( nTmpAscent );
596 Height( nTmpHeight,
false );
600 if( nLineWidth <
Width() )
602 SAL_WARN_IF( nLineWidth <
Width(),
"sw.core",
"SwLineLayout::CalcLine: line is bursting" );
603 SetDummy( bTmpDummy );
604 std::pair<SwTextNode const*, sal_Int32>
const start(
606 std::pair<SwTextNode const*, sal_Int32>
const end(
608 bool bHasRedline = rLine.
GetRedln();
611 OUString sRedlineText;
615 end.first->GetIndex(), end.second, sRedlineText, bHasRedlineEnd, eRedlineEnd);
618 SetRedlineText( sRedlineText );
620 SetRedlineEnd( bHasRedlineEnd );
621 if( eRedlineEnd != RedlineType::None )
622 SetRedlineEndType( eRedlineEnd );
625 SetRedline( bHasRedline );
635 const bool _bNoFlyCntPorAndLinePor )
const
648 while ( pTmpPortion )
653 ( !_bNoFlyCntPorAndLinePor ||
663 ( pTmpPortion != _pDontConsiderPortion );
667 _orObjAscent = std::max( _orObjAscent, nPortionAsc );
668 _orObjDescent = std::max( _orObjDescent, nPortionDesc );
673 _orAscent = std::max( _orAscent, nPortionAsc );
674 _orDescent = std::max( _orDescent, nPortionDesc );
683 m_bFormatAdj = m_bDummy = m_bEndHyph = m_bMidHyph = m_bFly
684 = m_bRest = m_bBlinking = m_bClipping = m_bContent = m_bRedline
685 = m_bRedlineEnd = m_bForcedLeftMargin = m_bHanging =
false;
686 m_eRedlineEnd = RedlineType::None;
690 : m_pNext( nullptr ),
693 m_bUnderscore( false )
727 : m_nInvalidityPos(0)
746 OSL_FAIL(
"Somebody tells lies about the script type!" );
763 std::optional<std::vector<sw::Extent>::const_iterator> oPrevIter,
764 std::vector<sw::Extent>::const_iterator iter,
765 std::vector<sw::Extent>::const_iterator
const end,
767 std::vector<std::pair<sw::mark::IBookmark const*, SwScriptInfo::MarkKind>> & rBookmarks,
768 std::vector<std::pair<TextFrameIndex, SwScriptInfo::MarkKind>> & o_rBookmarks)
771 for (
auto const& it : rBookmarks)
773 assert(iter->pNode == pNode || pNode->
GetIndex() < iter->pNode->GetIndex());
774 assert(!oPrevIter || (*oPrevIter)->pNode->GetIndex() <= pNode->
GetIndex());
788 SwPosition const& rStart(it.first->GetMarkStart());
789 SwPosition const& rEnd(it.first->GetMarkEnd());
790 assert(&rStart.nNode.GetNode() == pNode);
793 if (&rStart.nNode.GetNode() != iter->pNode
794 || rStart.nContent.GetIndex() < iter->nStart)
796 if (rEnd.nNode.GetIndex() < iter->pNode->GetIndex()
797 || (&rEnd.nNode.GetNode() == iter->pNode && rEnd.nContent.GetIndex() <= iter->nStart))
803 o_rBookmarks.emplace_back(nOffset, it.second);
807 else if (rStart.nContent.GetIndex() <= iter->nEnd)
809 auto const iterNext(iter + 1);
810 if (rStart.nContent.GetIndex() == iter->nEnd
812 ? &rEnd.nNode.GetNode() == iter->pNode
813 : (rEnd.nNode.GetIndex() < iterNext->pNode->GetIndex()
814 || (&rEnd.nNode.GetNode() == iterNext->pNode && rEnd.nContent.GetIndex() < iterNext->nStart))))
820 o_rBookmarks.emplace_back(
821 nOffset +
TextFrameIndex(rStart.nContent.GetIndex() - iter->nStart),
835 if (pNode->
GetIndex() < rEnd.nNode.GetIndex())
841 o_rBookmarks.emplace_back(nOffset, it.second);
848 SwPosition const& rEnd(it.first->GetMarkEnd());
849 assert(&rEnd.nNode.GetNode() == pNode);
853 || &rEnd.nNode.GetNode() != iter->pNode
854 || rEnd.nContent.GetIndex() <= iter->nStart)
856 SwPosition const& rStart(it.first->GetMarkStart());
859 ? ((*oPrevIter)->pNode->GetIndex() < rStart.nNode.GetIndex()
860 || ((*oPrevIter)->pNode == &rStart.nNode.GetNode()
861 && ((iter != end && &rEnd.nNode.GetNode() == iter->pNode && rEnd.nContent.GetIndex() == iter->nStart)
862 ? (*oPrevIter)->nEnd < rStart.nContent.GetIndex()
863 : (*oPrevIter)->nEnd <= rStart.nContent.GetIndex())))
864 : rStart.nNode == rEnd.nNode)
870 o_rBookmarks.emplace_back(nOffset, it.second);
874 else if (rEnd.nContent.GetIndex() <= iter->nEnd)
876 o_rBookmarks.emplace_back(
877 nOffset +
TextFrameIndex(rEnd.nContent.GetIndex() - iter->nStart),
892 SwPosition const& rPos(it.first->GetMarkPos());
893 assert(&rPos.nNode.GetNode() == pNode);
896 if (&rPos.nNode.GetNode() != iter->pNode
897 || rPos.nContent.GetIndex() < iter->nStart)
901 else if (rPos.nContent.GetIndex() <= iter->nEnd)
903 if (rPos.nContent.GetIndex() == iter->nEnd
904 && rPos.nContent.GetIndex() != iter->pNode->Len())
910 o_rBookmarks.emplace_back(
911 nOffset +
TextFrameIndex(rPos.nContent.GetIndex() - iter->nStart),
951 std::optional<std::vector<sw::Extent>::const_iterator> oPrevIter;
952 for (
auto iter = pMerged->
extents.begin(); iter != pMerged->
extents.end();
953 oPrevIter = iter, ++iter)
955 if (iter->pNode == pNode)
961 Range aRange( 0, pNode->
Len() > 0 ? pNode->
Len() - 1 : 0 );
963 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> bookmarks;
968 for (sal_Int32
i = 0;
i < aHiddenMulti.GetRangeCount(); ++
i)
970 const Range& rRange = aHiddenMulti.GetRange(
i );
971 const sal_Int32 nStart = rRange.
Min();
972 const sal_Int32 nEnd = rRange.
Max() + 1;
978 assert(!(iter->nStart <= nStart && nStart < iter->nEnd && iter->nEnd < nEnd));
979 assert(!(nStart < iter->nStart && iter->nStart < nEnd && nEnd <= iter->nEnd));
980 if (iter->nStart <= nStart && nEnd <= iter->nEnd)
1001 assert(iter->pNode == pNode);
1010 Range aRange( 0, !rText.isEmpty() ? rText.getLength() - 1 : 0 );
1012 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> bookmarks;
1015 for (
auto const& it : bookmarks)
1031 for (sal_Int32
i = 0;
i < aHiddenMulti.GetRangeCount(); ++
i)
1033 const Range& rRange = aHiddenMulti.GetRange(
i );
1034 const sal_Int32 nStart = rRange.
Min();
1035 const sal_Int32 nEnd = rRange.
Max() + 1;
1055 size_t nCntComp = 0;
1057 size_t nCntKash = 0;
1059 sal_Int16 nScript = i18n::ScriptType::LATIN;
1064 auto const& rParaItems((pMerged ? *pMerged->
pParaPropsNode : rNode).GetSwAttrSet());
1066 const bool bAdjustBlock = SvxAdjust::Block == rParaItems.GetAdjust().GetAdjust();
1086 if( CharCompressType::NONE != aCompEnum )
1117 while ( nChg > nGrpStart &&
1123 if ( nChg == nGrpStart )
1137 if( nChg >= nLastCompression +
GetCompLen( nCntComp ) )
1139 nLastCompression = nChg;
1150 if( nCntKash && i18n::ScriptType::COMPLEX == nScript )
1176 SAL_WARN_IF( i18n::ScriptType::LATIN != nScript &&
1177 i18n::ScriptType::ASIAN != nScript &&
1178 i18n::ScriptType::COMPLEX != nScript,
"sw.core",
"Wrong default language" );
1187 if ( nScript != nNextScript )
1191 nScript = nNextScript;
1201 "sw.core",
"Inserting WEAK into SwScriptInfo structure" );
1205 rText, sal_Int32(nSearchStt), nScript));
1213 if( i18n::ScriptType::COMPLEX == nScript )
1216 rText, sal_Int32(nSearchStt) );
1218 short nCurrentScriptType = nScriptType;
1219 while( css::i18n::CTLScriptType::CTL_UNKNOWN == nCurrentScriptType || nScriptType == nCurrentScriptType )
1223 rText, sal_Int32(nNextCTLScriptStart)));
1225 || nNextCTLScriptStart >= nChg)
1228 rText, sal_Int32(nNextCTLScriptStart));
1230 nChg = std::min( nChg, nNextCTLScriptStart );
1236 && (i18n::ScriptType::WEAK ==
1239 int8_t
nType = u_charType(rText[sal_Int32(nChg)]);
1240 if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK ||
1241 nType == U_COMBINING_SPACING_MARK )
1258 if ( CharCompressType::NONE != aCompEnum &&
1259 i18n::ScriptType::ASIAN == nScript )
1265 while ( nLastCompression < nChg )
1267 sal_Unicode cChar = rText[ sal_Int32(nLastCompression) ];
1273 case 0x3008:
case 0x300A:
case 0x300C:
case 0x300E:
1274 case 0x3010:
case 0x3014:
case 0x3016:
case 0x3018:
1275 case 0x301A:
case 0x301D:
1279 case 0x3009:
case 0x300B:
1280 case 0x300D:
case 0x300F:
case 0x3011:
case 0x3015:
1281 case 0x3017:
case 0x3019:
case 0x301B:
case 0x301E:
1285 case 0x3001:
case 0x3002:
1289 eState = ( 0x3040 <= cChar && 0x3100 > cChar ) ?
KANA :
NONE;
1293 if( ePrevState != eState )
1295 if ( ePrevState !=
NONE )
1298 if ( CharCompressType::PunctuationAndKana == aCompEnum ||
1299 ePrevState !=
KANA )
1302 nLastCompression - nPrevChg, ePrevState);
1306 ePrevState = eState;
1307 nPrevChg = nLastCompression;
1314 if ( ePrevState !=
NONE )
1317 if ( CharCompressType::PunctuationAndKana == aCompEnum ||
1318 ePrevState !=
KANA )
1321 nLastCompression - nPrevChg, ePrevState);
1327 else if ( bAdjustBlock && i18n::ScriptType::COMPLEX == nScript )
1331 std::function<LanguageType (sal_Int32, sal_Int32, bool)>
const pGetLangOfCharM(
1332 [&pMerged](sal_Int32
const nBegin, sal_uInt16
const script,
bool const bNoChar)
1334 std::pair<SwTextNode const*, sal_Int32>
const pos(
1336 return pos.first->GetLang(pos.second, bNoChar ? 0 : 1, script);
1338 std::function<LanguageType (sal_Int32, sal_Int32, bool)>
const pGetLangOfChar1(
1339 [&rNode](sal_Int32
const nBegin, sal_uInt16
const script,
bool const bNoChar)
1340 {
return rNode.GetLang(nBegin, bNoChar ? 0 : 1, script); });
1341 auto pGetLangOfChar(pMerged ? pGetLangOfCharM : pGetLangOfChar1);
1343 i18n::WordType::DICTIONARY_WORD,
1344 sal_Int32(nLastKashida), sal_Int32(nChg));
1349 const OUString& rWord = aScanner.
GetWord();
1352 sal_Int32 nKashidaPos = -1;
1356 int nPriorityLevel = 7;
1359 sal_Int32 nWordLen = rWord.getLength();
1365 while (nIdx < nWordLen)
1367 cCh = rWord[ nIdx ];
1373 nKashidaPos = aScanner.
GetBegin() + nIdx;
1379 if (nPriorityLevel >= 1 && nIdx < nWordLen - 1)
1382 && (rWord[ nIdx+1 ] != 0x200C) )
1384 nKashidaPos = aScanner.
GetBegin() + nIdx;
1391 if ( nPriorityLevel >= 2 && nIdx > 0 )
1395 (
isHehChar ( cCh ) && nIdx == nWordLen - 1))
1398 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1402 nKashidaPos = aScanner.
GetBegin() + nIdx - 1;
1410 if ( nPriorityLevel >= 3 && nIdx > 0 )
1417 && nIdx == nWordLen - 1))
1419 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1423 nKashidaPos = aScanner.
GetBegin() + nIdx - 1;
1431 if ( nPriorityLevel >= 4 && nIdx > 0 && nIdx < nWordLen - 1 )
1439 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1443 nKashidaPos = aScanner.
GetBegin() + nIdx - 1;
1452 if ( nPriorityLevel >= 5 && nIdx > 0 )
1459 && nIdx == nWordLen - 1))
1461 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1465 nKashidaPos = aScanner.
GetBegin() + nIdx - 1;
1472 if ( nPriorityLevel >= 6 && nIdx > 0 )
1477 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1481 nKashidaPos = aScanner.
GetBegin() + nIdx - 1;
1495 if ( -1 != nKashidaPos )
1506 nLastCompression = nChg;
1507 nLastKashida = nChg;
1510 #if OSL_DEBUG_LEVEL > 0
1513 bool bWrongKash =
false;
1517 if ( nCurrKashidaPos <= nTmpKashidaPos )
1522 nTmpKashidaPos = nCurrKashidaPos;
1524 SAL_WARN_IF( bWrongKash,
"sw.core",
"Kashida array contains wrong data" );
1546 if ( nCurrDirType % 2 == UBIDI_RTL ||
1547 (nCurrDirType > UBIDI_LTR &&
1551 size_t nScriptIdx = 0;
1566 "sw.core",
"Script override with CTL font trouble" );
1589 #if OSL_DEBUG_LEVEL > 1
1592 sal_uInt8 nLastTyp = i18n::ScriptType::WEAK;
1597 nLastPos >= rScriptChange.position,
1598 "sw.core",
"Heavy InitScriptType() confusion" );
1599 nLastPos = rScriptChange.position;
1600 nLastTyp = rScriptChange.type;
1615 UErrorCode nError = U_ZERO_ERROR;
1616 UBiDi* pBidi = ubidi_openSized( rText.getLength(), 0, &nError );
1617 nError = U_ZERO_ERROR;
1619 ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(rText.getStr()), rText.getLength(),
1621 nError = U_ZERO_ERROR;
1622 int nCount = ubidi_countRuns( pBidi, &nError );
1625 UBiDiLevel nCurrDir;
1626 for (
int nIdx = 0; nIdx < nCount; ++nIdx )
1628 ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir );
1633 ubidi_close( pBidi );
1646 for(
size_t nX = 0; nX < nEnd; ++nX )
1659 for(
size_t nX = 0; nX < nEnd; ++nX )
1672 const sal_uInt8 nCurrDir = pLevel ? *pLevel : 62;
1674 for(
size_t nX = 0; nX < nEnd; ++nX )
1677 ( nX + 1 == nEnd ||
GetDirType( nX + 1 ) <= nCurrDir ) )
1687 for(
size_t nX = 0; nX < nEnd; ++nX )
1712 if (nPos < it.first)
1723 for (
auto const& it : m_Bookmarks)
1725 if (
nPos == it.first)
1729 else if (
nPos < it.first)
1739 const sal_Int32 nStt,
const sal_Int32 nEnd,
1744 std::vector<sal_Int32> aList;
1745 sal_Int32 nHiddenStart;
1746 sal_Int32 nHiddenEnd;
1747 sal_Int32 nNumOfHiddenChars = 0;
1749 auto rFirst( aList.crbegin() );
1750 auto rLast( aList.crend() );
1751 while ( rFirst != rLast )
1753 nHiddenEnd = *(rFirst++);
1754 nHiddenStart = *(rFirst++);
1756 if ( nHiddenEnd < nStt || nHiddenStart > nEnd )
1759 while ( nHiddenStart < nHiddenEnd && nHiddenStart < nEnd )
1761 if (nHiddenStart >= nStt)
1763 rText[nHiddenStart] = cChar;
1764 ++nNumOfHiddenChars;
1770 return nNumOfHiddenChars;
1776 std::vector<sal_Int32> aList;
1777 sal_Int32 nHiddenStart;
1778 sal_Int32 nHiddenEnd;
1780 auto rFirst( aList.crbegin() );
1781 auto rLast( aList.crend() );
1782 while ( rFirst != rLast )
1784 nHiddenEnd = *(rFirst++);
1785 nHiddenStart = *(rFirst++);
1787 SwPaM aPam( rNode, nHiddenStart, rNode, nHiddenEnd );
1793 sal_Int32& rnStartPos, sal_Int32& rnEndPos,
1794 std::vector<sal_Int32>* pList )
1799 bool bNewContainsHiddenChars =
false;
1807 if ( !bContainsHiddenChars )
1814 pList->push_back( 0 );
1815 pList->push_back(rNode.
GetText().getLength());
1819 rnEndPos = rNode.
GetText().getLength();
1833 const bool bNewHiddenCharsHidePara =
1834 rnStartPos == 0 && rnEndPos >= rNode.
GetText().getLength();
1844 ? rNode.
GetText().getLength() - 1
1848 for( sal_Int32
i = 0;
i < aHiddenMulti.GetRangeCount(); ++
i )
1850 const Range& rRange = aHiddenMulti.GetRange(
i );
1851 const sal_Int32 nHiddenStart = rRange.
Min();
1852 const sal_Int32 nHiddenEnd = rRange.
Max() + 1;
1854 if ( nHiddenStart > nPos )
1856 if (nPos < nHiddenEnd)
1858 rnStartPos = nHiddenStart;
1859 rnEndPos = std::min<sal_Int32>(nHiddenEnd,
1867 for( sal_Int32
i = 0;
i < aHiddenMulti.GetRangeCount(); ++
i )
1869 const Range& rRange = aHiddenMulti.GetRange(
i );
1870 pList->push_back( rRange.
Min() );
1871 pList->push_back( rRange.
Max() + 1 );
1875 bNewContainsHiddenChars = aHiddenMulti.GetRangeCount() > 0;
1878 return bNewContainsHiddenChars;
1888 for(
size_t nX = 0; nX < nEnd; ++nX )
1893 if ( nHiddenStart > nPos )
1895 if (nPos < nHiddenEnd)
1897 rnStartPos = nHiddenStart;
1898 rnEndPos = nHiddenEnd;
1908 sal_Int32 nStartPos;
1919 for(
size_t nX = 0; nX < nEnd; ++nX )
1940 for(
size_t nX = 0; nX < nCnt; ++nX )
1945 if ( nKanaStart >= nEnd )
1946 return SAL_MAX_SIZE;
1948 if ( nStart < nKanaEnd )
1952 return SAL_MAX_SIZE;
1956 const sal_uInt16 nCompress,
const sal_uInt16 nFontHeight,
1958 Point* pPoint )
const
1960 SAL_WARN_IF( !nCompress,
"sw.core",
"Compression without compression?!" );
1961 SAL_WARN_IF( !nLen,
"sw.core",
"Compression without text?!" );
1967 const tools::Long nMinWidth = ( 3 * nFontHeight ) / 4;
1969 size_t nCompIdx =
HasKana( nIdx, nLen );
1971 if ( SAL_MAX_SIZE == nCompIdx )
1981 nI = sal_Int32(nChg - nIdx);
1984 else if( nIdx < nChg + nCompLen )
1985 nCompLen -= nIdx - nChg;
1987 if( nIdx > nLen || nCompIdx >= nCompCount )
1991 tools::Long nLast = nI ? pKernArray[ nI - 1 ] : 0;
1999 if( nCompLen > nLen )
2003 if ( pKernArray[ nI ] - nLast < nMinWidth )
2009 while( nIdx < nCompLen )
2014 nLast -= pKernArray[ nI ];
2027 pPoint->AdjustX(nLast );
2037 nLast = pKernArray[ nI ];
2039 pKernArray[ nI - 1 ] += nMove;
2040 pKernArray[ nI++ ] -= nSub;
2049 if( ++nCompIdx < nCompCount )
2052 if( nTmpChg > nLen )
2057 while( nIdx < nTmpChg )
2059 nLast = pKernArray[ nI ];
2060 pKernArray[ nI++ ] -= nSub;
2063 }
while( nIdx < nLen );
2078 SAL_WARN_IF( !nLen,
"sw.core",
"Kashida justification without text?!" );
2085 size_t nCntKash = 0;
2095 size_t nCntKashEnd = nCntKash;
2103 size_t nActualKashCount = nCntKashEnd - nCntKash;
2104 for (
size_t i = nCntKash;
i < nCntKashEnd; ++
i)
2111 return nActualKashCount;
2125 while ( nIdx < nEnd )
2140 while ( nArrayPos < nArrayEnd )
2142 pKernArray[ sal_Int32(nArrayPos) ] += nKashAdd;
2144 pScrArray[ sal_Int32(nArrayPos) ] += nKashAdd;
2147 nKashAdd += nSpaceAdd;
2162 { UnicodeScript_kArabic, UnicodeScript_kArabic, sal_Int16(UnicodeScript_kArabic) },
2163 { UnicodeScript_kScriptCount, UnicodeScript_kScriptCount, sal_Int16(UnicodeScript_kScriptCount) }
2168 sal_Int32 nIdx = sal_Int32(nStt);
2169 const sal_Int32 nEnd = sal_Int32(nStt + nLen);
2189 return type == sal_Int16(UnicodeScript_kArabic);
2210 bool bMark, sal_Int32 nMarkCount)
2212 size_t nCntKash = 0;
2252 std::vector<TextFrameIndex>& rKashidaPosition)
2254 size_t nCntKash = 0;
2264 size_t nCntKashEnd = nCntKash;
2269 rKashidaPosition.push_back(
GetKashida(nCntKashEnd));
2310 SAL_WARN_IF( !pKashidaPositions || nCnt == 0,
"sw.core",
"Where are kashidas?" );
2312 size_t nCntKash = 0;
2313 sal_Int32 nKashidaPosIdx = 0;
2315 while (nCntKash <
CountKashida() && nKashidaPosIdx < nCnt)
2317 if ( pKashidaPositions [nKashidaPosIdx] >
GetKashida( nCntKash ) )
2339 SwTwips nNumOfTwipsToDistribute = nSpaceAdd * sal_Int32(nNumberOfBlanks) /
2345 for (sal_Int32 nI = 0; nI < sal_Int32(nLen); ++nI)
2347 const sal_Unicode cCh = rText[sal_Int32(nStt) + nI];
2350 if ( ( 0xE34 > cCh || cCh > 0xE3A ) &&
2351 ( 0xE47 > cCh || cCh > 0xE4E ) && cCh != 0xE31 )
2355 nSpaceAdd = nNumOfTwipsToDistribute / sal_Int32(nNumberOfBlanks);
2357 nNumOfTwipsToDistribute -= nSpaceAdd;
2359 nSpaceSum += nSpaceAdd;
2363 if ( pKernArray ) pKernArray[ nI ] += nSpaceSum;
2364 if ( pScrArray ) pScrArray[ nI ] += nSpaceSum;
2372 bool const bAllowInvalid)
2379 pScriptInfo =
const_cast<SwScriptInfo*
>(pLast->GetScriptInfo());
2382 if (bAllowInvalid ||
2391 pScriptInfo =
nullptr;
2424 while( pLay && pLay->
IsDummy() )
2429 while ( pPos && !pPos->
GetLen() )
2432 return static_cast<const SwDropPortion *>(pPos);
2454 bool bFound =
false;
2496 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> *
const pBookmarks)
2512 for(
size_t nTmp = 0; nTmp < pHints->
Count(); ++nTmp )
2518 const sal_Int32 nSt = pTextAttr->
GetStart();
2519 const sal_Int32 nEnd = *pTextAttr->
End();
2522 Range aTmp( nSt, nEnd - 1 );
2523 rHiddenMulti.
Select( aTmp, pHiddenItem->GetValue() );
2533 if (pBookmarks && pBookmark)
2551 if (pBookmark && pBookmark->
IsHidden())
2580 Range aTmp( nSt, nEnd - 1 );
2581 rHiddenMulti.
Select(aTmp,
true);
2605 if (pRed->
GetType() != RedlineType::Delete)
2608 sal_Int32 nRedlStart;
2609 sal_Int32 nRedlnEnd;
2612 nRedlnEnd = std::min<sal_Int32>(nRedlnEnd, rNode.
GetText().getLength());
2613 if ( nRedlnEnd > nRedlStart )
2615 Range aTmp( nRedlStart, nRedlnEnd - 1 );
2616 rHiddenMulti.
Select( aTmp, bSelect );
2624 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> *
const pBookmarks)
2634 const bool bNewContainsHiddenChars = rHiddenMulti.
GetRangeCount() > 0;
2635 bool bNewHiddenCharsHidePara =
false;
2636 if ( bNewContainsHiddenChars )
2639 const sal_Int32 nHiddenStart = rRange.
Min();
2640 const sal_Int32 nHiddenEnd = rRange.
Max() + 1;
2641 bNewHiddenCharsHidePara =
2642 (nHiddenStart == 0 && nHiddenEnd >= rNode.
GetText().getLength());
2653 sal_Int32 nDone = 0;
2655 while ( nPos < nEnd )
2658 rText, sal_Int32(nPos),
2660 i18n::CharacterIteratorMode::SKIPCELL, 1, nDone));
2665 nCount = nEnd - nPos ;
2675 assert( pKernArray !=
nullptr && sal_Int32(nStt) >= 0 );
2676 if (sal_Int32(nLen) <= 0)
2681 sal_Int32 nDone = 0;
2682 sal_Int32 nNext(nStt);
2683 for ( sal_Int32 nI = 0; nI < sal_Int32(nLen); ++nI )
2685 if (nI + sal_Int32(nStt) == nNext)
2689 i18n::CharacterIteratorMode::SKIPCELL, 1, nDone );
2690 if (nNext < sal_Int32(nStt + nLen) || !bIsSpaceStop)
2691 nSpaceSum += nSpaceAdd;
2693 pKernArray[ nI ] += nSpaceSum;
2695 pScrArray[ nI ] += nSpaceSum;
SwAttrHandler & GetAttrHandler()
virtual SwLinePortion * Insert(SwLinePortion *pPortion) override
Represents the visualization of a paragraph.
SwFontScript WhichFont(TextFrameIndex nIdx) const
sal_uLong GetIndex() const
TextFrameIndex GetInvalidityA() const
void SetHiddenCharAttribute(bool bNewHiddenCharsHidePara, bool bNewContainsHiddenChars) const
static sal_Int16 getUnicodeScriptType(const sal_Unicode ch, const ScriptTypeList *typeList, sal_Int16 unknownType=0)
bool IsGrfNumPortion() const
Marks a position in the document model.
SwTwips GetHangingMargin_() const
static bool lcl_HasOnlyBlanks(std::u16string_view rText, TextFrameIndex nStt, TextFrameIndex nEnd)
TextFrameIndex NextScriptChg(TextFrameIndex nPos) const
tools::Long Compress(tools::Long *pKernArray, TextFrameIndex nIdx, TextFrameIndex nLen, const sal_uInt16 nCompress, const sal_uInt16 nFontHeight, const bool bCentered, Point *pPoint=nullptr) const
sal_uInt16 Height() const
sal_uInt8 GetDirType(const size_t nCnt) const
const OUString & GetText() const
SwCharRange & operator+=(const SwCharRange &rRange)
SwMarginPortion * CalcLeftMargin()
static bool lcl_IsLigature(sal_Unicode cCh, sal_Unicode cNextCh)
SwpHints * GetpSwpHints()
TextFrameIndex GetStart() const
static bool isBehChar(sal_Unicode cCh)
TextFrameIndex NextHiddenChg(TextFrameIndex nPos) const
bool IsTextPortion() const
static sal_Int16 getCTLScriptType(std::u16string_view Text, sal_Int32 nPos)
virtual void FieldsToCalc(SwCalc &rCalc, sal_uLong nLastNd, sal_Int32 nLastCnt)=0
void SetFixWidth(const sal_uInt16 nNew)
virtual sal_Int32 Len() const override
static void InitBookmarks(std::optional< std::vector< sw::Extent >::const_iterator > oPrevIter, std::vector< sw::Extent >::const_iterator iter, std::vector< sw::Extent >::const_iterator const end, TextFrameIndex nOffset, std::vector< std::pair< sw::mark::IBookmark const *, SwScriptInfo::MarkKind >> &rBookmarks, std::vector< std::pair< TextFrameIndex, SwScriptInfo::MarkKind >> &o_rBookmarks)
SwTwips GetHangingMargin() const
virtual ~SwParaPortion() override
CompType GetCompType(const size_t nCnt) const
tools::Long GetLen(const Point &rPnt)
void CalcLine(SwTextFormatter &rLine, SwTextFormatInfo &rInf)
void MarkKashidasInvalid(sal_Int32 nCnt, const TextFrameIndex *pKashidaPositions)
Marks nCnt kashida positions as invalid pKashidaPositions: array of char indices relative to the para...
sal_uInt16 GetTextHeight() const
SwParaPortion * GetPara()
static SwScriptInfo * GetScriptInfo(const SwTextNode &rNode, SwTextFrame const **o_pFrame=nullptr, bool bAllowInvalid=false)
return a frame for the node, ScriptInfo is its member...
std::vector< CompressionChangeInfo > m_CompressionChanges
void SetLen(TextFrameIndex const nLen)
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
std::deque< TextFrameIndex > m_NoKashidaLine
bool IsHangingPortion() const
void SetFlyInCntBase(bool bNew=true)
bool IsKashidaLine(TextFrameIndex nCharIdx) const
bool Select(sal_Int32 nIndex, bool bSelect=true)
sal_uInt16 RealWidth() const
std::vector< ScriptChangeInfo > m_ScriptChanges
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
sal_Int32 GetRangeCount() const
void CalcStartEnd(sal_uLong nNdIdx, sal_Int32 &rStart, sal_Int32 &rEnd) const
Calculates the intersection with text node number nNdIdx.
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
sal_uInt8 DirType(const TextFrameIndex nPos) const
sal_uInt16 GetRealScriptOfText(const OUString &rText, sal_Int32 nPos) const
static bool IsShowChanges(const RedlineFlags eM)
const SwIndex * GetNext() const
virtual SwLinePortion * Compress()
size_t CountCompChg() const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
virtual const OUString & GetHideCondition() const =0
void SetNoKashidaLine(TextFrameIndex nStt, TextFrameIndex nLen)
Use regular blank justification instead of kashdida justification for the given line of text...
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
static sal_Int32 MaskHiddenRanges(const SwTextNode &rNode, OUStringBuffer &rText, const sal_Int32 nStt, const sal_Int32 nEnd, const sal_Unicode cChar)
Hidden text attribute handling.
static void selectHiddenTextProperty(const SwTextNode &rNode, MultiSelection &rHiddenMulti, std::vector< std::pair< sw::mark::IBookmark const *, MarkKind >> *pBookmarks)
virtual ~SwLineLayout() override
std::vector< DirectionChangeInfo > m_DirectionChanges
TextFrameIndex GetKashida(const size_t nCnt) const
bool MarkOrClearKashidaInvalid(TextFrameIndex nStt, TextFrameIndex nLen, bool bMark, sal_Int32 nMarkCount)
bool IsBreakPortion() const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
bool HasHiddenCharAttribute(bool bWholePara) const
Hidden Paragraph Field:
static SwFontScript lcl_ScriptToFont(sal_uInt16 const nScript)
static sal_Int32 endOfCTLScriptType(const OUString &Text, sal_Int32 nPos)
void UpdateBidiInfo(const OUString &rText)
sal_Int32 GetStart() const
void InitScriptInfo(const SwTextNode &rNode, sw::MergedPara const *pMerged, bool bRTL)
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
virtual bool Format(SwTextFormatInfo &rInf) override
TextFrameIndex GetLineStart() const
This portion represents an as-character anchored fly (shape, frame, etc.)
virtual CharCompressType getCharacterCompressionType() const =0
Get the character compression type for Asian characters.
static void CJKJustify(const OUString &rText, tools::Long *pKernArray, tools::Long *pScrArray, TextFrameIndex nStt, TextFrameIndex nLen, LanguageType aLang, tools::Long nSpaceAdd, bool bIsSpaceStop)
MarkKind GetBookmark(TextFrameIndex nPos) const
static bool IsArabicText(const OUString &rText, TextFrameIndex nStt, TextFrameIndex nLen)
Checks if text is Arabic text.
static SwTextPortion * CopyLinePortion(const SwLinePortion &rPortion)
std::vector< Extent > extents
TextFrameIndex NextDirChg(const TextFrameIndex nPos, const sal_uInt8 *pLevel=nullptr) const
PaM is Point and Mark: a selection of the document model.
void Join(SwGluePortion *pVictim)
void SetRealHeight(sal_uInt16 nNew)
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const =0
SwTextAttr * Get(size_t nPos) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
static void CalcHiddenRanges(const SwTextNode &rNode, MultiSelection &rHiddenMulti, std::vector< std::pair< sw::mark::IBookmark const *, MarkKind >> *pBookmarks)
const IDocumentRedlineAccess & getIDocumentRedlineAccess() const
Provides access to the document redline interface.
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const
Collection of SwLinePortion instances, representing one line of text.
const sal_Unicode CH_FULL_BLANK
static void selectRedLineDeleted(const SwTextNode &rNode, MultiSelection &rHiddenMulti, bool bSelect=true)
size_t CountHiddenChg() const
vcl::RenderContext * GetOut()
IDocumentContentOperations & getIDocumentContentOperations()
Provides access to the document content operations interface.
Records a single change in script type.
SwParaPortion * GetParaPortion()
void SetWhichPor(const PortionType nNew)
bool IsFlyPortion() const
bool IsKashidaValid(size_t nKashPos) const
size_t HasKana(TextFrameIndex nStart, TextFrameIndex nEnd) const
vector_type::size_type size_type
SwLinePortion * GetFirstPortion() const
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(MergedPara const &, TextFrameIndex nIndex)
static sal_Int16 GetI18NScriptTypeOfLanguage(LanguageType nLang)
Marks a character position inside a document model node.
SwTextNode * pParaPropsNode
most paragraph properties are taken from the first non-empty node
virtual SwLinePortion * Append(SwLinePortion *pPortion) override
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
void GetDefaultAscentAndHeight(SwViewShell const *pShell, OutputDevice const &rOut, sal_uInt16 &nAscent, sal_uInt16 &nHeight) const
Takes the default font and calculated the ascent and height.
bool IsDropPortion() const
OUString mergedText
note: cannot be const currently to avoid UB because SwTextGuess::Guess const_casts it and modifies it...
TextFrameIndex GetParLen() const
SwLinePortion * Cut(SwLinePortion *pVictim)
TextFrameIndex GetCompLen(const size_t nCnt) const
TextFrameIndex GetLen() const
std::deque< TextFrameIndex > m_NoKashidaLineEnd
bool IsCalcHiddenCharFlags() const
Optimization: Asking for information about hidden characters at SwScriptInfo updates these flags...
SwTextFrame * GetTextFrame()
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(TextFrameIndex nIndex) const
map position in potentially merged text frame to SwPosition
enumrange< T >::Iterator end(enumrange< T >)
const SwPosition * Start() const
const OUString & GetText() const
const Range & GetRange(sal_Int32 nRange) const
static TextFrameIndex ThaiJustify(const OUString &rText, tools::Long *pKernArray, tools::Long *pScrArray, TextFrameIndex nIdx, TextFrameIndex nLen, TextFrameIndex nNumberOfBlanks=TextFrameIndex(0), tools::Long nSpaceAdd=0)
Performs a thai justification on the kerning array.
static bool lcl_HasStrongLTR(std::u16string_view rText, sal_Int32 nStart, sal_Int32 nEnd)
virtual bool Format(SwTextFormatInfo &rInf) override
bool IsHolePortion() const
constexpr TypedWhichId< SvxCharHiddenItem > RES_CHRATR_HIDDEN(37)
CompType DbgCompType(const TextFrameIndex nPos) const
SwLinePortion * mpNextPortion
bool IsMultiPortion() const
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
const OUString & GetWord() const
Base class for anything that can be part of a line in the Writer layout.
SwSbxValue Calculate(const OUString &rStr)
const css::lang::Locale & GetLocale(const LanguageType aLang)
TextFrameIndex GetDirChg(const size_t nCnt) const
SwTextNode is a paragraph in the document model.
void ClearNoKashidaLine(TextFrameIndex nStt, TextFrameIndex nLen)
Clear forced blank justification for a given line.
std::vector< TextFrameIndex > m_HiddenChg
sal_Int16 ScriptType(const TextFrameIndex nPos) const
static bool lcl_ConnectToPrev(sal_Unicode cCh, sal_Unicode cPrevCh)
An SwTextAttr container, stores all directly formatted text portions for a text node.
void SetHanging(const bool bNew)
#define SAL_WARN_IF(condition, area, stream)
void SetNext(SwLineLayout *pNew)
PortionType GetWhichPor() const
sw::LineAlign GetAlign() const
const Range & GetTotalRange() const
TextFrameIndex GetHiddenChg(const size_t nCnt) const
static bool isTransparentChar(sal_Unicode cCh)
static bool isYehChar(sal_Unicode cCh)
size_t CountDirChg() const
TextFrameIndex m_nInvalidityPos
sal_uInt8 GetScriptType(const size_t nCnt) const
sal_Int32 GetIndex() const
SwTwips HangingMargin() const
LanguageType GetAppLanguage()
IDocumentSettingAccess const & getIDocumentSettingAccess() const
TextFrameIndex NextBookmark(TextFrameIndex nPos) const
std::unordered_set< size_t > m_KashidaInvalid
indexes into m_Kashida
RedlineType GetType(sal_uInt16 nPos=0) const
const sal_Int32 * End() const
void CreateSpaceAdd(const tools::Long nInit=0)
void ClearKashidaInvalid(size_t nKashPos)
std::vector< std::pair< TextFrameIndex, MarkKind > > m_Bookmarks
sal_Int32 GetBegin() const
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual const SwPosition & GetMarkEnd() const =0
void SetNextPortion(SwLinePortion *pNew)
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
#define isSeenOrSadChar(c)
static void DeleteHiddenRanges(SwTextNode &rNode)
Hidden text attribute handling.
const SwDropPortion * FindDropPortion() const
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 SetMargin(const bool bNew=true)
size_t CountKashida() const
TextFrameIndex GetCompStart(const size_t nCnt) const
void SetAscent(const sal_uInt16 nNewAsc)
sal_Int32 KashidaJustify(tools::Long *pKernArray, tools::Long *pScrArray, TextFrameIndex nStt, TextFrameIndex nLen, tools::Long nSpaceAdd=0) const
Performs a kashida justification on the kerning array.
static bool IsInHiddenRange(const SwTextNode &rNode, sal_Int32 nPos)
TextFrameIndex GetScriptChg(const size_t nCnt) const
#define SPACING_PRECISION_FACTOR
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
size_t CountScriptChg() const
bool CheckLine(sal_uLong nStartNode, sal_Int32 nChkStart, sal_uLong nEndNode, sal_Int32 nChkEnd, OUString &rRedlineText, bool &bRedlineEnd, RedlineType &eRedlineEnd)
const SwIndex * GetFirstIndex() const
virtual const SwPosition & GetMarkStart() const =0
void GetKashidaPositions(TextFrameIndex nStt, TextFrameIndex nLen, std::vector< TextFrameIndex > &rKashidaPosition)
retrieves kashida opportunities for a given text range.
TextFrameIndex GetEnd() const
virtual const SwRedlineTable & GetRedlineTable() const =0
void SelectAll(bool bSelect=true)
SwLinePortion * GetNextPortion() const
static TextFrameIndex CountCJKCharacters(const OUString &rText, TextFrameIndex nPos, TextFrameIndex nEnd, LanguageType aLang)
bool MarkKashidaInvalid(size_t nKashPos)
virtual bool IsExpanded() const =0
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...
CharClass & GetAppCharClass()
#define isTehMarbutaChar(c)
virtual bool IsHidden() const =0
bool IsFlyCntPortion() const
tools::Long GetHeight() const
SwRedlineItr * GetRedln()
const sal_Int32 COMPLETE_STRING
ScriptTypeList const typeList[]
bool IsPostItsPortion() const
std::deque< TextFrameIndex > m_Kashida
void Init(SwLinePortion *pNextPortion=nullptr)
const sal_Unicode CH_SIX_PER_EM