23#include <com/sun/star/i18n/ScriptType.hpp>
65#include <com/sun/star/rdf/Statement.hpp>
66#include <com/sun/star/rdf/URI.hpp>
67#include <com/sun/star/rdf/URIs.hpp>
68#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
69#include <com/sun/star/rdf/XLiteral.hpp>
70#include <com/sun/star/text/XTextContent.hpp>
79 const std::vector<tools::Long> &rFlyStarts );
84 bool lcl_HasSameBorder(
const SwFont& rFirst,
const SwFont& rSecond);
112 OSL_ENSURE(
false,
"+SwTextFormatter::CTOR: bad offset" );
155 return sal_uInt16( nHeight );
198 if( pPor != pUnderflow )
205 while( pPor && pPor != pUnderflow )
210 while( pTmpPrev != pPor )
212 pTmpPrev->
Move( rInf );
215 OSL_ENSURE( pTmpPrev,
"Underflow: losing control!" );
233 OSL_ENSURE( pPor,
"SwTextFormatter::Underflow: overflow but underflow" );
248 if( !pPor || !(rInf.
X() + pPor->
Width()) )
380 "SwTextFormatter::BuildPortions: bad text length in info" );
398 OSL_ENSURE( !rInf.
X() ||
m_pMulti,
"SwTextFormatter::BuildPortion X=0?" );
409 ::std::optional<TextFrameIndex> oMovedFlyIndex;
420 if (pAnchoredObj->RestartLayoutProcess()
421 && !pAnchoredObj->IsTmpConsiderWrapInfluence())
423 SwFormatAnchor const& rAnchor(pAnchoredObj->GetFrameFormat().GetAnchor());
424 assert(rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_CHAR || rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_PARA);
426 if (pFollow->GetOffset() <= nAnchor
427 && (pFollow->GetFollow() ==
nullptr
428 || nAnchor < pFollow->GetFollow()->GetOffset()))
430 if (!oMovedFlyIndex || nAnchor < *oMovedFlyIndex)
432 oMovedFlyIndex.emplace(nAnchor);
444 const bool bHasGrid = pGrid && rInf.
SnapToGrid() &&
449 const sal_uInt16 nGridWidth = bHasGrid ?
GetGridWidth(*pGrid, rDoc) : 0;
462 while( pPor && !rInf.
IsStop() )
466 "SwTextFormatter::BuildPortions: bad length in info" );
479 sal_uInt16 nLstHeight = o3tl::narrowing<sal_uInt16>(rInf.
GetFont()->
GetHeight());
480 bool bAllowBehind =
false;
488 if (
static_cast<SwFieldPortion*
>(pPor)->GetExpText( rInf, aAltText ) &&
489 !aAltText.isEmpty() )
500 const OUString& rText = rInf.
GetText();
501 sal_Int32 nIdx = sal_Int32(rInf.
GetIdx());
502 bAllowBehind = nIdx < rText.getLength() && rCC.
isLetterNumeric(rText, nIdx);
506 if ( bAllowBehind && pLast )
508 bool bAllowBefore =
false;
513 if (
static_cast<const SwFieldPortion*
>(pLast)->GetExpText( rInf, aAltText ) &&
514 !aAltText.isEmpty() )
516 bAllowBefore = rCC.
isLetterNumeric( aAltText, aAltText.getLength() - 1 );
522 nLstHeight = o3tl::narrowing<sal_uInt16>(pTmpFnt->
GetHeight());
536 if( bAllowBefore && ( nLstActual != nNxtActual ) &&
537 nLstHeight && rInf.
X() + nLstHeight <= rInf.
Width() &&
548 else if ( bHasGrid && ! pGridKernPortion && !
m_pMulti && ! pPor->
InTabGrp() )
566 if ( aRectFnSet.
IsVert() )
568 Point aPoint( nStartX, 0 );
570 nStartX = aPoint.Y();
573 const SwTwips nOfst = nStartX - nGridOrigin;
577 ( ( nOfst - 1 ) / nGridWidth + 1 ) :
579 const SwTwips nKernWidth =
i * nGridWidth - nOfst;
582 if ( nKernWidth <= nRestWidth )
583 pGridKernPortion->
Width( nKernWidth );
586 if ( pGridKernPortion != pPor )
597 bFull = pPor->
Format( rInf );
681 if ( rInf.
X() + pPor->
Width() + nDist <= rInf.
Width() )
691 if ( bHasGrid && pPor != pGridKernPortion && !
m_pMulti && ! pPor->
InTabGrp() )
709 OSL_ENSURE( pGridKernPortion,
"No GridKernPortion available" );
713 sal_uInt16 nSumWidth = pPor->
Width();
716 nSumWidth = nSumWidth + pTmpPor->
Width();
721 ( nSumWidth - 1 ) / nGridWidth + 1 :
723 const SwTwips nTmpWidth =
i * nGridWidth;
724 const SwTwips nKernWidth =
std::min(nTmpWidth - nSumWidth, nRestWidth);
728 OSL_ENSURE( nKernWidth <= nRestWidth,
729 "Not enough space left for adjusting non-asian text in grid mode" );
732 pGridKernPortion->
Width( pGridKernPortion->
Width() + nKernWidth_1 );
733 rInf.
X( rInf.
X() + nKernWidth_1 );
736 if ( ! bFull && nKernWidth - nKernWidth_1 > 0 )
737 new SwKernPortion( *pPor,
static_cast<short>(nKernWidth - nKernWidth_1),
740 pGridKernPortion =
nullptr;
744 pPor->
InFieldGrp() || nCurrScript != nNextScript )
746 pGridKernPortion =
nullptr;
850 if( !rInf.
GetText().isEmpty() )
872 if( bChg || bFirstPor || !pPor->
GetAscent()
901 Color m_aShadowColor;
905 void SetShadowColor(
const Color& rCol ) { m_aShadowColor = rCol; }
927 COL_BLACK == m_aShadowColor
936 : m_pTextContentControl(pTextContentControl)
941bool SwContentControlPortion::DescribePDFControl(
const SwTextPaintInfo& rInf)
const
944 if (!pPDFExtOutDevData)
949 if (!pPDFExtOutDevData->GetIsExportFormFields())
954 if (!m_pTextContentControl)
960 const std::shared_ptr<SwContentControl>& pContentControl = rFormatContentControl.
GetContentControl();
961 if (!pContentControl)
968 sal_Int32 nStart = m_pTextContentControl->GetStart();
969 sal_Int32 nEnd = *m_pTextContentControl->GetEnd();
979 std::unique_ptr<vcl::PDFWriter::AnyWidget> pDescriptor;
980 switch (pContentControl->GetType())
985 pDescriptor = std::make_unique<vcl::PDFWriter::EditWidget>();
990 pDescriptor = std::make_unique<vcl::PDFWriter::CheckBoxWidget>();
992 pCheckBoxWidget->
Checked = pContentControl->GetChecked();
993 pCheckBoxWidget->OnValue = pContentControl->GetCheckedState();
994 pCheckBoxWidget->OffValue = pContentControl->GetUncheckedState();
999 pDescriptor = std::make_unique<vcl::PDFWriter::ListBoxWidget>();
1002 for (
const auto& rItem : pContentControl->GetListItems())
1004 pListWidget->Entries.push_back(rItem.m_aDisplayText);
1010 pDescriptor = std::make_unique<vcl::PDFWriter::ComboBoxWidget>();
1012 for (
const auto& rItem : pContentControl->GetListItems())
1014 pComboWidget->
Entries.push_back(rItem.m_aDisplayText);
1020 pDescriptor = std::make_unique<vcl::PDFWriter::EditWidget>();
1026 pEditWidget->DateFormat = pContentControl->GetDateFormat().toAsciiLowerCase();
1045 if (!pContentControl->GetAlias().isEmpty())
1047 pDescriptor->Description = pContentControl->GetAlias();
1053 SwPaM aPam(aMark, aPoint);
1054 OUString aText = aPam.GetText();
1068 aLine.GetCharRect(&aStartRect, nViewStart);
1069 aLocation = aStartRect;
1071 aLine.GetCharRect(&aEndRect, nViewEnd);
1072 aLocation.
Union(aEndRect);
1073 pDescriptor->Location = aLocation.
SVRect();
1076 pPDFExtOutDevData->CreateControl(*pDescriptor);
1077 pPDFExtOutDevData->EndStructureElement();
1088 if (DescribePDFControl(rInf))
1104 assert(pCheckboxFm);
1106 ? OUString(
u"\u2612")
1107 : OUString(
u"\u2610");
1110 const IFieldmark::parameter_map_t*
const pParameters = pBM->GetParameters();
1111 sal_Int32 nCurrentIdx = 0;
1113 if(pResult != pParameters->end())
1114 pResult->second >>= nCurrentIdx;
1117 if (pListEntries != pParameters->end())
1119 uno::Sequence< OUString > vListEntries;
1120 pListEntries->second >>= vListEntries;
1121 if (nCurrentIdx < vListEntries.getLength())
1122 return vListEntries[nCurrentIdx];
1125 static constexpr OUStringLiteral vEnSpaces =
u"\u2002\u2002\u2002\u2002\u2002";
1137 else if (
GetFnt()->IsInputField() )
1154 assert(2 <= sal_Int32(nFieldLen));
1155 pPor =
new SwFieldPortion(aFieldName,
nullptr,
false, nFieldLen);
1166 else if (
GetFnt()->IsMeta())
1168 auto pMetaPor =
new SwMetaPortion;
1173 SwPaM aPam(aPosition);
1174 uno::Reference<text::XTextContent>
const xRet(
1180 static uno::Reference< uno::XComponentContext > xContext(
1181 ::comphelper::getProcessComponentContext());
1183 static uno::Reference< rdf::XURI > xODF_SHADING(
1184 rdf::URI::createKnown(xContext, rdf::URIs::LO_EXT_SHADING), uno::UNO_SET_THROW);
1186 uno::Reference<rdf::XDocumentMetadataAccess> xDocumentMetadataAccess(
1189 const css::uno::Reference<css::rdf::XResource> xSubject(xRet, uno::UNO_QUERY);
1190 const uno::Reference<rdf::XRepository>& xRepository =
1191 xDocumentMetadataAccess->getRDFRepository();
1192 const uno::Reference<container::XEnumeration> xEnum(
1193 xRepository->getStatements(xSubject, xODF_SHADING,
nullptr), uno::UNO_SET_THROW);
1195 while (xEnum->hasMoreElements())
1197 rdf::Statement stmt;
1198 if (!(xEnum->nextElement() >>= stmt)) {
1199 throw uno::RuntimeException();
1201 const uno::Reference<rdf::XLiteral> xObject(stmt.Object, uno::UNO_QUERY);
1202 if (!xObject.is())
continue;
1203 if (xEnum->hasMoreElements()) {
1204 SAL_INFO(
"sw.uno",
"ignoring other odf:shading statements");
1207 pMetaPor->SetShadowColor(rColor);
1213 else if (
GetFnt()->IsContentControl())
1224 pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr);
1227 pPor =
new SwContentControlPortion(pTextContentControl);
1239 if(pBM !=
nullptr && pBM->GetFieldname( ) ==
ODF_FORMDATE)
1256 OSL_ENSURE(pBM !=
nullptr,
"Where is my form field bookmark???");
1307 nNextChg =
std::min( nNextChg, nNextScript );
1311 nNextChg =
std::min( nNextChg, nNextDir );
1315 nNextChg =
std::min( nNextChg, nNextHidden );
1319 nNextChg =
std::min(nNextChg, nNextBookmark);
1443 "Rotated number portion trouble" );
1465 "Rotated number portion trouble" );
1505 if (!bookmark.empty())
1523 while( pPor && !bRet )
1546 ::std::optional<TextFrameIndex>
const oMovedFlyIndex)
1548 if (oMovedFlyIndex && *oMovedFlyIndex <= rInf.
GetIdx())
1550 SAL_WARN_IF(*oMovedFlyIndex != rInf.
GetIdx(),
"sw.core",
"stopping too late, no portion break at fly anchor?");
1559 OSL_ENSURE( rInf.
IsFull(),
"SwTextFormatter::NewPortion: underflow but not full" );
1618 if ( ::lcl_BuildHiddenPortion( rInf, nEnd ) )
1731 OSL_ENSURE( rInf.
X() >= pLastTabPortion->
GetFix(),
"Decimal tab stop position cannot be calculated" );
1732 const sal_uInt16 nWidthOfPortionsUpToDecimalPosition = o3tl::narrowing<sal_uInt16>(rInf.
X() - pLastTabPortion->
GetFix() );
1733 static_cast<SwTabDecimalPortion*
>(pLastTabPortion)->SetWidthOfPortionsUpToDecimalPosition( nWidthOfPortionsUpToDecimalPosition );
1766 if( !pPor || rInf.
IsStop() )
1773 assert(pPor &&
"can only reach here with pPor existing");
1784 if ( pTextFootnote )
1797 nDir = pItem->GetValue();
1842 OSL_ENSURE(
m_pCurr->
Height(),
"SwTextFormatter::NewPortion: limbo dance" );
1847 OSL_ENSURE(pPor->
Height(),
"SwTextFormatter::NewPortion: something went wrong");
1859 "SwTextFormatter::FormatLine( nStartPos ) with unswapped frame" );
1882 std::unique_ptr<SwFieldPortion> xSaveField;
1891 std::vector<tools::Long> flyStarts;
1902 flyStarts.push_back( nPOfst );
1904 nPOfst += pPor->
Width();
1939 else if(
GetInfo().IsDropInit() )
1954 SwTwips nTmpAscent, nTmpHeight;
1999 sal_uInt16 nSum = 0;
2004 nSum += pPor->
Width();
2013 if ( bOptimizeRepaint )
2035 if (
GetInfo().CompressLine() )
2040 if ( nRepaintOfst <
GetInfo().GetPaintOfst() )
2081 nLineHeight = nGridWidth + nRubyHeight;
2082 const sal_uInt16 nAmpRatio = (
m_pCurr->
Height() + nLineHeight - 1)/nLineHeight;
2083 nLineHeight *= nAmpRatio;
2104 nTmp *= nLineHeight;
2105 nLineHeight = nTmp / 100;
2125 case SvxLineSpaceRule::Auto:
2134 nTmp = nTmp ? 50 : 100;
2136 nTmp *= nLineHeight;
2141 sal_uInt16 nAsc = ( 4 * nLineHeight ) / 5;
2145 if( nAsc < pCurr->GetAscent() ||
2146 nLineHeight - nAsc < pCurr->Height() -
2147 pCurr->GetAscent() )
2148 pCurr->SetClipping(
true );
2156 case SvxLineSpaceRule::Min:
2162 case SvxLineSpaceRule::Fix:
2165 const sal_uInt16 nAsc = ( 4 * nLineHeight ) / 5;
2166 if( nAsc < m_pCurr->GetAscent() ||
2174 default: OSL_FAIL(
": unknown LineSpaceRule" );
2181 case SvxInterLineSpaceRule::Off:
2183 case SvxInterLineSpaceRule::Prop:
2189 nTmp = nTmp ? 50 : 100;
2195 nTmp += nLineHeight;
2201 case SvxInterLineSpaceRule::Fix:
2206 default: OSL_FAIL(
": unknown InterLineSpaceRule" );
2214 if ( aRectFnSet.
IsVert() )
2217 const sal_uInt16 nDiff = sal_uInt16( nTmpY %
RegDiff() );
2219 nLineHeight +=
RegDiff() - nDiff;
2279 if( nMin && ++nMin > nRet )
2283 if( nRet + nDist < nMin )
2287 nRet = nMin - nDist;
2319 if ( bOptimizeRepaint )
2323 case SvxAdjust::Block:
2326 bOptimizeRepaint =
false;
2331 if ( bOptimizeRepaint )
2336 bOptimizeRepaint = !pPos;
2341 case SvxAdjust::Center:
2342 case SvxAdjust::Right:
2343 bOptimizeRepaint =
false;
2360 return bOptimizeRepaint;
2366 "SwTextFormatter::CalcUnclipped with unswapped frame" );
2371 rBottom = rTop + nFlyDesc;
2379 "SwTextFormatter::UpdatePos with unswapped frame" );
2392 aTmpInf.
SetIdx( nStartIdx );
2393 aTmpInf.
SetPos( aStart );
2395 SwTwips nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
2410 aTmpInf.
X( aTmpInf.
X() - nAscent );
2413 aTmpInf.
X( aTmpInf.
X() + nAscent );
2419 aTmpInf.
Y( aTmpInf.
Y() + nAscent );
2423 aTmpInf.
Y( aTmpInf.
Y() + nAscent );
2431 && ( bAlways || !
IsQuick() ) )
2433 pCurrent->
MaxAscentDescent( nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc, pPos );
2437 if( !nFlyAsc && !nFlyDesc )
2439 nTmpAscent = nAscent;
2441 nTmpDescent = nTmpHeight - nAscent;
2442 nFlyDesc = nTmpDescent;
2444 static_cast<SwGrfNumPortion*
>(pPos)->SetBase( nTmpAscent, nTmpDescent,
2445 nFlyAsc, nFlyDesc );
2454 aBase, nTmpAscent, nTmpDescent, nFlyAsc,
2460 OSL_ENSURE( !
GetMulti(),
"Too much multi" );
2463 Point aSt( aTmpInf.
X(), aStart.Y() );
2467 OSL_ENSURE(
GetMulti()->IsDouble(),
"Brackets only for doubles");
2470 else if(
GetMulti()->HasRotation() )
2480 aSt.AdjustX(pLay->
Width() );
2485 UpdatePos( pLay, aSt, nStIdx, bAlways );
2486 nStIdx = nStIdx + pLay->
GetLen();
2487 aSt.AdjustY(pLay->
Height() );
2492 pPos->
Move( aTmpInf );
2500 "SwTextFormatter::AlignFlyInCntBase with unswapped frame" );
2514 SwTwips nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
2523 static_cast<SwGrfNumPortion*
>(pPos)->SetBase( nTmpAscent, nTmpDescent,
2524 nFlyAsc, nFlyDesc );
2537 nFlyAsc, nFlyDesc, nFlags );
2546 OSL_ENSURE( rInf.
GetTextFly().
IsOn(),
"SwTextFormatter::ChkFlyUnderflow: why?" );
2554 SwRect aLineVert( aLine );
2662 nHeight = pLast->
Height();
2675 + nLeftMar - nLeftMin , nHeight );
2685 if( nUpper > 0 && nTop >= nUpper )
2688 SwRect aLineVert( aLine );
2715 aLine.
Left( rInf.
X() + nLeftMar );
2716 bool bForced =
false;
2717 if( aInter.
Left() <= nLeftMin )
2722 if( aInter.
Left() < nFrameLeft )
2723 aInter.
Left( nFrameLeft );
2733 nAddMar = nLeftMar - nFrameLeft;
2746 const bool bFullLine = aLine.
Left() == aInter.
Left() &&
2759 aInter.
Pos().AdjustX( -nLeftMar );
2789 if( nNextTop > aInter.
Bottom() )
2795 if( nAscent < pFly->
Height() )
2811 if( nAscent < pFly->
Height() )
2837 const sal_uInt16 nGridWidth =
GetGridWidth(*pGrid, rDoc);
2840 if ( aRectFnSet.
IsVert() )
2842 Point aPoint( nStartX, 0 );
2844 nStartX = aPoint.Y();
2847 const SwTwips nOfst = nStartX - nGridOrigin;
2850 const SwTwips i = nTmpWidth / nGridWidth + 1;
2852 const SwTwips nNewWidth = (
i - 1 ) * nGridWidth - nOfst;
2853 if ( nNewWidth > 0 )
2854 rInf.
Width( nNewWidth );
2872 pFly =
static_cast<SwTextFlyCnt*
>(pHint)->GetFlyFrame(pFrame);
2880 SwTwips nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
2896 0 != ( bTextFrameVertical ?
2900 if ( bUseFlyAscent )
2901 nAscent =
std::abs(
int( bTextFrameVertical ?
2912 else if( nAscent > nFlyAsc )
2924 Point aTmpBase( aBase );
2948 nTmpDescent, nFlyAsc, nFlyDesc, nMode );
3011 if( bSeek &&
GetFnt()->HasBorder() && ::lcl_HasSameBorder(aCurFont, *
GetFnt()) && !bDisconnect )
3029 sal_uInt16 nMaxAscent = 0;
3030 sal_uInt16 nMaxHeight = 0;
3031 bool bReachCurrent =
false;
3034 if( nMaxHeight < pActPor->
Height() )
3035 nMaxHeight = pActPor->
Height();
3036 if( nMaxAscent < pActPor->GetAscent() )
3040 if( !pActPor && !bReachCurrent )
3042 pActPor = &rPortion;
3043 bReachCurrent =
true;
3049 bReachCurrent =
false;
3052 if( nMaxHeight > pActPor->
Height() )
3053 pActPor->
Height(nMaxHeight);
3058 if( !pActPor && !bReachCurrent )
3060 pActPor = &rPortion;
3061 bReachCurrent =
true;
3075 const std::vector<tools::Long> &rFlyStarts )
3087 if ( rFlyStarts.empty() && ! rCurr.
IsFly() )
3105 if (nReformat > txtFormatInfo.
GetLineStart() + nMaxContext)
3106 nReformat = nReformat - nMaxContext;
3122 OSL_ENSURE( nReformat < txtFormatInfo.
GetIdx(),
"Reformat too small for me!" );
3127 bool bOldMulti = txtFormatInfo.
IsMulti();
3129 txtFormatInfo.
SetMulti( bOldMulti );
3131 return nFormatRepaint ?
std::min( aRect.
Left(), nFormatRepaint ) :
3151 if (nCnt < rFlyStarts.size() &&
3152 nX == rFlyStarts[ nCnt ] &&
3156 nPOfst = nX + pPor->
Width();
3162 nX = nX + pPor->
Width();
3163 nIdx = nIdx + pPor->
GetLen();
3178 if (bShowInDocView || bShowForPrinting)
3194 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.
vcl::ExtOutDevData * GetExtOutDevData() const
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
wrapper class for the positioning of Writer fly frames and drawing objects
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
const SvxFont & GetActualFont() 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
SfxPoolItem subclass that wraps an SwContentControl.
const std::shared_ptr< SwContentControl > & GetContentControl() 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
SwLayoutFrame * GetUpper()
SwPageFrame * FindPageFrame()
sal_uInt16 GetFixWidth() 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 & GetPointNode() 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)
SwRect & Union(const SwRect &rRect)
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
tools::Rectangle SVRect() 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
std::vector< std::tuple< MarkKind, Color, OUString > > GetBookmarks(TextFrameIndex const nPos)
TextFrameIndex NextHiddenChg(TextFrameIndex nPos) const
TextFrameIndex NextScriptChg(TextFrameIndex nPos) const
TextFrameIndex NextBookmark(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
SwTextAttr subclass that tracks the location of the wrapped SwFormatContentControl.
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()
void SetStop(const bool bNew)
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)
SwLinePortion * NewPortion(SwTextFormatInfo &rInf, ::std::optional< TextFrameIndex >)
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)
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.
TextFrameIndex MapModelToView(SwTextNode const *pNode, sal_Int32 nIndex) const
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
SwTextNode is a paragraph in the document model.
SwTextAttr * GetTextAttrAt(sal_Int32 const nIndex, sal_uInt16 const nWhich, ::sw::GetTextAttrMode const eMode=::sw::GetTextAttrMode::Default) const
get the innermost text attribute covering position nIndex.
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()
vcl::RenderContext * GetOut()
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
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< SwFormatContentControl > RES_TXTATR_CONTENTCONTROL(56)
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_WARN_IF(condition, area, stream)
#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)
OUString removeAny(std::u16string_view rIn, sal_Unicode const *const pChars)
tools::Long SnapToGrid(KernArray &rKernArray, std::u16string_view aText, 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)
@ Parent
EXPAND : (Start < nIndex <= End)
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.
sal_Int32 GetContentIndex() const
tools::Long GetLen(const Point &rPnt)
const sal_Unicode CH_BREAK
const sal_Unicode CH_BLANK
constexpr sal_Int32 COMPLETE_STRING