LibreOffice Module sw (master)
1
|
Class to collect and output the styles table. More...
#include <wrtww8.hxx>
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 id of the style (rFormat). More... | |
OString const & | GetStyleId (sal_uInt16 nId) const |
Get styleId of the nId-th style (nId is its position in pFormatA). More... | |
const SwFormat * | GetSwFormat (sal_uInt16 nId) const |
const SwNumRule * | GetSwNumRule (sal_uInt16 nId) const |
Get numbering rule of the nId-th style. More... | |
sal_uInt16 | GetHeadingParagraphStyleId (sal_uInt16 nLevel) const |
Static Public Member Functions | |
static OString | CreateStyleId (const OUString &rName) |
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 | BuildStyleIds () |
Based on pFormatA, fill in m_aStyleIds with unique, MS-like names. More... | |
sal_uInt16 | BuildGetSlot (const SwFormat &rFormat) |
Get slot number during building the style table. More... | |
sal_uInt16 | BuildGetSlot (const SwNumRule &) |
void | GetStyleData (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 (SwFormat *pFormat, sal_uInt16 nPos) |
Outputs one style - called (in a loop) from OutputStylesTable(). More... | |
void | OutputStyle (const SwNumRule *pNumRule, sal_uInt16 nPos) |
MSWordStyles (const MSWordStyles &)=delete | |
MSWordStyles & | operator= (const MSWordStyles &)=delete |
Static Private Member Functions | |
static sal_uInt16 | GetWWId (const SwFormat &rFormat) |
Private Attributes | |
MSWordExportBase & | m_rExport |
sal_uInt16 | m_aHeadingParagraphStyles [MAXLEVEL] |
std::vector< SwFormat * > | m_aFormatA |
Slot <-> Character and paragraph style array (0 for list styles). More... | |
sal_uInt16 | m_nUsedSlots |
bool | m_bListStyles |
If list styles are requested to be exported as well. More... | |
std::map< sal_uInt16, const SwNumRule * > | m_aNumRules |
Slot <-> List style map. More... | |
std::vector< OString > | m_aStyleIds |
We need to build style id's for DOCX export; ideally we should roundtrip that, but this is good enough. More... | |
Class to collect and output the styles table.
Definition at line 1579 of file wrtww8.hxx.
|
privatedelete |
MSWordStyles::MSWordStyles | ( | MSWordExportBase & | rExport, |
bool | bListStyles = false |
||
) |
Definition at line 141 of file wrtw8sty.cxx.
References BuildStyleIds(), BuildStylesTable(), o3tl::sorted_vector< Value, Compare, Find, class >::empty(), SwEndNoteInfo::GetAnchorCharFormat(), SwEndNoteInfo::GetCharFormat(), SwDoc::GetCharFormats(), SwDoc::GetEndNoteInfo(), SwDoc::GetFootnoteIdxs(), SwDoc::GetFootnoteInfo(), SwDoc::GetNumRuleTable(), SwDoc::GetTextFormatColls(), m_aFormatA, m_aHeadingParagraphStyles, MSWordExportBase::m_rDoc, m_rExport, MAXLEVEL, MSWORD_MAX_STYLES_LIMIT, SwCharFormats::size(), SwVectorModifyBase< Value >::size(), and WW8_RESERVED_SLOTS.
MSWordStyles::~MSWordStyles | ( | ) |
Definition at line 167 of file wrtw8sty.cxx.
|
private |
Get slot number during building the style table.
Definition at line 181 of file wrtw8sty.cxx.
References SwFormat::GetPoolFormatId(), m_nUsedSlots, RES_POOLCOLL_HEADLINE1, RES_POOLCOLL_HEADLINE2, RES_POOLCOLL_HEADLINE3, RES_POOLCOLL_HEADLINE4, RES_POOLCOLL_HEADLINE5, RES_POOLCOLL_HEADLINE6, RES_POOLCOLL_HEADLINE7, RES_POOLCOLL_HEADLINE8, RES_POOLCOLL_HEADLINE9, and RES_POOLCOLL_STANDARD.
Referenced by BuildStylesTable().
|
inlineprivate |
Definition at line 1599 of file wrtww8.hxx.
|
private |
Based on pFormatA, fill in m_aStyleIds with unique, MS-like names.
Definition at line 341 of file wrtw8sty.cxx.
References aName, CreateStyleId(), GetName(), m_aFormatA, m_aNumRules, m_aStyleIds, m_nUsedSlots, and n.
Referenced by MSWordStyles().
|
private |
Create the style table, called from the constructor.
Definition at line 280 of file wrtw8sty.cxx.
References BuildGetSlot(), SwTextFormatColl::GetAssignedOutlineStyleLevel(), SwDoc::GetCharFormats(), SwNumRule::GetName(), SwDoc::GetNumRuleTable(), SwDoc::GetTextFormatColls(), i, SwTextFormatColl::IsAssignedToListLevelOfOutlineStyle(), SwNumRule::IsAutoRule(), m_aFormatA, m_aHeadingParagraphStyles, m_aNumRules, m_bListStyles, m_nUsedSlots, MSWordExportBase::m_rDoc, m_rExport, MAXLEVEL, MSWORD_MAX_STYLES_LIMIT, n, nId, SwCharFormats::size(), SwVectorModifyBase< Value >::size(), and WW8_RESERVED_SLOTS.
Referenced by MSWordStyles().
|
static |
create style id using only ASCII characters of the style name
Definition at line 321 of file wrtw8sty.cxx.
References i.
Referenced by BuildStyleIds(), DocxAttributeOutput::Redline(), and DocxAttributeOutput::TextINetFormat().
|
inline |
Definition at line 1637 of file wrtww8.hxx.
sal_uInt16 MSWordStyles::GetSlot | ( | const SwFormat * | pFormat | ) | const |
Get id of the style (rFormat).
Definition at line 172 of file wrtw8sty.cxx.
References m_aFormatA, m_nUsedSlots, and n.
Referenced by GetStyleData().
|
private |
Return information about one style.
Definition at line 552 of file wrtw8sty.cxx.
References SwFormat::DerivedFrom(), GetSlot(), SwFormat::IsDefault(), pLink, RES_CONDTXTFMTCOLL(), RES_TXTFMTCOLL(), and SwFormat::Which().
Referenced by OutputStyle().
OString const & MSWordStyles::GetStyleId | ( | sal_uInt16 | nId | ) | const |
Get styleId of the nId-th style (nId is its position in pFormatA).
Definition at line 379 of file wrtw8sty.cxx.
References m_aStyleIds.
|
inline |
Definition at line 1634 of file wrtww8.hxx.
Referenced by AttributeOutputBase::GridCharacterPitch().
const SwNumRule * MSWordStyles::GetSwNumRule | ( | sal_uInt16 | nId | ) | const |
Get numbering rule of the nId-th style.
Definition at line 729 of file wrtw8sty.cxx.
References m_aNumRules.
|
staticprivate |
Definition at line 210 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, and ww::stiUser.
Referenced by OutputStyle().
|
privatedelete |
Outputs one style - called (in a loop) from OutputStylesTable().
Definition at line 601 of file wrtw8sty.cxx.
References aName, MSWordExportBase::AttrOutput(), AttributeOutputBase::DefaultStyle(), MSWordExportBase::DOCX, AttributeOutputBase::EndStyle(), MSWordExportBase::GetExportFormat(), GetName(), SwFormat::GetName(), SwFormat::GetPoolFormatId(), GetStyleData(), GetWWId(), SwFormat::IsAutoUpdateFormat(), m_aFormatA, m_nUsedSlots, MSWordExportBase::m_pStyles, m_rExport, n, RES_POOLCOLL_STANDARD, AttributeOutputBase::StartStyle(), STYLE_TYPE_CHAR, STYLE_TYPE_PARA, and WriteProperties().
Referenced by OutputStylesTable().
Definition at line 591 of file wrtw8sty.cxx.
References MSWordExportBase::AttrOutput(), AttributeOutputBase::EndStyle(), false, SwNumRule::GetName(), m_rExport, AttributeOutputBase::StartStyle(), and STYLE_TYPE_LIST.
void MSWordStyles::OutputStylesTable | ( | ) |
Output the styles table.
Definition at line 701 of file wrtw8sty.cxx.
References MSWordExportBase::AttrOutput(), AttributeOutputBase::EndStyles(), m_aFormatA, m_aNumRules, MSWordExportBase::m_bStyDef, m_nUsedSlots, m_rExport, min(), MSWORD_MAX_STYLES_LIMIT, n, OutputStyle(), and AttributeOutputBase::StartStyles().
Definition at line 448 of file wrtw8sty.cxx.
References MSWordExportBase::AttrOutput(), MSWordExportBase::CollapseScriptsforWordOk(), SwFormat::GetAttrSet(), MSWordExportBase::GetCurItemSet(), SwDoc::GetDfltTextFormatColl(), SwFormat::GetFormatAttr(), SwFormat::GetItemState(), SwAttrSet::GetPool(), SfxItemPool::GetPoolDefaultItem(), MSWordExportBase::ignoreAttributeForStyleDefaults(), MSWordExportBase::m_pOutFormatNode, MSWordExportBase::m_rDoc, m_rExport, n, AttributeOutputBase::OutputItem(), RES_CHRATR_BEGIN(), RES_CHRATR_FONTSIZE(), RES_CHRATR_LANGUAGE(), RES_FRAMEDIR(), RES_FRMATR_END(), RES_PARATR_BEGIN(), RES_PARATR_HYPHENZONE(), RES_PARATR_WIDOWS(), RES_TXTATR_END(), and MSWordExportBase::SetCurItemSet().
Referenced by WriteProperties().
|
private |
Outputs attributes of one style.
Definition at line 525 of file wrtw8sty.cxx.
References MSWordExportBase::AttrOutput(), AttributeOutputBase::EndStyleProperties(), MSWordExportBase::m_pCurrentStyle, m_rExport, MSWordExportBase::OutputFormat(), SetStyleDefaults(), and AttributeOutputBase::StartStyleProperties().
Referenced by OutputStyle().
|
private |
Slot <-> Character and paragraph style array (0 for list styles).
Definition at line 1583 of file wrtww8.hxx.
Referenced by BuildStyleIds(), BuildStylesTable(), GetSlot(), MSWordStyles(), OutputStyle(), and OutputStylesTable().
|
private |
Definition at line 1582 of file wrtww8.hxx.
Referenced by BuildStylesTable(), and MSWordStyles().
Slot <-> List style map.
Definition at line 1586 of file wrtww8.hxx.
Referenced by BuildStyleIds(), BuildStylesTable(), GetSwNumRule(), and OutputStylesTable().
|
private |
We need to build style id's for DOCX export; ideally we should roundtrip that, but this is good enough.
Definition at line 1589 of file wrtww8.hxx.
Referenced by BuildStyleIds(), and GetStyleId().
|
private |
If list styles are requested to be exported as well.
Definition at line 1585 of file wrtww8.hxx.
Referenced by BuildStylesTable().
|
private |
Definition at line 1584 of file wrtww8.hxx.
Referenced by BuildGetSlot(), BuildStyleIds(), BuildStylesTable(), GetSlot(), OutputStyle(), and OutputStylesTable().
|
private |
Definition at line 1581 of file wrtww8.hxx.
Referenced by BuildStylesTable(), MSWordStyles(), OutputStyle(), OutputStylesTable(), SetStyleDefaults(), and WriteProperties().