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

Class to collect and output the styles table. More...

#include <wrtww8.hxx>

Collaboration diagram for MSWordStyles:
[legend]

Classes

struct  MapEntry
 

Public Member Functions

 MSWordStyles (MSWordExportBase &rExport, bool bListStyles=false)
 
 ~MSWordStyles ()
 
void OutputStylesTable ()
 Output the styles table. More...
 
sal_uInt16 GetSlot (const SwFormat *pFormat) const
 Get slot of the style (rFormat). More...
 
OString const & GetStyleId (sal_uInt16 nSlot) const
 Get styleId of the nSlot-th style (nSlot is its position in m_aStyles). More...
 
const SwFormatGetSwFormat (sal_uInt16 nSlot) const
 
const SwNumRuleGetSwNumRule (sal_uInt16 nSlot) const
 Get numbering rule of the nSlot-th style. More...
 
sal_uInt16 GetHeadingParagraphStyleId (sal_uInt16 nLevel) const
 

Static Public Member Functions

static OString CreateStyleId (std::u16string_view aName)
 create style id using only ASCII characters of the style name More...
 

Private Member Functions

void BuildStylesTable ()
 Create the style table, called from the constructor. More...
 
void BuildWwNames ()
 Generate proper Word names, taking mapping between special types into account. More...
 
void BuildStyleIds ()
 Based on style names, fill in unique, MS-like names. More...
 
void GetStyleData (const SwFormat *pFormat, bool &bFormatColl, sal_uInt16 &nBase, sal_uInt16 &nNext, sal_uInt16 &nLink)
 Return information about one style. More...
 
void WriteProperties (const SwFormat *pFormat, bool bPap, sal_uInt16 nPos, bool bInsDefCharSiz)
 Outputs attributes of one style. More...
 
void SetStyleDefaults (const SwFormat &rFormat, bool bPap)
 
void OutputStyle (sal_uInt16 nSlot)
 Outputs one style - called (in a loop) from OutputStylesTable(). More...
 
 MSWordStyles (const MSWordStyles &)=delete
 
MSWordStylesoperator= (const MSWordStyles &)=delete
 

Static Private Member Functions

static sal_uInt16 GetWWId (const SwFormat &rFormat)
 

Private Attributes

MSWordExportBasem_rExport
 
sal_uInt16 m_aHeadingParagraphStyles [MAXLEVEL]
 
std::vector< MapEntrym_aStyles
 Slot <-> Character/paragraph/list style array. More...
 
bool m_bListStyles
 If list styles are requested to be exported as well. More...
 

Detailed Description

Class to collect and output the styles table.

Definition at line 1580 of file wrtww8.hxx.

Constructor & Destructor Documentation

◆ MSWordStyles() [1/2]

MSWordStyles::MSWordStyles ( const MSWordStyles )
privatedelete

◆ MSWordStyles() [2/2]

MSWordStyles::MSWordStyles ( MSWordExportBase rExport,
bool  bListStyles = false 
)

◆ ~MSWordStyles()

MSWordStyles::~MSWordStyles ( )

Definition at line 205 of file wrtw8sty.cxx.

Member Function Documentation

◆ BuildStyleIds()

void MSWordStyles::BuildStyleIds ( )
private

Based on style names, fill in unique, MS-like names.

Definition at line 442 of file wrtw8sty.cxx.

References CreateStyleId(), and m_aStyles.

Referenced by MSWordStyles().

◆ BuildStylesTable()

void MSWordStyles::BuildStylesTable ( )
private

◆ BuildWwNames()

void MSWordStyles::BuildWwNames ( )
private

Generate proper Word names, taking mapping between special types into account.

Definition at line 371 of file wrtw8sty.cxx.

References ww::GetEnglishNameFromSti(), m_aStyles, name, ww::stiMax, ww::stiNormal, and StripWWSuffix().

Referenced by MSWordStyles().

◆ CreateStyleId()

OString MSWordStyles::CreateStyleId ( std::u16string_view  aName)
static

create style id using only ASCII characters of the style name

Definition at line 424 of file wrtw8sty.cxx.

