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 ) &&
539 nLstHeight && rInf.
X() + nLstHeight <= rInf.
Width() &&
559 else if ( bHasGrid && ! pGridKernPortion && !
m_pMulti && ! pPor->
InTabGrp() )
577 if ( aRectFnSet.
IsVert() )
579 Point aPoint( nStartX, 0 );
581 nStartX = aPoint.
Y();
584 const SwTwips nOfst = nStartX - nGridOrigin;
588 ( ( nOfst - 1 ) / nGridWidth + 1 ) :
590 const SwTwips nKernWidth =
i * nGridWidth - nOfst;
593 if ( nKernWidth <= nRestWidth )
594 pGridKernPortion->
Width( nKernWidth );
597 if ( pGridKernPortion != pPor )
608 bFull = pPor->
Format( rInf );
692 if ( rInf.
X() + pPor->
Width() + nDist <= rInf.
Width() )
702 if ( bHasGrid && pPor != pGridKernPortion && !
m_pMulti && ! pPor->
InTabGrp() )
720 OSL_ENSURE( pGridKernPortion,
"No GridKernPortion available" );
724 sal_uInt16 nSumWidth = pPor->
Width();
727 nSumWidth = nSumWidth + pTmpPor->
Width();
732 ( nSumWidth - 1 ) / nGridWidth + 1 :
734 const SwTwips nTmpWidth =
i * nGridWidth;
735 const SwTwips nKernWidth =
std::min(nTmpWidth - nSumWidth, nRestWidth);
739 OSL_ENSURE( nKernWidth <= nRestWidth,
740 "Not enough space left for adjusting non-asian text in grid mode" );
743 pGridKernPortion->
Width( pGridKernPortion->
Width() + nKernWidth_1 );
744 rInf.
X( rInf.
X() + nKernWidth_1 );
747 if ( ! bFull && nKernWidth - nKernWidth_1 > 0 )
748 new SwKernPortion( *pPor,
static_cast<short>(nKernWidth - nKernWidth_1),
751 pGridKernPortion =
nullptr;
755 pPor->
InFieldGrp() || nCurrScript != nNextScript )
757 pGridKernPortion =
nullptr;
861 if( !rInf.
GetText().isEmpty() )
883 if( bChg || bFirstPor || !pPor->
GetAscent()
912 Color m_aShadowColor;
916 void SetShadowColor(
const Color& rCol ) { m_aShadowColor = rCol; }
938 COL_BLACK == m_aShadowColor
947 : m_pTextContentControl(pTextContentControl)
952bool SwContentControlPortion::DescribePDFControl(
const SwTextPaintInfo& rInf)
const
955 if (!pPDFExtOutDevData)
960 if (!pPDFExtOutDevData->GetIsExportFormFields())
965 if (!m_pTextContentControl)
971 const std::shared_ptr<SwContentControl>& pContentControl = rFormatContentControl.
GetContentControl();
972 if (!pContentControl)
979 sal_Int32 nStart = m_pTextContentControl->GetStart();
980 sal_Int32 nEnd = *m_pTextContentControl->GetEnd();
990 const SwPaM aPam(*pTextNode, nEnd, *pTextNode, nStart);
997 std::unique_ptr<vcl::PDFWriter::AnyWidget> pDescriptor;
998 switch (pContentControl->GetType())
1003 pDescriptor = std::make_unique<vcl::PDFWriter::EditWidget>();
1008 pDescriptor = std::make_unique<vcl::PDFWriter::CheckBoxWidget>();
1010 pCheckBoxWidget->
Checked = pContentControl->GetChecked();
1011 pCheckBoxWidget->OnValue = pContentControl->GetCheckedState();
1012 pCheckBoxWidget->OffValue = pContentControl->GetUncheckedState();
1017 pDescriptor = std::make_unique<vcl::PDFWriter::ListBoxWidget>();
1021 for (
const auto& rItem : pContentControl->GetListItems())
1023 pListWidget->Entries.push_back(rItem.m_aDisplayText);
1024 if (rItem.m_aDisplayText == aText)
1025 pListWidget->SelectedEntries.push_back(nIndex);
1032 pDescriptor = std::make_unique<vcl::PDFWriter::ComboBoxWidget>();
1034 for (
const auto& rItem : pContentControl->GetListItems())
1036 pComboWidget->
Entries.push_back(rItem.m_aDisplayText);
1042 pDescriptor = std::make_unique<vcl::PDFWriter::EditWidget>();
1048 pEditWidget->DateFormat = pContentControl->GetDateFormat().toAsciiLowerCase();
1067 if (!pContentControl->GetAlias().isEmpty())
1069 pDescriptor->Description = pContentControl->GetAlias();
1073 pDescriptor->Text = aText;
1081 SwRect aStartRect, aEndRect;
1082 aLine.GetCharRect(&aStartRect, nViewStart);
1083 aLine.GetCharRect(&aEndRect, nViewEnd);
1093 aLocation = aStartRect;
1094 aLocation.
Union(aEndRect);
1095 pDescriptor->Location = aLocation.
SVRect();
1098 pPDFExtOutDevData->CreateControl(*pDescriptor);
1099 pPDFExtOutDevData->EndStructureElement();
1110 if (DescribePDFControl(rInf))
1126 assert(pCheckboxFm);
1128 ? OUString(
u"\u2612")
1129 : OUString(
u"\u2610");
1132 const IFieldmark::parameter_map_t*
const pParameters = pBM->GetParameters();
1133 sal_Int32 nCurrentIdx = 0;
1135 if(pResult != pParameters->end())
1136 pResult->second >>= nCurrentIdx;
1139 if (pListEntries != pParameters->end())
1141 uno::Sequence< OUString > vListEntries;
1142 pListEntries->second >>= vListEntries;
1143 if (nCurrentIdx < vListEntries.getLength())
1144 return vListEntries[nCurrentIdx];
1147 static constexpr OUStringLiteral vEnSpaces =
u"\u2002\u2002\u2002\u2002\u2002";
1159 else if (
GetFnt()->IsInputField() )
1176 assert(2 <= sal_Int32(nFieldLen));
1177 pPor =
new SwFieldPortion(aFieldName,
nullptr,
false, nFieldLen);
1188 else if (
GetFnt()->IsMeta())
1190 auto pMetaPor =
new SwMetaPortion;
1195 SwPaM aPam(aPosition);
1196 uno::Reference<text::XTextContent>
const xRet(
1202 static uno::Reference< uno::XComponentContext > xContext(
1203 ::comphelper::getProcessComponentContext());
1205 static uno::Reference< rdf::XURI > xODF_SHADING(
1206 rdf::URI::createKnown(xContext, rdf::URIs::LO_EXT_SHADING), uno::UNO_SET_THROW);
1208 uno::Reference<rdf::XDocumentMetadataAccess> xDocumentMetadataAccess(
1211 const css::uno::Reference<css::rdf::XResource> xSubject(xRet, uno::UNO_QUERY);
1212 const uno::Reference<rdf::XRepository>& xRepository =
1213 xDocumentMetadataAccess->getRDFRepository();
1214 const uno::Reference<container::XEnumeration> xEnum(
1215 xRepository->getStatements(xSubject, xODF_SHADING,
nullptr), uno::UNO_SET_THROW);
1217 while (xEnum->hasMoreElements())
1219 rdf::Statement stmt;
1220 if (!(xEnum->nextElement() >>= stmt)) {
1221 throw uno::RuntimeException();
1223 const uno::Reference<rdf::XLiteral> xObject(stmt.Object, uno::UNO_QUERY);
1224 if (!xObject.is())
continue;
1225 if (xEnum->hasMoreElements()) {
1226 SAL_INFO(
"sw.uno",
"ignoring other odf:shading statements");
1229 pMetaPor->SetShadowColor(rColor);
1235 else if (
GetFnt()->IsContentControl())
1246 pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr);
1249 pPor =
new SwContentControlPortion(pTextContentControl);
1261 if(pBM !=
nullptr && pBM->GetFieldname( ) ==
ODF_FORMDATE)
1278 OSL_ENSURE(pBM !=
nullptr,
"Where is my form field bookmark???");
1329 nNextChg =
std::min( nNextChg, nNextScript );
1333 nNextChg =
std::min( nNextChg, nNextDir );
1337 nNextChg =
std::min( nNextChg, nNextHidden );
1341 nNextChg =
std::min(nNextChg, nNextBookmark);
1465 "Rotated number portion trouble" );
1487 "Rotated number portion trouble" );
1527 if (!bookmark.empty())
1545 while( pPor && !bRet )
1568 ::std::optional<TextFrameIndex>
const oMovedFlyIndex)
1570 if (oMovedFlyIndex && *oMovedFlyIndex <= rInf.
GetIdx())
1572 SAL_WARN_IF(*oMovedFlyIndex != rInf.
GetIdx(),
"sw.core",
"stopping too late, no portion break at fly anchor?");
1581 OSL_ENSURE( rInf.
IsFull(),
"SwTextFormatter::NewPortion: underflow but not full" );
1640 if ( ::lcl_BuildHiddenPortion( rInf, nEnd ) )
1753 OSL_ENSURE( rInf.
X() >= pLastTabPortion->
GetFix(),
"Decimal tab stop position cannot be calculated" );
1754 const sal_uInt16 nWidthOfPortionsUpToDecimalPosition = o3tl::narrowing<sal_uInt16>(rInf.
X() - pLastTabPortion->
GetFix() );
1755 static_cast<SwTabDecimalPortion*
>(pLastTabPortion)->SetWidthOfPortionsUpToDecimalPosition( nWidthOfPortionsUpToDecimalPosition );
1788 if( !pPor || rInf.
IsStop() )
1795 assert(pPor &&
"can only reach here with pPor existing");
1806 if ( pTextFootnote )
1819 nDir = pItem->GetValue();
1864 OSL_ENSURE(
m_pCurr->
Height(),
"SwTextFormatter::NewPortion: limbo dance" );
1869 OSL_ENSURE(pPor->
Height(),
"SwTextFormatter::NewPortion: something went wrong");
1881 "SwTextFormatter::FormatLine( nStartPos ) with unswapped frame" );
1904 std::unique_ptr<SwFieldPortion> xSaveField;
1913 std::vector<tools::Long> flyStarts;
1924 flyStarts.push_back( nPOfst );
1926 nPOfst += pPor->
Width();
1971 else if(
GetInfo().IsDropInit() )
1986 SwTwips nTmpAscent, nTmpHeight;
2008 if (pPor->InNumberGrp())
2039 sal_uInt16 nSum = 0;
2044 nSum += pPor->
Width();
2053 if ( bOptimizeRepaint )
2075 if (
GetInfo().CompressLine() )
2080 if ( nRepaintOfst <
GetInfo().GetPaintOfst() )
2121 nLineHeight = nGridWidth + nRubyHeight;
2122 const sal_uInt16 nAmpRatio = (
m_pCurr->
Height() + nLineHeight - 1)/nLineHeight;
2123 nLineHeight *= nAmpRatio;
2144 nTmp *= nLineHeight;
2145 nLineHeight = nTmp / 100;
2165 case SvxLineSpaceRule::Auto:
2174 nTmp = nTmp ? 50 : 100;
2176 nTmp *= nLineHeight;
2181 sal_uInt16 nAsc = ( 4 * nLineHeight ) / 5;
2185 if( nAsc < pCurr->GetAscent() ||
2186 nLineHeight - nAsc < pCurr->Height() -
2187 pCurr->GetAscent() )
2188 pCurr->SetClipping(
true );
2196 case SvxLineSpaceRule::Min:
2202 case SvxLineSpaceRule::Fix:
2205 const sal_uInt16 nAsc = ( 4 * nLineHeight ) / 5;
2206 if( nAsc < m_pCurr->GetAscent() ||
2214 default: OSL_FAIL(
": unknown LineSpaceRule" );
2221 case SvxInterLineSpaceRule::Off:
2223 case SvxInterLineSpaceRule::Prop:
2229 nTmp = nTmp ? 50 : 100;
2235 nTmp += nLineHeight;
2241 case SvxInterLineSpaceRule::Fix:
2246 default: OSL_FAIL(
": unknown InterLineSpaceRule" );
2254 if ( aRectFnSet.
IsVert() )
2257 const sal_uInt16 nDiff = sal_uInt16( nTmpY %
RegDiff() );
2259 nLineHeight +=
RegDiff() - nDiff;
2319 if( nMin && ++nMin > nRet )
2323 if( nRet + nDist < nMin )
2327 nRet = nMin - nDist;
2359 if ( bOptimizeRepaint )
2363 case SvxAdjust::Block:
2366 bOptimizeRepaint =
false;
2371 if ( bOptimizeRepaint )
2376 bOptimizeRepaint = !pPos;
2381 case SvxAdjust::Center:
2382 case SvxAdjust::Right:
2383 bOptimizeRepaint =
false;
2400 return bOptimizeRepaint;
2406 "SwTextFormatter::CalcUnclipped with unswapped frame" );
2411 rBottom = rTop + nFlyDesc;
2419 "SwTextFormatter::UpdatePos with unswapped frame" );
2432 aTmpInf.
SetIdx( nStartIdx );
2433 aTmpInf.
SetPos( aStart );
2435 SwTwips nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
2450 aTmpInf.
X( aTmpInf.
X() - nAscent );
2453 aTmpInf.
X( aTmpInf.
X() + nAscent );
2459 aTmpInf.
Y( aTmpInf.
Y() + nAscent );
2463 aTmpInf.
Y( aTmpInf.
Y() + nAscent );
2471 && ( bAlways || !
IsQuick() ) )
2473 pCurrent->
MaxAscentDescent( nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc, pPos );
2477 if( !nFlyAsc && !nFlyDesc )
2479 nTmpAscent = nAscent;
2481 nTmpDescent = nTmpHeight - nAscent;
2482 nFlyDesc = nTmpDescent;
2484 static_cast<SwGrfNumPortion*
>(pPos)->SetBase( nTmpAscent, nTmpDescent,
2485 nFlyAsc, nFlyDesc );
2494 aBase, nTmpAscent, nTmpDescent, nFlyAsc,
2500 OSL_ENSURE( !
GetMulti(),
"Too much multi" );
2503 Point aSt( aTmpInf.
X(), aStart.
Y() );
2507 OSL_ENSURE(
GetMulti()->IsDouble(),
"Brackets only for doubles");
2510 else if(
GetMulti()->HasRotation() )
2525 UpdatePos( pLay, aSt, nStIdx, bAlways );
2526 nStIdx = nStIdx + pLay->
GetLen();
2532 pPos->
Move( aTmpInf );
2540 "SwTextFormatter::AlignFlyInCntBase with unswapped frame" );
2554 SwTwips nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
2563 static_cast<SwGrfNumPortion*
>(pPos)->SetBase( nTmpAscent, nTmpDescent,
2564 nFlyAsc, nFlyDesc );
2577 nFlyAsc, nFlyDesc, nFlags );
2586 OSL_ENSURE( rInf.
GetTextFly().
IsOn(),
"SwTextFormatter::ChkFlyUnderflow: why?" );
2594 SwRect aLineVert( aLine );
2702 nHeight = pLast->
Height();
2715 + nLeftMar - nLeftMin , nHeight );
2727 nUpper -=
m_pFrame->GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid();
2729 if( nUpper > 0 && nTop >= nUpper )
2745 SwRect aLineVert( aLine );
2772 aLine.
Left( rInf.
X() + nLeftMar );
2773 bool bForced =
false;
2774 if( aInter.
Left() <= nLeftMin )
2779 if( aInter.
Left() < nFrameLeft )
2780 aInter.
Left(nFrameLeft);
2790 nAddMar = nLeftMar - nFrameLeft;
2803 bool bFullLine = aLine.
Left() == aInter.
Left() &&
2805 if (!bFullLine && bWordFlyWrap && !
GetTextFrame()->IsInTab())
2823 aInter.
Pos().AdjustX( -nLeftMar );
2853 if( nNextTop > aInter.
Bottom() )
2859 if( nAscent < pFly->
Height() )
2875 if( nAscent < pFly->
Height() )
2901 const sal_uInt16 nGridWidth =
GetGridWidth(*pGrid, rDoc);
2904 if ( aRectFnSet.
IsVert() )
2906 Point aPoint( nStartX, 0 );
2908 nStartX = aPoint.
Y();
2911 const SwTwips nOfst = nStartX - nGridOrigin;
2914 const SwTwips i = nTmpWidth / nGridWidth + 1;
2916 const SwTwips nNewWidth = (
i - 1 ) * nGridWidth - nOfst;
2917 if ( nNewWidth > 0 )
2918 rInf.
Width( nNewWidth );
2936 pFly =
static_cast<SwTextFlyCnt*
>(pHint)->GetFlyFrame(pFrame);
2944 SwTwips nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
2960 0 != ( bTextFrameVertical ?
2964 if ( bUseFlyAscent )
2965 nAscent =
std::abs(
int( bTextFrameVertical ?
2976 else if( nAscent > nFlyAsc )
2988 Point aTmpBase( aBase );
3012 nTmpDescent, nFlyAsc, nFlyDesc, nMode );
3075 if( bSeek &&
GetFnt()->HasBorder() && ::lcl_HasSameBorder(aCurFont, *
GetFnt()) && !bDisconnect )
3093 sal_uInt16 nMaxAscent = 0;
3094 sal_uInt16 nMaxHeight = 0;
3095 bool bReachCurrent =
false;
3098 if( nMaxHeight < pActPor->
Height() )
3099 nMaxHeight = pActPor->
Height();
3100 if( nMaxAscent < pActPor->GetAscent() )
3104 if( !pActPor && !bReachCurrent )
3106 pActPor = &rPortion;
3107 bReachCurrent =
true;
3113 bReachCurrent =
false;
3116 if( nMaxHeight > pActPor->
Height() )
3117 pActPor->
Height(nMaxHeight);
3122 if( !pActPor && !bReachCurrent )
3124 pActPor = &rPortion;
3125 bReachCurrent =
true;
3139 const std::vector<tools::Long> &rFlyStarts )
3151 if ( rFlyStarts.empty() && ! rCurr.
IsFly() )
3169 if (nReformat > txtFormatInfo.
GetLineStart() + nMaxContext)
3170 nReformat = nReformat - nMaxContext;
3186 OSL_ENSURE( nReformat < txtFormatInfo.
GetIdx(),
"Reformat too small for me!" );
3191 bool bOldMulti = txtFormatInfo.
IsMulti();
3193 txtFormatInfo.
SetMulti( bOldMulti );
3195 return nFormatRepaint ?
std::min( aRect.
Left(), nFormatRepaint ) :
3215 if (nCnt < rFlyStarts.size() &&
3216 nX == rFlyStarts[ nCnt ] &&
3220 nPOfst = nX + pPor->
Width();
3226 nX = nX + pPor->
Width();
3227 nIdx = nIdx + pPor->
GetLen();
3242 if (bShowInDocView || bShowForPrinting)
3258 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
constexpr tools::Long Y() const
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() 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)
void AddBottom(const tools::Long nAdd)
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?
SwTwips GetLowerMarginForFlyIntersect() const
Get the amount of lower margin of this frame we need to consider for fly portion purposes.
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