LibreOffice Module sw (master) 1
|
Class to collect and output the styles table. More...
#include <wrtww8.hxx>
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... | |
OUString | GetStyleWWName (SwFormat const *pFormat) const |
the awful TOC field references names, not styleIds More... | |
const SwFormat * | GetSwFormat (sal_uInt16 nSlot) const |
const SwNumRule * | GetSwNumRule (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 | |
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< MapEntry > | m_aStyles |
Slot <-> Character/paragraph/list style array. More... | |
bool | m_bListStyles |
If list styles are requested to be exported as well. More... | |
Class to collect and output the styles table.
Definition at line 1582 of file wrtww8.hxx.
|
privatedelete |
MSWordStyles::MSWordStyles | ( | MSWordExportBase & | rExport, |
bool | bListStyles = false |
||
) |
Definition at line 184 of file wrtw8sty.cxx.
References BuildStyleIds(), BuildStylesTable(), BuildWwNames(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::empty(), SwEndNoteInfo::GetAnchorCharFormat(), SwEndNoteInfo::GetCharFormat(), SwDoc::GetEndNoteInfo(), SwDoc::GetFootnoteIdxs(), SwDoc::GetFootnoteInfo(), m_aHeadingParagraphStyles, MSWordExportBase::m_rDoc, m_rExport, and MAXLEVEL.
MSWordStyles::~MSWordStyles | ( | ) |
Definition at line 205 of file wrtw8sty.cxx.
|
private |
Based on style names, fill in unique, MS-like names.
Definition at line 429 of file wrtw8sty.cxx.
References CreateStyleId(), and m_aStyles.
Referenced by MSWordStyles().
|
private |
Create the style table, called from the constructor.
Definition at line 313 of file wrtw8sty.cxx.
References BuildGetSlot(), SwTextFormatColl::GetAssignedOutlineStyleLevel(), SwDoc::GetCharFormats(), SwNumRule::GetName(), SwDoc::GetNumRuleTable(), SwDoc::GetTextFormatColls(), i, SwTextFormatColl::IsAssignedToListLevelOfOutlineStyle(), SwNumRule::IsAutoRule(), m_aHeadingParagraphStyles, m_aStyles, m_bListStyles, MSWordExportBase::m_rDoc, m_rExport, MAXLEVEL, MSWORD_MAX_STYLES_LIMIT, n, SwCharFormats::size(), SwVectorModifyBase< Value >::size(), and WW8_RESERVED_SLOTS.
Referenced by MSWordStyles().
|
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().
|
static |
create style id using only ASCII characters of the style name
Definition at line 424 of file wrtw8sty.cxx.
References aName, msfilter::util::CreateDOCXStyleId(), and OUStringToOString().
Referenced by BuildStyleIds(), and DocxAttributeOutput::Redline().
|
inline |
Definition at line 1649 of file wrtww8.hxx.
References m_aHeadingParagraphStyles.
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().
|
private |
Return information about one style.
Definition at line 639 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 | nSlot | ) | const |
Get styleId of the nSlot-th style (nSlot is its position in m_aStyles).
Definition at line 455 of file wrtw8sty.cxx.
References m_aStyles.
OUString MSWordStyles::GetStyleWWName | ( | SwFormat const * | pFormat | ) | const |
the awful TOC field references names, not styleIds
Definition at line 461 of file wrtw8sty.cxx.
References m_aStyles, MSWordExportBase::m_pStyles, and m_rExport.
|
inline |
Definition at line 1646 of file wrtww8.hxx.
References m_aStyles.
Referenced by AttributeOutputBase::GridCharacterPitch().
|
inline |
Get numbering rule of the nSlot-th style.
Definition at line 1648 of file wrtww8.hxx.
References m_aStyles.
|
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_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, RES_POOLCOLL_TOX_ILLUS1, 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().
|
privatedelete |
|
private |
Outputs one style - called (in a loop) from OutputStylesTable().
Definition at line 678 of file wrtw8sty.cxx.
References MSWordExportBase::AttrOutput(), AttributeOutputBase::DefaultStyle(), MSWordExportBase::DOCX, AttributeOutputBase::EndStyle(), MSWordExportBase::GetExportFormat(), GetStyleData(), m_aStyles, m_rExport, AttributeOutputBase::StartStyle(), STYLE_TYPE_CHAR, STYLE_TYPE_LIST, STYLE_TYPE_PARA, and WriteProperties().
Referenced by OutputStylesTable().
void MSWordStyles::OutputStylesTable | ( | ) |
Output the styles table.
Definition at line 752 of file wrtw8sty.cxx.
References MSWordExportBase::AttrOutput(), AttributeOutputBase::EndStyles(), m_aStyles, MSWordExportBase::m_bStyDef, m_rExport, MSWORD_MAX_STYLES_LIMIT, OutputStyle(), and AttributeOutputBase::StartStyles().
|
private |
Definition at line 535 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 612 of file wrtw8sty.cxx.
References MSWordExportBase::AttrOutput(), AttributeOutputBase::EndStyleProperties(), MSWordExportBase::m_pCurrentStyle, m_rExport, nPos, MSWordExportBase::OutputFormat(), SetStyleDefaults(), and AttributeOutputBase::StartStyleProperties().
Referenced by OutputStyle().
|
private |
Definition at line 1585 of file wrtww8.hxx.
Referenced by BuildStylesTable(), GetHeadingParagraphStyleId(), and MSWordStyles().
|
private |
Slot <-> Character/paragraph/list style array.
Definition at line 1600 of file wrtww8.hxx.
Referenced by BuildStyleIds(), BuildStylesTable(), BuildWwNames(), GetSlot(), GetStyleId(), GetStyleWWName(), GetSwFormat(), GetSwNumRule(), OutputStyle(), and OutputStylesTable().
|
private |
If list styles are requested to be exported as well.
Definition at line 1601 of file wrtww8.hxx.
Referenced by BuildStylesTable().
|
private |
Definition at line 1584 of file wrtww8.hxx.
Referenced by BuildStylesTable(), GetStyleWWName(), MSWordStyles(), OutputStyle(), OutputStylesTable(), SetStyleDefaults(), and WriteProperties().