20#include <com/sun/star/linguistic2/XHyphenator.hpp>
72#include <com/sun/star/text/XTextRange.hpp>
78#include <com/sun/star/awt/FontSlant.hpp>
85#define CHAR_UNDERSCORE u'_'
86#define CHAR_LEFT_ARROW u'\x25C0'
87#define CHAR_RIGHT_ARROW u'\x25B6'
88#define CHAR_TAB u'\x2192'
89#define CHAR_TAB_RTL u'\x2190'
90#define CHAR_LINEBREAK u'\x21B5'
91#define CHAR_LINEBREAK_RTL u'\x21B3'
93#define DRAW_SPECIAL_OPTIONS_CENTER 1
94#define DRAW_SPECIAL_OPTIONS_ROTATE 2
97 : m_pSpace( nullptr ),
100 m_bListTabStopIncluded( false ),
101 m_nListTabStopPosition( 0 )
119 SvxTabAdjust::Left );
123 for ( sal_uInt16
i = 0;
i <
m_oRuler->Count();
i++ )
126 (*
m_oRuler)[
i].GetAdjustment() == SvxTabAdjust::Default )
137 for ( sal_uInt16
i = 0;
i <
m_oRuler->Count();
i++ )
140 (*
m_oRuler)[
i].GetAdjustment() == SvxTabAdjust::Default )
159 SAL_WARN(
"sw.core",
"+SwTextInfo::CTOR: missing paragraph information");
166 : m_pPara( const_cast<
SwTextInfo&>(rInf).GetParaPortion() )
167 , m_nTextStart( rInf.GetTextStart() )
170#if OSL_DEBUG_LEVEL > 0
179 OSL_ENSURE(
pOut && pRef,
"ChkOutDev: invalid output devices" );
193: m_pKanaComp(nullptr)
198, m_pUnderFnt(nullptr)
209, m_bStopUnderflow(false)
210, m_bFootnoteInside(false)
211, m_bOtherThanFootnoteInside(false)
213, m_bFirstMulti(false)
216, m_bScriptSpace(false)
217, m_bForbiddenChars(false)
218, m_bSnapToGrid(false)
224 m_pKanaComp(rNew.GetpKanaComp()),
229 m_pUnderFnt(rNew.GetUnderFnt()),
230 m_pFrame(rNew.m_pFrame),
231 m_pOpt(&rNew.GetOpt()),
232 m_pText(&rNew.GetText()),
233 m_nIdx(rNew.GetIdx()),
235 m_nMeasureLen(rNew.GetMeasureLen()),
236 m_nKanaIdx( rNew.GetKanaIdx() ),
237 m_bOnWin( rNew.OnWin() ),
238 m_bNotEOL( rNew.NotEOL() ),
239 m_bURLNotify( rNew.URLNotify() ),
240 m_bStopUnderflow( rNew.StopUnderflow() ),
241 m_bFootnoteInside( rNew.IsFootnoteInside() ),
242 m_bOtherThanFootnoteInside( rNew.IsOtherThanFootnoteInside() ),
243 m_bMulti( rNew.IsMulti() ),
244 m_bFirstMulti( rNew.IsFirstMulti() ),
245 m_bRuby( rNew.IsRuby() ),
246 m_bHanging( rNew.IsHanging() ),
247 m_bScriptSpace( rNew.HasScriptSpace() ),
248 m_bForbiddenChars( rNew.HasForbiddenChars() ),
252#if OSL_DEBUG_LEVEL > 0
288#if OSL_DEBUG_LEVEL > 0
336 m_pKanaComp(rNew.GetpKanaComp()),
341 m_pUnderFnt(rNew.GetUnderFnt()),
342 m_pFrame( rNew.m_pFrame ),
343 m_pOpt(&rNew.GetOpt()),
348 m_nKanaIdx( rNew.GetKanaIdx() ),
349 m_bOnWin( rNew.OnWin() ),
350 m_bNotEOL( rNew.NotEOL() ),
351 m_bURLNotify( rNew.URLNotify() ),
352 m_bStopUnderflow( rNew.StopUnderflow() ),
353 m_bFootnoteInside( rNew.IsFootnoteInside() ),
354 m_bOtherThanFootnoteInside( rNew.IsOtherThanFootnoteInside() ),
355 m_bMulti( rNew.IsMulti() ),
356 m_bFirstMulti( rNew.IsFirstMulti() ),
357 m_bRuby( rNew.IsRuby() ),
358 m_bHanging( rNew.IsHanging() ),
359 m_bScriptSpace( rNew.HasScriptSpace() ),
360 m_bForbiddenChars( rNew.HasForbiddenChars() ),
364#if OSL_DEBUG_LEVEL > 0
392 "SwTextSizeInfo::NoteAnimation() changed m_pOut" );
397 const OUString& rText,
433 sal_uInt16& nMinSize, sal_uInt16& nMaxSizeDiff,
443 nMaxSizeDiff = o3tl::narrowing<sal_uInt16>(aDrawInf.
GetKanaDiff());
444 nMinSize = aSize.
Width();
449 const sal_uInt16 nComp,
455 OSL_ENSURE(
m_pRef ==
m_pOut,
"GetTextBreak is supposed to use the RefDev" );
469 const sal_uInt16 nComp,
476 OSL_ENSURE(
m_pRef ==
m_pOut,
"GetTextBreak is supposed to use the RefDev" );
491 return pos.first->GetTextAttrForCharAt(
pos.second);
509 , m_pWrongList( rInf.GetpWrongList() )
510 , m_pGrammarCheckList( rInf.GetGrammarCheckList() )
511 , m_pSmartTags( rInf.GetSmartTags() )
512 , m_pSpaceAdd( rInf.GetpSpaceAdd() ),
513 m_pBrushItem( rInf.GetBrushItem() ),
514 m_aTextFly( rInf.GetTextFly() ),
515 m_aPos( rInf.GetPos() ),
516 m_aPaintRect( rInf.GetPaintRect() ),
517 m_nSpaceIdx( rInf.GetSpaceIdx() )
522 , m_pWrongList( rInf.GetpWrongList() )
523 , m_pGrammarCheckList( rInf.GetGrammarCheckList() )
524 , m_pSmartTags( rInf.GetSmartTags() )
525 , m_pSpaceAdd( rInf.GetpSpaceAdd() ),
526 m_pBrushItem( rInf.GetBrushItem() ),
527 m_aTextFly( rInf.GetTextFly() ),
528 m_aPos( rInf.GetPos() ),
529 m_aPaintRect( rInf.GetPaintRect() ),
530 m_nSpaceIdx( rInf.GetSpaceIdx() )
544class SwTransparentTextGuard
556 ~SwTransparentTextGuard();
559SwTransparentTextGuard::SwTransparentTextGuard(
const SwLinePortion& rPor,
561 : m_aNewMapMode(rPaintInf.GetOut()->GetMapMode())
562 , m_rPaintInf(rPaintInf)
563 , m_rDrawInf(rDrawInf)
565 rPaintInf.
CalcRect(rPor, &m_aPorRect);
566 rDrawInf.
SetOut(*m_aContentVDev);
568 m_aContentMetafile.Record(m_aContentVDev.get());
577SwTransparentTextGuard::~SwTransparentTextGuard()
579 m_aContentMetafile.Stop();
580 m_aContentMetafile.WindStart();
581 m_aNewMapMode.SetOrigin(m_aPorRect.TopLeft());
582 m_aContentMetafile.SetPrefMapMode(m_aNewMapMode);
583 m_aContentMetafile.SetPrefSize(m_aPorRect.SSize());
584 m_rDrawInf.SetOut(*m_rPaintInf.GetOut());
586 sal_uInt8 nTransPercentVcl = 255 - m_rPaintInf.GetFont()->GetColor().GetAlpha();
587 const Color aTransColor(nTransPercentVcl, nTransPercentVcl, nTransPercentVcl);
588 aVCLGradient.
SetStyle(css::awt::GradientStyle_LINEAR);
598 m_rPaintInf.GetOut()->DrawTransparent(m_aContentMetafile, m_aPorRect.TopLeft(),
599 m_aPorRect.SSize(), aVCLGradient);
605 const bool bKern,
const bool bWrong,
606 const bool bSmartTag,
607 const bool bGrammarCheck )
619 sal_uInt16 nComp = 0;
623 bool bCfgIsAutoGrammar =
false;
632 rPor.
Width(), bBullet );
670 aFontPos.AdjustX( -nLeftBorderSpace );
677 aFontPos.AdjustX(nLeftBorderSpace );
680 aFontPos.AdjustY( -nLeftBorderSpace );
683 aFontPos.AdjustX( -nLeftBorderSpace );
686 aFontPos.AdjustY(nLeftBorderSpace );
690 if( aFontPos.X() < 0 )
692 if( aFontPos.Y() < 0 )
697 std::unique_ptr<SwTransparentTextGuard, o3tl::default_delete<SwTransparentTextGuard>> pTransparentText;
700 pTransparentText.reset(
new SwTransparentTextGuard(rPor, *
this, aDrawInf));
707 const Point aPoint( aFontPos.X(), aFontPos.Y() - rPor.
GetAscent() );
709 aDrawInf.
SetPos( aPoint );
720 aDrawInf.
SetPos( aFontPos );
735 const bool bInsideBox )
const
758 aPoint.setY(
Y() - aSize.
Height() );
781 aPoint.AdjustX( -(aSize.
Width()) );
783 SwRect aRect( aPoint, aSize );
793 const bool bJoinWithPrev =
794 static_cast<const SwTextPortion&
>(rPor).GetJoinBorderWithPrev();
795 const bool bJoinWithNext =
796 static_cast<const SwTextPortion&
>(rPor).GetJoinBorderWithNext();
799 aRect.
AddTop(
GetFont()->CalcShadowSpace(SvxShadowItemSide::TOP, bIsVert, bIsVertLRBT,
800 bJoinWithPrev, bJoinWithNext));
801 aRect.
AddBottom( -
GetFont()->CalcShadowSpace(SvxShadowItemSide::BOTTOM, bIsVert, bIsVertLRBT,
802 bJoinWithPrev, bJoinWithNext));
803 aRect.
AddLeft(
GetFont()->CalcShadowSpace(SvxShadowItemSide::LEFT, bIsVert, bIsVertLRBT,
804 bJoinWithPrev, bJoinWithNext));
805 aRect.
AddRight( -
GetFont()->CalcShadowSpace(SvxShadowItemSide::RIGHT, bIsVert, bIsVertLRBT,
806 bJoinWithPrev, bJoinWithNext));
812 if( aRect.
HasArea() && pIntersect )
816 if (
GetOut()->IsClipRegion() )
818 SwRect aClip(
GetOut()->GetClipRegion().GetBoundRect() );
852 static SwFont s_aFnt = [&]()
875 rNonConstTextPaintInfo.
SetFont( &s_aFnt );
880 if (nDir == 900_deg10 || nDir == 2700_deg10)
881 nMaxWidth = rRect.
Height();
884 assert(nDir == 0_deg10);
885 nMaxWidth = rRect.
Width();
889 const OUString aTmp( cChar );
891 while ( aFontSize.
Width() > nMaxWidth )
893 SwTwips nFactor = ( 100 * aFontSize.
Width() ) / nMaxWidth;
904 s_aFnt.
SetSize( aFontSize, nAct );
908 if ( aFontSize.
Width() >= nOldWidth )
917 switch ( nDir.
get() )
921 nX += ( rRect.
Width() - aFontSize.
Width() ) / 2;
936 Point aTmpPos( nX, nY );
937 rNonConstTextPaintInfo.
SetPos( aTmpPos );
938 sal_uInt16 nOldWidth = rPor.
Width();
940 rTextPaintInfo.
DrawText( aTmp, rPor );
942 rNonConstTextPaintInfo.
SetFont(
const_cast<SwFont*
>(pOldFnt) );
943 rNonConstTextPaintInfo.
SetPos( aOldPos );
948 if (
OnWin() || !bRetouche )
952 DrawFlyRect(
m_pOut, rRect );
983 const auto& rBreakPortion =
static_cast<const SwBreakPortion&
>(rPor);
987 sal_uInt16 nOldWidth = rPor.
Width();
1030 aRect.
Pos().AdjustX(20 );
1039 aRect.
Pos().AdjustY( -(aRect.
Height() + 20) );
1040 aRect.
Pos().AdjustX( -(aRect.
Width() + 20) );
1072 aTmp.setY(
m_aPos.Y() - nFontAscent );
1077 aTmp.setX(
m_aPos.X() - nFontAscent );
1083 aTmp.setX(
m_aPos.X() - nFontHeight +
1089 SwRect aTmpRect( aTmp, aSize );
1109 !
GetOpt().IsPagePreview())
1114 pOut->SetLineColor();
1134 OSL_ENSURE(
OnWin(),
"SwTextPaintInfo::DrawBackground: printer pollution ?" );
1137 CalcRect( rPor,
nullptr, &aIntersect,
true );
1146 pOut->SetFillColor( *pColor );
1150 pOut->SetLineColor();
1160 CalcRect( rPor, &aIntersect,
nullptr,
true );
1164 const ::sw::mark::IMark* pFieldmark =
1169 SAL_INFO(
"sw.core",
"Found Fieldmark " << pFieldmark->ToString());
1172 SAL_INFO(
"sw.core",
"Found StartMark");
1173 if (
OnWin() && (pFieldmark!=
nullptr || bIsStartMark) &&
1174 GetOpt().IsFieldShadings() &&
1175 !
GetOpt().IsPagePreview())
1188 CalcRect( rPor,
nullptr, &aIntersect,
true );
1219 const sal_Int32 nMaxLen =
GetText().getLength();
1226 const sal_Int32 nEndPos =
std::min(sal_Int32(nIdx + pPos->
GetLen()), nMaxLen);
1227 for (sal_Int32
i = sal_Int32(nIdx);
i < nEndPos; ++
i)
1235 if (
i >= nCurrPorEnd)
1253 const sal_Int32 nLastPos =
std::min(nCurrPorEnd, nMaxLen) - 1;
1261 const sal_uInt16 nOldWidth = rPor.
Width();
1262 const sal_uInt16 nExcessWidth
1266 CalcRect( rPor,
nullptr, &aIntersect,
true );
1303bool HasValidPropertyValue(
const uno::Any& rAny)
1305 if (
bool bValue; rAny >>= bValue)
1309 else if (OUString aValue; (rAny >>= aValue) && !(aValue.isEmpty()))
1313 else if (awt::FontSlant eValue; rAny >>= eValue)
1317 else if (
tools::Long nValueLong; rAny >>= nValueLong)
1321 else if (
double fValue; rAny >>= fValue)
1325 else if (
short nValueShort; rAny >>= nValueShort)
1348 CalcRect(rPor, &aRect,
nullptr,
true);
1359 uno::Reference<text::XTextRange> xRange(
1361 uno::Reference<beans::XPropertySet> xPropertiesSet(xRange, uno::UNO_QUERY_THROW);
1363 OUString sCurrentCharStyle;
1364 xPropertiesSet->getPropertyValue(
"CharStyleName") >>= sCurrentCharStyle;
1366 std::optional<OUString> sCSNumberOrDF;
1367 std::optional<Color> aFillColor;
1370 if (!sCurrentCharStyle.isEmpty())
1372 if (!rCharStylesColorMap.empty())
1374 OUString sCharStyleDisplayName;
1377 if (!sCharStyleDisplayName.isEmpty()
1378 && rCharStylesColorMap.find(sCharStyleDisplayName)
1379 != rCharStylesColorMap.end())
1381 aFillColor = rCharStylesColorMap[sCharStyleDisplayName].first;
1382 sCSNumberOrDF = OUString::number(rCharStylesColorMap[sCharStyleDisplayName].second);
1389 const std::vector<OUString> aHiddenProperties{
UNO_NAME_RSID,
1409 uno::Reference<beans::XPropertyState> xPropertiesState(xRange, uno::UNO_QUERY_THROW);
1411 = xPropertiesSet->getPropertySetInfo()->getProperties();
1413 for (
const beans::Property& rProperty :
aProperties)
1415 const OUString& rPropName = rProperty.Name;
1420 if (std::find(aHiddenProperties.begin(), aHiddenProperties.end(), rPropName)
1421 != aHiddenProperties.end())
1424 if (xPropertiesState->getPropertyState(rPropName) == beans::PropertyState_DIRECT_VALUE)
1426 const uno::Any aAny = xPropertiesSet->getPropertyValue(rPropName);
1427 if (HasValidPropertyValue(aAny))
1429 sCSNumberOrDF =
SwResId(STR_CHARACTER_DIRECT_FORMATTING_TAG);
1452 aSVRect.
Move(-(nWidth / 1.5), -(nHeight / 1.5));
1462 pTmpOut->
DrawText(aSVRect, sCSNumberOrDF.value(), DrawTextFlags::NONE);
1487 if ( !
GetOpt().IsPagePreview()
1488 && !
GetOpt().IsReadonly()
1489 &&
GetOpt().IsFieldShadings()
1501 if ( !
GetOpt().IsPagePreview()
1502 &&
GetOpt().IsFieldShadings() )
1508 if (
GetOpt().IsTab() ) bDraw =
true;
1511 if (
GetOpt().IsSoftHyph() )bDraw =
true;
1514 if (
GetOpt().IsHardBlank())bDraw =
true;
1518 OSL_ENSURE(
false,
"SwTextPaintInfo::DrawViewOpt: don't know how to draw this" );
1527 sal_Int16 nMinLeading, sal_Int16 nMinTrailing,
1528 bool bNoCapsHyphenation,
bool bNoLastWordHyphenation,
1529 sal_Int16 nMinWordLength, sal_Int16 nTextHyphZone )
1531 sal_Int32 nLen = rVals.getLength();
1536 PropertyValue *pVal = rVals.getArray();
1540 pVal[0].Value <<= nMinLeading;
1544 pVal[1].Value <<= nMinTrailing;
1548 pVal[2].Value <<= bNoCapsHyphenation;
1552 pVal[3].Value <<= bNoLastWordHyphenation;
1556 pVal[4].Value <<= nMinWordLength;
1560 pVal[5].Value <<= nTextHyphZone;
1564 PropertyValue *pVal = rVals.getArray();
1565 pVal[0].Value <<= nMinLeading;
1566 pVal[1].Value <<= nMinTrailing;
1567 pVal[2].Value <<= bNoCapsHyphenation;
1568 pVal[3].Value <<= bNoLastWordHyphenation;
1569 pVal[4].Value <<= nMinWordLength;
1570 pVal[5].Value <<= nTextHyphZone;
1573 OSL_FAIL(
"unexpected size of sequence" );
1580 "hyphenation values not yet initialized" );
1592 const bool bAuto = bAutoHyphen || rAttr.
IsHyphen();
1596 const sal_Int16 nMinimalTrailing = rAttr.
GetMinTrail();
1602 bNoCapsHyphenation, bNoLastWordHyphenation,
1603 nMinimalWordLength, nTextHyphZone );
1609 const bool bNewQuick,
const bool bTst )
1635 SW_MOD()->GetCTLOptions().GetCTLTextNumerals());
1680 "hyphenationmissing",
SwResId(STR_HYPH_MISSING),
1681 SwResId(STR_HYPH_MISSING_DETAIL)
1683 InfobarType::WARNING);
1710 OSL_ENSURE(pMaster,
"pTextFrame without Master");
1737 const bool bQuickL,
const bool bTst)
1756 m_pUnderflow(nullptr),
1758 m_pLastTab(nullptr),
1760 m_nLineStart(rInf.GetIdx()),
1762 m_nLeft(rInf.m_nLeft),
1763 m_nRight(rInf.m_nRight),
1764 m_nFirst(rInf.m_nLeft),
1765 m_nRealWidth(sal_uInt16(nActWidth)),
1766 m_nWidth(m_nRealWidth),
1768 m_nLineNetHeight(0),
1769 m_nForcedLeftMargin(0),
1771 m_bFootnoteDone(true),
1778 m_bUnderflow(false),
1779 m_bInterHyph(false),
1782 m_bQuick(rInf.m_bQuick),
1783 m_bNoEndHyph(false),
1784 m_bNoMidHyph(false),
1785 m_bIgnoreFly(false),
1786 m_bFakeLineStart(false),
1787 m_bTabOverflow( false ),
1788 m_bTestFormat(rInf.m_bTestFormat),
1820 const sal_Unicode cThousandSep =
',' == cTabDec ?
'.' :
',';
1823 const sal_Unicode cThousandSep2 =
',' == cTabDec ?
'.' :
'\'';
1825 bool bNumFound =
false;
1828 for( ;
i < nEnd; ++
i )
1857 if( cTabDec == cPos )
1859 OSL_ENSURE( cPos,
"Unexpected end of string" );
1871 if ( ( 0x2F < cPos && cPos < 0x3A ) ||
1872 ( bNumFound && ( cPos == cThousandSep || cPos == cThousandSep2 ) ) )
1895 if ( cPos != cTabDec && cPos != cThousandSep && cPos !=cThousandSep2 && ( 0x2F >= cPos || cPos >= 0x3A ) )
1909 if(
GetLast()->IsKernPortion() )
1912 !
GetLast()->IsHolePortion() ) )
1941 if (!bTabOverMargin && !bTabOverSpacing)
1972 if (!bTabOverMargin)
1986 OUString
const & rCh )
1988 , m_pOldSmartTagList(nullptr)
1989 , m_pOldGrammarCheckList(nullptr)
2035 const sal_Int32 nListPos = pSmartTags->
Pos(
nPos);
2036 if (nListPos ==
pos.second && pSmartTags->
SubList(
nPos) !=
nullptr)
2042 && nListPos <
pos.second && !
aText.isEmpty())
2064 const sal_Int32 nListPos = pGrammar->
Pos(
nPos);
2065 if (nListPos ==
pos.second && pGrammar->
SubList(
nPos) !=
nullptr)
2071 && nListPos <
pos.second && !
aText.isEmpty())
@ TABS_RELATIVE_TO_INDENT
@ MS_WORD_COMP_TRAILING_BLANKS
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...
PropertiesInfo aProperties
static OutputDevice * GetDefaultDevice()
bool IsTransparent() const
void SetStyle(css::awt::GradientStyle eStyle)
void SetOfsX(sal_uInt16 nOfsX)
void SetStartIntensity(sal_uInt16 nIntens)
void SetBorder(sal_uInt16 nBorder)
void SetStartColor(const Color &rColor)
void SetSteps(sal_uInt16 nSteps)
void SetOfsY(sal_uInt16 nOfsY)
void SetAngle(Degree10 nAngle)
void SetEndColor(const Color &rColor)
void SetEndIntensity(sal_uInt16 nIntens)
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
virtual sw::mark::IFieldmark * getInnerFieldmarkFor(const SwPosition &pos) const =0
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
static OUString convertToBcp47(LanguageType nLangID)
static bool usesHyphenation(LanguageType nLang)
const vcl::Font & GetFont() const
void SetFont(const vcl::Font &rNewFont)
void DrawRect(const tools::Rectangle &rRect)
const Point & GetRefPoint() const
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
const Color & GetLineColor() const
const MapMode & GetMapMode() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
tools::Long GetTextHeight() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
void SetLayoutMode(vcl::text::ComplexTextLayoutFlags nTextLayoutMode)
DrawModeFlags GetDrawMode() const
const AllSettings & GetSettings() const
static std::shared_ptr< const vcl::text::TextLayoutCache > CreateTextLayoutCache(OUString const &)
const Color & GetFillColor() const
bool hasPropertyByName(std::u16string_view rName) const
const SfxItemPropertyMap & getPropertyMap() const
void AppendInfoBarWhenReady(const OUString &sId, const OUString &sPrimaryMessage, const OUString &sSecondaryMessage, InfobarType aInfobarType, bool bShowCloseButton=true)
StylesHighlighterColorMap & GetStylesHighlighterCharColorMap()
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
bool IsSmartTagsEnabled() const
css::uno::Any GetProperty(std::u16string_view rPropertyName) const
bool IsNoLastWordHyphenation() const
sal_uInt16 & GetTextHyphenZone()
sal_uInt8 & GetMinWordLength()
sal_uInt8 & GetMaxHyphens()
bool IsNoCapsHyphenation() const
sal_uInt8 & GetMinTrail()
static sal_Int16 CheckHyphLang(css::uno::Reference< css::linguistic2::XHyphenator >const &xHyph, LanguageType nLang)
Indicator that the content does not fit into a fixed height frame (red triangle on the UI).
sal_Int32 m_nPosition
current iteration index in text node
void SetFnt(SwFont *pNew)
const SvxParaVertAlignItem & GetParaVertAlign(bool=true) const
const SwFormatDrop & GetDrop(bool=true) const
const SvxTabStopItem & GetTabStops(bool=true) const
const SvxScriptSpaceItem & GetScriptSpace(bool=true) const
const SvxForbiddenRuleItem & GetForbiddenRule(bool=true) const
const SvxHangingPunctuationItem & GetHangingPunctuation(bool=true) const
const SvxParaGridItem & GetParaGrid(bool=true) const
const SvxLineSpacingItem & GetLineSpacing(bool=true) const
const SvxHyphenZoneItem & GetHyphenZone(bool=true) const
const css::lang::Locale & GetLocale(const LanguageType aLang)
SwLineBreakClear GetClear() const
SwTextFrame * FindMaster() const
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
IDocumentSettingAccess const & getIDocumentSettingAccess() const
IDocumentMarkAccess * getIDocumentMarkAccess()
SwDocShell * GetDocShell()
void SetKern(tools::Long nNew)
void SetAscent(sal_uInt16 nNew)
void SetSpaceStop(bool bNew)
void SetNumberOfBlanks(TextFrameIndex const nNew)
void SetSnapToGrid(bool bNew)
void SetHyphPos(TextFrameIndex *const pNew)
void SetPos(const Point &rNew)
void SetSize(const Size &rNew)
void SetFont(SwFont *pNew)
void SetSmartTags(sw::WrongListIterator *const pNew)
void SetMeasureLen(TextFrameIndex const nNew)
void SetKanaComp(short nNew)
tools::Long GetKanaDiff() const
void SetFrame(const SwTextFrame *pNewFrame)
void SetGrammarCheck(sw::WrongListIterator *const pNew)
void SetOut(OutputDevice &rNew)
void SetUnderFnt(SwUnderlineFont *pULFnt)
void SetSpace(tools::Long nNew)
void SetWrong(sw::WrongListIterator *const pNew)
SwFontSave(const SwTextSizeInfo &rInf, SwFont *pFnt, SwAttrIter *pItr=nullptr)
To take Asian or other languages into consideration, an SwFont object consists of 3 SwSubFonts (Latin...
void DrawStretchText_(SwDrawTextInfo &rInf)
void SetCharSet(const rtl_TextEncoding eCharSet, const SwFontScript nWhich)
const std::optional< Color > & GetBackColor() const
bool DifferentFontCacheId(const SwFont *pFnt, SwFontScript nWhich)
void DrawText_(SwDrawTextInfo &rInf)
const Size & GetSize(SwFontScript nWhich) const
void SetVertical(Degree10 nDir, const bool bVertLayout=false, const bool bVertLayoutLRBT=false)
Degree10 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
void SetAlign(const TextAlign eAlign)
void SetName(const OUString &rName, const SwFontScript nWhich)
Size GetTextSize_(SwDrawTextInfo &rInf)
void SetSize(const Size &rSize, const SwFontScript nWhich)
SwFontScript GetActual() const
TextFrameIndex GetTextBreak(SwDrawTextInfo const &rInf, tools::Long nTextWidth)
void SetColor(const Color &rColor)
const std::optional< editeng::SvxBorderLine > & GetLeftBorder() const
const Color & GetColor() const
LanguageType GetLanguage() const
void SetTransparent(const bool bTrans)
void SetFamily(const FontFamily eFamily, const SwFontScript nWhich)
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
void ChgPhysFnt(SwViewShell const *pSh, OutputDevice &rOut)
tools::Long GetHeight() const
sal_uInt16 GetLeftBorderSpace() const
const Color & GetHighlightColor() const
void SetStyleName(const OUString &rStyleName, const SwFontScript nWhich)
const SwRect & getFrameArea() const
bool IsRightToLeft() const
SwRootFrame * getRootFrame()
bool IsFootnoteAllowed() const
void CtorInitLineInfo(const SwAttrSet &rAttrSet, const SwTextNode &rTextNode)
tools::Long m_nListTabStopPosition
const SvxLineSpacingItem * m_pSpace
bool m_bListTabStopIncluded
std::optional< SvxTabStopItem > m_oRuler
SvxParaVertAlignItem::Align m_nVertAlign
Collection of SwLinePortion instances, representing one line of text.
virtual void Height(const SwTwips nNew, const bool bText=true) override
SwTwips GetRealHeight() const
Base class for anything that can be part of a line in the Writer layout.
bool IsBlankPortion() const
bool IsHangingPortion() const
SwLinePortion * GetNextPortion() const
bool GetJoinBorderWithPrev() const
PortionType GetWhichPor() const
TextFrameIndex GetLen() const
bool IsKernPortion() const
bool GetJoinBorderWithNext() const
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const
bool IsDropPortion() const
virtual tools::Long CalcSpacing(tools::Long nSpaceAdd, const SwTextSizeInfo &rInf) const
bool IsBreakPortion() const
bool IsHolePortion() const
bool IsFlyPortion() const
bool InFixMargGrp() const
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
SwScriptInfo & GetScriptInfo()
Of course Writer needs its own rectangles.
SwRect & Intersection(const SwRect &rRect)
void Height(tools::Long nNew)
void Top(const tools::Long nTop)
void Right(const tools::Long nRight)
void Bottom(const tools::Long nBottom)
void Pos(const Point &rNew)
void AddLeft(const tools::Long nAdd)
void AddBottom(const tools::Long nAdd)
void AddRight(const tools::Long nAdd)
void AddTop(const tools::Long nAdd)
Point BottomRight() const
tools::Rectangle SVRect() const
void Left(const tools::Long nLeft)
void Width(tools::Long nNew)
SwViewShell * GetCurrShell() const
static bool FlushVout()
Output virtual Device (e.g. for animations)
size_t CountCompChg() const
static SwSmartTagMgr & Get()
static const OUString & GetUIName(const OUString &rName, SwGetPoolIdFromName)
sal_uInt16 GetTabPos() const
void CtorInitTextFly(const SwTextFrame *pFrame)
void DrawTextOpaque(SwDrawTextInfo &rInf)
This method is called by DrawText().
TextFrameIndex m_nLastBookmarkPos
need to check for bookmarks at every portion
SwLinePortion * GetLast()
SwTabPortion * GetLastTab()
void CtorInitTextFormatInfo(OutputDevice *pRenderContext, SwTextFrame *pFrame, const bool bInterHyph=false, const bool bQuick=false, const bool bTst=false)
const SwFormatDrop * GetDropFormat() const
SwLinePortion * m_pUnderflow
void SetLineStart(TextFrameIndex const nNew)
bool InitHyph(const bool bAuto=false)
sal_uInt16 m_nLineNetHeight
void SetLineNetHeight(const sal_uInt16 nNew)
bool CheckFootnotePortion_(SwLineLayout const *pCurr)
void SetLineHeight(const sal_uInt16 nNew)
TextFrameIndex m_nUnderScorePos
enlarge repaint if underscore has been found
TextFrameIndex ScanPortionEnd(TextFrameIndex nStart, TextFrameIndex nEnd)
TextFrameIndex m_nSoftHyphPos
SoftHyphPos for Hyphenation.
sal_Unicode m_cTabDecimal
SwTabPortion * m_pLastTab
void SetLast(SwLinePortion *pNewLast)
sal_uInt16 m_nForcedLeftMargin
SwTwips m_nLeftMargin
First or left margin, depending on context.
sal_Unicode GetTabDecimal() const
void SetTabDecimal(const sal_Unicode cNew)
bool IsHyphenate() const
If the Hyphenator returns ERROR or the language is set to NOLANGUAGE we do not hyphenate.
bool CheckCurrentPosBookmark()
SwTwips GetLineWidth()
Returns the distance between the current horizontal position and the end of the line.
const css::beans::PropertyValues & GetHyphValues() const
SwTextFormatInfo(OutputDevice *pRenderContext, SwTextFrame *pFrame, const bool bInterHyphL=false, const bool bQuickL=false, const bool bTst=false)
bool ChgHyph(const bool bNew)
css::beans::PropertyValues m_aHyphVals
Represents the visualization of a paragraph.
void SwitchVerticalToHorizontal(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from vertical to horizontal layout.
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
TextFrameIndex GetOffset() const
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(TextFrameIndex nIndex) const
map position in potentially merged text frame to SwPosition
void SwitchLTRtoRTL(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from LTR to RTL layout.
static SwView * GetView()
void SwitchRTLtoLTR(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from RTL to LTR layout.
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
Calculates the frame area size and the print area, in case they are invalid.
SwParaPortion * GetPara()
void SwitchHorizontalToVertical(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from horizontal to vertical layout.
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
SwTextNode const * GetTextNodeForParaProps() const
SwParaPortion * GetParaPortion()
TextFrameIndex m_nTextStart
void CtorInitTextInfo(SwTextFrame *pFrame)
SwTextNode is a paragraph in the document model.
bool GetListTabStopPosition(tools::Long &nListTabStopPosition) const
Retrieves the list tab stop position, if the paragraph's list level defines one and this list tab sto...
bool HasMarkedLabel() const
Returns if this text node has a marked label.
void DrawCSDFHighlighting(const SwLinePortion &rPor) const
const SvxBrushItem * m_pBrushItem
void SetPaintOfst(const SwTwips nNew)
void DrawText_(const OUString &rText, const SwLinePortion &rPor, const TextFrameIndex nIdx, const TextFrameIndex nLen, const bool bKern, const bool bWrong=false, const bool bSmartTag=false, const bool bGrammarCheck=false)
void DrawTab(const SwLinePortion &rPor) const
void DrawText(const OUString &rText, const SwLinePortion &rPor, TextFrameIndex nIdx=TextFrameIndex(0), TextFrameIndex nLen=TextFrameIndex(COMPLETE_STRING), const bool bKern=false) const
void DrawBackground(const SwLinePortion &rPor, const Color *pColor=nullptr) const
void SetPos(const Point &rNew)
const Point & GetPos() const
sw::WrongListIterator * m_pSmartTags
void CalcRect(const SwLinePortion &rPor, SwRect *pRect, SwRect *pIntersect=nullptr, const bool bInsideBox=false) const
Calculate the rectangular area where the portion takes place.
void DrawRect(const SwRect &rRect, bool bRetouche) const
void DrawBackBrush(const SwLinePortion &rPor) const
std::vector< tools::Long > * m_pSpaceAdd
void DrawPostIts(bool bScript) const
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich, const Color *pColor=nullptr) const
void DrawCheckBox(const SwFieldFormCheckboxPortion &rPor, bool bChecked) const
void DrawRedArrow(const SwLinePortion &rPor) const
sw::WrongListIterator * m_pGrammarCheckList
tools::Long GetSpaceAdd() const
sw::WrongListIterator * m_pWrongList
void DrawBorder(const SwLinePortion &rPor) const
Draw character border around a line portion.
void DrawLineBreak(const SwLinePortion &rPor) const
void CtorInitTextPaintInfo(OutputDevice *pRenderContext, SwTextFrame *pFrame, const SwRect &rPaint)
This portion represents a part of the paragraph string.
TextFrameIndex GetSpaceCnt(const SwTextSizeInfo &rInf, TextFrameIndex &rCnt) const
SwTextFrame * GetTextFrame()
vcl::RenderContext * GetOut()
void CtorInitTextSizeInfo(OutputDevice *pRenderContext, SwTextFrame *pFrame, TextFrameIndex nIdx)
sal_uInt8 GetDirection() const
const SwViewOption & GetOpt() const
void SetMulti(const bool bNew)
VclPtr< OutputDevice > m_pOut
void SetLen(const TextFrameIndex nNew)
VclPtr< OutputDevice > m_pRef
void SetSnapToGrid(const bool bN)
TextFrameIndex GetTextBreak(const tools::Long nLineWidth, const TextFrameIndex nMaxLen, const sal_uInt16 nComp, vcl::text::TextLayoutCache const *) const
TextFrameIndex GetMeasureLen() const
void SetMeasureLen(const TextFrameIndex nNew)
const std::shared_ptr< const vcl::text::TextLayoutCache > & GetCachedVclData() const
void SetCachedVclData(std::shared_ptr< const vcl::text::TextLayoutCache > const &pCachedVclData)
void NoteAnimation() const
void SetForbiddenChars(const bool bN)
vcl::RenderContext * GetRefDev()
void SetIdx(const TextFrameIndex nNew)
void SetFont(SwFont *pNew)
TextFrameIndex m_nMeasureLen
bool m_bOtherThanFootnoteInside
SwPosSize GetTextSize(OutputDevice *pOut, const SwScriptInfo *pSI, const OUString &rText, TextFrameIndex nIdx, TextFrameIndex nLen) const
void SetFirstMulti(const bool bNew)
sal_uInt16 GetAscent() const
sal_Unicode GetChar(TextFrameIndex const nPos) const
std::deque< sal_uInt16 > * m_pKanaComp
void SetText(const OUString &rNew)
TextFrameIndex GetLen() const
bool IsFirstMulti() const
const OUString & GetText() const
SwPosSize GetTextSize() const
TextFrameIndex GetIdx() const
void SetHanging(const bool bNew)
bool HasHint(TextFrameIndex nPos) const
void SetScriptSpace(const bool bNew)
sal_uInt16 GetKanaComp() const
const SwViewOption * m_pOpt
SwUnderlineFont * m_pUnderFnt
sw::WrongListIterator * m_pOldSmartTagList
TextFrameIndex nMeasureLen
SwTextSlot(const SwTextSizeInfo *pNew, const SwLinePortion *pPor, bool bTextLen, bool bExgLists, OUString const &rCh=OUString())
std::unique_ptr< SwWrongList > m_pTempList
sw::WrongListIterator * m_pOldGrammarCheckList
const OUString * pOldText
std::unique_ptr< sw::WrongListIterator > m_pTempIter
std::shared_ptr< const vcl::text::TextLayoutCache > m_pOldCachedVclData
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
bool IsPagePreview() const
bool IsBlank(bool bHard=false) const
void PaintPostIts(OutputDevice *pOut, const SwRect &rRect, bool bIsScript) const
const Color & GetFieldShadingsColor() const
bool IsOnlineSpell() const
static sal_uInt16 GetPostItsWidth(const OutputDevice *pOut)
vcl::RenderContext * GetOut() const
const SwViewOption * GetViewOptions() const
bool isOutputToWindow() const
vcl::Window * GetWin() const
vcl::RenderContext & GetRefDev() const
sal_Int32 Pos(sal_uInt16 nIdx) const
sal_uInt16 GetWrongPos(sal_Int32 nValue) const
Find the first position that is greater or equal to the given value.
SwWrongList * SubList(sal_uInt16 nIdx) const
void SetOrientation(Degree10 nLineOrientation)
constexpr ::Color COL_LIGHTRED(0xFF, 0x00, 0x00)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
virtual editeng::HangulHanjaConversion::ConversionDirection GetDirection(editeng::HangulHanjaConversion::ConversionDirection _eDefaultDirection) const override
#define CH_TXTATR_NEWLINE
#define CH_TXT_ATR_FIELDSTART
#define CH_TXTATR_BREAKWORD
#define DRAW_SPECIAL_OPTIONS_ROTATE
#define DRAW_SPECIAL_OPTIONS_CENTER
static void lcl_DrawSpecial(const SwTextPaintInfo &rTextPaintInfo, const SwLinePortion &rPor, SwRect &rRect, const Color &rCol, sal_Unicode cChar, sal_uInt8 nOptions)
Draws a special portion E.g.
static void lcl_InitHyphValues(PropertyValues &rVals, sal_Int16 nMinLeading, sal_Int16 nMinTrailing, bool bNoCapsHyphenation, bool bNoLastWordHyphenation, sal_Int16 nMinWordLength, sal_Int16 nTextHyphZone)
static TextFrameIndex GetMinLen(const SwTextSizeInfo &rInf)
static void ChkOutDev(const SwTextSizeInfo &rInf)
#define CHAR_LINEBREAK_RTL
#define LANGUAGE_DONTKNOW
constexpr OUStringLiteral UPN_IS_GRAMMAR_AUTO
#define UPH_HYPH_NO_LAST_WORD
#define UPH_HYPH_MIN_WORD_LENGTH
#define UPH_HYPH_MIN_LEADING
constexpr OUStringLiteral UPN_HYPH_ZONE
constexpr OUStringLiteral UPN_HYPH_NO_CAPS
constexpr OUStringLiteral UPN_HYPH_MIN_WORD_LENGTH
constexpr OUStringLiteral UPN_HYPH_NO_LAST_WORD
constexpr OUStringLiteral UPN_HYPH_MIN_LEADING
#define UPH_HYPH_MIN_TRAILING
constexpr OUStringLiteral UPN_HYPH_MIN_TRAILING
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
double getLength(const B2DPolygon &rCandidate)
std::map< sal_Int32, std::shared_ptr< SetItemPropertyStorage > > PropertyValues
OUString const & GetDefBulletFontname()
retrieve font family name used for the default bullet list characters
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...
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
vcl::Font GetFont(vcl::Font const &rFont, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
#define SPECIAL_FONT_HEIGHT
#define SPACING_PRECISION_FACTOR
Marks a position in the document model.
UNDERLYING_TYPE get() const
tools::Long GetLen(const Point &rPnt)
const sal_Unicode CH_BREAK
const sal_Unicode CH_BLANK
OUString SwResId(TranslateId aId)
uno::Reference< linguistic2::XHyphenator > GetHyphenator()
constexpr sal_Int32 COMPLETE_STRING
#define NON_PRINTING_CHARACTER_COLOR
SwUnoPropertyMapProvider aSwMapProvider
#define PROPERTY_MAP_CHAR_AUTO_STYLE
constexpr OUStringLiteral UNO_NAME_SORTED_TEXT_ID
constexpr OUStringLiteral UNO_NAME_PARA_IS_NUMBERING_RESTART
constexpr OUStringLiteral UNO_NAME_CHAR_COLOR_THEME
constexpr OUStringLiteral UNO_NAME_NUMBERING_IS_NUMBER
constexpr OUStringLiteral UNO_NAME_PARA_CONDITIONAL_STYLE_NAME
constexpr OUStringLiteral UNO_NAME_PARA_STYLE_NAME
constexpr OUStringLiteral UNO_NAME_CHAR_COLOR_TINT_OR_SHADE
constexpr OUStringLiteral UNO_NAME_RSID
constexpr OUStringLiteral UNO_NAME_NUMBERING_LEVEL
constexpr OUStringLiteral UNO_NAME_PAGE_STYLE_NAME
constexpr OUStringLiteral UNO_NAME_NUMBERING_START_VALUE
constexpr OUStringLiteral UNO_NAME_PARA_CONTINUEING_PREVIOUS_SUB_TREE
constexpr OUStringLiteral UNO_NAME_PARRSID
constexpr OUStringLiteral UNO_NAME_CHAR_STYLE_NAME
std::unordered_map< OUString, std::pair< Color, int > > StylesHighlighterColorMap