59 m_eUnderline( eUL ), m_eStrikeout( eStrkout ),
m_aColor( rCol )
145 [pPortion, nHeight, &rInf, nVertPosOffset]
149 const_cast<SwTextPaintInfo&>(rInf).Y(rInf.Y() - nVertPosOffset);
151 pPortion->Height(nHeight,
false);
161 if ( nNoBreakWidth > 0 )
168 for (sal_Int16
i = 1;
i < nSpaces; ++
i)
230 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwBreakPortion"));
234 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"text-height"),
237 (void)xmlTextWriterEndElement(pWriter);
243 bool bBG,
bool bGK ) :
244 m_nKern( nKrn ), m_bBackground( bBG ), m_bGridKern( bGK )
256 m_nKern( 0 ), m_bBackground( false ), m_bGridKern( true )
339 SwContentFrame const*
const pCurrFrame = pCrSh->GetCurrFrame(
false);
349 OSL_ENSURE( !
IsVertical() || !
IsSwapped(),
"SwTextFrame::EmptyHeight with swapped frame" );
351 std::unique_ptr<SwFont> pFnt;
358 pFnt.reset(
new SwFont( pAttrSet, pIDSA ));
364 pFnt->CheckFontCacheId( pSh, pFnt->GetActual() );
368 pFnt->SetVertical( 2700_deg10 );
399 pFnt->SetFntChg(
true );
400 pFnt->ChgPhysFnt( pSh, *
pOut );
401 nRet = pFnt->GetHeight( pSh, *
pOut );
408 OSL_ENSURE( !
IsVertical() || !
IsSwapped(),
"SwTextFrame::FormatEmpty with swapped frame" );
438 if ( !bCollapse && bFirstFlyCheck &&
439 aTextFly.
IsOn() && aTextFly.
IsAnyObj( aRect ) && !bHasNonLastSplitFlyDrawObj )
451 pIndex; pIndex = pIndex->GetNext())
474 SetUndersized(
false );
489 if( !bCollapse && !bFirstFlyCheck &&
510 rRegStart = aRectFnSet.
GetPrtTop(*pFrame);
552 sal_uInt16 nNetHeight = rRegDiff;
556 case SvxLineSpaceRule::Auto:
558 case SvxLineSpaceRule::Min:
565 OSL_FAIL(
": unknown LineSpaceRule" );
569 case SvxInterLineSpaceRule::Off:
571 case SvxInterLineSpaceRule::Prop:
575 nTmp = nTmp ? 50 : 100;
580 rRegDiff = o3tl::narrowing<sal_uInt16>(nTmp);
581 nNetHeight = rRegDiff;
584 case SvxInterLineSpaceRule::Fix:
587 nNetHeight = rRegDiff;
590 default: OSL_FAIL(
": unknown InterLineSpaceRule" );
595 pOut->SetMapMode( aOldMap );
600 if ( aRectFnSet.
IsVert() )
601 rRegStart -= nTmpDiff;
603 rRegStart += nTmpDiff;
607 return ( 0 != rRegDiff );
616 pOut->SetFillColor( aCol );
622 pOut->SetFillColor( aOldColor );
637 OUString & rOutString,
SwFont & rTmpFont,
int &)
const
647 rOutString =
"/";
break;
658 const sal_uInt16 nProp = 40;
665 OUString & rOutString,
SwFont & rFont,
int & rDeltaY)
const
673 rOutString = OUStringChar(
mcChar);
682 assert(aSize.
Height() != 0);
702 rDeltaY = nOSAscent - nOrigAscent;
721 &&
DoPaint(rInf, aOutString, aTmpFont, deltaY)))
730 Point aNewPos( aOldPos );
771 &&
DoPaint(rInf, aOutString, aTmpFont, deltaY)))
780 Point aNewPos( aOldPos );
837 aOutString = OUString(
'[');
854 aStr.append(
"#" + std::get<2>(it) +
" " +
SwResId(STR_BOOKMARK_DEF_NAME));
855 switch (std::get<0>(it))
873 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwBookmarkPortion"));
882 aStr.append(
"#" + std::get<2>(rColor) +
" " +
SwResId(STR_BOOKMARK_DEF_NAME));
883 switch (std::get<0>(rColor))
895 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"colors"),
896 BAD_CAST(
aStr.makeStringAndClear().toUtf8().getStr()));
899 (void)xmlTextWriterEndElement(pWriter);
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...
static OutputDevice * GetDefaultDevice()
virtual OutputDevice * getReferenceDevice(bool bCreate) const =0
Returns the current reference device.
static bool IsShowChanges(const RedlineFlags eM)
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const =0
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
Provides access to settings of a document.
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long Height() const
SvxAdjust GetAdjust() 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).
SwArrowPortion(const SwLinePortion &rPortion)
virtual SwLinePortion * Compress() override
virtual void Paint(const SwTextPaintInfo &rInf) const override
Used by Attribute Iterators to organize attributes on stacks to find the valid attribute in each cate...
void Init(const SwAttrSet &rAttrSet, const IDocumentSettingAccess &rIDocumentSettingAccess)
const SvxAdjustItem & GetAdjust(bool=true) const
const SvxFirstLineIndentItem & GetFirstLineIndent(bool=true) const
const SvxParaGridItem & GetParaGrid(bool=true) const
const SvxLineSpacingItem & GetLineSpacing(bool=true) const
const SwRegisterItem & GetRegister(bool=true) const
virtual bool DoPaint(SwTextPaintInfo const &rInf, OUString &rOutString, SwFont &rTmpFont, int &rDeltaY) const override
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &rOffset) const override
virtual void HandlePortion(SwPortionHandler &rPH) const override
std::vector< std::tuple< SwScriptInfo::MarkKind, Color, OUString > > m_oColors
virtual void Paint(const SwTextPaintInfo &rInf) const override
virtual void Paint(const SwTextPaintInfo &rInf) const override
static constexpr OUStringLiteral S_NOBREAK_FOR_REDLINE
virtual SwLinePortion * Compress() override
SwBreakPortion(const SwLinePortion &rPortion, const SwTextAttr *pAttr)
virtual bool Format(SwTextFormatInfo &rInf) override
SwLineBreakClear m_eClear
Tracks the type of the breaking clear from SwTextLineBreak, if there is one.
SwTwips m_nTextHeight
Height of the line-break character itself, without spacing added for clearing.
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &nOffset) const override
SwLineBreakClear GetClear() const
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override
the parameter is actually SwTwips apparently?
virtual void HandlePortion(SwPortionHandler &rPH) const override
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Marks a character position inside a document model content node (SwContentNode)
bool HasSwAttrSet() const
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
SwFormatColl & GetAnyFormatColl() const
sal_uInt16 mnHalfCharWidth
virtual void Paint(const SwTextPaintInfo &rInf) const override
virtual bool Format(SwTextFormatInfo &rInf) override
virtual bool DoPaint(SwTextPaintInfo const &rInf, OUString &rOutString, SwFont &rTmpFont, int &rDeltaY) const
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
To take Asian or other languages into consideration, an SwFont object consists of 3 SwSubFonts (Latin...
void SetOverline(const FontLineStyle eOverline)
void ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
void SetStrikeout(const FontStrikeout eStrikeout)
void SetEscapement(const short nNewEsc)
const Size & GetSize(SwFontScript nWhich) const
Degree10 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
void SetAlign(const TextAlign eAlign)
void SetEmphasisMark(const FontEmphasisMark eValue)
void SetName(const OUString &rName, const SwFontScript nWhich)
void SetProportion(const sal_uInt8 nNewPropr)
void SetOutline(const bool bOutline)
void SetPitch(const FontPitch ePitch, const SwFontScript nWhich)
SwFontScript GetActual() const
void SetShadow(const bool bShadow)
void SetColor(const Color &rColor)
bool IsPaintBlank() const
void SetTransparent(const bool bTrans)
void SetUnderline(const FontLineStyle eUnderline)
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
void SetWeight(const FontWeight eWeight, const SwFontScript nWhich)
void SetRelief(const FontRelief eNew)
tools::Long GetHeight() const
const SwRect & getFrameArea() const
const SwRect & getFramePrintArea() const
Base class of the Writer layout elements.
SwFrameType GetType() const
bool IsInFootnote() const
bool IsRightToLeft() const
SwLayoutFrame * GetUpper()
SwRootFrame * getRootFrame()
void SetCompletePaint() const
SwPageFrame * FindPageFrame()
virtual void Paint(const SwTextPaintInfo &rInf) const override
virtual bool Format(SwTextFormatInfo &rInf) override
virtual void Paint(const SwTextPaintInfo &rInf) const override
SwKernPortion(SwLinePortion &rPortion, short nKrn, bool bBG=false, bool bGridKern=false)
virtual void FormatEOL(SwTextFormatInfo &rInf) override
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
SwLinePortion * GetNextPortion() const
void SetAscent(const SwTwips nNewAsc)
bool GetJoinBorderWithPrev() const
PortionType GetWhichPor() const
TextFrameIndex GetLen() const
bool GetJoinBorderWithNext() const
SwLinePortion * FindPrevPortion(const SwLinePortion *pRoot)
void SetWhichPor(const PortionType nNew)
void PrePaint(const SwTextPaintInfo &rInf, const SwLinePortion *pLast) const
virtual SwLinePortion * Insert(SwLinePortion *pPortion)
const IDocumentRedlineAccess & getIDocumentRedlineAccess() const
Provides access to the document redline interface.
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
sal_uInt16 GetRegHeight() const
void SetRegAscent(sal_uInt16 const nNew)
void SetRegHeight(sal_uInt16 const nNew)
sal_uInt16 GetRegAscent() const
const SwTextFormatColl * GetRegisterFormatColl() const
retrieve the style for the grid alignment
A page of the document layout.
SwPageDesc * FindPageDesc()
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
virtual void Text(TextFrameIndex nLength, PortionType nType)=0
(empty) destructor
virtual void Special(TextFrameIndex nLength, const OUString &rText, PortionType nType)=0
special portion.
tools::Long GetHeight(const SwRect &rRect) const
tools::Long GetPrtTop(const SwFrame &rFrame) const
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 SSize(const Size &rNew)
tools::Rectangle SVRect() const
void Left(const tools::Long nLeft)
static constexpr size_type npos
vector_type::size_type size_type
SwViewShell * GetCurrShell() const
void ChgClip(const SwRect &rRect, const SwTextFrame *pFrame=nullptr, bool bEnlargeRect=false, sal_Int32 nEnlargeTop=0, sal_Int32 nEnlargeBottom=0)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
const SwFormatLineBreak & GetLineBreak() const
The purpose of this class is to be the universal interface between formatting/text output and the pos...
bool IsAnyObj(const SwRect &rRect) const
true when a frame or DrawObj must be taken in account.
SwTwips GetMaxBottom(const SwBreakPortion &rPortion, const SwTextFormatInfo &rInfo) const
Gets the maximum of the fly frame bottoms.
Represents the style of a paragraph.
SwLinePortion * GetLast()
void SetLast(SwLinePortion *pNewLast)
void SetNewLine(const bool bNew)
void HideAndShowObjects()
Hides respectively shows objects, which are anchored at paragraph, at/as a character of the paragraph...
bool IsEmptyWithSplitFly() const
This text frame is not split, doesn't fit the upper, has a single split fly anchored to it with a neg...
bool FillRegister(SwTwips &rRegStart, sal_uInt16 &rRegDiff)
Determines the start position and step size of the register.
void ClearPara()
Removes the Line information from the Cache but retains the entry itself.
sw::MergedPara * GetMergedPara()
void AdjustFrame(const SwTwips nChgHeight, bool bHasToFit=false)
SwTwips EmptyHeight() const
SwParaPortion * GetPara()
void SetHasRotatedPortions(bool bHasRotatedPortions)
void HideFootnotes(TextFrameIndex nStart, TextFrameIndex nEnd)
bool HasNonLastSplitFlyDrawObj() const
This text frame may have a split fly frames anchored to it.
SwTextNode * GetTextNodeFirst()
void RemoveFromCache()
Removes this frame completely from the Cache.
SwTextNode const * GetTextNodeForParaProps() const
void SetEmpty(const bool bNew)
bool GetHasRotatedPortions() const
sal_uInt16 GetBaseHeight() const
sal_uInt16 GetRubyHeight() const
SwTextNode is a paragraph in the document model.
void DrawText(const OUString &rText, const SwLinePortion &rPor, TextFrameIndex nIdx=TextFrameIndex(0), TextFrameIndex nLen=TextFrameIndex(COMPLETE_STRING), const bool bKern=false) const
const Point & GetPos() const
void CalcRect(const SwLinePortion &rPor, SwRect *pRect, SwRect *pIntersect=nullptr, const bool bInsideBox=false) const
Calculate the rectangular area where the portion takes place.
void DrawBackBrush(const SwLinePortion &rPor) const
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich, const Color *pColor=nullptr) const
void DrawBorder(const SwLinePortion &rPor) const
Draw character border around a line portion.
void DrawLineBreak(const SwLinePortion &rPor) const
SwTextFrame * GetTextFrame()
vcl::RenderContext * GetOut()
const SwViewOption & GetOpt() const
SwPosSize GetTextSize(OutputDevice *pOut, const SwScriptInfo *pSI, const OUString &rText, TextFrameIndex nIdx, TextFrameIndex nLen) const
const OUString & GetText() const
TextFrameIndex GetIdx() const
const FontStrikeout m_eStrikeout
virtual void Paint(const SwTextPaintInfo &rInf) const override
SwTmpEndPortion(const SwLinePortion &rPortion, const FontLineStyle eUnderline, const FontStrikeout eStrikeout, const Color &rColor)
const FontLineStyle m_eUnderline
bool IsParagraph(bool bHard=false) const
bool IsPagePreview() const
bool IsShowBookmarks(bool const bHard=false) const
bool getBrowseMode() const
bool IsLineBreak(bool bHard=false) const
const Color & GetFieldShadingsColor() const
bool IsFieldShadings() const
vcl::RenderContext * GetOut() const
const SwViewOption * GetViewOptions() const
vcl::Window * GetWin() const
::OutputDevice const * GetOutDev() const
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
struct _xmlTextWriter * xmlTextWriterPtr
#define DFLT_ESC_AUTO_SUB
constexpr TypedWhichId< SwFormatLineBreak > RES_TXTATR_LINEBREAK(61)
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
SwTextGridItem const * GetGridItem(SwPageFrame const *const)
UNDERLYING_TYPE get() const
constexpr OUStringChar CH_PAR
OUString SwResId(TranslateId aId)
#define NON_PRINTING_CHARACTER_COLOR