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() &&
557 else if ( bHasGrid && ! pGridKernPortion && !
m_pMulti && ! pPor->
InTabGrp() )
575 if ( aRectFnSet.
IsVert() )
577 Point aPoint( nStartX, 0 );
579 nStartX = aPoint.Y();
582 const SwTwips nOfst = nStartX - nGridOrigin;
586 ( ( nOfst - 1 ) / nGridWidth + 1 ) :
588 const SwTwips nKernWidth =
i * nGridWidth - nOfst;
591 if ( nKernWidth <= nRestWidth )
592 pGridKernPortion->
Width( nKernWidth );
595 if ( pGridKernPortion != pPor )
606 bFull = pPor->
Format( rInf );
690 if ( rInf.
X() + pPor->
Width() + nDist <= rInf.
Width() )
700 if ( bHasGrid && pPor != pGridKernPortion && !
m_pMulti && ! pPor->
InTabGrp() )
718 OSL_ENSURE( pGridKernPortion,
"No GridKernPortion available" );
722 sal_uInt16 nSumWidth = pPor->
Width();
725 nSumWidth = nSumWidth + pTmpPor->
Width();
730 ( nSumWidth - 1 ) / nGridWidth + 1 :
732 const SwTwips nTmpWidth =
i * nGridWidth;
733 const SwTwips nKernWidth =
std::min(nTmpWidth - nSumWidth, nRestWidth);
737 OSL_ENSURE( nKernWidth <= nRestWidth,
738 "Not enough space left for adjusting non-asian text in grid mode" );
741 pGridKernPortion->
Width( pGridKernPortion->
Width() + nKernWidth_1 );
742 rInf.
X( rInf.
X() + nKernWidth_1 );
745 if ( ! bFull && nKernWidth - nKernWidth_1 > 0 )
746 new SwKernPortion( *pPor,
static_cast<short>(nKernWidth - nKernWidth_1),
749 pGridKernPortion =
nullptr;
753 pPor->
InFieldGrp() || nCurrScript != nNextScript )
755 pGridKernPortion =
nullptr;
859 if( !rInf.
GetText().isEmpty() )
881 if( bChg || bFirstPor || !pPor->
GetAscent()
910 Color m_aShadowColor;
914 void SetShadowColor(
const Color& rCol ) { m_aShadowColor = rCol; }
936 COL_BLACK == m_aShadowColor
945 : m_pTextContentControl(pTextContentControl)
950bool SwContentControlPortion::DescribePDFControl(
const SwTextPaintInfo& rInf)
const
953 if (!pPDFExtOutDevData)
958 if (!pPDFExtOutDevData->GetIsExportFormFields())
963 if (!m_pTextContentControl)
969 const std::shared_ptr<SwContentControl>& pContentControl = rFormatContentControl.
GetContentControl();
970 if (!pContentControl)
977 sal_Int32 nStart = m_pTextContentControl->GetStart();
978 sal_Int32 nEnd = *m_pTextContentControl->GetEnd();
988 std::unique_ptr<vcl::PDFWriter::AnyWidget> pDescriptor;
989 switch (pContentControl->GetType())
994 pDescriptor = std::make_unique<vcl::PDFWriter::EditWidget>();
999 pDescriptor = std::make_unique<vcl::PDFWriter::CheckBoxWidget>();
1001 pCheckBoxWidget->
Checked = pContentControl->GetChecked();
1002 pCheckBoxWidget->OnValue = pContentControl->GetCheckedState();
1003 pCheckBoxWidget->OffValue = pContentControl->GetUncheckedState();
1008 pDescriptor = std::make_unique<vcl::PDFWriter::ListBoxWidget>();
1011 for (
const auto& rItem : pContentControl->GetListItems())
1013 pListWidget->Entries.push_back(rItem.m_aDisplayText);
1019 pDescriptor = std::make_unique<vcl::PDFWriter::ComboBoxWidget>();
1021 for (
const auto& rItem : pContentControl->GetListItems())
1023 pComboWidget->
Entries.push_back(rItem.m_aDisplayText);
1029 pDescriptor = std::make_unique<vcl::PDFWriter::EditWidget>();
1035 pEditWidget->DateFormat = pContentControl->GetDateFormat().toAsciiLowerCase();
1054 if (!pContentControl->GetAlias().isEmpty())
1056 pDescriptor->Description = pContentControl->GetAlias();
1062 SwPaM aPam(aMark, aPoint);
1063 OUString aText = aPam.GetText();
1076 SwRect aStartRect, aEndRect;
1077 aLine.GetCharRect(&aStartRect, nViewStart);
1078 aLine.GetCharRect(&aEndRect, nViewEnd);
1088 aLocation = aStartRect;
1089 aLocation.
Union(aEndRect);
1090 pDescriptor->Location = aLocation.
SVRect();
1093 pPDFExtOutDevData->CreateControl(*pDescriptor);
1094 pPDFExtOutDevData->EndStructureElement();
1105 if (DescribePDFControl(rInf))
1121 assert(pCheckboxFm);
1123 ? OUString(
u"\u2612")
1124 : OUString(
u"\u2610");
1127 const IFieldmark::parameter_map_t*
const pParameters = pBM->GetParameters();
1128 sal_Int32 nCurrentIdx = 0;
1130 if(pResult != pParameters->end())
1131 pResult->second >>= nCurrentIdx;
1134 if (pListEntries != pParameters->end())
1136 uno::Sequence< OUString > vListEntries;
1137 pListEntries->second >>= vListEntries;
1138 if (nCurrentIdx < vListEntries.getLength())
1139 return vListEntries[nCurrentIdx];
1142 static constexpr OUStringLiteral vEnSpaces =
u"\u2002\u2002\u2002\u2002\u2002";
1154 else if (
GetFnt()->IsInputField() )
1171 assert(2 <= sal_Int32(nFieldLen));
1172 pPor =
new SwFieldPortion(aFieldName,
nullptr,
false, nFieldLen);
1183 else if (
GetFnt()->IsMeta())
1185 auto pMetaPor =
new SwMetaPortion;
1190 SwPaM aPam(aPosition);
1191 uno::Reference<text::XTextContent>
const xRet(
1197 static uno::Reference< uno::XComponentContext > xContext(
1198 ::comphelper::getProcessComponentContext());
1200 static uno::Reference< rdf::XURI > xODF_SHADING(
1201 rdf::URI::createKnown(xContext, rdf::URIs::LO_EXT_SHADING), uno::UNO_SET_THROW);
1203 uno::Reference<rdf::XDocumentMetadataAccess> xDocumentMetadataAccess(
1206 const css::uno::Reference<css::rdf::XResource> xSubject(xRet, uno::UNO_QUERY);
1207 const uno::Reference<rdf::XRepository>& xRepository =
1208 xDocumentMetadataAccess->getRDFRepository();
1209 const uno::Reference<container::XEnumeration> xEnum(
1210 xRepository->getStatements(xSubject, xODF_SHADING,
nullptr), uno::UNO_SET_THROW);
1212 while (xEnum->hasMoreElements())
1214 rdf::Statement stmt;
1215 if (!(xEnum->nextElement() >>= stmt)) {
1216 throw uno::RuntimeException();
1218 const uno::Reference<rdf::XLiteral> xObject(stmt.Object, uno::UNO_QUERY);
1219 if (!xObject.is())
continue;
1220 if (xEnum->hasMoreElements()) {
1221 SAL_INFO(
"sw.uno",
"ignoring other odf:shading statements");
1224 pMetaPor->SetShadowColor(rColor);
1230 else if (
GetFnt()->IsContentControl())
1241 pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr);
1244 pPor =
new SwContentControlPortion(pTextContentControl);
1256 if(pBM !=
nullptr && pBM->GetFieldname( ) ==
ODF_FORMDATE)
1273 OSL_ENSURE(pBM !=
nullptr,
"Where is my form field bookmark???");
1324 nNextChg =
std::min( nNextChg, nNextScript );
1328 nNextChg =
std::min( nNextChg, nNextDir );
1332 nNextChg =
std::min( nNextChg, nNextHidden );
1336 nNextChg =
std::min(nNextChg, nNextBookmark);
1460 "Rotated number portion trouble" );
1482 "Rotated number portion trouble" );
1522 if (!bookmark.empty())
1540 while( pPor && !bRet )
1563 ::std::optional<TextFrameIndex>
const oMovedFlyIndex)
1565 if (oMovedFlyIndex && *oMovedFlyIndex <= rInf.
GetIdx())
1567 SAL_WARN_IF(*oMovedFlyIndex != rInf.
GetIdx(),
"sw.core",
"stopping too late, no portion break at fly anchor?");
1576 OSL_ENSURE( rInf.
IsFull(),
"SwTextFormatter::NewPortion: underflow but not full" );
1635 if ( ::lcl_BuildHiddenPortion( rInf, nEnd ) )
1748 OSL_ENSURE( rInf.
X() >= pLastTabPortion->
GetFix(),
"Decimal tab stop position cannot be calculated" );
1749 const sal_uInt16 nWidthOfPortionsUpToDecimalPosition = o3tl::narrowing<sal_uInt16>(rInf.
X() - pLastTabPortion->
GetFix() );
1750 static_cast<SwTabDecimalPortion*
>(pLastTabPortion)->SetWidthOfPortionsUpToDecimalPosition( nWidthOfPortionsUpToDecimalPosition );
1783 if( !pPor || rInf.
IsStop() )
1790 assert(pPor &&
"can only reach here with pPor existing");
1801 if ( pTextFootnote )
1814 nDir = pItem->GetValue();
1859 OSL_ENSURE(
m_pCurr->
Height(),
"SwTextFormatter::NewPortion: limbo dance" );
1864 OSL_ENSURE(pPor->
Height(),
"SwTextFormatter::NewPortion: something went wrong");
1876 "SwTextFormatter::FormatLine( nStartPos ) with unswapped frame" );
1899 std::unique_ptr<SwFieldPortion> xSaveField;
1908 std::vector<tools::Long> flyStarts;
1919 flyStarts.push_back( nPOfst );
1921 nPOfst += pPor->
Width();
1966 else if(
GetInfo().IsDropInit() )
1981 SwTwips nTmpAscent, nTmpHeight;
2003 if (pPor->InNumberGrp())
2034 sal_uInt16 nSum = 0;
2039 nSum += pPor->
Width();
2048 if ( bOptimizeRepaint )
2070 if (
GetInfo().CompressLine() )
2075 if ( nRepaintOfst <
GetInfo().GetPaintOfst() )
2116 nLineHeight = nGridWidth + nRubyHeight;
2117 const sal_uInt16 nAmpRatio = (
m_pCurr->
Height() + nLineHeight - 1)/nLineHeight;
2118 nLineHeight *= nAmpRatio;
2139 nTmp *= nLineHeight;
2140 nLineHeight = nTmp / 100;
2160 case SvxLineSpaceRule::Auto:
2169 nTmp = nTmp ? 50 : 100;
2171 nTmp *= nLineHeight;
2176 sal_uInt16 nAsc = ( 4 * nLineHeight ) / 5;
2180 if( nAsc < pCurr->GetAscent() ||
2181 nLineHeight - nAsc < pCurr->Height() -
2182 pCurr->GetAscent() )
2183 pCurr->SetClipping(
true );
2191 case SvxLineSpaceRule::Min:
2197 case SvxLineSpaceRule::Fix:
2200 const sal_uInt16 nAsc = ( 4 * nLineHeight ) / 5;
2201 if( nAsc < m_pCurr->GetAscent() ||
2209 default: OSL_FAIL(
": unknown LineSpaceRule" );
2216 case SvxInterLineSpaceRule::Off:
2218 case SvxInterLineSpaceRule::Prop:
2224 nTmp = nTmp ? 50 : 100;
2230 nTmp += nLineHeight;
2236 case SvxInterLineSpaceRule::Fix:
2241 default: OSL_FAIL(
": unknown InterLineSpaceRule" );
2249 if ( aRectFnSet.
IsVert() )
2252 const sal_uInt16 nDiff = sal_uInt16( nTmpY %
RegDiff() );
2254 nLineHeight +=
RegDiff() - nDiff;
2314 if( nMin && ++nMin > nRet )
2318 if( nRet + nDist < nMin )
2322 nRet = nMin - nDist;
2354 if ( bOptimizeRepaint )
2358 case SvxAdjust::Block:
2361 bOptimizeRepaint =
false;
2366 if ( bOptimizeRepaint )
2371 bOptimizeRepaint = !pPos;
2376 case SvxAdjust::Center:
2377 case SvxAdjust::Right:
2378 bOptimizeRepaint =
false;
2395 return bOptimizeRepaint;
2401 "SwTextFormatter::CalcUnclipped with unswapped frame" );
2406 rBottom = rTop + nFlyDesc;
2414 "SwTextFormatter::UpdatePos with unswapped frame" );
2427 aTmpInf.
SetIdx( nStartIdx );
2428 aTmpInf.
SetPos( aStart );
2430 SwTwips nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
2445 aTmpInf.
X( aTmpInf.
X() - nAscent );
2448 aTmpInf.
X( aTmpInf.
X() + nAscent );
2454 aTmpInf.
Y( aTmpInf.
Y() + nAscent );
2458 aTmpInf.
Y( aTmpInf.
Y() + nAscent );
2466 && ( bAlways || !
IsQuick() ) )
2468 pCurrent->
MaxAscentDescent( nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc, pPos );
2472 if( !nFlyAsc && !nFlyDesc )
2474 nTmpAscent = nAscent;
2476 nTmpDescent = nTmpHeight - nAscent;
2477 nFlyDesc = nTmpDescent;
2479 static_cast<SwGrfNumPortion*
>(pPos)->SetBase( nTmpAscent, nTmpDescent,
2480 nFlyAsc, nFlyDesc );
2489 aBase, nTmpAscent, nTmpDescent, nFlyAsc,
2495 OSL_ENSURE( !
GetMulti(),
"Too much multi" );
2498 Point aSt( aTmpInf.
X(), aStart.Y() );
2502 OSL_ENSURE(
GetMulti()->IsDouble(),
"Brackets only for doubles");
2505 else if(
GetMulti()->HasRotation() )
2515 aSt.AdjustX(pLay->
Width() );
2520 UpdatePos( pLay, aSt, nStIdx, bAlways );
2521 nStIdx = nStIdx + pLay->
GetLen();
2522 aSt.AdjustY(pLay->
Height() );
2527 pPos->
Move( aTmpInf );
2535 "SwTextFormatter::AlignFlyInCntBase with unswapped frame" );
2549 SwTwips nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
2558 static_cast<SwGrfNumPortion*
>(pPos)->SetBase( nTmpAscent, nTmpDescent,
2559 nFlyAsc, nFlyDesc );
2572 nFlyAsc, nFlyDesc, nFlags );
2581 OSL_ENSURE( rInf.
GetTextFly().
IsOn(),
"SwTextFormatter::ChkFlyUnderflow: why?" );
2589 SwRect aLineVert( aLine );
2697 nHeight = pLast->
Height();
2710 + nLeftMar - nLeftMin , nHeight );
2720 if( nUpper > 0 && nTop >= nUpper )
2723 SwRect aLineVert( aLine );
2750 aLine.
Left( rInf.
X() + nLeftMar );
2751 bool bForced =
false;
2752 if( aInter.
Left() <= nLeftMin )
2757 if( aInter.
Left() < nFrameLeft )
2758 aInter.
Left(nFrameLeft);
2768 nAddMar = nLeftMar - nFrameLeft;
2781 const bool bFullLine = aLine.
Left() == aInter.
Left() &&
2794 aInter.
Pos().AdjustX( -nLeftMar );
2824 if( nNextTop > aInter.
Bottom() )
2830 if( nAscent < pFly->
Height() )
2846 if( nAscent < pFly->
Height() )
2872 const sal_uInt16 nGridWidth =
GetGridWidth(*pGrid, rDoc);
2875 if ( aRectFnSet.
IsVert() )
2877 Point aPoint( nStartX, 0 );
2879 nStartX = aPoint.Y();
2882 const SwTwips nOfst = nStartX - nGridOrigin;
2885 const SwTwips i = nTmpWidth / nGridWidth + 1;
2887 const SwTwips nNewWidth = (
i - 1 ) * nGridWidth - nOfst;
2888 if ( nNewWidth > 0 )
2889 rInf.
Width( nNewWidth );
2907 pFly =
static_cast<SwTextFlyCnt*
>(pHint)->GetFlyFrame(pFrame);
2915 SwTwips nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
2931 0 != ( bTextFrameVertical ?
2935 if ( bUseFlyAscent )
2936 nAscent =
std::abs(
int( bTextFrameVertical ?
2947 else if( nAscent > nFlyAsc )
2959 Point aTmpBase( aBase );
2983 nTmpDescent, nFlyAsc, nFlyDesc, nMode );
3046 if( bSeek &&
GetFnt()->HasBorder() && ::lcl_HasSameBorder(aCurFont, *
GetFnt()) && !bDisconnect )
3064 sal_uInt16 nMaxAscent = 0;
3065 sal_uInt16 nMaxHeight = 0;
3066 bool bReachCurrent =
false;
3069 if( nMaxHeight < pActPor->
Height() )
3070 nMaxHeight = pActPor->
Height();
3071 if( nMaxAscent < pActPor->GetAscent() )
3075 if( !pActPor && !bReachCurrent )
3077 pActPor = &rPortion;
3078 bReachCurrent =
true;
3084 bReachCurrent =
false;
3087 if( nMaxHeight > pActPor->
Height() )
3088 pActPor->
Height(nMaxHeight);
3093 if( !pActPor && !bReachCurrent )
3095 pActPor = &rPortion;
3096 bReachCurrent =
true;
3110 const std::vector<tools::Long> &rFlyStarts )
3122 if ( rFlyStarts.empty() && ! rCurr.
IsFly() )
3140 if (nReformat > txtFormatInfo.
GetLineStart() + nMaxContext)
3141 nReformat = nReformat - nMaxContext;
3157 OSL_ENSURE( nReformat < txtFormatInfo.
GetIdx(),
"Reformat too small for me!" );
3162 bool bOldMulti = txtFormatInfo.
IsMulti();
3164 txtFormatInfo.
SetMulti( bOldMulti );
3166 return nFormatRepaint ?
std::min( aRect.
Left(), nFormatRepaint ) :
3186 if (nCnt < rFlyStarts.size() &&
3187 nX == rFlyStarts[ nCnt ] &&
3191 nPOfst = nX + pPor->
Width();
3197 nX = nX + pPor->
Width();
3198 nIdx = nIdx + pPor->
GetLen();
3213 if (bShowInDocView || bShowForPrinting)
3229 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 * getInnerFieldmarkFor(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.
Flys that are anchored as a character in the content.
const Point & GetRefPoint() const
Point const & GetRelPos() const
To take Asian or other languages into consideration, an SwFont object consists of 3 SwSubFonts (Latin...
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.
bool HasNonLastSplitFlyDrawObj() const
This text frame may have a split fly frames anchored to it.
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(162)
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