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/UnicodeType.hpp>
37#include <com/sun/star/i18n/WordType.hpp>
38#include <com/sun/star/i18n/XBreakIterator.hpp>
61#include <com/sun/star/frame/XModel.hpp>
62#include <com/sun/star/text/XBookmarksSupplier.hpp>
63#include <officecfg/Office/Common.hxx>
71#include <com/sun/star/rdf/Statement.hpp>
72#include <com/sun/star/rdf/URI.hpp>
73#include <com/sun/star/rdf/URIs.hpp>
74#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
75#include <com/sun/star/rdf/XLiteral.hpp>
76#include <com/sun/star/text/XTextContent.hpp>
79using namespace i18n::ScriptType;
81#include <unicode/ubidi.h>
113#define IS_JOINING_GROUP(c, g) ( u_getIntPropertyValue( (c), UCHAR_JOINING_GROUP ) == U_JG_##g )
114#define isAinChar(c) IS_JOINING_GROUP((c), AIN)
115#define isAlefChar(c) IS_JOINING_GROUP((c), ALEF)
116#define isDalChar(c) IS_JOINING_GROUP((c), DAL)
117#define isFehChar(c) (IS_JOINING_GROUP((c), FEH) || IS_JOINING_GROUP((c), AFRICAN_FEH))
118#define isGafChar(c) IS_JOINING_GROUP((c), GAF)
119#define isHehChar(c) IS_JOINING_GROUP((c), HEH)
120#define isKafChar(c) IS_JOINING_GROUP((c), KAF)
121#define isLamChar(c) IS_JOINING_GROUP((c), LAM)
122#define isQafChar(c) (IS_JOINING_GROUP((c), QAF) || IS_JOINING_GROUP((c), AFRICAN_QAF))
123#define isRehChar(c) IS_JOINING_GROUP((c), REH)
124#define isTahChar(c) IS_JOINING_GROUP((c), TAH)
125#define isTehMarbutaChar(c) IS_JOINING_GROUP((c), TEH_MARBUTA)
126#define isWawChar(c) IS_JOINING_GROUP((c), WAW)
127#define isSeenOrSadChar(c) (IS_JOINING_GROUP((c), SAD) || IS_JOINING_GROUP((c), SEEN))
133 switch (u_getIntPropertyValue(cCh, UCHAR_JOINING_GROUP))
137 case U_JG_AFRICAN_NOON:
141 case U_JG_BURUSHASKI_YEH_BARREE:
156 switch (u_getIntPropertyValue(cCh, UCHAR_JOINING_GROUP))
160 case U_JG_YEH_BARREE:
161 case U_JG_BURUSHASKI_YEH_BARREE:
162 case U_JG_YEH_WITH_TAIL:
175 return u_getIntPropertyValue( cCh, UCHAR_JOINING_TYPE ) == U_JT_TRANSPARENT;
188 const int32_t nJoiningType = u_getIntPropertyValue( cPrevCh, UCHAR_JOINING_TYPE );
189 bool bRet = nJoiningType != U_JT_RIGHT_JOINING && nJoiningType != U_JT_NON_JOINING;
198static bool lcl_HasStrongLTR ( std::u16string_view rText, sal_Int32 nStart, sal_Int32 nEnd )
200 for( sal_Int32 nCharIdx = nStart; nCharIdx < nEnd; ++nCharIdx )
202 const UCharDirection nCharDir = u_charDirection ( rText[ nCharIdx ] );
203 if ( nCharDir == U_LEFT_TO_RIGHT ||
204 nCharDir == U_LEFT_TO_RIGHT_EMBEDDING ||
205 nCharDir == U_LEFT_TO_RIGHT_OVERRIDE )
354 while ( nStt < nEnd )
356 switch (rText[sal_Int32(nStt++)])
376 sal_uInt16 nFlyAscent = 0;
377 sal_uInt16 nFlyHeight = 0;
378 sal_uInt16 nFlyDescent = 0;
381 sal_uInt16 nBreakHeight = 0;
383 bool bOnlyPostIts =
true;
386 bool bTmpDummy = !
GetLen();
396 const bool bIgnoreBlanksAndTabsForLineHeightCalculation =
400 bool bHasBlankPortion =
false;
401 bool bHasOnlyBlankPortions =
true;
402 bool bHasFlyPortion =
false;
419 sal_uInt16 nMaxDescent = 0;
426 "sw.core",
"SwLineLayout::CalcLine: don't use SwLinePortions !" );
454 if (bIgnoreBlanksAndTabsForLineHeightCalculation && !rInf.
GetLineStart())
462 bHasBlankPortion =
true;
477 bHasOnlyBlankPortions =
false;
485 "sw.core",
"SwLineLayout::CalcLine: bad ascent or height" );
493 bHasFlyPortion =
true;
497 bool bClearingBreak =
false;
502 nBreakHeight = nPosHeight;
512 if( nFlyHeight < nPosHeight )
513 nFlyHeight = nPosHeight;
514 if( nFlyAscent < nPosAscent )
515 nFlyAscent = nPosAscent;
516 if( nFlyDescent < nPosHeight - nPosAscent )
517 nFlyDescent = nPosHeight - nPosAscent;
525 if( nTmp > nPosAscent )
527 nPosHeight += nTmp - nPosAscent;
532 if( nTmp > nPosHeight )
535 Height( nPosHeight,
false );
537 nMaxDescent = nPosHeight - nPosAscent;
542 if(
Height() < nPosHeight )
545 if (bIgnoreBlanksAndTabsForLineHeightCalculation && pPos->
IsFlyCntPortion())
547 Height(std::max(nPosHeight, nLineHeight),
false);
568 if( nMaxDescent < nPosHeight - nPosAscent )
569 nMaxDescent = nPosHeight - nPosAscent;
581 if( pPos->
GetExpText( rInf, aText ) && !aText.isEmpty() )
611 if( bTmpDummy && nFlyHeight )
614 if( nFlyDescent > nFlyHeight - nFlyAscent )
615 Height( nFlyHeight + nFlyDescent,
false );
618 if (nBreakHeight > nFlyHeight)
623 Height(nBreakHeight,
false);
627 Height(nFlyHeight,
false);
634 if( bOnlyPostIts && !( bHasBlankPortion && bHasOnlyBlankPortions ) )
646 if ( bIgnoreBlanksAndTabsForLineHeightCalculation &&
649 bHasBlankPortion =
true;
654 if ( bHasBlankPortion && bHasOnlyBlankPortions )
657 sal_uInt16 nTmpHeight =
Height();
662 Height(nTmpHeight,
false);
670 std::pair<SwTextNode const*, sal_Int32>
const start(
672 std::pair<SwTextNode const*, sal_Int32>
const end(
674 bool bHasRedline = rLine.
GetRedln();
677 OUString sRedlineText;
681 end.first->GetIndex(),
end.second, sRedlineText, bHasRedlineEnd, eRedlineEnd);
687 if( eRedlineEnd != RedlineType::None )
694 if ( !bHasFlyPortion )
702 nLineLength += pPos->
GetLen();
706 bool bDeleted =
false;
707 size_t nAuthor = std::string::npos;
710 OUString sRedlineText;
713 std::pair<SwTextNode const*, sal_Int32>
const flyStart(
716 flyStart.second, flyStart.first->GetIndex(), flyStart.second, sRedlineText,
717 bHasRedlineEnd, eRedlineEnd, &nAuthor);
718 bDeleted = bHasFlyRedline && eRedlineEnd == RedlineType::Delete;
736 bool bDeleted =
false;
737 size_t nAuthor = std::string::npos;
739 if ( rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_CHAR )
745 if ( pFnd && RedlineType::Delete == pFnd->
GetType() )
751 pFly->SetDeleted(bDeleted);
752 pFly->SetAuthor(nAuthor);
768 const bool _bNoFlyCntPorAndLinePor )
const
781 while ( pTmpPortion )
786 ( !_bNoFlyCntPorAndLinePor ||
795 ( pTmpPortion != _pDontConsiderPortion );
799 _orObjAscent = std::max( _orObjAscent, nPortionAsc );
800 _orObjDescent = std::max( _orObjDescent, nPortionDesc );
805 _orAscent = std::max( _orAscent, nPortionAsc );
806 _orDescent = std::max( _orDescent, nPortionDesc );
816 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwLineLayout"));
820 (void)xmlTextWriterEndElement(pWriter);
832 : m_pNext( nullptr ),
835 m_bUnderscore( false )
869 : m_nInvalidityPos(0)
888 OSL_FAIL(
"Somebody tells lies about the script type!" );
914 const css::uno::Reference<css::rdf::XResource> xSubject(xRef, uno::UNO_QUERY);
917 static uno::Reference< uno::XComponentContext > xContext(
918 ::comphelper::getProcessComponentContext());
920 static uno::Reference< rdf::XURI > xODF_SHADING(
921 rdf::URI::createKnown(xContext, rdf::URIs::LO_EXT_SHADING), uno::UNO_SET_THROW);
923 uno::Reference<rdf::XDocumentMetadataAccess> xDocumentMetadataAccess(
925 const uno::Reference<rdf::XRepository>& xRepository =
926 xDocumentMetadataAccess->getRDFRepository();
927 const uno::Reference<container::XEnumeration> xEnum(
928 xRepository->getStatements(xSubject, xODF_SHADING,
nullptr), uno::UNO_SET_THROW);
931 if ( xEnum->hasMoreElements() && (xEnum->nextElement() >>= stmt) )
933 const uno::Reference<rdf::XLiteral> xObject(stmt.Object, uno::UNO_QUERY);
938 catch (
const lang::IllegalArgumentException&)
946 std::optional<std::vector<sw::Extent>::const_iterator> oPrevIter,
947 std::vector<sw::Extent>::const_iterator iter,
948 std::vector<sw::Extent>::const_iterator
const end,
950 std::vector<std::pair<sw::mark::IBookmark const*, SwScriptInfo::MarkKind>> & rBookmarks,
951 std::vector<std::tuple<TextFrameIndex, SwScriptInfo::MarkKind, Color, OUString>> & o_rBookmarks)
954 for (
auto const& it : rBookmarks)
956 assert(iter->pNode == pNode || pNode->
GetIndex() < iter->pNode->GetIndex());
957 assert(!oPrevIter || (*oPrevIter)->pNode->GetIndex() <= pNode->
GetIndex());
975 SwPosition const& rStart(it.first->GetMarkStart());
976 SwPosition const& rEnd(it.first->GetMarkEnd());
977 assert(&rStart.
GetNode() == pNode);
980 if (&rStart.
GetNode() != iter->pNode
990 o_rBookmarks.emplace_back(nOffset, it.second, c, it.first->GetName());
996 auto const iterNext(iter + 1);
999 ? &rEnd.
GetNode() == iter->pNode
1007 o_rBookmarks.emplace_back(
1009 it.second, c, it.first->GetName());
1028 o_rBookmarks.emplace_back(nOffset, it.second, c, it.first->GetName());
1035 SwPosition const& rEnd(it.first->GetMarkEnd());
1036 assert(&rEnd.
GetNode() == pNode);
1040 || &rEnd.
GetNode() != iter->pNode
1043 SwPosition const& rStart(it.first->GetMarkStart());
1046 ? ((*oPrevIter)->pNode->GetIndex() < rStart.
GetNodeIndex()
1047 || ((*oPrevIter)->pNode == &rStart.
GetNode()
1057 o_rBookmarks.emplace_back(nOffset, it.second, c, it.first->GetName());
1063 o_rBookmarks.emplace_back(
1065 it.second, c, it.first->GetName());
1079 SwPosition const& rPos(it.first->GetMarkPos());
1080 assert(&rPos.
GetNode() == pNode);
1083 if (&rPos.
GetNode() != iter->pNode
1097 o_rBookmarks.emplace_back(
1099 it.second, c, it.first->GetName());
1142 std::optional<std::vector<sw::Extent>::const_iterator> oPrevIter;
1143 for (
auto iter = pMerged->
extents.begin(); iter != pMerged->
extents.end();
1146 if (iter->pNode == pNode)
1152 pNode = iter->pNode;
1153 Range aRange( 0, pNode->
Len() > 0 ? pNode->
Len() - 1 : 0 );
1155 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> bookmarks;
1163 const sal_Int32 nStart = rRange.
Min();
1164 const sal_Int32 nEnd = rRange.
Max() + 1;
1165 bool isStartHandled(
false);
1166 ::std::optional<sal_Int32> oExtend;
1168 if (nEnd <= iter->nStart)
1175 if (!isStartHandled && nStart <= iter->nEnd)
1177 isStartHandled =
true;
1178 if (nStart <= iter->nStart && !
m_HiddenChg.empty()
1182 oExtend.emplace(
::std::min(iter->nEnd, nEnd) - ::std::max(iter->nStart, nStart));
1191 *oExtend +=
::std::min(iter->nEnd, nEnd) - iter->nStart;
1193 if (nEnd <= iter->nEnd)
1208 while (iter != pMerged->
extents.end() && iter->pNode == pNode);
1209 if (iter == pMerged->
extents.end() || iter->pNode != pNode)
1229 Range aRange( 0, !rText.isEmpty() ? rText.getLength() - 1 : 0 );
1231 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> bookmarks;
1234 for (
auto const& it : bookmarks)
1239 if (it.first->GetName().startsWith(
1251 m_Bookmarks.emplace_back(
TextFrameIndex(it.first->GetMarkStart().GetContentIndex()), it.second, c, it.first->GetName());
1266 const sal_Int32 nStart = rRange.
Min();
1267 const sal_Int32 nEnd = rRange.
Max() + (rText.isEmpty() ? 0 : 1);
1287 size_t nCntComp = 0;
1289 size_t nCntKash = 0;
1291 sal_Int16 nScript = i18n::ScriptType::LATIN;
1296 auto const& rParaItems((pMerged ? *pMerged->
pParaPropsNode : rNode).GetSwAttrSet());
1298 const bool bAdjustBlock = SvxAdjust::Block == rParaItems.GetAdjust().GetAdjust();
1318 if( CharCompressType::NONE != aCompEnum )
1349 while ( nChg > nGrpStart &&
1355 if ( nChg == nGrpStart )
1369 if( nChg >= nLastCompression +
GetCompLen( nCntComp ) )
1371 nLastCompression = nChg;
1382 if( nCntKash && i18n::ScriptType::COMPLEX == nScript )
1408 SAL_WARN_IF( i18n::ScriptType::LATIN != nScript &&
1409 i18n::ScriptType::ASIAN != nScript &&
1410 i18n::ScriptType::COMPLEX != nScript,
"sw.core",
"Wrong default language" );
1419 if ( nScript != nNextScript )
1423 nScript = nNextScript;
1433 "sw.core",
"Inserting WEAK into SwScriptInfo structure" );
1437 rText, sal_Int32(nSearchStt), nScript));
1446 auto nPos = sal_Int32(nChg);
1447 auto nPrevPos =
nPos;
1448 auto nPrevChar = rText.iterateCodePoints(&nPrevPos, -1);
1452 auto nChar = rText.iterateCodePoints(&
nPos, 0);
1454 if (
nType == css::i18n::UnicodeType::NON_SPACING_MARK ||
1455 nType == css::i18n::UnicodeType::ENCLOSING_MARK ||
1456 nType == css::i18n::UnicodeType::COMBINING_SPACING_MARK ||
1458 u_getIntPropertyValue(nChar, UCHAR_SCRIPT) == USCRIPT_MONGOLIAN))
1468 if ( CharCompressType::NONE != aCompEnum &&
1469 i18n::ScriptType::ASIAN == nScript )
1475 while ( nLastCompression < nChg )
1477 sal_Unicode cChar = rText[ sal_Int32(nLastCompression) ];
1483 case 0x3008:
case 0x300A:
case 0x300C:
case 0x300E:
1484 case 0x3010:
case 0x3014:
case 0x3016:
case 0x3018:
1485 case 0x301A:
case 0x301D:
1486 case 0xFF08:
case 0xFF3B:
case 0xFF5B:
1490 case 0x3009:
case 0x300B:
1491 case 0x300D:
case 0x300F:
case 0x3011:
case 0x3015:
1492 case 0x3017:
case 0x3019:
case 0x301B:
case 0x301E:
1494 case 0xFF09:
case 0xFF3D:
case 0xFF5D:
1497 case 0x3001:
case 0x3002:
1498 case 0xFF0C:
case 0xFF0E:
case 0xFF1A:
case 0xFF1B:
1502 eState = ( 0x3040 <= cChar && 0x3100 > cChar ) ?
KANA :
NONE;
1506 if( ePrevState != eState )
1508 if ( ePrevState !=
NONE )
1511 if ( CharCompressType::PunctuationAndKana == aCompEnum ||
1512 ePrevState !=
KANA )
1515 nLastCompression - nPrevChg, ePrevState);
1519 ePrevState = eState;
1520 nPrevChg = nLastCompression;
1527 if ( ePrevState !=
NONE )
1530 if ( CharCompressType::PunctuationAndKana == aCompEnum ||
1531 ePrevState !=
KANA )
1534 nLastCompression - nPrevChg, ePrevState);
1540 else if ( bAdjustBlock && i18n::ScriptType::COMPLEX == nScript )
1544 std::function<
LanguageType (sal_Int32, sal_Int32,
bool)>
const pGetLangOfCharM(
1545 [&pMerged](sal_Int32
const nBegin, sal_uInt16
const script,
bool const bNoChar)
1547 std::pair<SwTextNode const*, sal_Int32>
const pos(
1549 return pos.first->GetLang(
pos.second, bNoChar ? 0 : 1,
script);
1551 std::function<
LanguageType (sal_Int32, sal_Int32,
bool)>
const pGetLangOfChar1(
1552 [&rNode](sal_Int32
const nBegin, sal_uInt16
const script,
bool const bNoChar)
1553 {
return rNode.
GetLang(nBegin, bNoChar ? 0 : 1,
script); });
1554 auto pGetLangOfChar(pMerged ? pGetLangOfCharM : pGetLangOfChar1);
1556 i18n::WordType::DICTIONARY_WORD,
1557 sal_Int32(nLastKashida), sal_Int32(nChg));
1562 const OUString& rWord = aScanner.
GetWord();
1564 sal_Int32 nIdx = 0, nPrevIdx = 0;
1565 sal_Int32 nKashidaPos = -1;
1568 int nPriorityLevel = 7;
1571 sal_Int32 nWordLen = rWord.getLength();
1577 while (nIdx < nWordLen)
1579 cCh = rWord[ nIdx ];
1585 nKashidaPos = aScanner.
GetBegin() + nIdx;
1591 if (nPriorityLevel >= 1 && nIdx < nWordLen - 1)
1594 && (rWord[ nIdx+1 ] != 0x200C) )
1596 nKashidaPos = aScanner.
GetBegin() + nIdx;
1603 if ( nPriorityLevel >= 2 && nIdx > 0 )
1607 (
isHehChar ( cCh ) && nIdx == nWordLen - 1))
1610 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1614 nKashidaPos = aScanner.
GetBegin() + nPrevIdx;
1622 if ( nPriorityLevel >= 3 && nIdx > 0 )
1629 && nIdx == nWordLen - 1))
1631 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1635 nKashidaPos = aScanner.
GetBegin() + nPrevIdx;
1643 if ( nPriorityLevel >= 4 && nIdx > 0 && nIdx < nWordLen - 1 )
1651 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1655 nKashidaPos = aScanner.
GetBegin() + nPrevIdx;
1664 if ( nPriorityLevel >= 5 && nIdx > 0 )
1671 && nIdx == nWordLen - 1))
1673 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1677 nKashidaPos = aScanner.
GetBegin() + nPrevIdx;
1684 if ( nPriorityLevel >= 6 && nIdx > 0 )
1689 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1693 nKashidaPos = aScanner.
GetBegin() + nPrevIdx;
1710 if ( -1 != nKashidaPos )
1721 nLastCompression = nChg;
1722 nLastKashida = nChg;
1725#if OSL_DEBUG_LEVEL > 0
1728 bool bWrongKash =
false;
1732 if ( nCurrKashidaPos <= nTmpKashidaPos )
1737 nTmpKashidaPos = nCurrKashidaPos;
1739 SAL_WARN_IF( bWrongKash,
"sw.core",
"Kashida array contains wrong data" );
1761 if ( nCurrDirType % 2 == UBIDI_RTL ||
1762 (nCurrDirType > UBIDI_LTR &&
1766 size_t nScriptIdx = 0;
1781 "sw.core",
"Script override with CTL font trouble" );
1804#if OSL_DEBUG_LEVEL > 1
1807 sal_uInt8 nLastTyp = i18n::ScriptType::WEAK;
1812 nLastPos >= rScriptChange.position,
1813 "sw.core",
"Heavy InitScriptType() confusion" );
1814 nLastPos = rScriptChange.position;
1815 nLastTyp = rScriptChange.type;
1830 UErrorCode nError = U_ZERO_ERROR;
1831 UBiDi* pBidi = ubidi_openSized( rText.getLength(), 0, &nError );
1832 nError = U_ZERO_ERROR;
1834 ubidi_setPara( pBidi,
reinterpret_cast<const UChar *
>(rText.getStr()), rText.getLength(),
1836 nError = U_ZERO_ERROR;
1837 int nCount = ubidi_countRuns( pBidi, &nError );
1840 UBiDiLevel nCurrDir;
1841 for (
int nIdx = 0; nIdx <
nCount; ++nIdx )
1843 ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir );
1848 ubidi_close( pBidi );
1861 for(
size_t nX = 0; nX < nEnd; ++nX )
1874 for(
size_t nX = 0; nX < nEnd; ++nX )
1887 const sal_uInt8 nCurrDir = pLevel ? *pLevel : 62;
1889 for(
size_t nX = 0; nX < nEnd; ++nX )
1892 ( nX + 1 == nEnd ||
GetDirType( nX + 1 ) <= nCurrDir ) )
1902 for(
size_t nX = 0; nX < nEnd; ++nX )
1927 if (
nPos < std::get<0>(it))
1929 return std::get<0>(it);
1935std::vector<std::tuple<SwScriptInfo::MarkKind, Color, OUString>>
1938 std::vector<std::tuple<SwScriptInfo::MarkKind, Color, OUString>> aColors;
1941 if (
nPos == std::get<0>(it))
1943 const OUString&
sName = std::get<3>(it);
1946 if ( !(
sName.startsWith(
"_Toc") ||
sName.startsWith(
"_Ref") ) )
1948 OUString>(std::get<1>(it), std::get<2>(it), std::get<3>(it)));
1950 else if (
nPos < std::get<0>(it))
1959 sort(aColors.begin(), aColors.end(),
1960 [](std::tuple<MarkKind, Color, OUString>
const a, std::tuple<MarkKind, Color, OUString>
const b) {
1961 return (MarkKind::End == std::get<0>(a) && MarkKind::End != std::get<0>(b)) ||
1962 (MarkKind::Point == std::get<0>(a) && MarkKind::Start == std::get<0>(b)) ||
1964 (MarkKind::End == std::get<0>(a) && MarkKind::End == std::get<0>(b) && std::get<1>(a) < std::get<1>(b)) ||
1965 (MarkKind::Start == std::get<0>(a) && MarkKind::Start == std::get<0>(b) && std::get<1>(b) < std::get<1>(a));});
1972 const sal_Int32 nStt,
const sal_Int32 nEnd,
1975 assert(rNode.
GetText().getLength() == rText.getLength());
1977 std::vector<sal_Int32> aList;
1978 sal_Int32 nHiddenStart;
1979 sal_Int32 nHiddenEnd;
1980 sal_Int32 nNumOfHiddenChars = 0;
1982 auto rFirst( aList.crbegin() );
1983 auto rLast( aList.crend() );
1984 while ( rFirst != rLast )
1986 nHiddenEnd = *(rFirst++);
1987 nHiddenStart = *(rFirst++);
1989 if ( nHiddenEnd < nStt || nHiddenStart > nEnd )
1992 while ( nHiddenStart < nHiddenEnd && nHiddenStart < nEnd )
1994 if (nHiddenStart >= nStt)
1996 rText[nHiddenStart] = cChar;
1997 ++nNumOfHiddenChars;
2003 return nNumOfHiddenChars;
2009 std::vector<sal_Int32> aList;
2010 sal_Int32 nHiddenStart;
2011 sal_Int32 nHiddenEnd;
2013 auto rFirst( aList.crbegin() );
2014 auto rLast( aList.crend() );
2015 while ( rFirst != rLast )
2017 nHiddenEnd = *(rFirst++);
2018 nHiddenStart = *(rFirst++);
2020 SwPaM aPam( rNode, nHiddenStart, rNode, nHiddenEnd );
2026 sal_Int32& rnStartPos, sal_Int32& rnEndPos,
2027 std::vector<sal_Int32>* pList )
2032 bool bNewContainsHiddenChars =
false;
2040 if ( !bContainsHiddenChars )
2047 pList->push_back( 0 );
2048 pList->push_back(rNode.
GetText().getLength());
2052 rnEndPos = rNode.
GetText().getLength();
2066 const bool bNewHiddenCharsHidePara =
2067 rnStartPos == 0 && rnEndPos >= rNode.
GetText().getLength();
2077 ? rNode.
GetText().getLength() - 1
2084 const sal_Int32 nHiddenStart = rRange.
Min();
2085 const sal_Int32 nHiddenEnd = rRange.
Max() + 1;
2087 if ( nHiddenStart >
nPos )
2089 if (
nPos < nHiddenEnd)
2091 rnStartPos = nHiddenStart;
2092 rnEndPos = std::min<sal_Int32>(nHiddenEnd,
2103 pList->push_back( rRange.
Min() );
2104 pList->push_back( rRange.
Max() + 1 );
2111 return bNewContainsHiddenChars;
2121 for(
size_t nX = 0; nX < nEnd; ++nX )
2126 if ( nHiddenStart >
nPos )
2128 if (
nPos < nHiddenEnd)
2130 rnStartPos = nHiddenStart;
2131 rnEndPos = nHiddenEnd;
2141 sal_Int32 nStartPos;
2152 for(
size_t nX = 0; nX < nEnd; ++nX )
2173 for(
size_t nX = 0; nX < nCnt; ++nX )
2178 if ( nKanaStart >= nEnd )
2179 return SAL_MAX_SIZE;
2181 if ( nStart < nKanaEnd )
2185 return SAL_MAX_SIZE;
2189 const sal_uInt16 nCompress,
const sal_uInt16 nFontHeight,
2191 Point* pPoint )
const
2193 SAL_WARN_IF( !nCompress,
"sw.core",
"Compression without compression?!" );
2194 SAL_WARN_IF( !nLen,
"sw.core",
"Compression without text?!" );
2200 const tools::Long nMinWidth = ( 3 * nFontHeight ) / 4;
2202 size_t nCompIdx =
HasKana( nIdx, nLen );
2204 if ( SAL_MAX_SIZE == nCompIdx )
2214 nI = sal_Int32(nChg - nIdx);
2217 else if( nIdx < nChg + nCompLen )
2218 nCompLen -= nIdx - nChg;
2220 if( nIdx > nLen || nCompIdx >= nCompCount )
2224 tools::Long nLast = nI ? rKernArray[ nI - 1 ] : 0;
2232 if( nCompLen > nLen )
2236 if ( rKernArray[ nI ] - nLast < nMinWidth )
2242 while( nIdx < nCompLen )
2247 nLast -= rKernArray[ nI ];
2270 nLast = rKernArray[ nI ];
2272 rKernArray.
adjust(nI - 1, nMove);
2273 rKernArray.
adjust(nI, -nSub);
2283 if( ++nCompIdx < nCompCount )
2286 if( nTmpChg > nLen )
2291 while( nIdx < nTmpChg )
2293 nLast = rKernArray[ nI ];
2294 rKernArray.
adjust(nI, -nSub);
2298 }
while( nIdx < nLen );
2313 SAL_WARN_IF( !nLen,
"sw.core",
"Kashida justification without text?!" );
2320 size_t nCntKash = 0;
2330 size_t nCntKashEnd = nCntKash;
2338 size_t nActualKashCount = nCntKashEnd - nCntKash;
2339 for (
size_t i = nCntKash;
i < nCntKashEnd; ++
i)
2346 return nActualKashCount;
2360 while ( nIdx < nEnd )
2367 pKashidaArray[sal_Int32(nArrayPos)] =
true;
2380 while ( nArrayPos < nArrayEnd )
2382 pKernArray->
adjust(sal_Int32(nArrayPos), nKashAdd);
2385 nKashAdd += nSpaceAdd;
2400 { UnicodeScript_kArabic, UnicodeScript_kArabic, sal_Int16(UnicodeScript_kArabic) },
2401 { UnicodeScript_kScriptCount, UnicodeScript_kScriptCount, sal_Int16(UnicodeScript_kScriptCount) }
2406 sal_Int32 nIdx = sal_Int32(nStt);
2407 const sal_Int32 nEnd = sal_Int32(nStt + nLen);
2427 return type == sal_Int16(UnicodeScript_kArabic);
2448 bool bMark, sal_Int32 nMarkCount)
2450 size_t nCntKash = 0;
2490 std::vector<TextFrameIndex>& rKashidaPosition)
2492 size_t nCntKash = 0;
2502 size_t nCntKashEnd = nCntKash;
2507 rKashidaPosition.push_back(
GetKashida(nCntKashEnd));
2548 SAL_WARN_IF( !pKashidaPositions || nCnt == 0,
"sw.core",
"Where are kashidas?" );
2550 size_t nCntKash = 0;
2551 sal_Int32 nKashidaPosIdx = 0;
2553 while (nCntKash <
CountKashida() && nKashidaPosIdx < nCnt)
2555 if ( pKashidaPositions [nKashidaPosIdx] >
GetKashida( nCntKash ) )
2577 SwTwips nNumOfTwipsToDistribute = nSpaceAdd * sal_Int32(nNumberOfBlanks) /
2583 for (sal_Int32 nI = 0; nI < sal_Int32(nLen); ++nI)
2585 const sal_Unicode cCh = aText[sal_Int32(nStt) + nI];
2588 if ( ( 0xE34 > cCh || cCh > 0xE3A ) &&
2589 ( 0xE47 > cCh || cCh > 0xE4E ) && cCh != 0xE31 )
2593 nSpaceAdd = nNumOfTwipsToDistribute / sal_Int32(nNumberOfBlanks);
2595 nNumOfTwipsToDistribute -= nSpaceAdd;
2597 nSpaceSum += nSpaceAdd;
2602 pKernArray->
adjust(nI, nSpaceSum);
2610 bool const bAllowInvalid)
2617 pScriptInfo =
const_cast<SwScriptInfo*
>(pLast->GetScriptInfo());
2620 if (bAllowInvalid ||
2629 pScriptInfo =
nullptr;
2663 for (
SwLineLayout const* pLine =
this; pLine && !pPortion; pLine = pLine->GetNext())
2665 pPortion = pLine->GetFirstPortion();
2682 for (
SwLineLayout const* pLine =
this; pLine && !pPortion; pLine = pLine->GetNext())
2684 pPortion = pLine->GetFirstPortion();
2690 return pPortion !=
nullptr;
2696 while( pLay && pLay->
IsDummy() )
2701 while ( pPos && !pPos->
GetLen() )
2713 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwParaPortion"));
2717 (void)xmlTextWriterEndElement(pWriter);
2736 bool bFound =
false;
2804 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> *
const pBookmarks)
2810 if( pItem && pItem->GetValue() )
2819 for(
size_t nTmp = 0; nTmp < pHints->
Count(); ++nTmp )
2825 const sal_Int32 nSt = pTextAttr->
GetStart();
2826 const sal_Int32 nEnd = *pTextAttr->
End();
2829 Range aTmp( nSt, nEnd - 1 );
2830 rHiddenMulti.
Select( aTmp, pHiddenItem->GetValue() );
2836 for (
const SwContentIndex* pIndex = rNode.GetFirstIndex(); pIndex; pIndex = pIndex->GetNext())
2840 if (pBookmarks && pBookmark)
2858 if (pBookmark && pBookmark->
IsHidden())
2867 Range aTmp( nSt, nEnd - 1 );
2868 rHiddenMulti.
Select(aTmp,
true);
2892 if (pRed->
GetType() != RedlineType::Delete)
2895 sal_Int32 nRedlStart;
2896 sal_Int32 nRedlnEnd;
2899 nRedlnEnd = std::min<sal_Int32>(nRedlnEnd, rNode.
GetText().getLength());
2900 if ( nRedlnEnd > nRedlStart )
2902 Range aTmp( nRedlStart, nRedlnEnd - 1 );
2903 rHiddenMulti.
Select( aTmp, bSelect );
2911 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> *
const pBookmarks)
2921 const bool bNewContainsHiddenChars = rHiddenMulti.
GetRangeCount() > 0;
2922 bool bNewHiddenCharsHidePara =
false;
2923 if ( bNewContainsHiddenChars )
2926 const sal_Int32 nHiddenStart = rRange.
Min();
2927 const sal_Int32 nHiddenEnd = rRange.
Max() + 1;
2928 bNewHiddenCharsHidePara =
2929 (nHiddenStart == 0 && nHiddenEnd >= rNode.
GetText().getLength());
2940 sal_Int32 nDone = 0;
2942 while (
nPos < nEnd )
2945 rText, sal_Int32(
nPos),
2947 i18n::CharacterIteratorMode::SKIPCELL, 1, nDone));
2962 assert( sal_Int32(nStt) >= 0 );
2963 if (sal_Int32(nLen) <= 0)
2968 sal_Int32 nDone = 0;
2969 sal_Int32 nNext(nStt);
2970 for ( sal_Int32 nI = 0; nI < sal_Int32(nLen); ++nI )
2972 if (nI + sal_Int32(nStt) == nNext)
2976 i18n::CharacterIteratorMode::SKIPCELL, 1, nDone );
2977 if (nNext < sal_Int32(nStt + nLen) || !bIsSpaceStop)
2978 nSpaceSum += nSpaceAdd;
2980 rKernArray.
adjust(nI, nSpaceSum);
@ IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION
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...
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
static Color STRtoRGB(std::u16string_view colorname)
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
static SW_DLLPUBLIC OUString GetCrossRefHeadingBookmarkNamePrefix()
static bool IsShowChanges(const RedlineFlags eM)
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const =0
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
Provides access to settings of a document.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual CharCompressType getCharacterCompressionType() const =0
Get the character compression type for Asian characters.
void adjust(size_t nIndex, sal_Int32 nDiff)
const Range & GetTotalRange() const
const Range & GetRange(sal_Int32 nRange) const
sal_Int32 GetRangeCount() const
bool Select(sal_Int32 nIndex, bool bSelect=true)
void SelectAll(bool bSelect=true)
tools::Long AdjustX(tools::Long nHorzMove)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
css::uno::Reference< css::frame::XModel3 > GetBaseModel() const
sal_uInt16 GetLower() const
wrapper class for the positioning of Writer fly frames and drawing objects
virtual SwFrameFormat & GetFrameFormat()=0
virtual const SwFlyFrame * DynCastFlyFrame() const
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.
SwAttrHandler & GetAttrHandler()
SwRedlineItr * GetRedln()
const SvxULSpaceItem & GetULSpace(bool=true) const
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
const css::lang::Locale & GetLocale(const LanguageType aLang)
sal_uInt16 GetRealScriptOfText(const OUString &rText, sal_Int32 nPos) const
SwLineBreakClear GetClear() const
SwCharRange & operator+=(const SwCharRange &rRange)
Marks a character position inside a document model content node (SwContentNode)
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
const SwAttrSet * GetpSwAttrSet() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
IDocumentSettingAccess const & getIDocumentSettingAccess() const
SwDocShell * GetDocShell()
Text portion for the Format -> Paragraph -> Drop Caps functionality.
sal_uInt16 GetLines() const
This portion represents an as-character anchored fly (shape, frame, etc.)
sw::LineAlign GetAlign() const
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
tools::Long GetHeight() const
const SwSortedObjs * GetDrawObjs() const
A glue portion is either a base class for other portions that want to have a certain width to push te...
void SetFixWidth(const sal_uInt16 nNew)
void Join(SwGluePortion *pVictim)
Collection of SwLinePortion instances, representing one line of text.
std::unique_ptr< std::deque< sal_uInt16 > > m_pKanaComp
void Init(SwLinePortion *pNextPortion=nullptr)
void SetBlinking(const bool bNew)
virtual ~SwLineLayout() override
std::unique_ptr< std::vector< tools::Long > > m_pLLSpaceAdd
std::deque< sal_uInt16 > & GetKanaComp()
void SetRedline(const bool bNew)
void SetRedlineEndType(const enum RedlineType eNew)
enum RedlineType m_eRedlineEnd
virtual SwLinePortion * Insert(SwLinePortion *pPortion) override
void SetHanging(const bool bNew)
void CreateSpaceAdd(const tools::Long nInit=0)
SwLinePortion * GetFirstPortion() const
void SetLLSpaceAdd(tools::Long nNew, sal_uInt16 nIdx)
void CalcLine(SwTextFormatter &rLine, SwTextFormatInfo &rInf)
SwTwips GetHangingMargin() const
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
void SetRedlineText(const OUString &sText)
void SetRedlineEnd(const bool bNew)
void SetRealHeight(SwTwips nNew)
SwMarginPortion * CalcLeftMargin()
void SetContent(const bool bNew)
void SetNext(SwLineLayout *pNew)
virtual SwLinePortion * Append(SwLinePortion *pPortion) override
void SetDummy(const bool bNew)
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &nOffset) const override
SwTwips GetHangingMargin_() const
std::deque< sal_uInt16 > * GetpKanaComp() const
virtual bool Format(SwTextFormatInfo &rInf) override
Base class for anything that can be part of a line in the Writer layout.
TextFrameIndex mnLineLength
bool IsTextPortion() const
void dumpAsXmlAttributes(xmlTextWriterPtr writer, std::u16string_view rText, TextFrameIndex nOffset) const
SwLinePortion * mpNextPortion
bool IsHangingPortion() const
bool IsMarginPortion() const
SwLinePortion * GetNextPortion() const
void SetAscent(const SwTwips nNewAsc)
PortionType GetWhichPor() const
void SetNextPortion(SwLinePortion *pNew)
bool IsPostItsPortion() const
SwLinePortion * Cut(SwLinePortion *pVictim)
TextFrameIndex GetLen() const
bool IsKernPortion() const
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const
virtual SwLinePortion * Compress()
void AddPrtWidth(const SwTwips nNew)
bool IsDropPortion() const
bool IsBreakPortion() const
void SetLen(TextFrameIndex const nLen)
bool IsGrfNumPortion() const
bool IsMultiPortion() const
bool IsHolePortion() const
bool IsFlyPortion() const
bool IsFootnoteNumPortion() const
void SetWhichPor(const PortionType nNew)
bool IsFlyCntPortion() const
bool HasFlyInContent() const
const IDocumentRedlineAccess & getIDocumentRedlineAccess() const
Provides access to the document redline interface.
IDocumentContentOperations & getIDocumentContentOperations()
Provides access to the document content operations interface.
SwNodeOffset GetIndex() const
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
PaM is Point and Mark: a selection of the document model.
const SwPosition * Start() const
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
bool HasContentPortions() const
bool HasNumberingPortion(FootnoteOrNot) const
TextFrameIndex GetParLen() const
const SwDropPortion * FindDropPortion() const
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &nOffset) const override
void SetMargin(const bool bNew=true)
virtual ~SwParaPortion() override
std::size_t GetAuthor(sal_uInt16 nPos=0) const
void CalcStartEnd(SwNodeOffset nNdIdx, sal_Int32 &rStart, sal_Int32 &rEnd) const
Calculates the intersection with text node number nNdIdx.
RedlineType GetType(sal_uInt16 nPos=0) const
bool CheckLine(SwNodeOffset nStartNode, sal_Int32 nChkStart, SwNodeOffset nEndNode, sal_Int32 nChkEnd, OUString &rRedlineText, bool &bRedlineEnd, RedlineType &eRedlineEnd, size_t *pAuthorAtPos=nullptr)
vector_type::size_type size_type
const SwRangeRedline * FindAtPosition(const SwPosition &startPosition, size_type &tableIndex, bool next=true) const
Find the redline at the given position.
sal_Int32 GetBegin() const
const OUString & GetWord() const
std::unordered_set< size_t > m_KashidaInvalid
indexes into m_Kashida
TextFrameIndex m_nInvalidityPos
static void DeleteHiddenRanges(SwTextNode &rNode)
Hidden text attribute handling.
sal_Int16 ScriptType(const TextFrameIndex nPos) const
void ClearNoKashidaLine(TextFrameIndex nStt, TextFrameIndex nLen)
Clear forced blank justification for a given line.
CompType GetCompType(const size_t nCnt) const
void MarkKashidasInvalid(sal_Int32 nCnt, const TextFrameIndex *pKashidaPositions)
Marks nCnt kashida positions as invalid pKashidaPositions: array of char indices relative to the para...
TextFrameIndex GetCompStart(const size_t nCnt) const
std::deque< TextFrameIndex > m_NoKashidaLineEnd
static void selectHiddenTextProperty(const SwTextNode &rNode, MultiSelection &rHiddenMulti, std::vector< std::pair< sw::mark::IBookmark const *, MarkKind > > *pBookmarks)
TextFrameIndex GetCompLen(const size_t nCnt) const
TextFrameIndex NextDirChg(const TextFrameIndex nPos, const sal_uInt8 *pLevel=nullptr) const
tools::Long Compress(KernArray &rKernArray, TextFrameIndex nIdx, TextFrameIndex nLen, const sal_uInt16 nCompress, const sal_uInt16 nFontHeight, const bool bCentered, Point *pPoint=nullptr) 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.
std::deque< TextFrameIndex > m_Kashida
TextFrameIndex GetHiddenChg(const size_t nCnt) const
SwFontScript WhichFont(TextFrameIndex nIdx) const
std::vector< ScriptChangeInfo > m_ScriptChanges
sal_Int32 KashidaJustify(KernArray *pKernArray, sal_Bool *pKashidaArray, TextFrameIndex nStt, TextFrameIndex nLen, tools::Long nSpaceAdd=0) const
Performs a kashida justification on the kerning array.
std::vector< std::tuple< MarkKind, Color, OUString > > GetBookmarks(TextFrameIndex const nPos)
void UpdateBidiInfo(const OUString &rText)
std::vector< DirectionChangeInfo > m_DirectionChanges
static bool IsInHiddenRange(const SwTextNode &rNode, sal_Int32 nPos)
sal_uInt8 DirType(const TextFrameIndex nPos) const
CompType DbgCompType(const TextFrameIndex nPos) const
static void CJKJustify(const OUString &rText, KernArray &rKernArray, TextFrameIndex nStt, TextFrameIndex nLen, LanguageType aLang, tools::Long nSpaceAdd, bool bIsSpaceStop)
bool MarkOrClearKashidaInvalid(TextFrameIndex nStt, TextFrameIndex nLen, bool bMark, sal_Int32 nMarkCount)
size_t CountScriptChg() 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 TextFrameIndex CountCJKCharacters(const OUString &rText, TextFrameIndex nPos, TextFrameIndex nEnd, LanguageType aLang)
static TextFrameIndex ThaiJustify(std::u16string_view aText, KernArray *pKernArray, TextFrameIndex nIdx, TextFrameIndex nLen, TextFrameIndex nNumberOfBlanks=TextFrameIndex(0), tools::Long nSpaceAdd=0)
Performs a thai justification on the kerning array.
bool IsKashidaLine(TextFrameIndex nCharIdx) const
TextFrameIndex GetInvalidityA() const
void ClearKashidaInvalid(size_t nKashPos)
void GetKashidaPositions(TextFrameIndex nStt, TextFrameIndex nLen, std::vector< TextFrameIndex > &rKashidaPosition)
retrieves kashida opportunities for a given text range.
TextFrameIndex GetScriptChg(const size_t nCnt) const
bool IsKashidaValid(size_t nKashPos) const
sal_uInt8 GetScriptType(const size_t nCnt) const
TextFrameIndex NextHiddenChg(TextFrameIndex nPos) const
size_t CountKashida() const
bool MarkKashidaInvalid(size_t nKashPos)
static bool IsArabicText(const OUString &rText, TextFrameIndex nStt, TextFrameIndex nLen)
Checks if text is Arabic text.
static SwScriptInfo * GetScriptInfo(const SwTextNode &rNode, SwTextFrame const **o_pFrame=nullptr, bool bAllowInvalid=false)
return a frame for the node, ScriptInfo is its member... (many clients need both frame and SI,...
void SetNoKashidaLine(TextFrameIndex nStt, TextFrameIndex nLen)
Use regular blank justification instead of kashdida justification for the given line of text.
size_t CountDirChg() const
static void CalcHiddenRanges(const SwTextNode &rNode, MultiSelection &rHiddenMulti, std::vector< std::pair< sw::mark::IBookmark const *, MarkKind > > *pBookmarks)
TextFrameIndex GetDirChg(const size_t nCnt) const
TextFrameIndex NextScriptChg(TextFrameIndex nPos) const
size_t CountCompChg() const
size_t CountHiddenChg() const
std::deque< TextFrameIndex > m_NoKashidaLine
TextFrameIndex NextBookmark(TextFrameIndex nPos) const
std::vector< TextFrameIndex > m_HiddenChg
static void selectRedLineDeleted(const SwTextNode &rNode, MultiSelection &rHiddenMulti, bool bSelect=true)
size_t HasKana(TextFrameIndex nStart, TextFrameIndex nEnd) const
std::vector< CompressionChangeInfo > m_CompressionChanges
void InitScriptInfo(const SwTextNode &rNode, sw::MergedPara const *pMerged, bool bRTL)
std::vector< std::tuple< TextFrameIndex, MarkKind, Color, OUString > > m_Bookmarks
sal_uInt8 GetDirType(const size_t nCnt) const
TextFrameIndex GetKashida(const size_t nCnt) const
class for collecting anchored objects
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
const sal_Int32 * End() const
sal_Int32 GetStart() const
sal_uInt16 RealWidth() const
TextFrameIndex GetLineStart() const
bool ClearIfIsFirstOfBorderMerge(SwLinePortion const *pPortion)
void SetFlyInCntBase(bool bNew=true)
Represents the visualization of a paragraph.
SwTwips GetLowerMarginForFlyIntersect() const
Get the amount of lower margin of this frame we need to consider for fly portion purposes.
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(TextFrameIndex nIndex) const
map position in potentially merged text frame to SwPosition
SwParaPortion * GetPara()
SwTwips HangingMargin() const
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
SwTextNode const * GetTextNodeForParaProps() const
SwParaPortion * GetParaPortion()
TextFrameIndex GetEnd() const
TextFrameIndex GetStart() const
SwTextNode is a paragraph in the document model.
void SetHiddenCharAttribute(bool bNewHiddenCharsHidePara, bool bNewContainsHiddenChars) const
virtual sal_Int32 Len() const override
bool IsCalcHiddenCharFlags() const
Optimization: Asking for information about hidden characters at SwScriptInfo updates these flags.
SwpHints * GetpSwpHints()
const OUString & GetText() const
bool HasHiddenCharAttribute(bool bWholePara) const
Hidden Paragraph Field:
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
static SwTextPortion * CopyLinePortion(const SwLinePortion &rPortion)
virtual bool Format(SwTextFormatInfo &rInf) override
SwTextFrame * GetTextFrame()
vcl::RenderContext * GetOut()
sal_uInt16 GetTextHeight() const
const OUString & GetText() const
static rtl::Reference< SwXBookmark > CreateXBookmark(SwDoc &rDoc, ::sw::mark::IMark *pBookmark)
An SwTextAttr container, stores all directly formatted text portions for a text node.
SwTextAttr * Get(size_t nPos) const
virtual bool IsHidden() const =0
virtual bool IsExpanded() const =0
virtual const SwPosition & GetMarkEnd() const =0
virtual const SwPosition & GetMarkStart() const =0
static sal_Int16 getUnicodeScriptType(const sal_Unicode ch, const ScriptTypeList *typeList, sal_Int16 unknownType=0)
static sal_Int16 getUnicodeType(const sal_uInt32 ch)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
struct _xmlTextWriter * xmlTextWriterPtr
constexpr TypedWhichId< SvxCharHiddenItem > RES_CHRATR_HIDDEN(37)
CharClass & GetAppCharClass()
LanguageType GetAppLanguage()
#define SAL_WARN_IF(condition, area, stream)
sal_Int16 GetI18NScriptTypeOfLanguage(LanguageType nLang)
ScriptTypeList const typeList[]
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(MergedPara const &, TextFrameIndex nIndex)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
static bool lcl_HasOnlyBlanks(std::u16string_view rText, TextFrameIndex nStt, TextFrameIndex nEnd)
static SwFontScript lcl_ScriptToFont(sal_uInt16 const nScript)
static bool isBehChar(sal_Unicode cCh)
static bool isYehChar(sal_Unicode cCh)
static Color getBookmarkColor(const SwTextNode &rNode, const sw::mark::IBookmark *pBookmark)
static bool isTransparentChar(sal_Unicode cCh)
#define isTehMarbutaChar(c)
static bool lcl_IsLigature(sal_Unicode cCh, sal_Unicode cNextCh)
static bool lcl_HasStrongLTR(std::u16string_view rText, sal_Int32 nStart, sal_Int32 nEnd)
#define isSeenOrSadChar(c)
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::tuple< TextFrameIndex, SwScriptInfo::MarkKind, Color, OUString > > &o_rBookmarks)
static bool lcl_ConnectToPrev(sal_Unicode cCh, sal_Unicode cPrevCh)
#define SPACING_PRECISION_FACTOR
Marks a position in the document model.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
Records a single change in script type.
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
OUString mergedText
note: cannot be const currently to avoid UB because SwTextGuess::Guess const_casts it and modifies it...
SwTextNode * pParaPropsNode
most paragraph properties are taken from the first non-empty node
std::vector< Extent > extents
Reference< XModel > xModel
constexpr sal_Int32 COMPLETE_STRING