26#if OSL_DEBUG_LEVEL > 0
35 OSL_ENSURE(
nCount < 200 && pPor != pStart,
36 "ChkChain(): lost in chains" );
37 if(
nCount >= 200 || pPor == pStart )
67 mpNextPortion( nullptr ),
70 mnHangingBaseline( 0 ),
72 m_bJoinBorderWithPrev(false),
73 m_bJoinBorderWithNext(false)
80 OSL_ENSURE( rInf.
OnWin(),
"SwLinePortion::PrePaint: don't prepaint on a printer");
81 OSL_ENSURE( !
Width(),
"SwLinePortion::PrePaint: For Width()==0 only!");
88 const sal_uInt16 nHalfView = nViewWidth / 2;
89 sal_uInt16 nLastWidth = pLast->
Width();
106 if (nLastWidth > nHalfView || pLast ==
this)
111 nPos = sal_uInt16( rInf.
X() );
112 nPos += nLastWidth - nHalfView;
116 nPos = sal_uInt16( rInf.
Y() );
117 nPos -= nLastWidth - nHalfView;
121 nPos = sal_uInt16( rInf.
X() );
122 nPos -= nLastWidth - nHalfView;
126 nPos = sal_uInt16( rInf.
Y() );
127 nPos += nLastWidth - nHalfView;
134 pThis->
Width( nViewWidth );
157 OSL_ENSURE( pPos !=
this,
"SwLinePortion::Truncate: loop" );
173#if OSL_DEBUG_LEVEL > 0
195#if OSL_DEBUG_LEVEL > 0
204 OSL_ENSURE( pPrev,
"SwLinePortion::Cut(): can't cut" );
215 OSL_ENSURE( pRoot !=
this,
"SwLinePortion::FindPrevPortion(): invalid root" );
222 "SwLinePortion::FindPrevPortion: blowing in the wind");
236 OSL_ENSURE(
false,
"SwLinePortion::GetTextSize: don't ask me about sizes, "
237 "I'm only a stupid SwLinePortion" );
243 if( rInf.
X() > rInf.
Width() )
253 const sal_uInt16 nNewWidth = o3tl::narrowing<sal_uInt16>(rInf.
X() +
PrtWidth());
259 if( nNewWidth > rInf.
Width() )
283 rInf.
Y( rInf.
Y() + ( bB2T ? -nTmp : nTmp ) );
284 else if ( bCounterDir )
285 rInf.
X( rInf.
X() - nTmp );
287 rInf.
X( rInf.
X() + nTmp );
298 else if ( bCounterDir )
326 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwLinePortion"));
330 (void)xmlTextWriterEndElement(pWriter);
335 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
336 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"symbol"), BAD_CAST(
typeid(*this).name()));
337 (void)xmlTextWriterWriteAttribute(
338 pWriter, BAD_CAST(
"width"),
339 BAD_CAST(OString::number(
Width()).getStr()));
340 (void)xmlTextWriterWriteAttribute(
341 pWriter, BAD_CAST(
"height"),
342 BAD_CAST(OString::number(
Height()).getStr()));
343 (void)xmlTextWriterWriteAttribute(
344 pWriter, BAD_CAST(
"length"),
345 BAD_CAST(OString::number(
static_cast<sal_Int32
>(
mnLineLength)).getStr()));
346 (void)xmlTextWriterWriteAttribute(
347 pWriter, BAD_CAST(
"type"),
349 OUString aText( rText.substr(sal_Int32(nOffset), sal_Int32(
GetLen())) );
350 for (
int i = 0;
i < 32; ++
i)
351 aText = aText.replace(
i,
'*');
352 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"portion"),
353 BAD_CAST(aText.toUtf8().getStr()));
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...
vcl::text::ComplexTextLayoutFlags GetLayoutMode() const
Degree10 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
bool IsRightToLeft() const
Base class for anything that can be part of a line in the Writer layout.
TextFrameIndex mnLineLength
void dumpAsXmlAttributes(xmlTextWriterPtr writer, std::u16string_view rText, TextFrameIndex nOffset) const
virtual void FormatEOL(SwTextFormatInfo &rInf)
SwLinePortion * mpNextPortion
bool IsMarginPortion() const
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const
the parameter is actually SwTwips apparently?
SwLinePortion * GetNextPortion() const
void SetAscent(const SwTwips nNewAsc)
PortionType GetWhichPor() const
void SetNextPortion(SwLinePortion *pNew)
virtual void Paint(const SwTextPaintInfo &rInf) const =0
SwLinePortion * Cut(SwLinePortion *pVictim)
virtual SwLinePortion * Append(SwLinePortion *pPortion)
TextFrameIndex GetLen() const
void Move(SwTextPaintInfo &rInf)
SwLinePortion * FindLastPortion()
bool IsKernPortion() const
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const
virtual SwLinePortion * Compress()
virtual tools::Long CalcSpacing(tools::Long nSpaceAdd, const SwTextSizeInfo &rInf) const
void CalcTextSize(const SwTextSizeInfo &rInfo)
SwLinePortion * FindPrevPortion(const SwLinePortion *pRoot)
virtual void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &rOffset) const
virtual void HandlePortion(SwPortionHandler &rPH) const
bool IsMultiPortion() const
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const
virtual bool Format(SwTextFormatInfo &rInf)
bool InFixMargGrp() const
void PrePaint(const SwTextPaintInfo &rInf, const SwLinePortion *pLast) const
virtual SwLinePortion * Insert(SwLinePortion *pPortion)
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
virtual void Special(TextFrameIndex nLength, const OUString &rText, PortionType nType)=0
special portion.
SwPosSize(const SwTwips nW=0, const SwTwips nH=0)
SwLinePortion * GetLast()
void SetUnderflow(SwLinePortion *pNew)
tools::Long GetSpaceAdd() const
SwTextFrame * GetTextFrame()
vcl::RenderContext * GetOut()
sal_uInt8 GetDirection() const
void SetLen(const TextFrameIndex nNew)
void SetIdx(const TextFrameIndex nNew)
TextFrameIndex GetLen() const
TextFrameIndex GetIdx() const
struct _xmlTextWriter * xmlTextWriterPtr
const char * PortionTypeToString(PortionType nType)
static bool ChkChain(SwLinePortion *pStart)
UNDERLYING_TYPE get() const