94 if( nTmp + (pPor->
Height()/2) >= nPaintOfst )
122 const bool bUnderSized,
123 ::std::optional<SwTaggedPDFHelper> & roTaggedLabel,
124 ::std::optional<SwTaggedPDFHelper> & roTaggedParagraph,
125 bool const isPDFTaggingEnabled)
127#if OSL_DEBUG_LEVEL > 1
163 if( nMaxRight < nTabPos )
165 nMaxRight = rPaint.
Right();
172 if( !bEndPor && nTmpLeft >= nMaxRight )
186 SwTwips nTmpHeight, nTmpAscent;
192 bool bClip = ( bDrawInWindow || bUnderSized ) && !rClip.
IsChg();
205#if OSL_DEBUG_LEVEL > 1
206 static bool bClipAlways =
false;
207 if( bClip && bClipAlways )
217 if ( aPnt1.X() < rPaint.
Left() )
218 aPnt1.setX( rPaint.
Left() );
219 if ( aPnt1.Y() < rPaint.
Top() )
220 aPnt1.setY( rPaint.
Top() );
222 GetInfo().GetPos().
Y() + nTmpHeight );
223 if ( aPnt2.X() > rPaint.
Right() )
224 aPnt2.setX( rPaint.
Right() );
225 if ( aPnt2.Y() > rPaint.
Bottom() )
226 aPnt2.setY( rPaint.
Bottom() );
228 const SwRect aLineRect( aPnt1, aPnt2 );
242 if( !pPor && !bEndPor )
249 const bool bAdjustBaseLine =
253 if ( ! bAdjustBaseLine )
261 if( bAdjustBaseLine )
295 if ( bAdjustBaseLine )
330 std::pair<SwTextNode const*, sal_Int32>
const pos(
380 pUnderLineFnt->
GetPos().Y() :
382 pUnderLineFnt->
SetPos( aTmpPoint );
397 assert(!roTaggedLabel);
398 assert(isPDFTaggingEnabled); (void) isPDFTaggingEnabled;
399 Por_Info aPorInfo(*pPor, *
this,
true);
400 roTaggedLabel.emplace(
nullptr,
nullptr, &aPorInfo, *
pOut);
405 Por_Info aPorInfo(*pPor, *
this,
false);
419 assert(roTaggedLabel);
420 roTaggedLabel.reset();
421 assert(!roTaggedParagraph);
423 roTaggedParagraph.emplace(
nullptr, &aFrameInfo,
nullptr, *
pOut);
427 if ( pOldUnderLineFnt )
433 bFirst &= !pPor->
GetLen();
439 pPor = bDrawInWindow ||
GetInfo().
X() <= nMaxRight ||
471 std::pair<SwTextNode const*, sal_Int32>
const pos(
481 if ( bAdjustBaseLine )
491 const bool bNextUndersized =
497 if( bUnderSized || bNextUndersized )
499 if ( bAdjustBaseLine )
511 (nDiff >= 0 && bNextUndersized) )
553 if (
GetInfo().GetUnderFnt() &&
560 "CheckSpecialUnderline without underlined font" );
571 for (
auto const& e : pMerged->extents)
577 pItem->GetLineStyle());
578 aUnderMulti.
Select(
Range(nTmp, nTmp + e.nEnd - e.nStart - 1),
581 nTmp += e.nEnd - e.nStart;
602 aUnderMulti.
Select(
Range(sal_Int32(nStart), sal_Int32(nEnd) - 1),
613 for(
size_t i = 0;
i < nCnt; ++
i )
630 SwFont* pUnderlineFnt =
nullptr;
631 Point aCommonBaseLine;
645 sal_uInt16 nMaxBaseLineOfst = 0;
646 int nNumberOfPortions = 0;
648 while (nTmpIdx <= nUnderEnd && pPor)
656 aIter.
Seek( nTmpIdx );
663 nSumWidth += pPor->
Width();
668 if ( nAdjustBaseLine )
671 if ( nMaxBaseLineOfst < nTmpBaseLineOfst )
673 nMaxBaseLineOfst = nTmpBaseLineOfst;
674 nSumHeight = nFontHeight;
679 nSumHeight += pPor->
Width() * nFontHeight;
682 nBold += pPor->
Width();
687 nTmpIdx += pPor->
GetLen();
692 if ( nNumberOfPortions > 1 && nSumWidth )
694 const sal_uLong nNewFontHeight = nAdjustBaseLine ?
696 nSumHeight / nSumWidth;
703 nNewFontHeight ), nActual );
706 if ( 2 * nBold > nSumWidth )
712 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...
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 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)
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
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)
TextFrameIndex GetStart() const
bool SeekStartAndChg(SwTextSizeInfo &rInf, const bool bPara=false)
const SwLineLayout * GetPrevLine()
const SwLineLayout * GetCurr() const
sal_uInt16 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
SwLinePortion * CalcPaintOfst(const SwRect &rPaint)
void DrawTextLine(const SwRect &rPaint, SwSaveClip &rClip, const bool bUnderSz, ::std::optional< SwTaggedPDFHelper > &roTaggedLabel, ::std::optional< SwTaggedPDFHelper > &roTaggedParagraph, bool isPDFTaggingEnabled)
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)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
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)