163 if ( !pSet )
return nullptr;
167 bool bRet = SfxItemState::SET == pSet->
GetItemState( nWhich, bInParent, &pItem );
169 return bRet ? pItem :
nullptr;
172 return ( nWhich == rAttr.
Which() ) ? &rAttr.
GetAttr() :
nullptr;
182 bRet = SfxItemState::SET == pItemSet->
GetItemState( nWhich );
211 static_txtattr_cast<SwTextINetFormat const&>(rAttr)));
225 *pColor = static_cast<const SvxColorItem*>(pItem)->GetValue();
265 : m_pIDocumentSettingAccess(nullptr)
267 , m_bVertLayout(false)
268 , m_bVertLayoutLRBT(false)
290 SwFont& rFnt,
bool bVL,
bool bVertLayoutLRBT )
303 if ( pAS && pAS->
Count() )
310 nWhich = pItem->
Which();
360 if (
Push( rAttr, *pItem ) )
367 FontChg( aItemNext, rFnt,
true );
393 "I do not want this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
421 const auto it = std::find(rStack.begin(), rStack.end(), &rAttr);
422 if (it != rStack.end())
469 "I do not have this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
480 "I cannot activate this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
482 const sal_uInt16 nStackPos =
StackPos[ nAttr ];
504 FontChg( aItemNext, rFnt,
false );
507 FontChg( *pItemNext, rFnt,
false );
529 bool bTwoLineAct =
false;
571 switch ( rItem.
Which() )
583 rFnt.
SetStrikeout( static_cast<const SvxCrossedOutItem&>(rItem).GetStrikeout() );
586 rFnt.
SetEscapement( static_cast<const SvxEscapementItem&>(rItem).GetEsc() );
587 rFnt.
SetProportion( static_cast<const SvxEscapementItem&>(rItem).GetProportionalHeight() );
621 (pTmpItem && !static_cast<const SvxCharHiddenItem*>(pTmpItem)->GetValue()) )
623 rFnt.
SetUnderline( static_cast<const SvxUnderlineItem&>(rItem).GetLineStyle() );
624 rFnt.
SetUnderColor( static_cast<const SvxUnderlineItem&>(rItem).GetColor() );
650 rFnt.
SetOverline( static_cast<const SvxOverlineItem&>(rItem).GetLineStyle() );
651 rFnt.
SetOverColor( static_cast<const SvxOverlineItem&>(rItem).GetColor() );
660 if( static_cast<const SvxAutoKernItem&>(rItem).
GetValue() )
664 FontKerning::FontSpecific :
665 FontKerning::Asian );
671 rFnt.
SetBackColor(static_cast<const SvxBrushItem&>(rItem).GetColor());
716 static_cast<const SvxEmphasisMarkItem&>(rItem).GetEmphasisMark()
728 if ( static_cast<const SvxCharHiddenItem&>(rItem).GetValue() )
747 bool bTwoLineAct =
false;
773 if ( !bRuby && static_cast<const SvxTwoLinesItem&>(rItem).
GetValue() )
833 sal_uInt16& nAscent, sal_uInt16& nHeight )
const
835 OSL_ENSURE(
m_pFnt,
"No font available for GetDefaultAscentAndHeight");
840 nHeight = aFont.
GetHeight( pShell, rOut );
841 nAscent = aFont.
GetAscent( pShell, rOut );
void SetLeftBorderDist(const sal_uInt16 nLeftDist)
vcl::RenderContext * GetOut() const
OutDevType GetOutDevType() const
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
SwCharFormat * GetCharFormat()
bool IsPagePreview() const
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr TypedWhichId< SvxEscapementItem > RES_CHRATR_ESCAPEMENT(6)
void Pop(const SwTextAttr &rAttr)
Only used during redlining.
static bool IsVisitedLinks()
bool IsPriorityAttr() const
void SetWordLineMode(const bool bWordLineMode)
bool isCHRATR(const sal_uInt16 nWhich)
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_METAFIELD(49)
void PopAndChg(const SwTextAttr &rAttr, SwFont &rFnt)
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_META(48)
void FontChg(const SfxPoolItem &rItem, SwFont &rFnt, bool bPush)
When popping an attribute from the stack, the top more remaining attribute in the stack becomes valid...
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
static Color & GetLinksColor()
void SetEmphasisMark(const FontEmphasisMark eValue)
sal_uInt16 GetDistance(SvxBoxItemLine nLine) const
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr TypedWhichId< SvxAutoKernItem > RES_CHRATR_AUTOKERN(17)
const SfxPoolItem * m_pDefaultArray[NUM_DEFAULT_VALUES]
constexpr TypedWhichId< SvxBoxItem > RES_CHRATR_BOX(40)
void SetOutline(const bool bOutline)
const editeng::SvxBorderLine * GetRight() const
void SetPropWidth(const sal_uInt16 nNew)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
void SetBottomBorderDist(const sal_uInt16 nBottomDist)
void SetPitch(const FontPitch ePitch, const SwFontScript nWhich)
constexpr TypedWhichId< SvxTwoLinesItem > RES_CHRATR_TWO_LINES(34)
#define NUM_DEFAULT_VALUES
void SetColor(const Color &rColor)
constexpr TypedWhichId< SvxCaseMapItem > RES_CHRATR_CASEMAP(RES_CHRATR_BEGIN)
void SetShadow(const bool bShadow)
const SfxPoolItem * NextItem()
SvxShadowLocation GetLocation() const
constexpr TypedWhichId< SvxShadowItem > RES_CHRATR_SHADOW(41)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
static Color & GetVisitedLinksColor()
constexpr TypedWhichId< SwFormatRuby > RES_TXTATR_CJK_RUBY(53)
void SetShadowColor(const Color &rColor)
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
void SetUnderline(const FontLineStyle eUnderline)
constexpr TypedWhichId< SvxCharReliefItem > RES_CHRATR_RELIEF(36)
void SetShadowLocation(const SvxShadowLocation aLocation)
std::unique_ptr< SwFont > m_pFnt
constexpr TypedWhichId< SwFormatAutoFormat > RES_TXTATR_AUTOFMT(50)
void SetStrikeout(const FontStrikeout eStrikeout)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
void SetLeftBorder(const editeng::SvxBorderLine *pLeftBorder)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
const Color & GetColor() const
void SetStyleName(const OUString &rStyleName, const SwFontScript nWhich)
const editeng::SvxBorderLine * GetTop() const
void SetLanguage(LanguageType eNewLang, const SwFontScript nWhich)
void Init(const SwAttrSet &rAttrSet, const IDocumentSettingAccess &rIDocumentSettingAccess)
void SetRightBorder(const editeng::SvxBorderLine *pRightBorder)
const editeng::SvxBorderLine * GetLeft() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetVisited(bool bNew)
void SetUnderColor(const Color &rColor)
void SetRightBorderDist(const sal_uInt16 nRightDist)
void SetShadowWidth(const sal_uInt16 nWidth)
void SetCaseMap(const SvxCaseMap eNew)
constexpr sal_uInt16 RES_TXTATR_WITHEND_END(56)
void SetVertical(Degree10 nDir, const bool bVertLayout=false, const bool bVertLayoutLRBT=false)
constexpr TypedWhichId< SvxShadowedItem > RES_CHRATR_SHADOWED(13)
void SetRelief(const FontRelief eNew)
const IDocumentSettingAccess * m_pIDocumentSettingAccess
void SetEscapement(const short nNewEsc)
Provides access to settings of a document.
void RemoveFromStack(sal_uInt16 nWhich, const SwTextAttr &rAttr)
void SetWeight(const FontWeight eWeight, const SwFontScript nWhich)
void GetDefaultAscentAndHeight(SwViewShell const *pShell, OutputDevice const &rOut, sal_uInt16 &nAscent, sal_uInt16 &nHeight) const
Takes the default font and calculated the ascent and height.
bool Push(const SwTextAttr &rAttr, const SfxPoolItem &rItem)
constexpr TypedWhichId< SvxOverlineItem > RES_CHRATR_OVERLINE(38)
constexpr TypedWhichId< SvxEmphasisMarkItem > RES_CHRATR_EMPHASIS_MARK(33)
void SetOverColor(const Color &rColor)
const SwTextAttr * GetTop(sal_uInt16 nStack)
void SetFixKerning(const short nNewKern)
constexpr TypedWhichId< SvxCharScaleWidthItem > RES_CHRATR_SCALEW(35)
constexpr TypedWhichId< SvxCharHiddenItem > RES_CHRATR_HIDDEN(37)
void SetBottomBorder(const editeng::SvxBorderLine *pBottomBorder)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
const sal_uInt8 StackPos[RES_TXTATR_WITHEND_END-RES_CHRATR_BEGIN+1]
Attribute to Stack Mapping.
const SwViewShell * m_pShell
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
sal_uInt8 & GetInputField()
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void SetBackColor(std::optional< Color > xNewColor)
void SetSize(const Size &rSize, const SwFontScript nWhich)
constexpr TypedWhichId< SvxWordLineModeItem > RES_CHRATR_WORDLINEMODE(16)
const SwViewOption * GetViewOptions() const
vcl::Window * GetWin() const
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
void SetTopBorder(const editeng::SvxBorderLine *pTopBorder)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
void SetFamily(const FontFamily eFamily, const SwFontScript nWhich)
void SetCharSet(const rtl_TextEncoding eCharSet, const SwFontScript nWhich)
constexpr TypedWhichId< SwTOXMark > RES_TXTATR_TOXMARK(47)
void ActivateTop(SwFont &rFnt, sal_uInt16 nStackPos)
std::vector< const SwTextAttr * > m_aAttrStack[NUM_ATTRIBUTE_STACKS]
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
constexpr TypedWhichId< SwFormatField > RES_TXTATR_INPUTFIELD(55)
constexpr sal_uInt16 RES_CHRATR_END(46)
void SetName(const OUString &rName, const SwFontScript nWhich)
void PushAndChg(const SwTextAttr &rAttr, SwFont &rFnt)
const SfxPoolItem & GetAttr() const
void SetAutoKern(FontKerning nAutoKern)
constexpr TypedWhichId< SvxCharRotateItem > RES_CHRATR_ROTATE(32)
void SetItalic(const FontItalic eItalic, const SwFontScript nWhich)
constexpr TypedWhichId< SwFormatRefMark > RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN)
void SetProportion(const sal_uInt8 nNewPropr)
void SetHighlightColor(const Color &aNewColor)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
static bool lcl_ChgHyperLinkColor(const SwTextAttr &rAttr, const SfxPoolItem &rItem, const SwViewShell *pShell, Color *pColor)
The color of hyperlinks is taken from the associated character attribute, depending on its 'visited' ...
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_HIGHLIGHT(42)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxKerningItem > RES_CHRATR_KERNING(9)
void SetOverline(const FontLineStyle eOverline)
const editeng::SvxBorderLine * GetBottom() const
tools::Long GetHeight() const
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
void SetTopBorderDist(const sal_uInt16 nTopDist)
sal_Int16 GetCaseMap(sal_Int32 nToken)
const SfxPoolItem * GetCurItem() const
sal_uInt16 GetWidth() const
constexpr TypedWhichId< SvxContourItem > RES_CHRATR_CONTOUR(4)