LibreOffice Module sw (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SwAttrHandler Class Reference

Used by Attribute Iterators to organize attributes on stacks to find the valid attribute in each category. More...

#include <atrhndl.hxx>

Collaboration diagram for SwAttrHandler:
[legend]

Public Member Functions

 SwAttrHandler ()
 
 ~SwAttrHandler ()
 
void Init (const SwAttrSet &rAttrSet, const IDocumentSettingAccess &rIDocumentSettingAccess)
 
void Init (const SfxPoolItem **pPoolItem, const SwAttrSet *pAttrSet, const IDocumentSettingAccess &rIDocumentSettingAccess, const SwViewShell *pShell, SwFont &rFnt, bool bVertLayout, bool bVertLayoutLRBT)
 
bool IsVertLayout () const
 
void Reset ()
 
void PushAndChg (const SwTextAttr &rAttr, SwFont &rFnt)
 
void PopAndChg (const SwTextAttr &rAttr, SwFont &rFnt)
 
void Pop (const SwTextAttr &rAttr)
 Only used during redlining. More...
 
void ResetFont (SwFont &rFnt) const
 
const SwFontGetFont () const
 
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. More...
 

Private Member Functions

const SwTextAttrGetTop (sal_uInt16 nStack)
 
void RemoveFromStack (sal_uInt16 nWhich, const SwTextAttr &rAttr)
 
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. More...
 
bool Push (const SwTextAttr &rAttr, const SfxPoolItem &rItem)
 
void ActivateTop (SwFont &rFnt, sal_uInt16 nStackPos)
 

Private Attributes

std::vector< const SwTextAttr * > m_aAttrStack [NUM_ATTRIBUTE_STACKS]
 
const SfxPoolItemm_pDefaultArray [NUM_DEFAULT_VALUES]
 
const IDocumentSettingAccessm_pIDocumentSettingAccess
 
const SwViewShellm_pShell
 
std::optional< SwFontm_oFnt
 
bool m_bVertLayout
 
bool m_bVertLayoutLRBT
 

Detailed Description

Used by Attribute Iterators to organize attributes on stacks to find the valid attribute in each category.

Definition at line 37 of file atrhndl.hxx.

Constructor & Destructor Documentation

◆ SwAttrHandler()

SwAttrHandler::SwAttrHandler ( )

Definition at line 264 of file atrstck.cxx.

References m_pDefaultArray, m_pShell, and NUM_DEFAULT_VALUES.

◆ ~SwAttrHandler()

SwAttrHandler::~SwAttrHandler ( )

Definition at line 273 of file atrstck.cxx.

Member Function Documentation

◆ ActivateTop()

void SwAttrHandler::ActivateTop ( SwFont rFnt,
sal_uInt16  nStackPos 
)
private

◆ FontChg()

void SwAttrHandler::FontChg ( const SfxPoolItem rItem,
SwFont rFnt,
bool  bPush 
)
private

When popping an attribute from the stack, the top more remaining attribute in the stack becomes valid.

The following function change a font depending on the stack id.

Definition at line 564 of file atrstck.cxx.

References ActivateTop(), CJK, CTL, IDocumentSettingAccess::get(), SvxBoxItem::GetBottom(), SvxShadowItem::GetColor(), SwFont::GetContentControl(), SvxBoxItem::GetDistance(), SwFont::GetInputField(), CharFormat::GetItem(), SvxBoxItem::GetLeft(), SvxShadowItem::GetLocation(), SwFont::GetMeta(), SwFont::GetRef(), SvxBoxItem::GetRight(), SvxBoxItem::GetTop(), GetTop(), SwFont::GetTox(), GetValue, SvxShadowItem::GetWidth(), SwViewShell::GetWin(), KERN_ASIAN_PUNCTUATION, Latin, LINESTYLE_DOTTED, m_aAttrStack, m_bVertLayout, m_bVertLayoutLRBT, m_pDefaultArray, m_pIDocumentSettingAccess, m_pShell, RES_CHRATR_AUTOKERN(), RES_CHRATR_BACKGROUND(), RES_CHRATR_BOX(), RES_CHRATR_CASEMAP(), RES_CHRATR_CJK_FONT(), RES_CHRATR_CJK_FONTSIZE(), RES_CHRATR_CJK_LANGUAGE(), RES_CHRATR_CJK_POSTURE(), RES_CHRATR_CJK_WEIGHT(), RES_CHRATR_COLOR(), RES_CHRATR_CONTOUR(), RES_CHRATR_CROSSEDOUT(), RES_CHRATR_CTL_FONT(), RES_CHRATR_CTL_FONTSIZE(), RES_CHRATR_CTL_LANGUAGE(), RES_CHRATR_CTL_POSTURE(), RES_CHRATR_CTL_WEIGHT(), RES_CHRATR_EMPHASIS_MARK(), RES_CHRATR_ESCAPEMENT(), RES_CHRATR_FONT(), RES_CHRATR_FONTSIZE(), RES_CHRATR_HIDDEN(), RES_CHRATR_HIGHLIGHT(), RES_CHRATR_KERNING(), RES_CHRATR_LANGUAGE(), RES_CHRATR_OVERLINE(), RES_CHRATR_POSTURE(), RES_CHRATR_RELIEF(), RES_CHRATR_ROTATE(), RES_CHRATR_SCALEW(), RES_CHRATR_SHADOW(), RES_CHRATR_SHADOWED(), RES_CHRATR_TWO_LINES(), RES_CHRATR_UNDERLINE(), RES_CHRATR_WEIGHT(), RES_CHRATR_WORDLINEMODE(), RES_TXTATR_CJK_RUBY(), RES_TXTATR_CONTENTCONTROL(), RES_TXTATR_INPUTFIELD(), RES_TXTATR_META(), RES_TXTATR_METAFIELD(), RES_TXTATR_REFMARK(), RES_TXTATR_TOXMARK(), SwFont::SetAutoKern(), SwFont::SetBackColor(), SwFont::SetBottomBorder(), SwFont::SetBottomBorderDist(), SwFont::SetCaseMap(), SwFont::SetCharSet(), SwFont::SetColor(), SwFont::SetEmphasisMark(), SwFont::SetEscapement(), SwFont::SetFamily(), SwFont::SetFixKerning(), SwFont::SetHighlightColor(), SwFont::SetItalic(), SwFont::SetLanguage(), SwFont::SetLeftBorder(), SwFont::SetLeftBorderDist(), SwFont::SetName(), SwFont::SetOutline(), SwFont::SetOverColor(), SwFont::SetOverline(), SwFont::SetPitch(), SwFont::SetProportion(), SwFont::SetPropWidth(), SwFont::SetRelief(), SwFont::SetRightBorder(), SwFont::SetRightBorderDist(), SwFont::SetShadow(), SwFont::SetShadowColor(), SwFont::SetShadowLocation(), SwFont::SetShadowWidth(), SwFont::SetSize(), SwFont::SetStrikeout(), SwFont::SetStyleName(), SwFont::SetTopBorder(), SwFont::SetTopBorderDist(), SwFont::SetUnderColor(), SwFont::SetUnderline(), SwFont::SetVertical(), SwFont::SetWeight(), SwFont::SetWordLineMode(), StackPos, SfxPoolItem::StaticWhichCast(), and SfxPoolItem::Which().

Referenced by ActivateTop(), Init(), and PushAndChg().

◆ GetDefaultAscentAndHeight()

void SwAttrHandler::GetDefaultAscentAndHeight ( SwViewShell const *  pShell,
OutputDevice const &  rOut,
sal_uInt16 &  nAscent,
sal_uInt16 &  nHeight 
) const

Takes the default font and calculated the ascent and height.

Definition at line 838 of file atrstck.cxx.

References SwFont::GetAscent(), SwFont::GetHeight(), and m_oFnt.

Referenced by SwLineLayout::CalcLine().

◆ GetFont()

const SwFont * SwAttrHandler::GetFont ( ) const
inline

Definition at line 111 of file atrhndl.hxx.

References m_oFnt.

Referenced by SwTextPainter::CheckSpecialUnderline().

◆ GetTop()

const SwTextAttr * SwAttrHandler::GetTop ( sal_uInt16  nStack)
private

Definition at line 381 of file atrstck.cxx.

References m_aAttrStack.

Referenced by ActivateTop(), FontChg(), and Push().

◆ Init() [1/2]

void SwAttrHandler::Init ( const SfxPoolItem **  pPoolItem,
const SwAttrSet pAttrSet,
const IDocumentSettingAccess rIDocumentSettingAccess,
const SwViewShell pShell,
SwFont rFnt,
bool  bVertLayout,
bool  bVertLayoutLRBT 
)

◆ Init() [2/2]

void SwAttrHandler::Init ( const SwAttrSet rAttrSet,
const IDocumentSettingAccess rIDocumentSettingAccess 
)

◆ IsVertLayout()

bool SwAttrHandler::IsVertLayout ( ) const
inline

Definition at line 79 of file atrhndl.hxx.

References m_bVertLayout.

Referenced by SwAttrIter::InitFontAndAttrHandler().

◆ Pop()

void SwAttrHandler::Pop ( const SwTextAttr rAttr)

Only used during redlining.

Definition at line 462 of file atrstck.cxx.

References RemoveFromStack(), RES_TXTATR_WITHEND_END(), and SwTextAttr::Which().

Referenced by SwRedlineItr::Clear_().

◆ PopAndChg()

void SwAttrHandler::PopAndChg ( const SwTextAttr rAttr,
SwFont rFnt 
)

◆ Push()

bool SwAttrHandler::Push ( const SwTextAttr rAttr,
const SfxPoolItem rItem 
)
private

◆ PushAndChg()

void SwAttrHandler::PushAndChg ( const SwTextAttr rAttr,
SwFont rFnt 
)

◆ RemoveFromStack()

void SwAttrHandler::RemoveFromStack ( sal_uInt16  nWhich,
const SwTextAttr rAttr 
)
private

Definition at line 414 of file atrstck.cxx.

References m_aAttrStack, and StackPos.

Referenced by Pop(), and PopAndChg().

◆ Reset()

void SwAttrHandler::Reset ( void  )

Definition at line 331 of file atrstck.cxx.

References i, and m_aAttrStack.

Referenced by SwAttrIter::Seek(), and SwAttrIter::SeekStartAndChgAttrIter().

◆ ResetFont()

void SwAttrHandler::ResetFont ( SwFont rFnt) const
inline

Definition at line 104 of file atrhndl.hxx.

References m_oFnt.

Referenced by SwAttrIter::Seek(), and SwAttrIter::SeekStartAndChgAttrIter().

Member Data Documentation

◆ m_aAttrStack

std::vector<const SwTextAttr*> SwAttrHandler::m_aAttrStack[NUM_ATTRIBUTE_STACKS]
private

Definition at line 40 of file atrhndl.hxx.

Referenced by FontChg(), GetTop(), Push(), RemoveFromStack(), and Reset().

◆ m_bVertLayout

bool SwAttrHandler::m_bVertLayout
private

Definition at line 49 of file atrhndl.hxx.

Referenced by ActivateTop(), FontChg(), Init(), and IsVertLayout().

◆ m_bVertLayoutLRBT

bool SwAttrHandler::m_bVertLayoutLRBT
private

Definition at line 50 of file atrhndl.hxx.

Referenced by FontChg(), and Init().

◆ m_oFnt

std::optional<SwFont> SwAttrHandler::m_oFnt
private

Definition at line 47 of file atrhndl.hxx.

Referenced by GetDefaultAscentAndHeight(), GetFont(), Init(), and ResetFont().

◆ m_pDefaultArray

const SfxPoolItem* SwAttrHandler::m_pDefaultArray[NUM_DEFAULT_VALUES]
private

Definition at line 41 of file atrhndl.hxx.

Referenced by ActivateTop(), FontChg(), Init(), and SwAttrHandler().

◆ m_pIDocumentSettingAccess

const IDocumentSettingAccess* SwAttrHandler::m_pIDocumentSettingAccess
private

Definition at line 42 of file atrhndl.hxx.

Referenced by FontChg(), and Init().

◆ m_pShell

const SwViewShell* SwAttrHandler::m_pShell
private

Definition at line 43 of file atrhndl.hxx.

Referenced by ActivateTop(), FontChg(), Init(), Push(), and PushAndChg().


The documentation for this class was generated from the following files: