94 if( nTmp + (pPor->
Height()/2) >= nPaintOfst )
104 rbSkippedNumPortions =
true;
127 const bool bUnderSized,
128 ::std::optional<SwTaggedPDFHelper> & roTaggedLabel,
129 ::std::optional<SwTaggedPDFHelper> & roTaggedParagraph,
130 bool const isPDFTaggingEnabled)
132#if OSL_DEBUG_LEVEL > 1
153 bool bSkippedNumPortions(
false);
156 if (bSkippedNumPortions)
158 assert(!roTaggedLabel);
159 assert(!roTaggedParagraph);
161 roTaggedParagraph.emplace(
nullptr, &aFrameInfo,
nullptr, *
GetInfo().GetOut());
171 if (bTabOverMargin || bTabOverSpacing)
180 if( nMaxRight < nTabPos )
182 nMaxRight = rPaint.
Right();
189 if( !bEndPor && nTmpLeft >= nMaxRight )
203 SwTwips nTmpHeight, nTmpAscent;
209 bool bClip = ( bDrawInWindow || bUnderSized ) && !rClip.
IsChg();
222#if OSL_DEBUG_LEVEL > 1
223 static bool bClipAlways =
false;
224 if( bClip && bClipAlways )
234 if ( aPnt1.
X() < rPaint.
Left() )
236 if ( aPnt1.
Y() < rPaint.
Top() )
239 GetInfo().GetPos().
Y() + nTmpHeight );
240 if ( aPnt2.
X() > rPaint.
Right() )
242 if ( aPnt2.
Y() > rPaint.
Bottom() )
245 const SwRect aLineRect( aPnt1, aPnt2 );
259 if( !pPor && !bEndPor )
266 const bool bAdjustBaseLine =
270 if ( ! bAdjustBaseLine )
278 if( bAdjustBaseLine )
312 if ( bAdjustBaseLine )
347 std::pair<SwTextNode const*, sal_Int32>
const pos(
399 pUnderLineFnt->
SetPos( aTmpPoint );
416 assert(isPDFTaggingEnabled);
417 Por_Info aPorInfo(*pPor, *
this,
true);
418 roTaggedLabel.emplace(
nullptr,
nullptr, &aPorInfo, *
pOut);
423 Por_Info aPorInfo(*pPor, *
this,
false);
437 assert(roTaggedLabel);
438 roTaggedLabel.reset();
439 assert(!roTaggedParagraph);
441 roTaggedParagraph.emplace(
nullptr, &aFrameInfo,
nullptr, *
pOut);
445 if ( pOldUnderLineFnt )
451 bFirst &= !pPor->
GetLen();
457 pPor = bDrawInWindow ||
GetInfo().
X() <= nMaxRight ||
464 if (!pPor && isPDFTaggingEnabled && !roTaggedParagraph)
469 if (pP->InNumberGrp()
474 roTaggedLabel.reset();
477 roTaggedParagraph.emplace(
nullptr, &aFrameInfo,
nullptr, *
GetInfo().GetOut());
480 pP = pP->GetNextPortion();
484 if (!FindEndOfNumbering(pNext))
491 if (FindEndOfNumbering(pLine->GetFirstPortion()))
524 std::pair<SwTextNode const*, sal_Int32>
const pos(
534 if ( bAdjustBaseLine )
544 const bool bNextUndersized =
550 if( bUnderSized || bNextUndersized )
552 if ( bAdjustBaseLine )
564 (nDiff >= 0 && bNextUndersized) )
606 if (
GetInfo().GetUnderFnt() &&
613 "CheckSpecialUnderline without underlined font" );
624 for (
auto const& e : pMerged->extents)
630 pItem->GetLineStyle());
631 aUnderMulti.
Select(
Range(nTmp, nTmp + e.nEnd - e.nStart - 1),
634 nTmp += e.nEnd - e.nStart;
655 aUnderMulti.
Select(
Range(sal_Int32(nStart), sal_Int32(nEnd) - 1),
666 for(
size_t i = 0;
i < nCnt; ++
i )
683 SwFont* pUnderlineFnt =
nullptr;
684 Point aCommonBaseLine;
698 sal_uInt16 nMaxBaseLineOfst = 0;
699 int nNumberOfPortions = 0;
701 while (nTmpIdx <= nUnderEnd && pPor)
709 aIter.
Seek( nTmpIdx );
716 nSumWidth += pPor->
Width();
721 if ( nAdjustBaseLine )
724 if ( nMaxBaseLineOfst < nTmpBaseLineOfst )
726 nMaxBaseLineOfst = nTmpBaseLineOfst;
727 nSumHeight = nFontHeight;
732 nSumHeight += pPor->
Width() * nFontHeight;
735 nBold += pPor->
Width();
740 nTmpIdx += pPor->
GetLen();
745 if ( nNumberOfPortions > 1 && nSumWidth )
747 const sal_uLong nNewFontHeight = nAdjustBaseLine ?
749 nSumHeight / nSumWidth;
756 nNewFontHeight ), nActual );
759 if ( 2 * nBold > nSumWidth )
765 aCommonBaseLine.
setY( nAdjustBaseLine + nMaxBaseLineOfst );
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...
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
const Range & GetRange(sal_Int32 nRange) const
sal_Int32 GetRangeCount() const
bool Select(sal_Int32 nIndex, bool bSelect=true)
void SelectAll(bool bSelect=true)
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
constexpr tools::Long Width() const
FontLineStyle GetLineStyle() const
Indicator that the content does not fit into a fixed height frame (red triangle on the UI).
const SwFont * GetFont() const
SwAttrHandler & GetAttrHandler()
SwRedlineItr * GetRedln()
bool Seek(TextFrameIndex nPos)
Enables the attributes used at char pos nPos in the logical font.
void SetRedline(const RedlineType eRedline)
IDocumentSettingAccess const & getIDocumentSettingAccess() const
To take Asian or other languages into consideration, an SwFont object consists of 3 SwSubFonts (Latin...
void SetOverline(const FontLineStyle eOverline)
void SetStrikeout(const FontStrikeout eStrikeout)
void SetEscapement(const short nNewEsc)
const Size & GetSize(SwFontScript nWhich) const
FontLineStyle GetUnderline() const
short GetEscapement() const
void SetProportion(const sal_uInt8 nNewPropr)
FontStrikeout GetStrikeout() const
void SetSize(const Size &rSize, const SwFontScript nWhich)
void SetFillColor(const Color &rColor)
const Color & GetUnderColor() const
SwFontScript GetActual() const
SvxCaseMap GetCaseMap() const
bool IsWordLineMode() const
FontWeight GetWeight() const
void SetColor(const Color &rColor)
const Color & GetColor() const
void ChgPhysFnt(SwViewShell const *pSh, OutputDevice &rOut)
void SetWeight(const FontWeight eWeight, const SwFontScript nWhich)
tools::Long GetHeight() const
const SwRect & getFrameArea() const
const SwRect & getFramePrintArea() const
tools::Long GetBottomMargin() const
tools::Long GetTopMargin() const
bool HasSpecialAlign(bool bVert) const
Collection of SwLinePortion instances, representing one line of text.
SwLinePortion * GetFirstPortion() const
bool HasUnderscore() const
RedlineType GetRedlineEndType() const
bool HasRedlineEnd() const
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 IsMarginPortion() const
bool IsArrowPortion() const
SwLinePortion * GetNextPortion() const
bool IsPostItsPortion() const
virtual void Paint(const SwTextPaintInfo &rInf) const =0
TextFrameIndex GetLen() const
void Move(SwTextPaintInfo &rInf)
SwTwips GetHangingBaseline() const
virtual tools::Long CalcSpacing(tools::Long nSpaceAdd, const SwTextSizeInfo &rInf) const
bool IsBreakPortion() const
bool IsQuoVadisPortion() const
bool IsMultiPortion() const
bool IsHolePortion() const
bool IsFlyPortion() const
bool IsFlyCntPortion() const
void PrePaint(const SwTextPaintInfo &rInf, const SwLinePortion *pLast) const
SwScriptInfo & GetScriptInfo()
Of course Writer needs its own rectangles.
void Height(tools::Long nNew)
void Top(const tools::Long nTop)
void Right(const tools::Long nRight)
void Bottom(const tools::Long nBottom)
void Left(const tools::Long nLeft)
short Seek(SwFont &rFnt, SwNodeOffset nNode, sal_Int32 nNew, sal_Int32 nOld)
void ChgClip(const SwRect &rRect, const SwTextFrame *pFrame=nullptr, bool bEnlargeRect=false, sal_Int32 nEnlargeTop=0, sal_Int32 nEnlargeBottom=0)
sal_uInt16 GetTabPos() const
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
SwTwips AdjustBaseLine(const SwLineLayout &rLine, const SwLinePortion *pPor, SwTwips nPorHeight=0, SwTwips nAscent=0, const bool bAutoToCentered=false) const
void AddExtraBlankWidth()
void CtorInitTextCursor(SwTextFrame *pFrame, SwTextSizeInfo *pInf)
Represents the visualization of a paragraph.
SwParaPortion * GetParaPortion()
TextFrameIndex GetEnd() const
bool SeekAndChgBefore(SwTextSizeInfo &rInf)
const SwLineLayout * GetNext() const
TextFrameIndex GetStart() const
bool SeekStartAndChg(SwTextSizeInfo &rInf, const bool bPara=false)
const SwLineLayout * GetPrevLine()
SwTwips GetLineHeight() const
const SwLineLayout * GetCurr() const
sal_Int32 GetLineNr() const
SwTextFrame * GetTextFrame()
void CalcAscentAndHeight(SwTwips &rAscent, SwTwips &rHeight) const
const SwLineInfo & GetLineInfo() const
const SwLineLayout * GetNextLine() const
bool SeekAndChg(SwTextSizeInfo &rInf)
sal_uInt16 GetDropLines() const
SwTextNode is a paragraph in the document model.
void SetpSpaceAdd(std::vector< tools::Long > *pNew)
void SetPaintOfst(const SwTwips nNew)
void SetPos(const Point &rNew)
const Point & GetPos() const
void DrawRedArrow(const SwLinePortion &rPor) const
void DrawTextLine(const SwRect &rPaint, SwSaveClip &rClip, const bool bUnderSz, ::std::optional< SwTaggedPDFHelper > &roTaggedLabel, ::std::optional< SwTaggedPDFHelper > &roTaggedParagraph, bool isPDFTaggingEnabled)
SwLinePortion * CalcPaintOfst(const SwRect &rPaint, bool &rbSkippedNumPortions)
void PaintMultiPortion(const SwRect &rPaint, SwMultiPortion &rMulti, const SwMultiPortion *pEnvPor=nullptr)
SwTextPaintInfo & GetInfo()
void CheckSpecialUnderline(const SwLinePortion *pPor, tools::Long nAdjustBaseLine=0)
void CtorInitTextPainter(SwTextFrame *pFrame, SwTextPaintInfo *pInf)
SwTextFrame * GetTextFrame()
vcl::RenderContext * GetOut()
const SwViewOption & GetOpt() const
void SetUnderFnt(SwUnderlineFont *pNew)
void SetLen(const TextFrameIndex nNew)
void SetIdx(const TextFrameIndex nNew)
void SetFont(SwFont *pNew)
SwUnderlineFont * GetUnderFnt() const
void SetKanaComp(std::deque< sal_uInt16 > *pNew)
const OUString & GetText() const
TextFrameIndex GetIdx() const
virtual void Paint(const SwTextPaintInfo &rInf) const override
void SetPos(const Point &rPoint)
const Point & GetPos() const
bool IsParagraph(bool bHard=false) const
const SwViewOption * GetViewOptions() const
SwTextAttr const * NextAttr(SwTextNode const **ppNode=nullptr)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
static Color GetUnderColor(const SwFont *pFont)
bool IsUnderlineBreak(const SwLinePortion &rPor, const SwFont &rFnt)
double getLength(const B2DPolygon &rCandidate)
TextFrameIndex MapModelToView(MergedPara const &, SwTextNode const *pNode, sal_Int32 nIndex)
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(MergedPara const &, TextFrameIndex nIndex)
vcl::Font GetFont(vcl::Font const &rFont, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
SwTextGridItem const * GetGridItem(SwPageFrame const *const)
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
tools::Long GetLen(const Point &rPnt)