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;
701 if (!
m_bOnWin || !
m_pOut->SupportsOperation(OutDevSupportType::TransparentText) ||
m_pOut->GetConnectMetaFile())
702 pTransparentText.reset(
new SwTransparentTextGuard(rPor, *
this, aDrawInf));
711 aDrawInf.
SetPos( aPoint );
722 aDrawInf.
SetPos( aFontPos );
737 const bool bInsideBox )
const
785 SwRect aRect( aPoint, aSize );
795 const bool bJoinWithPrev =
796 static_cast<const SwTextPortion&
>(rPor).GetJoinBorderWithPrev();
797 const bool bJoinWithNext =
798 static_cast<const SwTextPortion&
>(rPor).GetJoinBorderWithNext();
801 aRect.
AddTop(
GetFont()->CalcShadowSpace(SvxShadowItemSide::TOP, bIsVert, bIsVertLRBT,
802 bJoinWithPrev, bJoinWithNext));
803 aRect.
AddBottom( -
GetFont()->CalcShadowSpace(SvxShadowItemSide::BOTTOM, bIsVert, bIsVertLRBT,
804 bJoinWithPrev, bJoinWithNext));
805 aRect.
AddLeft(
GetFont()->CalcShadowSpace(SvxShadowItemSide::LEFT, bIsVert, bIsVertLRBT,
806 bJoinWithPrev, bJoinWithNext));
807 aRect.
AddRight( -
GetFont()->CalcShadowSpace(SvxShadowItemSide::RIGHT, bIsVert, bIsVertLRBT,
808 bJoinWithPrev, bJoinWithNext));
814 if( aRect.
HasArea() && pIntersect )
818 if (
GetOut()->IsClipRegion() )
820 SwRect aClip(
GetOut()->GetClipRegion().GetBoundRect() );
854 static SwFont s_aFnt = [&]()
877 rNonConstTextPaintInfo.
SetFont( &s_aFnt );
882 if (nDir == 900_deg10 || nDir == 2700_deg10)
883 nMaxWidth = rRect.
Height();
886 assert(nDir == 0_deg10);
887 nMaxWidth = rRect.
Width();
891 const OUString aTmp( cChar );
893 while ( aFontSize.
Width() > nMaxWidth )
895 SwTwips nFactor = ( 100 * aFontSize.
Width() ) / nMaxWidth;
906 s_aFnt.
SetSize( aFontSize, nAct );
910 if ( aFontSize.
Width() >= nOldWidth )
919 switch ( nDir.
get() )
923 nX += ( rRect.
Width() - aFontSize.
Width() ) / 2;
938 Point aTmpPos( nX, nY );
939 rNonConstTextPaintInfo.
SetPos( aTmpPos );
940 sal_uInt16 nOldWidth = rPor.
Width();
942 rTextPaintInfo.
DrawText( aTmp, rPor );
944 rNonConstTextPaintInfo.
SetFont(
const_cast<SwFont*
>(pOldFnt) );
945 rNonConstTextPaintInfo.
SetPos( aOldPos );
950 if (
OnWin() || !bRetouche )
954 DrawFlyRect(
m_pOut, rRect );
985 const auto& rBreakPortion =
static_cast<const SwBreakPortion&
>(rPor);
989 sal_uInt16 nOldWidth = rPor.
Width();
1032 aRect.
Pos().AdjustX(20 );
1041 aRect.
Pos().AdjustY( -(aRect.
Height() + 20) );
1042 aRect.
Pos().AdjustX( -(aRect.
Width() + 20) );
1091 SwRect aTmpRect( aTmp, aSize );
1111 !
GetOpt().IsPagePreview())
1116 pOut->SetLineColor();
1136 OSL_ENSURE(
OnWin(),
"SwTextPaintInfo::DrawBackground: printer pollution ?" );
1139 CalcRect( rPor,
nullptr, &aIntersect,
true );
1148 pOut->SetFillColor( *pColor );
1152 pOut->SetLineColor();
1162 CalcRect( rPor, &aIntersect,
nullptr,
true );
1166 const ::sw::mark::IMark* pFieldmark =
1171 SAL_INFO(
"sw.core",
"Found Fieldmark " << pFieldmark->ToString());
1174 SAL_INFO(
"sw.core",
"Found StartMark");
1175 if (
OnWin() && (pFieldmark!=
nullptr || bIsStartMark) &&
1176 GetOpt().IsFieldShadings() &&
1177 !
GetOpt().IsPagePreview())
1190 CalcRect( rPor,
nullptr, &aIntersect,
true );
1221 const sal_Int32 nMaxLen =
GetText().getLength();
1228 const sal_Int32 nEndPos =
std::min(sal_Int32(nIdx + pPos->
GetLen()), nMaxLen);
1229 for (sal_Int32
i = sal_Int32(nIdx);
i < nEndPos; ++
i)
1237 if (
i >= nCurrPorEnd)
1255 const sal_Int32 nLastPos =
std::min(nCurrPorEnd, nMaxLen) - 1;
1263 const sal_uInt16 nOldWidth = rPor.
Width();
1264 const sal_uInt16 nExcessWidth
1268 CalcRect( rPor,
nullptr, &aIntersect,
true );
1305bool HasValidPropertyValue(
const uno::Any& rAny)
1307 if (
bool bValue; rAny >>= bValue)
1311 else if (OUString aValue; (rAny >>= aValue) && !(aValue.isEmpty()))
1315 else if (awt::FontSlant eValue; rAny >>= eValue)
1319 else if (
tools::Long nValueLong; rAny >>= nValueLong)
1323 else if (
double fValue; rAny >>= fValue)
1327 else if (
short nValueShort; rAny >>= nValueShort)
1350 CalcRect(rPor, &aRect,
nullptr,
true);
1361 uno::Reference<text::XTextRange> xRange(
1363 uno::Reference<beans::XPropertySet> xPropertiesSet(xRange, uno::UNO_QUERY_THROW);
1365 OUString sCurrentCharStyle;
1366 xPropertiesSet->getPropertyValue(
"CharStyleName") >>= sCurrentCharStyle;
1368 std::optional<OUString> sCSNumberOrDF;
1369 std::optional<Color> aFillColor;
1372 if (!sCurrentCharStyle.isEmpty())
1374 if (!rCharStylesColorMap.empty())
1376 OUString sCharStyleDisplayName;
1379 if (!sCharStyleDisplayName.isEmpty()
1380 && rCharStylesColorMap.find(sCharStyleDisplayName)
1381 != rCharStylesColorMap.end())
1383 aFillColor = rCharStylesColorMap[sCharStyleDisplayName].first;
1384 sCSNumberOrDF = OUString::number(rCharStylesColorMap[sCharStyleDisplayName].second);
1391 const std::vector<OUString> aHiddenProperties{
UNO_NAME_RSID,
1411 uno::Reference<beans::XPropertyState> xPropertiesState(xRange, uno::UNO_QUERY_THROW);
1413 = xPropertiesSet->getPropertySetInfo()->getProperties();
1415 for (
const beans::Property& rProperty :
aProperties)
1417 const OUString& rPropName = rProperty.Name;
1422 if (std::find(aHiddenProperties.begin(), aHiddenProperties.end(), rPropName)
1423 != aHiddenProperties.end())
1426 if (xPropertiesState->getPropertyState(rPropName) == beans::PropertyState_DIRECT_VALUE)
1428 const uno::Any aAny = xPropertiesSet->getPropertyValue(rPropName);
1429 if (HasValidPropertyValue(aAny))
1431 sCSNumberOrDF =
SwResId(STR_CHARACTER_DIRECT_FORMATTING_TAG);
1454 aSVRect.
Move(-(nWidth / 1.5), -(nHeight / 1.5));
1464 pTmpOut->
DrawText(aSVRect, sCSNumberOrDF.value(), DrawTextFlags::NONE);
1489 if ( !
GetOpt().IsPagePreview()
1490 && !
GetOpt().IsReadonly()
1491 &&
GetOpt().IsFieldShadings()
1503 if ( !
GetOpt().IsPagePreview()
1504 &&
GetOpt().IsFieldShadings() )
1510 if (
GetOpt().IsTab() ) bDraw =
true;
1513 if (
GetOpt().IsSoftHyph() )bDraw =
true;
1516 if (
GetOpt().IsHardBlank())bDraw =
true;
1520 OSL_ENSURE(
false,
"SwTextPaintInfo::DrawViewOpt: don't know how to draw this" );
1529 sal_Int16 nMinLeading, sal_Int16 nMinTrailing,
1530 bool bNoCapsHyphenation,
bool bNoLastWordHyphenation,
1531 sal_Int16 nMinWordLength, sal_Int16 nTextHyphZone )
1533 sal_Int32 nLen = rVals.getLength();
1538 PropertyValue *pVal = rVals.getArray();
1542 pVal[0].Value <<= nMinLeading;
1546 pVal[1].Value <<= nMinTrailing;
1550 pVal[2].Value <<= bNoCapsHyphenation;
1554 pVal[3].Value <<= bNoLastWordHyphenation;
1558 pVal[4].Value <<= nMinWordLength;
1562 pVal[5].Value <<= nTextHyphZone;
1566 PropertyValue *pVal = rVals.getArray();
1567 pVal[0].Value <<= nMinLeading;
1568 pVal[1].Value <<= nMinTrailing;
1569 pVal[2].Value <<= bNoCapsHyphenation;
1570 pVal[3].Value <<= bNoLastWordHyphenation;
1571 pVal[4].Value <<= nMinWordLength;
1572 pVal[5].Value <<= nTextHyphZone;
1575 OSL_FAIL(
"unexpected size of sequence" );
1582 "hyphenation values not yet initialized" );
1594 const bool bAuto = bAutoHyphen || rAttr.
IsHyphen();
1598 const sal_Int16 nMinimalTrailing = rAttr.
GetMinTrail();
1604 bNoCapsHyphenation, bNoLastWordHyphenation,
1605 nMinimalWordLength, nTextHyphZone );
1611 const bool bNewQuick,
const bool bTst )
1682 "hyphenationmissing",
SwResId(STR_HYPH_MISSING),
1683 SwResId(STR_HYPH_MISSING_DETAIL)
1685 InfobarType::WARNING);
1712 OSL_ENSURE(pMaster,
"pTextFrame without Master");
1739 const bool bQuickL,
const bool bTst)
1758 m_pUnderflow(nullptr),
1760 m_pLastTab(nullptr),
1762 m_nLineStart(rInf.GetIdx()),
1764 m_nLeft(rInf.m_nLeft),
1765 m_nRight(rInf.m_nRight),
1766 m_nFirst(rInf.m_nLeft),
1767 m_nRealWidth(sal_uInt16(nActWidth)),
1768 m_nWidth(m_nRealWidth),
1770 m_nLineNetHeight(0),
1771 m_nForcedLeftMargin(0),
1773 m_bFootnoteDone(true),
1780 m_bUnderflow(false),
1781 m_bInterHyph(false),
1784 m_bQuick(rInf.m_bQuick),
1785 m_bNoEndHyph(false),
1786 m_bNoMidHyph(false),
1787 m_bIgnoreFly(false),
1788 m_bFakeLineStart(false),
1789 m_bTabOverflow( false ),
1790 m_bTestFormat(rInf.m_bTestFormat),
1822 const sal_Unicode cThousandSep =
',' == cTabDec ?
'.' :
',';
1825 const sal_Unicode cThousandSep2 =
',' == cTabDec ?
'.' :
'\'';
1827 bool bNumFound =
false;
1830 for( ;
i < nEnd; ++
i )
1859 if( cTabDec == cPos )
1861 OSL_ENSURE( cPos,
"Unexpected end of string" );
1873 if ( ( 0x2F < cPos && cPos < 0x3A ) ||
1874 ( bNumFound && ( cPos == cThousandSep || cPos == cThousandSep2 ) ) )
1897 if ( cPos != cTabDec && cPos != cThousandSep && cPos !=cThousandSep2 && ( 0x2F >= cPos || cPos >= 0x3A ) )
1911 if(
GetLast()->IsKernPortion() )
1914 !
GetLast()->IsHolePortion() ) )
1943 if (!bTabOverMargin && !bTabOverSpacing)
1974 if (!bTabOverMargin)
1988 OUString
const & rCh )
1990 , m_pOldSmartTagList(nullptr)
1991 , m_pOldGrammarCheckList(nullptr)
2037 const sal_Int32 nListPos = pSmartTags->
Pos(
nPos);
2038 if (nListPos ==
pos.second && pSmartTags->
SubList(
nPos) !=
nullptr)
2044 && nListPos <
pos.second && !
aText.isEmpty())
2066 const sal_Int32 nListPos = pGrammar->
Pos(
nPos);
2067 if (nListPos ==
pos.second && pGrammar->
SubList(
nPos) !=
nullptr)
2073 && 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
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() 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
static TextNumerals GetCTLTextNumerals()
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