23#include <com/sun/star/i18n/ScriptType.hpp>
60#include <com/sun/star/rdf/Statement.hpp>
61#include <com/sun/star/rdf/URI.hpp>
62#include <com/sun/star/rdf/URIs.hpp>
63#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
64#include <com/sun/star/rdf/XLiteral.hpp>
65#include <com/sun/star/text/XTextContent.hpp>
74 const std::vector<tools::Long> &rFlyStarts );
79 bool lcl_HasSameBorder(
const SwFont& rFirst,
const SwFont& rSecond);
107 OSL_ENSURE(
false,
"+SwTextFormatter::CTOR: bad offset" );
150 return sal_uInt16( nHeight );
193 if( pPor != pUnderflow )
200 while( pPor && pPor != pUnderflow )
205 while( pTmpPrev != pPor )
207 pTmpPrev->
Move( rInf );
210 OSL_ENSURE( pTmpPrev,
"Underflow: losing control!" );
228 OSL_ENSURE( pPor,
"SwTextFormatter::Underflow: overflow but underflow" );
243 if( !pPor || !(rInf.
X() + pPor->
Width()) )
375 "SwTextFormatter::BuildPortions: bad text length in info" );
393 OSL_ENSURE( !rInf.
X() ||
m_pMulti,
"SwTextFormatter::BuildPortion X=0?" );
408 const bool bHasGrid = pGrid && rInf.
SnapToGrid() &&
413 const sal_uInt16 nGridWidth = bHasGrid ?
GetGridWidth(*pGrid, rDoc) : 0;
426 while( pPor && !rInf.
IsStop() )
430 "SwTextFormatter::BuildPortions: bad length in info" );
443 sal_uInt16 nLstHeight = o3tl::narrowing<sal_uInt16>(rInf.
GetFont()->
GetHeight());
444 bool bAllowBehind =
false;
452 if (
static_cast<SwFieldPortion*
>(pPor)->GetExpText( rInf, aAltText ) &&
453 !aAltText.isEmpty() )
464 const OUString& rText = rInf.
GetText();
465 sal_Int32 nIdx = sal_Int32(rInf.
GetIdx());
466 bAllowBehind = nIdx < rText.getLength() && rCC.
isLetterNumeric(rText, nIdx);
470 if ( bAllowBehind && pLast )
472 bool bAllowBefore =
false;
477 if (
static_cast<const SwFieldPortion*
>(pLast)->GetExpText( rInf, aAltText ) &&
478 !aAltText.isEmpty() )
480 bAllowBefore = rCC.
isLetterNumeric( aAltText, aAltText.getLength() - 1 );
486 nLstHeight = o3tl::narrowing<sal_uInt16>(pTmpFnt->
GetHeight());
500 if( bAllowBefore && ( nLstActual != nNxtActual ) &&
501 nLstHeight && rInf.
X() + nLstHeight <= rInf.
Width() &&
512 else if ( bHasGrid && ! pGridKernPortion && !
m_pMulti && ! pPor->
InTabGrp() )
530 if ( aRectFnSet.
IsVert() )
532 Point aPoint( nStartX, 0 );
534 nStartX = aPoint.Y();
537 const SwTwips nOfst = nStartX - nGridOrigin;
541 ( ( nOfst - 1 ) / nGridWidth + 1 ) :
543 const SwTwips nKernWidth =
i * nGridWidth - nOfst;
546 if ( nKernWidth <= nRestWidth )
547 pGridKernPortion->
Width( nKernWidth );
550 if ( pGridKernPortion != pPor )
561 bFull = pPor->
Format( rInf );
645 if ( rInf.
X() + pPor->
Width() + nDist <= rInf.
Width() )
655 if ( bHasGrid && pPor != pGridKernPortion && !
m_pMulti && ! pPor->
InTabGrp() )
673 OSL_ENSURE( pGridKernPortion,
"No GridKernPortion available" );
677 sal_uInt16 nSumWidth = pPor->
Width();
680 nSumWidth = nSumWidth + pTmpPor->
Width();
685 ( nSumWidth - 1 ) / nGridWidth + 1 :
687 const SwTwips nTmpWidth =
i * nGridWidth;
688 const SwTwips nKernWidth =
std::min(nTmpWidth - nSumWidth, nRestWidth);
692 OSL_ENSURE( nKernWidth <= nRestWidth,
693 "Not enough space left for adjusting non-asian text in grid mode" );
696 pGridKernPortion->
Width( pGridKernPortion->
Width() + nKernWidth_1 );
697 rInf.
X( rInf.
X() + nKernWidth_1 );
700 if ( ! bFull && nKernWidth - nKernWidth_1 > 0 )
701 new SwKernPortion( *pPor,
static_cast<short>(nKernWidth - nKernWidth_1),
704 pGridKernPortion =
nullptr;
708 pPor->
InFieldGrp() || nCurrScript != nNextScript )
710 pGridKernPortion =
nullptr;
814 if( !rInf.
GetText().isEmpty() )
836 if( bChg || bFirstPor || !pPor->
GetAscent()
865 Color m_aShadowColor;
869 void SetShadowColor(
const Color& rCol ) { m_aShadowColor = rCol; }
887 COL_BLACK == m_aShadowColor
913 ? OUString(
u"\u2612")
914 : OUString(
u"\u2610");
918 sal_Int32 nCurrentIdx = 0;
919 const IFieldmark::parameter_map_t::const_iterator pResult = pParameters->find(OUString(
ODF_FORMDROPDOWN_RESULT));
920 if(pResult != pParameters->end())
921 pResult->second >>= nCurrentIdx;
924 if (pListEntries != pParameters->end())
926 uno::Sequence< OUString > vListEntries;
927 pListEntries->second >>= vListEntries;
928 if (nCurrentIdx < vListEntries.getLength())
929 return vListEntries[nCurrentIdx];
932 static constexpr OUStringLiteral vEnSpaces =
u"\u2002\u2002\u2002\u2002\u2002";
944 else if (
GetFnt()->IsInputField() )
961 assert(2 <= sal_Int32(nFieldLen));
973 else if (
GetFnt()->IsMeta())
975 auto pMetaPor =
new SwMetaPortion;
980 SwPaM aPam(aPosition);
981 uno::Reference<text::XTextContent>
const xRet(
987 static uno::Reference< uno::XComponentContext > xContext(
988 ::comphelper::getProcessComponentContext());
990 static uno::Reference< rdf::XURI > xODF_SHADING(
991 rdf::URI::createKnown(xContext, rdf::URIs::LO_EXT_SHADING), uno::UNO_SET_THROW);
993 uno::Reference<rdf::XDocumentMetadataAccess> xDocumentMetadataAccess(
996 const css::uno::Reference<css::rdf::XResource> xSubject(xRet, uno::UNO_QUERY);
997 const uno::Reference<rdf::XRepository>& xRepository =
998 xDocumentMetadataAccess->getRDFRepository();
999 const uno::Reference<container::XEnumeration> xEnum(
1000 xRepository->getStatements(xSubject, xODF_SHADING,
nullptr), uno::UNO_SET_THROW);
1002 while (xEnum->hasMoreElements())
1004 rdf::Statement stmt;
1005 if (!(xEnum->nextElement() >>= stmt)) {
1006 throw uno::RuntimeException();
1008 const uno::Reference<rdf::XLiteral> xObject(stmt.Object, uno::UNO_QUERY);
1009 if (!xObject.is())
continue;
1010 if (xEnum->hasMoreElements()) {
1011 SAL_INFO(
"sw.uno",
"ignoring other odf:shading statements");
1014 pMetaPor->SetShadowColor(rColor);
1020 else if (
GetFnt()->IsContentControl())
1022 pPor =
new SwContentControlPortion;
1051 OSL_ENSURE(pBM !=
nullptr,
"Where is my form field bookmark???");
1102 nNextChg =
std::min( nNextChg, nNextScript );
1106 nNextChg =
std::min( nNextChg, nNextDir );
1110 nNextChg =
std::min( nNextChg, nNextHidden );
1114 nNextChg =
std::min(nNextChg, nNextBookmark);
1238 "Rotated number portion trouble" );
1260 "Rotated number portion trouble" );
1300 if (
static_cast<bool>(bookmark))
1337 while( pPor && !bRet )
1365 OSL_ENSURE( rInf.
IsFull(),
"SwTextFormatter::NewPortion: underflow but not full" );
1424 if ( ::lcl_BuildHiddenPortion( rInf, nEnd ) )
1537 OSL_ENSURE( rInf.
X() >= pLastTabPortion->
GetFix(),
"Decimal tab stop position cannot be calculated" );
1538 const sal_uInt16 nWidthOfPortionsUpToDecimalPosition = o3tl::narrowing<sal_uInt16>(rInf.
X() - pLastTabPortion->
GetFix() );
1539 static_cast<SwTabDecimalPortion*
>(pLastTabPortion)->SetWidthOfPortionsUpToDecimalPosition( nWidthOfPortionsUpToDecimalPosition );
1572 if( !pPor || rInf.
IsStop() )
1579 assert(pPor &&
"can only reach here with pPor existing");
1590 if ( pTextFootnote )
1603 nDir = pItem->GetValue();
1648 OSL_ENSURE(
m_pCurr->
Height(),
"SwTextFormatter::NewPortion: limbo dance" );
1653 OSL_ENSURE(pPor->
Height(),
"SwTextFormatter::NewPortion: something went wrong");
1665 "SwTextFormatter::FormatLine( nStartPos ) with unswapped frame" );
1688 std::unique_ptr<SwFieldPortion> xSaveField;
1697 std::vector<tools::Long> flyStarts;
1708 flyStarts.push_back( nPOfst );
1710 nPOfst += pPor->
Width();
1745 else if(
GetInfo().IsDropInit() )
1760 SwTwips nTmpAscent, nTmpHeight;
1805 sal_uInt16 nSum = 0;
1810 nSum += pPor->
Width();
1819 if ( bOptimizeRepaint )
1841 if (
GetInfo().CompressLine() )
1846 if ( nRepaintOfst <
GetInfo().GetPaintOfst() )
1887 nLineHeight = nGridWidth + nRubyHeight;
1888 const sal_uInt16 nAmpRatio = (
m_pCurr->
Height() + nLineHeight - 1)/nLineHeight;
1889 nLineHeight *= nAmpRatio;
1910 nTmp *= nLineHeight;
1911 nLineHeight = nTmp / 100;
1931 case SvxLineSpaceRule::Auto:
1940 nTmp = nTmp ? 50 : 100;
1942 nTmp *= nLineHeight;
1947 sal_uInt16 nAsc = ( 4 * nLineHeight ) / 5;
1951 if( nAsc < pCurr->GetAscent() ||
1952 nLineHeight - nAsc < pCurr->Height() -
1953 pCurr->GetAscent() )
1954 pCurr->SetClipping(
true );
1962 case SvxLineSpaceRule::Min:
1968 case SvxLineSpaceRule::Fix:
1971 const sal_uInt16 nAsc = ( 4 * nLineHeight ) / 5;
1972 if( nAsc < m_pCurr->GetAscent() ||
1980 default: OSL_FAIL(
": unknown LineSpaceRule" );
1987 case SvxInterLineSpaceRule::Off:
1989 case SvxInterLineSpaceRule::Prop:
1995 nTmp = nTmp ? 50 : 100;
2001 nTmp += nLineHeight;
2007 case SvxInterLineSpaceRule::Fix:
2012 default: OSL_FAIL(
": unknown InterLineSpaceRule" );
2020 if ( aRectFnSet.
IsVert() )
2023 const sal_uInt16 nDiff = sal_uInt16( nTmpY %
RegDiff() );
2025 nLineHeight +=
RegDiff() - nDiff;
2085 if( nMin && ++nMin > nRet )
2089 if( nRet + nDist < nMin )
2093 nRet = nMin - nDist;
2125 if ( bOptimizeRepaint )
2129 case SvxAdjust::Block:
2132 bOptimizeRepaint =
false;
2137 if ( bOptimizeRepaint )
2142 bOptimizeRepaint = !pPos;
2147 case SvxAdjust::Center:
2148 case SvxAdjust::Right:
2149 bOptimizeRepaint =
false;
2166 return bOptimizeRepaint;
2172 "SwTextFormatter::CalcUnclipped with unswapped frame" );
2177 rBottom = rTop + nFlyDesc;
2185 "SwTextFormatter::UpdatePos with unswapped frame" );
2198 aTmpInf.
SetIdx( nStartIdx );
2199 aTmpInf.
SetPos( aStart );
2201 SwTwips nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
2216 aTmpInf.
X( aTmpInf.
X() - nAscent );
2219 aTmpInf.
X( aTmpInf.
X() + nAscent );
2225 aTmpInf.
Y( aTmpInf.
Y() + nAscent );
2229 aTmpInf.
Y( aTmpInf.
Y() + nAscent );
2237 && ( bAlways || !
IsQuick() ) )
2239 pCurrent->
MaxAscentDescent( nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc, pPos );
2243 if( !nFlyAsc && !nFlyDesc )
2245 nTmpAscent = nAscent;
2247 nTmpDescent = nTmpHeight - nAscent;
2248 nFlyDesc = nTmpDescent;
2250 static_cast<SwGrfNumPortion*
>(pPos)->SetBase( nTmpAscent, nTmpDescent,
2251 nFlyAsc, nFlyDesc );
2260 aBase, nTmpAscent, nTmpDescent, nFlyAsc,
2266 OSL_ENSURE( !
GetMulti(),
"Too much multi" );
2269 Point aSt( aTmpInf.
X(), aStart.Y() );
2273 OSL_ENSURE(
GetMulti()->IsDouble(),
"Brackets only for doubles");
2276 else if(
GetMulti()->HasRotation() )
2286 aSt.AdjustX(pLay->
Width() );
2291 UpdatePos( pLay, aSt, nStIdx, bAlways );
2292 nStIdx = nStIdx + pLay->
GetLen();
2293 aSt.AdjustY(pLay->
Height() );
2298 pPos->
Move( aTmpInf );
2306 "SwTextFormatter::AlignFlyInCntBase with unswapped frame" );
2320 SwTwips nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
2329 static_cast<SwGrfNumPortion*
>(pPos)->SetBase( nTmpAscent, nTmpDescent,
2330 nFlyAsc, nFlyDesc );
2343 nFlyAsc, nFlyDesc, nFlags );
2352 OSL_ENSURE( rInf.
GetTextFly().
IsOn(),
"SwTextFormatter::ChkFlyUnderflow: why?" );
2360 SwRect aLineVert( aLine );
2468 nHeight = pLast->
Height();
2481 + nLeftMar - nLeftMin , nHeight );
2491 if( nUpper > 0 && nTop >= nUpper )
2494 SwRect aLineVert( aLine );
2521 aLine.
Left( rInf.
X() + nLeftMar );
2522 bool bForced =
false;
2523 if( aInter.
Left() <= nLeftMin )
2528 if( aInter.
Left() < nFrameLeft )
2529 aInter.
Left( nFrameLeft );
2539 nAddMar = nLeftMar - nFrameLeft;
2552 const bool bFullLine = aLine.
Left() == aInter.
Left() &&
2565 aInter.
Pos().AdjustX( -nLeftMar );
2595 if( nNextTop > aInter.
Bottom() )
2601 if( nAscent < pFly->
Height() )
2617 if( nAscent < pFly->
Height() )
2643 const sal_uInt16 nGridWidth =
GetGridWidth(*pGrid, rDoc);
2646 if ( aRectFnSet.
IsVert() )
2648 Point aPoint( nStartX, 0 );
2650 nStartX = aPoint.Y();
2653 const SwTwips nOfst = nStartX - nGridOrigin;
2656 const SwTwips i = nTmpWidth / nGridWidth + 1;
2658 const SwTwips nNewWidth = (
i - 1 ) * nGridWidth - nOfst;
2659 if ( nNewWidth > 0 )
2660 rInf.
Width( nNewWidth );
2678 pFly =
static_cast<SwTextFlyCnt*
>(pHint)->GetFlyFrame(pFrame);
2686 SwTwips nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
2702 0 != ( bTextFrameVertical ?
2706 if ( bUseFlyAscent )
2707 nAscent =
std::abs(
int( bTextFrameVertical ?
2718 else if( nAscent > nFlyAsc )
2730 Point aTmpBase( aBase );
2754 nTmpDescent, nFlyAsc, nFlyDesc, nMode );
2817 if( bSeek &&
GetFnt()->HasBorder() && ::lcl_HasSameBorder(aCurFont, *
GetFnt()) && !bDisconnect )
2835 sal_uInt16 nMaxAscent = 0;
2836 sal_uInt16 nMaxHeight = 0;
2837 bool bReachCurrent =
false;
2840 if( nMaxHeight < pActPor->
Height() )
2841 nMaxHeight = pActPor->
Height();
2842 if( nMaxAscent < pActPor->GetAscent() )
2846 if( !pActPor && !bReachCurrent )
2848 pActPor = &rPortion;
2849 bReachCurrent =
true;
2855 bReachCurrent =
false;
2858 if( nMaxHeight > pActPor->
Height() )
2859 pActPor->
Height(nMaxHeight);
2864 if( !pActPor && !bReachCurrent )
2866 pActPor = &rPortion;
2867 bReachCurrent =
true;
2881 const std::vector<tools::Long> &rFlyStarts )
2893 if ( rFlyStarts.empty() && ! rCurr.
IsFly() )
2911 if (nReformat > txtFormatInfo.
GetLineStart() + nMaxContext)
2912 nReformat = nReformat - nMaxContext;
2928 OSL_ENSURE( nReformat < txtFormatInfo.
GetIdx(),
"Reformat too small for me!" );
2933 bool bOldMulti = txtFormatInfo.
IsMulti();
2935 txtFormatInfo.
SetMulti( bOldMulti );
2937 return nFormatRepaint ?
std::min( aRect.
Left(), nFormatRepaint ) :
2957 if (nCnt < rFlyStarts.size() &&
2958 nX == rFlyStarts[ nCnt ] &&
2962 nPOfst = nX + pPor->
Width();
2968 nX = nX + pPor->
Width();
2969 nIdx = nIdx + pPor->
GetLen();
2984 if (bShowInDocView || bShowForPrinting)
3000 bool lcl_HasSameBorder(
const SwFont& rFirst,
const SwFont& rSecond)
@ ADD_VERTICAL_FLY_OFFSETS
@ MS_WORD_COMP_MIN_LINE_HEIGHT_BY_FLY
@ PROP_LINE_SPACING_SHRINKS_FIRST_LINE
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 ::sw::mark::IFieldmark * getFieldmarkFor(const SwPosition &pos) const =0
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
css::uno::Reference< css::frame::XModel3 > GetBaseModel() const
sal_uInt16 GetPropLineSpace() const
SvxInterLineSpaceRule GetInterLineSpaceRule() const
SvxLineSpaceRule GetLineSpaceRule() const
sal_uInt16 GetLineHeight() const
short GetInterLineSpace() const
Indicator that the content does not fit into a fixed height frame (red triangle on the UI).
SwRedlineItr * GetRedln()
SwScriptInfo * m_pScriptInfo
TextFrameIndex GetNextAttr() const
bool Seek(TextFrameIndex nPos)
Enables the attributes used at char pos nPos in the logical font.
SwTextAttr * GetAttr(TextFrameIndex nPos) const
Returns the attribute for a position.
Non-breaking space or non-breaking hyphen.
for showing bookmark starts and ends; note that in contrast to SwControlCharPortion these do not have...
void LeftMove(TextFrameIndex const nNew)
const SwFootnoteInfo & GetFootnoteInfo() const
IDocumentSettingAccess const & getIDocumentSettingAccess() const
IDocumentMarkAccess * getIDocumentMarkAccess()
const SwEndNoteInfo & GetEndNoteInfo() const
SwDocShell * GetDocShell()
void SetJoinBorderWithPrev(const bool bJoinPrev)
void SetJoinBorderWithNext(const bool bJoinNext)
SwDropPortionPart * GetFollow() const
Text portion for the Format -> Paragraph -> Drop Caps functionality.
sal_uInt16 GetLines() const
SwDropPortionPart * GetPart() const
SwCharFormat * GetAnchorCharFormat(SwDoc &rDoc) const
const SwFont * GetFont() const
static const OUString & GetTypeStr(SwFieldTypesEnum nTypeId)
sal_uInt16 GetFix() const
This portion represents an as-character anchored fly (shape, frame, etc.)
void SetBase(const SwTextFrame &rFrame, const Point &rBase, tools::Long nLnAscent, tools::Long nLnDescent, tools::Long nFlyAscent, tools::Long nFlyDescent, AsCharFlags nFlags)
After setting the RefPoints, the ascent needs to be recalculated because it is dependent on RelPos.
const Point & GetRefPoint() const
Point const & GetRelPos() const
sal_uInt16 GetBottomBorderSpace() const
sal_uInt16 GetTopBorderSpace() const
const std::optional< editeng::SvxBorderLine > & GetTopBorder() const
const std::optional< editeng::SvxBorderLine > & GetRightBorder() const
sal_uInt16 GetBottomBorderDist() const
FontLineStyle GetUnderline() const
Degree10 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
sal_uInt16 GetRightBorderSpace() const
sal_uInt16 GetShadowWidth() const
const Color & GetShadowColor() const
const std::optional< editeng::SvxBorderLine > & GetBottomBorder() const
sal_uInt16 GetTopBorderDist() const
SwFontScript GetActual() const
sal_uInt16 GetRightBorderDist() const
const std::optional< editeng::SvxBorderLine > & GetLeftBorder() const
SvxShadowLocation GetShadowLocation() const
sal_uInt16 GetLeftBorderDist() const
bool HasBorder() const
Check whether font has any border on any side.
tools::Long GetHeight() const
sal_uInt16 GetLeftBorderSpace() const
const SwRect & getFrameArea() const
bool isFrameAreaPositionValid() const
const SwRect & getFramePrintArea() const
Base class of the Writer layout elements.
SwFrame * GetIndPrev() const
bool IsInFootnote() const
bool IsRightToLeft() const
SwPageFrame * FindPageFrame()
sal_uInt16 GetFixWidth() const
sal_Int32 GetIndex() const
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
const SvxLineSpacingItem * GetLineSpacing() const
Collection of SwLinePortion instances, representing one line of text.
void Init(SwLinePortion *pNextPortion=nullptr)
void SetFormatAdj(const bool bNew)
void SetMidHyph(const bool bNew)
void SetForcedLeftMargin()
SwTwips GetTextHeight() const
void SetClipping(const bool bNew)
SwLinePortion * GetFirstPortion() const
void CalcLine(SwTextFormatter &rLine, SwTextFormatInfo &rInf)
void SetFly(const bool bNew)
virtual void Height(const SwTwips nNew, const bool bText=true) override
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 SetRealHeight(SwTwips nNew)
SwTwips GetRealHeight() const
void SetEndHyph(const bool bNew)
void SetNext(SwLineLayout *pNew)
void SetDummy(const bool bNew)
void SetRest(const bool bNew)
std::vector< tools::Long > * GetpLLSpaceAdd() const
std::deque< sal_uInt16 > * GetpKanaComp() const
Base class for anything that can be part of a line in the Writer layout.
bool IsTextPortion() const
virtual void FormatEOL(SwTextFormatInfo &rInf)
bool IsSoftHyphPortion() const
void SetJoinBorderWithNext(const bool bJoinNext)
SwLinePortion * GetNextPortion() const
void SetAscent(const SwTwips nNewAsc)
bool GetJoinBorderWithPrev() const
void SetHangingBaseline(const SwTwips nNewBaseline)
PortionType GetWhichPor() const
void SetNextPortion(SwLinePortion *pNew)
bool IsPostItsPortion() const
TextFrameIndex GetLen() const
void Move(SwTextPaintInfo &rInf)
SwLinePortion * FindLastPortion()
bool IsKernPortion() const
bool GetJoinBorderWithNext() const
SwTwips GetHangingBaseline() const
bool IsFootnotePortion() const
bool IsErgoSumPortion() const
bool IsDropPortion() const
bool IsTabLeftPortion() const
bool IsBreakPortion() const
bool IsQuoVadisPortion() const
void SetLen(TextFrameIndex const nLen)
bool IsGrfNumPortion() const
bool IsMultiPortion() const
void SetJoinBorderWithPrev(const bool bJoinPrev)
bool IsFlyPortion() const
bool IsFootnoteNumPortion() const
virtual bool Format(SwTextFormatInfo &rInf)
void SetWhichPor(const PortionType nNew)
bool IsFlyCntPortion() const
bool InFixMargGrp() const
virtual SwLinePortion * Insert(SwLinePortion *pPortion)
bool HasFlyInContent() const
const SwLineLayout & GetRoot() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
PaM is Point and Mark: a selection of the document model.
SwNode & GetNode(bool bPoint=true) const
A page of the document layout.
void SetFootnoteNum(const bool bNew)
SwCharRange & GetReformat()
SwScriptInfo & GetScriptInfo()
tools::Long YDiff(tools::Long n1, tools::Long n2) const
tools::Long GetPrtLeft(const SwFrame &rFrame) const
Of course Writer needs its own rectangles.
SwRect & Intersection(const SwRect &rRect)
void SubTop(const tools::Long nSub)
void Height(tools::Long nNew)
void Top(const tools::Long nTop)
void Right(const tools::Long nRight)
void Bottom(const tools::Long nBottom)
SwRect & Intersection_(const SwRect &rRect)
void Pos(const Point &rNew)
bool Overlaps(const SwRect &rRect) const
void Left(const tools::Long nLeft)
void Width(tools::Long nNew)
sal_Int16 ScriptType(const TextFrameIndex nPos) const
TextFrameIndex NextDirChg(const TextFrameIndex nPos, const sal_uInt8 *pLevel=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.
SwFontScript WhichFont(TextFrameIndex nIdx) const
TextFrameIndex NextHiddenChg(TextFrameIndex nPos) const
TextFrameIndex NextScriptChg(TextFrameIndex nPos) const
TextFrameIndex NextBookmark(TextFrameIndex nPos) const
MarkKind GetBookmark(TextFrameIndex nPos) const
virtual bool Format(SwTextFormatInfo &rInf) override
virtual void FormatEOL(SwTextFormatInfo &rInf) override
void CalcAdjLine(SwLineLayout *pCurr)
SwTwips CalcKanaAdj(SwLineLayout *pCurr)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
const SwFormatFootnote & GetFootnote() const
void GetCharRect(SwRect *, TextFrameIndex, SwCursorMoveState *=nullptr, const tools::Long nMax=0)
static void SetRightMargin(const bool bNew)
The purpose of this class is to be the universal interface between formatting/text output and the pos...
SwTwips GetMinBottom() const
SwRect GetFrame(const SwRect &rPortion) const
tools::Long GetNextTop() const
void SetArrowDone(const bool bNew)
SwLinePortion * GetLast()
SwTabPortion * GetLastTab()
void SetFly(SwFlyPortion *pNew)
void SetErgoDone(const bool bNew)
void ChkNoHyph(const sal_uInt8 bEnd, const sal_uInt8 bMid)
void SetUnderScorePos(TextFrameIndex const nNew)
const SwFormatDrop * GetDropFormat() const
void SetRoot(SwLineLayout *pNew)
void SetRest(SwLinePortion *pNewRest)
sal_uInt16 ForcedLeftMargin() const
bool CheckFootnotePortion(SwLineLayout const *pCurr)
void SetShift(const bool bNew)
void SetLineStart(TextFrameIndex const nNew)
void SetDropInit(const bool bNew)
sal_uInt16 RealWidth() const
void SetTabOverflow(bool bOverflow)
TextFrameIndex GetLineStart() const
void SetLineNetHeight(const sal_uInt16 nNew)
const SwLinePortion * GetUnderflow() const
sal_Unicode GetHookChar() const
void SetLineHeight(const sal_uInt16 nNew)
TextFrameIndex ScanPortionEnd(TextFrameIndex nStart, TextFrameIndex nEnd)
sal_uInt16 GetLineNetHeight() const
sal_uInt16 GetLineHeight() const
void SetLast(SwLinePortion *pNewLast)
SwLinePortion * GetRest()
bool IsFootnoteDone() const
TextFrameIndex GetSoftHyphPos() const
sal_Unicode GetTabDecimal() const
void SetNumDone(const bool bNew)
void SetNewLine(const bool bNew)
void SetTabDecimal(const sal_Unicode cNew)
bool CheckCurrentPosBookmark()
TextFrameIndex GetUnderScorePos() const
void SetFootnoteDone(const bool bNew)
SwTwips GetLineWidth()
Returns the distance between the current horizontal position and the end of the line.
void SetUnderflow(SwLinePortion *pNew)
TextFrameIndex GetReformatStart() const
void LeftMargin(const SwTwips nNew)
void SetFull(const bool bNew)
void SetSoftHyphPos(TextFrameIndex const nNew)
SwExpandPortion * TryNewNoLengthPortion(SwTextFormatInfo const &rInfo)
Try to create a new portion with zero length, for an end of a hint (where there is no CH_TXTATR).
bool IsFlyInCntBase() const
std::unique_ptr< sw::MergedAttrIterByEnd > m_pByEndIter
sal_uInt16 GetFrameRstHeight() const
bool AllowRepaintOpt() const
TextFrameIndex m_nRightScanIdx
SwTextPortion * NewTextPortion(SwTextFormatInfo &rInf)
sal_uInt8 m_nContentEndHyph
const sal_uInt8 & CntMidHyph() const
bool ClearIfIsFirstOfBorderMerge(SwLinePortion const *pPortion)
SwErgoSumPortion * NewErgoSumPortion(SwTextFormatInfo const &rInf) const
bool HasTruncLines() const
SwMultiPortion * GetMulti() const
void SetFlyInCntBase(bool bNew=true)
SwTabPortion * NewTabPortion(SwTextFormatInfo &rInf, bool bAuto) const
const sal_uInt8 & CntEndHyph() const
void CalcFlyWidth(SwTextFormatInfo &rInf)
Calculation of the emulated right side.
void CalcUnclipped(SwTwips &rTop, SwTwips &rBottom)
void FormatReset(SwTextFormatInfo &rInf)
void CalcDropHeight(const sal_uInt16 nLines)
SwTwips CalcFitToContent_()
void CtorInitTextFormatter(SwTextFrame *pFrame, SwTextFormatInfo *pInf)
void AlignFlyInCntBase(tools::Long nBaseLine) const
Set all anchored as character objects to the passed BaseLine (in Y direction).
SwDropPortion * NewDropPortion(SwTextFormatInfo &rInf)
bool ChkFlyUnderflow(SwTextFormatInfo &rInf) const
This is called after the real height of the line has been calculated Therefore it is possible,...
void CalcAscent(SwTextFormatInfo &rInf, SwLinePortion *pPor)
SwLinePortion * NewPortion(SwTextFormatInfo &rInf)
const SwFormatDrop * GetDropFormat() const
void BuildPortions(SwTextFormatInfo &rInf)
void CalcAdjustLine(SwLineLayout *pCurr)
TextFrameIndex FormatLine(TextFrameIndex nStart)
SwMultiPortion * m_pMulti
SwNumberPortion * NewNumberPortion(SwTextFormatInfo &rInf) const
SwLinePortion * WhichFirstPortion(SwTextFormatInfo &rInf)
void UpdatePos(SwLineLayout *pCurr, Point aStart, TextFrameIndex nStartIdx, bool bAlways=false) const
The position of the portions changes with the adjustment.
SwLinePortion * NewExtraPortion(SwTextFormatInfo &rInf)
bool BuildMultiPortion(SwTextFormatInfo &rInf, SwMultiPortion &rMulti)
TextFrameIndex m_nLeftScanIdx
static void MergeCharacterBorder(SwDropPortion const &rPortion)
Merge border of the drop portion with modifying the font of the portions' part.
SwNumberPortion * NewFootnoteNumPortion(SwTextFormatInfo const &rInf) const
The portion for the Footnote Numbering in the Footnote Area.
void CalcRealHeight(bool bNewLine=false)
const SwFormatDrop * m_pDropFormat
SwFlyCntPortion * NewFlyCntPortion(SwTextFormatInfo &rInf, SwTextAttr *pHt) const
Sets a new portion for an object anchored as character.
void FeedInf(SwTextFormatInfo &rInf) const
SwTextPortion * WhichTextPor(SwTextFormatInfo &rInf) const
SwLinePortion * m_pFirstOfBorderMerge
SwLinePortion * Underflow(SwTextFormatInfo &rInf)
void InsertPortion(SwTextFormatInfo &rInf, SwLinePortion *pPor)
SwTwips CalcBottomLine() const
SwTextFormatInfo & GetInfo()
virtual ~SwTextFormatter() override
void Insert(SwLineLayout *pLine)
sal_uInt8 m_nContentMidHyph
Represents the visualization of a paragraph.
bool IsFootnoteNumFrame() const
Am I a FootnoteFrame, with a number at the start of the paragraph?
void SwitchVerticalToHorizontal(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from vertical to horizontal layout.
SwTextFrame * GetFollow()
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
TextFrameIndex GetOffset() const
void SwitchLTRtoRTL(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from LTR to RTL layout.
void SwitchRTLtoLTR(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from RTL to LTR layout.
void SetHasRotatedPortions(bool bHasRotatedPortions)
void SwitchHorizontalToVertical(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from horizontal to vertical layout.
sal_uInt16 GetBaseHeight() const
bool GetRubyTextBelow() const
sal_uInt16 GetRubyHeight() const
SwTextGrid GetGridType() const
bool IsSnapToChars() const
SwParaPortion * GetParaPortion()
bool SeekAndChgBefore(SwTextSizeInfo &rInf)
TextFrameIndex GetStart() const
bool SeekStartAndChg(SwTextSizeInfo &rInf, const bool bPara=false)
bool IsFirstTextLine() const
SwTwips GetLineHeight() const
const SwLineLayout * Next()
sal_uInt16 RegDiff() const
const SwLineLayout * GetCurr() const
SwTextFrame * GetTextFrame()
void CalcAscentAndHeight(SwTwips &rAscent, SwTwips &rHeight) const
bool SeekAndChg(SwTextSizeInfo &rInf)
bool IsRegisterOn() const
sal_uInt16 GetDropLeft() const
bool IsLastCenter() const
SwTwips GetLeftMargin() const
sal_uInt16 GetDropHeight() const
SwTwips FirstLeft() const
SvxAdjust GetAdjust() const
SwTwips GetLeftMin() const
void SetpSpaceAdd(std::vector< tools::Long > *pNew)
void SetPaintOfst(const SwTwips nNew)
void SetPos(const Point &rNew)
SwTwips GetPaintOfst() const
const Point & GetPos() const
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich, const Color *pColor=nullptr) const
void CtorInitTextPainter(SwTextFrame *pFrame, SwTextPaintInfo *pInf)
This portion represents a part of the paragraph string.
virtual void Paint(const SwTextPaintInfo &rInf) const override
SwTextFrame * GetTextFrame()
sal_uInt16 GetHangingBaseline() const
const SwViewOption & GetOpt() const
void SetMulti(const bool bNew)
void SetLen(const TextFrameIndex nNew)
sal_uInt16 GetTextHeight() const
void SetIdx(const TextFrameIndex nNew)
bool HasScriptSpace() const
void SetDirection(const sal_uInt8 nNew)
sal_uInt16 GetAscent() const
sal_Unicode GetChar(TextFrameIndex const nPos) const
void SetKanaComp(std::deque< sal_uInt16 > *pNew)
TextFrameIndex GetLen() const
bool IsOtherThanFootnoteInside() const
void SetFootnoteInside(const bool bNew)
std::optional< SwMultiCreator > GetMultiCreator(TextFrameIndex &rPos, SwMultiPortion const *pM) const
const OUString & GetText() const
TextFrameIndex GetIdx() const
void SetOtherThanFootnoteInside(const bool bNew)
bool HasHint(TextFrameIndex nPos) const
void SetStopUnderflow(const bool bNew)
bool IsShowHiddenChar(bool bHard=false) const
vcl::Window * GetWin() const
static DrawFlyCntPortion * Create(const SwTextFrame &rFrame, SwFrameFormat const &rFormat, const Point &rBase, tools::Long nAsc, tools::Long nDescent, tools::Long nFlyAsc, tools::Long nFlyDesc, AsCharFlags nFlags)
static FlyContentPortion * Create(const SwTextFrame &rFrame, SwFlyInContentFrame *pFly, const Point &rBase, tools::Long nAscent, tools::Long nDescent, tools::Long nFlyAsc, tools::Long nFlyDesc, AsCharFlags nFlags)
virtual bool IsChecked() const =0
std::map< OUString, css::uno::Any > parameter_map_t
virtual OUString GetFieldname() const =0
virtual parameter_map_t * GetParameters()=0
virtual editeng::HangulHanjaConversion::ConversionDirection GetDirection(editeng::HangulHanjaConversion::ConversionDirection _eDefaultDirection) const override
#define CH_TXT_ATR_FIELDSEP
#define CH_TXT_ATR_INPUTFIELDSTART
#define CH_TXT_ATR_FORMELEMENT
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(156)
constexpr TypedWhichId< SvxCharRotateItem > RES_CHRATR_ROTATE(32)
#define CH_TXT_ATR_INPUTFIELDEND
#define CH_TXT_ATR_FIELDEND
#define CH_TXT_ATR_FIELDSTART
#define CH_TXTATR_BREAKWORD
CharClass & GetAppCharClass()
bool IsUnderlineBreak(const SwLinePortion &rPor, const SwFont &rFnt)
#define SAL_INFO(area, stream)
uno::Reference< text::XTextContent > GetNestedTextContent(SwTextNode const &rTextNode, sal_Int32 const nIndex, bool const bParent)
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
double getLength(const B2DPolygon &rCandidate)
tools::Long SnapToGrid(std::vector< sal_Int32 > &rKernArray, const OUString &rText, sal_Int32 nStt, sal_Int32 nLen, tools::Long nGridWidth, bool bForceLeft)
Snap ideographs to text grids: a) Ideographic open brackets are aligned to the rightmost edge of span...
OUString ExpandFieldmark(IFieldmark *pBM)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
vcl::Font GetFont(vcl::Font const &rFont, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwNodeOffset abs(const SwNodeOffset &a)
constexpr OUStringLiteral ODF_FORMTEXT
constexpr OUStringLiteral ODF_FORMDROPDOWN_RESULT
constexpr OUStringLiteral ODF_FORMDROPDOWN_LISTENTRY
constexpr OUStringLiteral ODF_FORMCHECKBOX
constexpr OUStringLiteral ODF_FORMDATE
constexpr OUStringLiteral ODF_FORMDROPDOWN
SwTextGridItem const * GetGridItem(SwPageFrame const *const)
sal_uInt16 GetGridWidth(SwTextGridItem const &, SwDoc const &)
Marks a position in the document model.
tools::Long GetLen(const Point &rPnt)
const sal_Unicode CH_BREAK
const sal_Unicode CH_BLANK
constexpr sal_Int32 COMPLETE_STRING