References aName, and i.

Referenced by BuildStyleIds(), and DocxAttributeOutput::Redline().

◆ GetHeadingParagraphStyleId()

sal_uInt16 MSWordStyles::GetHeadingParagraphStyleId ( sal_uInt16  nLevel) const
inline

Definition at line 1645 of file wrtww8.hxx.

References m_aHeadingParagraphStyles.

◆ GetSlot()

sal_uInt16 MSWordStyles::GetSlot ( const SwFormat pFormat) const

Get slot of the style (rFormat).

Definition at line 210 of file wrtw8sty.cxx.

References m_aStyles.

Referenced by GetStyleData().

◆ GetStyleData()

void MSWordStyles::GetStyleData ( const SwFormat pFormat,
bool &  bFormatColl,
sal_uInt16 &  nBase,
sal_uInt16 &  nNext,
sal_uInt16 &  nLink 
)
private

Return information about one style.

Definition at line 642 of file wrtw8sty.cxx.

References SwFormat::DerivedFrom(), GetSlot(), SwFormat::IsDefault(), pLink, RES_CONDTXTFMTCOLL(), RES_TXTFMTCOLL(), and SwFormat::Which().

Referenced by OutputStyle().

◆ GetStyleId()

OString const & MSWordStyles::GetStyleId ( sal_uInt16  nSlot) const

Get styleId of the nSlot-th style (nSlot is its position in m_aStyles).

Definition at line 468 of file wrtw8sty.cxx.

References m_aStyles.

◆ GetSwFormat()

const SwFormat * MSWordStyles::GetSwFormat ( sal_uInt16  nSlot) const
inline

Definition at line 1642 of file wrtww8.hxx.

References m_aStyles.

Referenced by AttributeOutputBase::GridCharacterPitch().

◆ GetSwNumRule()

const SwNumRule * MSWordStyles::GetSwNumRule ( sal_uInt16  nSlot) const
inline

Get numbering rule of the nSlot-th style.

Definition at line 1644 of file wrtww8.hxx.

References m_aStyles.

◆ GetWWId()

sal_uInt16 MSWordStyles::GetWWId ( const SwFormat rFormat)
staticprivate

Definition at line 244 of file wrtw8sty.cxx.

