LibreOffice Module sw (master)  1
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]

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 SwFormatGetSwFormat (sal_uInt16 nId) const
 
const SwNumRuleGetSwNumRule (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)
 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
 
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::unique_ptr< SwFormat *[]> m_pFormatA
 Slot <-> Character and paragraph style array (0 for list styles). More...
 
sal_uInt16 m_nUsedSlots
 
bool const 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...
 

Detailed Description

Class to collect and output the styles table.

Definition at line 1567 of file wrtww8.hxx.

Constructor & Destructor Documentation

MSWordStyles::MSWordStyles ( const MSWordStyles )
privatedelete
MSWordStyles::MSWordStyles ( MSWordExportBase rExport,
bool  bListStyles = false 
)
MSWordStyles::~MSWordStyles ( )

Definition at line 167 of file wrtw8sty.cxx.

Member Function Documentation

sal_uInt16 MSWordStyles::BuildGetSlot ( const SwFormat rFormat)
private
sal_uInt16 MSWordStyles::BuildGetSlot ( const SwNumRule )
inlineprivate

Definition at line 1587 of file wrtww8.hxx.

void MSWordStyles::BuildStyleIds ( )
private

Based on pFormatA, fill in m_aStyleIds with unique, MS-like names.

Definition at line 340 of file wrtw8sty.cxx.

References aName, CreateStyleId(), m_aNumRules, m_aStyleIds, m_nUsedSlots, and m_pFormatA.

Referenced by MSWordStyles().

void MSWordStyles::BuildStylesTable ( )
private
OString MSWordStyles::CreateStyleId ( const OUString &  rName)
static

create style id using only ASCII characters of the style name

Definition at line 320 of file wrtw8sty.cxx.

References i.

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

sal_uInt16 MSWordStyles::GetHeadingParagraphStyleId ( sal_uInt16  nLevel) const
inline

Definition at line 1625 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_nUsedSlots, and m_pFormatA.

Referenced by GetStyleData().

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

Return information about one style.

Definition at line 551 of file wrtw8sty.cxx.

References SwFormat::DerivedFrom(), GetSlot(), SwFormat::IsDefault(), 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 378 of file wrtw8sty.cxx.

References m_aStyleIds.

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

Definition at line 1622 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 708 of file wrtw8sty.cxx.

References m_aNumRules.

sal_uInt16 MSWordStyles::GetWWId ( const SwFormat rFormat)
staticprivate
MSWordStyles& MSWordStyles::operator= ( const MSWordStyles )
privatedelete
void MSWordStyles::OutputStyle ( SwFormat pFormat,
sal_uInt16  nPos 
)
private
void MSWordStyles::OutputStyle ( const SwNumRule pNumRule,
sal_uInt16  nPos 
)
private
void MSWordStyles::OutputStylesTable ( )
void MSWordStyles::SetStyleDefaults ( const SwFormat rFormat,
bool  bPap 
)
private
void MSWordStyles::WriteProperties ( const SwFormat pFormat,
bool  bPap,
sal_uInt16  nPos,
bool  bInsDefCharSiz 
)
private

Member Data Documentation

sal_uInt16 MSWordStyles::m_aHeadingParagraphStyles[MAXLEVEL]
private

Definition at line 1570 of file wrtww8.hxx.

Referenced by BuildStylesTable(), and MSWordStyles().

std::map<sal_uInt16, const SwNumRule*> MSWordStyles::m_aNumRules
private

Slot <-> List style map.

Definition at line 1574 of file wrtww8.hxx.

Referenced by BuildStyleIds(), BuildStylesTable(), GetSwNumRule(), and OutputStylesTable().

std::vector<OString> MSWordStyles::m_aStyleIds
private

We need to build style id's for DOCX export; ideally we should roundtrip that, but this is good enough.

Definition at line 1577 of file wrtww8.hxx.

Referenced by BuildStyleIds(), and GetStyleId().

bool const MSWordStyles::m_bListStyles
private

If list styles are requested to be exported as well.

Definition at line 1573 of file wrtww8.hxx.

Referenced by BuildStylesTable().

sal_uInt16 MSWordStyles::m_nUsedSlots
private
std::unique_ptr<SwFormat*[]> MSWordStyles::m_pFormatA
private

Slot <-> Character and paragraph style array (0 for list styles).

Definition at line 1571 of file wrtww8.hxx.

Referenced by BuildStyleIds(), BuildStylesTable(), GetSlot(), MSWordStyles(), OutputStyle(), and OutputStylesTable().

MSWordExportBase& MSWordStyles::m_rExport
private

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