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>
61#include <com/sun/star/frame/XModel.hpp>
62#include <com/sun/star/text/XBookmarksSupplier.hpp>
63#include <officecfg/Office/Common.hxx>
69#include <com/sun/star/rdf/Statement.hpp>
70#include <com/sun/star/rdf/URI.hpp>
71#include <com/sun/star/rdf/URIs.hpp>
72#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
73#include <com/sun/star/rdf/XLiteral.hpp>
74#include <com/sun/star/text/XTextContent.hpp>
77using namespace i18n::ScriptType;
79#include <unicode/ubidi.h>
111#define IS_JOINING_GROUP(c, g) ( u_getIntPropertyValue( (c), UCHAR_JOINING_GROUP ) == U_JG_##g )
112#define isAinChar(c) IS_JOINING_GROUP((c), AIN)
113#define isAlefChar(c) IS_JOINING_GROUP((c), ALEF)
114#define isDalChar(c) IS_JOINING_GROUP((c), DAL)
115#if U_ICU_VERSION_MAJOR_NUM >= 58
116#define isFehChar(c) (IS_JOINING_GROUP((c), FEH) || IS_JOINING_GROUP((c), AFRICAN_FEH))
118#define isFehChar(c) IS_JOINING_GROUP((c), FEH)
120#define isGafChar(c) IS_JOINING_GROUP((c), GAF)
121#define isHehChar(c) IS_JOINING_GROUP((c), HEH)
122#define isKafChar(c) IS_JOINING_GROUP((c), KAF)
123#define isLamChar(c) IS_JOINING_GROUP((c), LAM)
124#if U_ICU_VERSION_MAJOR_NUM >= 58
125#define isQafChar(c) (IS_JOINING_GROUP((c), QAF) || IS_JOINING_GROUP((c), AFRICAN_QAF))
127#define isQafChar(c) IS_JOINING_GROUP((c), QAF)
129#define isRehChar(c) IS_JOINING_GROUP((c), REH)
130#define isTahChar(c) IS_JOINING_GROUP((c), TAH)
131#define isTehMarbutaChar(c) IS_JOINING_GROUP((c), TEH_MARBUTA)
132#define isWawChar(c) IS_JOINING_GROUP((c), WAW)
133#define isSeenOrSadChar(c) (IS_JOINING_GROUP((c), SAD) || IS_JOINING_GROUP((c), SEEN))
139 switch (u_getIntPropertyValue(cCh, UCHAR_JOINING_GROUP))
143#if U_ICU_VERSION_MAJOR_NUM >= 58
144 case U_JG_AFRICAN_NOON:
149 case U_JG_BURUSHASKI_YEH_BARREE:
164 switch (u_getIntPropertyValue(cCh, UCHAR_JOINING_GROUP))
168 case U_JG_YEH_BARREE:
169 case U_JG_BURUSHASKI_YEH_BARREE:
170 case U_JG_YEH_WITH_TAIL:
183 return u_getIntPropertyValue( cCh, UCHAR_JOINING_TYPE ) == U_JT_TRANSPARENT;
196 const int32_t nJoiningType = u_getIntPropertyValue( cPrevCh, UCHAR_JOINING_TYPE );
197 bool bRet = nJoiningType != U_JT_RIGHT_JOINING && nJoiningType != U_JT_NON_JOINING;
206static bool lcl_HasStrongLTR ( std::u16string_view rText, sal_Int32 nStart, sal_Int32 nEnd )
208 for( sal_Int32 nCharIdx = nStart; nCharIdx < nEnd; ++nCharIdx )
210 const UCharDirection nCharDir = u_charDirection ( rText[ nCharIdx ] );
211 if ( nCharDir == U_LEFT_TO_RIGHT ||
212 nCharDir == U_LEFT_TO_RIGHT_EMBEDDING ||
213 nCharDir == U_LEFT_TO_RIGHT_OVERRIDE )
362 while ( nStt < nEnd )
364 switch (rText[sal_Int32(nStt++)])
384 sal_uInt16 nFlyAscent = 0;
385 sal_uInt16 nFlyHeight = 0;
386 sal_uInt16 nFlyDescent = 0;
389 sal_uInt16 nBreakHeight = 0;
391 bool bOnlyPostIts =
true;
394 bool bTmpDummy = !
GetLen();
404 const bool bIgnoreBlanksAndTabsForLineHeightCalculation =
408 bool bHasBlankPortion =
false;
409 bool bHasOnlyBlankPortions =
true;
410 bool bHasFlyPortion =
false;
427 sal_uInt16 nMaxDescent = 0;
434 "sw.core",
"SwLineLayout::CalcLine: don't use SwLinePortions !" );
462 if (bIgnoreBlanksAndTabsForLineHeightCalculation && !rInf.
GetLineStart())
470 bHasBlankPortion =
true;
485 bHasOnlyBlankPortions =
false;
493 "sw.core",
"SwLineLayout::CalcLine: bad ascent or height" );
501 bHasFlyPortion =
true;
505 bool bClearingBreak =
false;
510 nBreakHeight = nPosHeight;
520 if( nFlyHeight < nPosHeight )
521 nFlyHeight = nPosHeight;
522 if( nFlyAscent < nPosAscent )
523 nFlyAscent = nPosAscent;
524 if( nFlyDescent < nPosHeight - nPosAscent )
525 nFlyDescent = nPosHeight - nPosAscent;
533 if( nTmp > nPosAscent )
535 nPosHeight += nTmp - nPosAscent;
540 if( nTmp > nPosHeight )
543 Height( nPosHeight,
false );
545 nMaxDescent = nPosHeight - nPosAscent;
550 if(
Height() < nPosHeight )
553 if (bIgnoreBlanksAndTabsForLineHeightCalculation && pPos->
IsFlyCntPortion())
555 Height(std::max(nPosHeight, nLineHeight),
false);
576 if( nMaxDescent < nPosHeight - nPosAscent )
577 nMaxDescent = nPosHeight - nPosAscent;
589 if( pPos->
GetExpText( rInf, aText ) && !aText.isEmpty() )
619 if( bTmpDummy && nFlyHeight )
622 if( nFlyDescent > nFlyHeight - nFlyAscent )
623 Height( nFlyHeight + nFlyDescent,
false );
626 if (nBreakHeight > nFlyHeight)
631 Height(nBreakHeight,
false);
635 Height(nFlyHeight,
false);
642 if( bOnlyPostIts && !( bHasBlankPortion && bHasOnlyBlankPortions ) )
654 if ( bIgnoreBlanksAndTabsForLineHeightCalculation &&
657 bHasBlankPortion =
true;
662 if ( bHasBlankPortion && bHasOnlyBlankPortions )
665 sal_uInt16 nTmpHeight =
Height();
670 Height(nTmpHeight,
false);
678 std::pair<SwTextNode const*, sal_Int32>
const start(
680 std::pair<SwTextNode const*, sal_Int32>
const end(
682 bool bHasRedline = rLine.
GetRedln();
685 OUString sRedlineText;
689 end.first->GetIndex(),
end.second, sRedlineText, bHasRedlineEnd, eRedlineEnd);
695 if( eRedlineEnd != RedlineType::None )
702 if ( !bHasFlyPortion )
710 nLineLength += pPos->
GetLen();
714 bool bDeleted =
false;
715 size_t nAuthor = std::string::npos;
718 OUString sRedlineText;
721 std::pair<SwTextNode const*, sal_Int32>
const flyStart(
724 flyStart.second, flyStart.first->GetIndex(), flyStart.second, sRedlineText,
725 bHasRedlineEnd, eRedlineEnd, &nAuthor);
726 bDeleted = bHasFlyRedline && eRedlineEnd == RedlineType::Delete;
744 bool bDeleted =
false;
745 size_t nAuthor = std::string::npos;
747 if ( rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_CHAR )
753 if ( pFnd && RedlineType::Delete == pFnd->
GetType() )
759 pFly->SetDeleted(bDeleted);
760 pFly->SetAuthor(nAuthor);
776 const bool _bNoFlyCntPorAndLinePor )
const
789 while ( pTmpPortion )
794 ( !_bNoFlyCntPorAndLinePor ||
803 ( pTmpPortion != _pDontConsiderPortion );
807 _orObjAscent = std::max( _orObjAscent, nPortionAsc );
808 _orObjDescent = std::max( _orObjDescent, nPortionDesc );
813 _orAscent = std::max( _orAscent, nPortionAsc );
814 _orDescent = std::max( _orDescent, nPortionDesc );
824 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwLineLayout"));
828 (void)xmlTextWriterEndElement(pWriter);
840 : m_pNext( nullptr ),
843 m_bUnderscore( false )
877 : m_nInvalidityPos(0)
896 OSL_FAIL(
"Somebody tells lies about the script type!" );
922 const css::uno::Reference<css::rdf::XResource> xSubject(xRef, uno::UNO_QUERY);
925 static uno::Reference< uno::XComponentContext > xContext(
926 ::comphelper::getProcessComponentContext());
928 static uno::Reference< rdf::XURI > xODF_SHADING(
929 rdf::URI::createKnown(xContext, rdf::URIs::LO_EXT_SHADING), uno::UNO_SET_THROW);
931 uno::Reference<rdf::XDocumentMetadataAccess> xDocumentMetadataAccess(
933 const uno::Reference<rdf::XRepository>& xRepository =
934 xDocumentMetadataAccess->getRDFRepository();
935 const uno::Reference<container::XEnumeration> xEnum(
936 xRepository->getStatements(xSubject, xODF_SHADING,
nullptr), uno::UNO_SET_THROW);
939 if ( xEnum->hasMoreElements() && (xEnum->nextElement() >>= stmt) )
941 const uno::Reference<rdf::XLiteral> xObject(stmt.Object, uno::UNO_QUERY);
946 catch (
const lang::IllegalArgumentException&)
954 std::optional<std::vector<sw::Extent>::const_iterator> oPrevIter,
955 std::vector<sw::Extent>::const_iterator iter,
956 std::vector<sw::Extent>::const_iterator
const end,
958 std::vector<std::pair<sw::mark::IBookmark const*, SwScriptInfo::MarkKind>> & rBookmarks,
959 std::vector<std::tuple<TextFrameIndex, SwScriptInfo::MarkKind, Color, OUString>> & o_rBookmarks)
962 for (
auto const& it : rBookmarks)
964 assert(iter->pNode == pNode || pNode->
GetIndex() < iter->pNode->GetIndex());
965 assert(!oPrevIter || (*oPrevIter)->pNode->GetIndex() <= pNode->
GetIndex());
983 SwPosition const& rStart(it.first->GetMarkStart());
984 SwPosition const& rEnd(it.first->GetMarkEnd());
985 assert(&rStart.
GetNode() == pNode);
988 if (&rStart.
GetNode() != iter->pNode
998 o_rBookmarks.emplace_back(nOffset, it.second, c, it.first->GetName());
1004 auto const iterNext(iter + 1);
1007 ? &rEnd.
GetNode() == iter->pNode
1015 o_rBookmarks.emplace_back(
1017 it.second, c, it.first->GetName());
1036 o_rBookmarks.emplace_back(nOffset, it.second, c, it.first->GetName());
1043 SwPosition const& rEnd(it.first->GetMarkEnd());
1044 assert(&rEnd.
GetNode() == pNode);
1048 || &rEnd.
GetNode() != iter->pNode
1051 SwPosition const& rStart(it.first->GetMarkStart());
1054 ? ((*oPrevIter)->pNode->GetIndex() < rStart.
GetNodeIndex()
1055 || ((*oPrevIter)->pNode == &rStart.
GetNode()
1065 o_rBookmarks.emplace_back(nOffset, it.second, c, it.first->GetName());
1071 o_rBookmarks.emplace_back(
1073 it.second, c, it.first->GetName());
1087 SwPosition const& rPos(it.first->GetMarkPos());
1088 assert(&rPos.
GetNode() == pNode);
1091 if (&rPos.
GetNode() != iter->pNode
1105 o_rBookmarks.emplace_back(
1107 it.second, c, it.first->GetName());
1150 std::optional<std::vector<sw::Extent>::const_iterator> oPrevIter;
1151 for (
auto iter = pMerged->
extents.begin(); iter != pMerged->
extents.end();
1154 if (iter->pNode == pNode)
1160 pNode = iter->pNode;
1161 Range aRange( 0, pNode->
Len() > 0 ? pNode->
Len() - 1 : 0 );
1163 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> bookmarks;
1171 const sal_Int32 nStart = rRange.
Min();
1172 const sal_Int32 nEnd = rRange.
Max() + 1;
1173 bool isStartHandled(
false);
1174 ::std::optional<sal_Int32> oExtend;
1176 if (nEnd <= iter->nStart)
1183 if (!isStartHandled && nStart <= iter->nEnd)
1185 isStartHandled =
true;
1186 if (nStart <= iter->nStart && !
m_HiddenChg.empty()
1190 oExtend.emplace(
::std::min(iter->nEnd, nEnd) - ::std::max(iter->nStart, nStart));
1199 *oExtend +=
::std::min(iter->nEnd, nEnd) - iter->nStart;
1201 if (nEnd <= iter->nEnd)
1216 while (iter != pMerged->
extents.end() && iter->pNode == pNode);
1217 if (iter == pMerged->
extents.end() || iter->pNode != pNode)
1237 Range aRange( 0, !rText.isEmpty() ? rText.getLength() - 1 : 0 );
1239 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> bookmarks;
1242 for (
auto const& it : bookmarks)
1247 if (it.first->GetName().startsWith(
1259 m_Bookmarks.emplace_back(
TextFrameIndex(it.first->GetMarkStart().GetContentIndex()), it.second, c, it.first->GetName());
1274 const sal_Int32 nStart = rRange.
Min();
1275 const sal_Int32 nEnd = rRange.
Max() + 1;
1295 size_t nCntComp = 0;
1297 size_t nCntKash = 0;
1299 sal_Int16 nScript = i18n::ScriptType::LATIN;
1304 auto const& rParaItems((pMerged ? *pMerged->
pParaPropsNode : rNode).GetSwAttrSet());
1306 const bool bAdjustBlock = SvxAdjust::Block == rParaItems.GetAdjust().GetAdjust();
1326 if( CharCompressType::NONE != aCompEnum )
1357 while ( nChg > nGrpStart &&
1363 if ( nChg == nGrpStart )
1377 if( nChg >= nLastCompression +
GetCompLen( nCntComp ) )
1379 nLastCompression = nChg;
1390 if( nCntKash && i18n::ScriptType::COMPLEX == nScript )
1416 SAL_WARN_IF( i18n::ScriptType::LATIN != nScript &&
1417 i18n::ScriptType::ASIAN != nScript &&
1418 i18n::ScriptType::COMPLEX != nScript,
"sw.core",
"Wrong default language" );
1427 if ( nScript != nNextScript )
1431 nScript = nNextScript;
1441 "sw.core",
"Inserting WEAK into SwScriptInfo structure" );
1445 rText, sal_Int32(nSearchStt), nScript));
1453 if( i18n::ScriptType::COMPLEX == nScript )
1456 rText, sal_Int32(nSearchStt) );
1458 short nCurrentScriptType = nScriptType;
1459 while( css::i18n::CTLScriptType::CTL_UNKNOWN == nCurrentScriptType || nScriptType == nCurrentScriptType )
1463 rText, sal_Int32(nNextCTLScriptStart)));
1465 || nNextCTLScriptStart >= nChg)
1468 rText, sal_Int32(nNextCTLScriptStart));
1470 nChg =
std::min( nChg, nNextCTLScriptStart );
1476 && (i18n::ScriptType::WEAK ==
1479 int8_t
nType = u_charType(rText[sal_Int32(nChg)]);
1480 if (
nType == U_NON_SPACING_MARK ||
nType == U_ENCLOSING_MARK ||
1481 nType == U_COMBINING_SPACING_MARK )
1498 if ( CharCompressType::NONE != aCompEnum &&
1499 i18n::ScriptType::ASIAN == nScript )
1505 while ( nLastCompression < nChg )
1507 sal_Unicode cChar = rText[ sal_Int32(nLastCompression) ];
1513 case 0x3008:
case 0x300A:
case 0x300C:
case 0x300E:
1514 case 0x3010:
case 0x3014:
case 0x3016:
case 0x3018:
1515 case 0x301A:
case 0x301D:
1519 case 0x3009:
case 0x300B:
1520 case 0x300D:
case 0x300F:
case 0x3011:
case 0x3015:
1521 case 0x3017:
case 0x3019:
case 0x301B:
case 0x301E:
1525 case 0x3001:
case 0x3002:
1529 eState = ( 0x3040 <= cChar && 0x3100 > cChar ) ?
KANA :
NONE;
1533 if( ePrevState != eState )
1535 if ( ePrevState !=
NONE )
1538 if ( CharCompressType::PunctuationAndKana == aCompEnum ||
1539 ePrevState !=
KANA )
1542 nLastCompression - nPrevChg, ePrevState);
1546 ePrevState = eState;
1547 nPrevChg = nLastCompression;
1554 if ( ePrevState !=
NONE )
1557 if ( CharCompressType::PunctuationAndKana == aCompEnum ||
1558 ePrevState !=
KANA )
1561 nLastCompression - nPrevChg, ePrevState);
1567 else if ( bAdjustBlock && i18n::ScriptType::COMPLEX == nScript )
1571 std::function<
LanguageType (sal_Int32, sal_Int32,
bool)>
const pGetLangOfCharM(
1572 [&pMerged](sal_Int32
const nBegin, sal_uInt16
const script,
bool const bNoChar)
1574 std::pair<SwTextNode const*, sal_Int32>
const pos(
1576 return pos.first->GetLang(
pos.second, bNoChar ? 0 : 1,
script);
1578 std::function<
LanguageType (sal_Int32, sal_Int32,
bool)>
const pGetLangOfChar1(
1579 [&rNode](sal_Int32
const nBegin, sal_uInt16
const script,
bool const bNoChar)
1580 {
return rNode.
GetLang(nBegin, bNoChar ? 0 : 1,
script); });
1581 auto pGetLangOfChar(pMerged ? pGetLangOfCharM : pGetLangOfChar1);
1583 i18n::WordType::DICTIONARY_WORD,
1584 sal_Int32(nLastKashida), sal_Int32(nChg));
1589 const OUString& rWord = aScanner.
GetWord();
1591 sal_Int32 nIdx = 0, nPrevIdx = 0;
1592 sal_Int32 nKashidaPos = -1;
1595 int nPriorityLevel = 7;
1598 sal_Int32 nWordLen = rWord.getLength();
1604 while (nIdx < nWordLen)
1606 cCh = rWord[ nIdx ];
1612 nKashidaPos = aScanner.
GetBegin() + nIdx;
1618 if (nPriorityLevel >= 1 && nIdx < nWordLen - 1)
1621 && (rWord[ nIdx+1 ] != 0x200C) )
1623 nKashidaPos = aScanner.
GetBegin() + nIdx;
1630 if ( nPriorityLevel >= 2 && nIdx > 0 )
1634 (
isHehChar ( cCh ) && nIdx == nWordLen - 1))
1637 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1641 nKashidaPos = aScanner.
GetBegin() + nPrevIdx;
1649 if ( nPriorityLevel >= 3 && nIdx > 0 )
1656 && nIdx == nWordLen - 1))
1658 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1662 nKashidaPos = aScanner.
GetBegin() + nPrevIdx;
1670 if ( nPriorityLevel >= 4 && nIdx > 0 && nIdx < nWordLen - 1 )
1678 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1682 nKashidaPos = aScanner.
GetBegin() + nPrevIdx;
1691 if ( nPriorityLevel >= 5 && nIdx > 0 )
1698 && nIdx == nWordLen - 1))
1700 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1704 nKashidaPos = aScanner.
GetBegin() + nPrevIdx;
1711 if ( nPriorityLevel >= 6 && nIdx > 0 )
1716 SAL_WARN_IF( 0 == cPrevCh,
"sw.core",
"No previous character" );
1720 nKashidaPos = aScanner.
GetBegin() + nPrevIdx;
1737 if ( -1 != nKashidaPos )
1748 nLastCompression = nChg;
1749 nLastKashida = nChg;
1752#if OSL_DEBUG_LEVEL > 0
1755 bool bWrongKash =
false;
1759 if ( nCurrKashidaPos <= nTmpKashidaPos )
1764 nTmpKashidaPos = nCurrKashidaPos;
1766 SAL_WARN_IF( bWrongKash,
"sw.core",
"Kashida array contains wrong data" );
1788 if ( nCurrDirType % 2 == UBIDI_RTL ||
1789 (nCurrDirType > UBIDI_LTR &&
1793 size_t nScriptIdx = 0;
1808 "sw.core",
"Script override with CTL font trouble" );
1831#if OSL_DEBUG_LEVEL > 1
1834 sal_uInt8 nLastTyp = i18n::ScriptType::WEAK;
1839 nLastPos >= rScriptChange.position,
1840 "sw.core",
"Heavy InitScriptType() confusion" );
1841 nLastPos = rScriptChange.position;
1842 nLastTyp = rScriptChange.type;
1857 UErrorCode nError = U_ZERO_ERROR;
1858 UBiDi* pBidi = ubidi_openSized( rText.getLength(), 0, &nError );
1859 nError = U_ZERO_ERROR;
1861 ubidi_setPara( pBidi,
reinterpret_cast<const UChar *
>(rText.getStr()), rText.getLength(),
1863 nError = U_ZERO_ERROR;
1864 int nCount = ubidi_countRuns( pBidi, &nError );
1867 UBiDiLevel nCurrDir;
1868 for (
int nIdx = 0; nIdx <
nCount; ++nIdx )
1870 ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir );
1875 ubidi_close( pBidi );
1888 for(
size_t nX = 0; nX < nEnd; ++nX )
1901 for(
size_t nX = 0; nX < nEnd; ++nX )
1914 const sal_uInt8 nCurrDir = pLevel ? *pLevel : 62;
1916 for(
size_t nX = 0; nX < nEnd; ++nX )
1919 ( nX + 1 == nEnd ||
GetDirType( nX + 1 ) <= nCurrDir ) )
1929 for(
size_t nX = 0; nX < nEnd; ++nX )
1954 if (
nPos < std::get<0>(it))
1956 return std::get<0>(it);
1962std::vector<std::tuple<SwScriptInfo::MarkKind, Color, OUString>>
1965 std::vector<std::tuple<SwScriptInfo::MarkKind, Color, OUString>> aColors;
1968 if (
nPos == std::get<0>(it))
1970 const OUString&
sName = std::get<3>(it);
1973 if ( !(
sName.startsWith(
"_Toc") ||
sName.startsWith(
"_Ref") ) )
1975 OUString>(std::get<1>(it), std::get<2>(it), std::get<3>(it)));
1977 else if (
nPos < std::get<0>(it))
1986 sort(aColors.begin(), aColors.end(),
1987 [](std::tuple<MarkKind, Color, OUString>
const a, std::tuple<MarkKind, Color, OUString>
const b) {
1988 return (MarkKind::End == std::get<0>(a) && MarkKind::End != std::get<0>(b)) ||
1989 (MarkKind::Point == std::get<0>(a) && MarkKind::Start == std::get<0>(b)) ||
1991 (MarkKind::End == std::get<0>(a) && MarkKind::End == std::get<0>(b) && std::get<1>(a) < std::get<1>(b)) ||
1992 (MarkKind::Start == std::get<0>(a) && MarkKind::Start == std::get<0>(b) && std::get<1>(b) < std::get<1>(a));});
1999 const sal_Int32 nStt,
const sal_Int32 nEnd,
2002 assert(rNode.
GetText().getLength() == rText.getLength());
2004 std::vector<sal_Int32> aList;
2005 sal_Int32 nHiddenStart;
2006 sal_Int32 nHiddenEnd;
2007 sal_Int32 nNumOfHiddenChars = 0;
2009 auto rFirst( aList.crbegin() );
2010 auto rLast( aList.crend() );
2011 while ( rFirst != rLast )
2013 nHiddenEnd = *(rFirst++);
2014 nHiddenStart = *(rFirst++);
2016 if ( nHiddenEnd < nStt || nHiddenStart > nEnd )
2019 while ( nHiddenStart < nHiddenEnd && nHiddenStart < nEnd )
2021 if (nHiddenStart >= nStt)
2023 rText[nHiddenStart] = cChar;
2024 ++nNumOfHiddenChars;
2030 return nNumOfHiddenChars;
2036 std::vector<sal_Int32> aList;
2037 sal_Int32 nHiddenStart;
2038 sal_Int32 nHiddenEnd;
2040 auto rFirst( aList.crbegin() );
2041 auto rLast( aList.crend() );
2042 while ( rFirst != rLast )
2044 nHiddenEnd = *(rFirst++);
2045 nHiddenStart = *(rFirst++);
2047 SwPaM aPam( rNode, nHiddenStart, rNode, nHiddenEnd );
2053 sal_Int32& rnStartPos, sal_Int32& rnEndPos,
2054 std::vector<sal_Int32>* pList )
2059 bool bNewContainsHiddenChars =
false;
2067 if ( !bContainsHiddenChars )
2074 pList->push_back( 0 );
2075 pList->push_back(rNode.
GetText().getLength());
2079 rnEndPos = rNode.
GetText().getLength();
2093 const bool bNewHiddenCharsHidePara =
2094 rnStartPos == 0 && rnEndPos >= rNode.
GetText().getLength();
2104 ? rNode.
GetText().getLength() - 1
2111 const sal_Int32 nHiddenStart = rRange.
Min();
2112 const sal_Int32 nHiddenEnd = rRange.
Max() + 1;
2114 if ( nHiddenStart >
nPos )
2116 if (
nPos < nHiddenEnd)
2118 rnStartPos = nHiddenStart;
2119 rnEndPos = std::min<sal_Int32>(nHiddenEnd,
2130 pList->push_back( rRange.
Min() );
2131 pList->push_back( rRange.
Max() + 1 );
2138 return bNewContainsHiddenChars;
2148 for(
size_t nX = 0; nX < nEnd; ++nX )
2153 if ( nHiddenStart >
nPos )
2155 if (
nPos < nHiddenEnd)
2157 rnStartPos = nHiddenStart;
2158 rnEndPos = nHiddenEnd;
2168 sal_Int32 nStartPos;
2179 for(
size_t nX = 0; nX < nEnd; ++nX )
2200 for(
size_t nX = 0; nX < nCnt; ++nX )
2205 if ( nKanaStart >= nEnd )
2206 return SAL_MAX_SIZE;
2208 if ( nStart < nKanaEnd )
2212 return SAL_MAX_SIZE;
2216 const sal_uInt16 nCompress,
const sal_uInt16 nFontHeight,
2218 Point* pPoint )
const
2220 SAL_WARN_IF( !nCompress,
"sw.core",
"Compression without compression?!" );
2221 SAL_WARN_IF( !nLen,
"sw.core",
"Compression without text?!" );
2227 const tools::Long nMinWidth = ( 3 * nFontHeight ) / 4;
2229 size_t nCompIdx =
HasKana( nIdx, nLen );
2231 if ( SAL_MAX_SIZE == nCompIdx )
2241 nI = sal_Int32(nChg - nIdx);
2244 else if( nIdx < nChg + nCompLen )
2245 nCompLen -= nIdx - nChg;
2247 if( nIdx > nLen || nCompIdx >= nCompCount )
2251 tools::Long nLast = nI ? rKernArray[ nI - 1 ] : 0;
2259 if( nCompLen > nLen )
2263 if ( rKernArray[ nI ] - nLast < nMinWidth )
2269 while( nIdx < nCompLen )
2274 nLast -= rKernArray[ nI ];
2287 pPoint->AdjustX(nLast );
2297 nLast = rKernArray[ nI ];
2299 rKernArray.
adjust(nI - 1, nMove);
2300 rKernArray.
adjust(nI, -nSub);
2310 if( ++nCompIdx < nCompCount )
2313 if( nTmpChg > nLen )
2318 while( nIdx < nTmpChg )
2320 nLast = rKernArray[ nI ];
2321 rKernArray.
adjust(nI, -nSub);
2325 }
while( nIdx < nLen );
2340 SAL_WARN_IF( !nLen,
"sw.core",
"Kashida justification without text?!" );
2347 size_t nCntKash = 0;
2357 size_t nCntKashEnd = nCntKash;
2365 size_t nActualKashCount = nCntKashEnd - nCntKash;
2366 for (
size_t i = nCntKash;
i < nCntKashEnd; ++
i)
2373 return nActualKashCount;
2387 while ( nIdx < nEnd )
2394 pKashidaArray[sal_Int32(nArrayPos)] =
true;
2407 while ( nArrayPos < nArrayEnd )
2409 pKernArray->
adjust(sal_Int32(nArrayPos), nKashAdd);
2412 nKashAdd += nSpaceAdd;
2427 { UnicodeScript_kArabic, UnicodeScript_kArabic, sal_Int16(UnicodeScript_kArabic) },
2428 { UnicodeScript_kScriptCount, UnicodeScript_kScriptCount, sal_Int16(UnicodeScript_kScriptCount) }
2433 sal_Int32 nIdx = sal_Int32(nStt);
2434 const sal_Int32 nEnd = sal_Int32(nStt + nLen);
2454 return type == sal_Int16(UnicodeScript_kArabic);
2475 bool bMark, sal_Int32 nMarkCount)
2477 size_t nCntKash = 0;
2517 std::vector<TextFrameIndex>& rKashidaPosition)
2519 size_t nCntKash = 0;
2529 size_t nCntKashEnd = nCntKash;
2534 rKashidaPosition.push_back(
GetKashida(nCntKashEnd));
2575 SAL_WARN_IF( !pKashidaPositions || nCnt == 0,
"sw.core",
"Where are kashidas?" );
2577 size_t nCntKash = 0;
2578 sal_Int32 nKashidaPosIdx = 0;
2580 while (nCntKash <
CountKashida() && nKashidaPosIdx < nCnt)
2582 if ( pKashidaPositions [nKashidaPosIdx] >
GetKashida( nCntKash ) )
2604 SwTwips nNumOfTwipsToDistribute = nSpaceAdd * sal_Int32(nNumberOfBlanks) /
2610 for (sal_Int32 nI = 0; nI < sal_Int32(nLen); ++nI)
2612 const sal_Unicode cCh = aText[sal_Int32(nStt) + nI];
2615 if ( ( 0xE34 > cCh || cCh > 0xE3A ) &&
2616 ( 0xE47 > cCh || cCh > 0xE4E ) && cCh != 0xE31 )
2620 nSpaceAdd = nNumOfTwipsToDistribute / sal_Int32(nNumberOfBlanks);
2622 nNumOfTwipsToDistribute -= nSpaceAdd;
2624 nSpaceSum += nSpaceAdd;
2629 pKernArray->
adjust(nI, nSpaceSum);
2637 bool const bAllowInvalid)
2644 pScriptInfo =
const_cast<SwScriptInfo*
>(pLast->GetScriptInfo());
2647 if (bAllowInvalid ||
2656 pScriptInfo =
nullptr;
2689 while( pLay && pLay->
IsDummy() )
2694 while ( pPos && !pPos->
GetLen() )
2706 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwParaPortion"));
2710 (void)xmlTextWriterEndElement(pWriter);
2729 bool bFound =
false;
2771 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> *
const pBookmarks)
2777 if( pItem && pItem->GetValue() )
2786 for(
size_t nTmp = 0; nTmp < pHints->
Count(); ++nTmp )
2792 const sal_Int32 nSt = pTextAttr->
GetStart();
2793 const sal_Int32 nEnd = *pTextAttr->
End();
2796 Range aTmp( nSt, nEnd - 1 );
2797 rHiddenMulti.
Select( aTmp, pHiddenItem->GetValue() );
2803 for (
const SwContentIndex* pIndex = rNode.GetFirstIndex(); pIndex; pIndex = pIndex->GetNext())
2807 if (pBookmarks && pBookmark)
2825 if (pBookmark && pBookmark->
IsHidden())
2834 Range aTmp( nSt, nEnd - 1 );
2835 rHiddenMulti.
Select(aTmp,
true);
2859 if (pRed->
GetType() != RedlineType::Delete)
2862 sal_Int32 nRedlStart;
2863 sal_Int32 nRedlnEnd;
2866 nRedlnEnd = std::min<sal_Int32>(nRedlnEnd, rNode.
GetText().getLength());
2867 if ( nRedlnEnd > nRedlStart )
2869 Range aTmp( nRedlStart, nRedlnEnd - 1 );
2870 rHiddenMulti.
Select( aTmp, bSelect );
2878 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> *
const pBookmarks)
2888 const bool bNewContainsHiddenChars = rHiddenMulti.
GetRangeCount() > 0;
2889 bool bNewHiddenCharsHidePara =
false;
2890 if ( bNewContainsHiddenChars )
2893 const sal_Int32 nHiddenStart = rRange.
Min();
2894 const sal_Int32 nHiddenEnd = rRange.
Max() + 1;
2895 bNewHiddenCharsHidePara =
2896 (nHiddenStart == 0 && nHiddenEnd >= rNode.
GetText().getLength());
2907 sal_Int32 nDone = 0;
2909 while (
nPos < nEnd )
2912 rText, sal_Int32(
nPos),
2914 i18n::CharacterIteratorMode::SKIPCELL, 1, nDone));
2929 assert( sal_Int32(nStt) >= 0 );
2930 if (sal_Int32(nLen) <= 0)
2935 sal_Int32 nDone = 0;
2936 sal_Int32 nNext(nStt);
2937 for ( sal_Int32 nI = 0; nI < sal_Int32(nLen); ++nI )
2939 if (nI + sal_Int32(nStt) == nNext)
2943 i18n::CharacterIteratorMode::SKIPCELL, 1, nDone );
2944 if (nNext < sal_Int32(nStt + nLen) || !bIsSpaceStop)
2945 nSpaceSum += nSpaceAdd;
2947 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.
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)
static sal_Int16 getCTLScriptType(std::u16string_view Text, sal_Int32 nPos)
static sal_Int32 endOfCTLScriptType(std::u16string_view Text, sal_Int32 nPos)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
css::uno::Reference< css::frame::XModel3 > GetBaseModel() 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()
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.
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
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
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
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.
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.
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(TextFrameIndex nIndex) const
map position in potentially merged text frame to SwPosition
SwParaPortion * GetPara()
SwTwips HangingMargin() 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)
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