References SwFormat::GetPoolFormatId(), RES_POOLCHR_ENDNOTE_ANCHOR, RES_POOLCHR_FOOTNOTE_ANCHOR, RES_POOLCHR_HTML_EMPHASIS, RES_POOLCHR_HTML_STRONG, RES_POOLCHR_INET_NORMAL, RES_POOLCHR_INET_VISIT, RES_POOLCHR_LINENUM, RES_POOLCHR_PAGENO, RES_POOLCOLL_BULLET_LEVEL1, RES_POOLCOLL_BULLET_LEVEL2, RES_POOLCOLL_BULLET_LEVEL3, RES_POOLCOLL_BULLET_LEVEL4, RES_POOLCOLL_BULLET_LEVEL5, RES_POOLCOLL_BULLET_NONUM1, RES_POOLCOLL_BULLET_NONUM2, RES_POOLCOLL_BULLET_NONUM3, RES_POOLCOLL_BULLET_NONUM4, RES_POOLCOLL_BULLET_NONUM5, RES_POOLCOLL_DOC_APPENDIX, RES_POOLCOLL_DOC_SUBTITLE, RES_POOLCOLL_DOC_TITLE, RES_POOLCOLL_ENDNOTE, RES_POOLCOLL_ENVELOPE_ADDRESS, RES_POOLCOLL_FOOTER, RES_POOLCOLL_FOOTNOTE, RES_POOLCOLL_GREETING, RES_POOLCOLL_HEADER, RES_POOLCOLL_HEADLINE1, RES_POOLCOLL_HEADLINE9, RES_POOLCOLL_LABEL, RES_POOLCOLL_LABEL_DRAWING, RES_POOLCOLL_LISTS_BEGIN, RES_POOLCOLL_MARGINAL, RES_POOLCOLL_NUM_LEVEL1, RES_POOLCOLL_NUM_LEVEL2, RES_POOLCOLL_NUM_LEVEL3, RES_POOLCOLL_NUM_LEVEL4, RES_POOLCOLL_NUM_LEVEL5, RES_POOLCOLL_SEND_ADDRESS, RES_POOLCOLL_SIGNATURE, RES_POOLCOLL_STANDARD, RES_POOLCOLL_TEXT, RES_POOLCOLL_TEXT_IDENT, RES_POOLCOLL_TEXT_MOVE, RES_POOLCOLL_TOX_AUTHORITIESH, RES_POOLCOLL_TOX_CNTNT1, RES_POOLCOLL_TOX_CNTNT5, RES_POOLCOLL_TOX_CNTNT6, RES_POOLCOLL_TOX_CNTNT9, RES_POOLCOLL_TOX_CNTNTH, RES_POOLCOLL_TOX_IDX1, RES_POOLCOLL_TOX_IDX3, RES_POOLCOLL_TOX_IDXH, ww::stiAtnText, ww::stiBodyText, ww::stiBodyText1I, ww::stiBodyTextInd1, ww::stiCaption, ww::stiClosing, ww::stiEdnRef, ww::stiEdnText, ww::stiEmphasis, ww::stiEnvAddr, ww::stiEnvRet, ww::stiFooter, ww::stiFootnoteRef, ww::stiFootnoteText, ww::stiHeader, ww::stiHyperlink, ww::stiHyperlinkFollowed, ww::stiIndexFirst, ww::stiIndexHeading, ww::stiLevFirst, ww::stiList, ww::stiListBullet, ww::stiListBullet2, ww::stiListBullet3, ww::stiListBullet4, ww::stiListBullet5, ww::stiListCont, ww::stiListCont2, ww::stiListCont3, ww::stiListCont4, ww::stiListCont5, ww::stiListNumber, ww::stiListNumber2, ww::stiListNumber3, ww::stiListNumber4, ww::stiListNumber5, ww::stiLnn, ww::stiNormal, ww::stiPgn, ww::stiSalutation, ww::stiSignature, ww::stiStrong, ww::stiSubtitle, ww::stiTitle, ww::stiToa, ww::stiToaHeading, ww::stiToc1, ww::stiToc6, ww::stiToCaption, and ww::stiUser.

Referenced by MSWordStyles::MapEntry::MapEntry().

◆ operator=()

MSWordStyles & MSWordStyles::operator= ( const MSWordStyles )
privatedelete

◆ OutputStyle()

void MSWordStyles::OutputStyle ( sal_uInt16  nSlot)
private

◆ OutputStylesTable()

void MSWordStyles::OutputStylesTable ( )

◆ SetStyleDefaults()

void MSWordStyles::SetStyleDefaults ( const SwFormat rFormat,
bool  bPap 
)
private

◆ WriteProperties()

void MSWordStyles::WriteProperties ( const SwFormat pFormat,
bool  bPap,
sal_uInt16  nPos,
bool  bInsDefCharSiz 
)
private

Member Data Documentation

◆ m_aHeadingParagraphStyles

sal_uInt16 MSWordStyles::m_aHeadingParagraphStyles[MAXLEVEL]
private

Definition at line 1583 of file wrtww8.hxx.

Referenced by BuildStylesTable(), GetHeadingParagraphStyleId(), and MSWordStyles().

◆ m_aStyles

std::vector<MapEntry> MSWordStyles::m_aStyles
private

Slot <-> Character/paragraph/list style array.

Definition at line 1598 of file wrtww8.hxx.

Referenced by BuildStyleIds(), BuildStylesTable(), BuildWwNames(), GetSlot(), GetStyleId(), GetSwFormat(), GetSwNumRule(), OutputStyle(), and OutputStylesTable().

◆ m_bListStyles

bool MSWordStyles::m_bListStyles
private

If list styles are requested to be exported as well.

Definition at line 1599 of file wrtww8.hxx.

Referenced by BuildStylesTable().

◆ m_rExport

MSWordExportBase& MSWordStyles::m_rExport
private

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