LibreOffice Module xmloff (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
XMLSectionExport Class Reference

This class handles the export of sections and indices (which are, internally, just sections). More...

#include <XMLSectionExport.hxx>

Collaboration diagram for XMLSectionExport:
[legend]

Public Member Functions

 XMLSectionExport (SvXMLExport &rExp, XMLTextParagraphExport &rParaExp)
 
void ExportSectionStart (const css::uno::Reference< css::text::XTextSection > &rSection, bool bAutoStyles)
 export section or index start and source elements. More...
 
void ExportSectionEnd (const css::uno::Reference< css::text::XTextSection > &rSection, bool bAutoStyles)
 export section or index end elements More...
 
bool IsMuteSection (const css::uno::Reference< css::text::XTextSection > &rSection) const
 Should the content of this section be exported? (E.g. More...
 
bool IsMuteSection (const css::uno::Reference< css::text::XTextContent > &rSection, bool bDefault) const
 XTextContent-version of IsMuteSection(Reference<XTextSection>&) returns true for all non-section elements. More...
 
void ExportMasterDocHeadingDummies ()
 export a heading for every level. More...
 

Static Public Member Functions

static bool IsInSection (const css::uno::Reference< css::text::XTextSection > &rEnclosingSection, const css::uno::Reference< css::text::XTextContent > &rContent, bool bDefault)
 Determine whether rContent is contained in rEnclosingSection. More...
 
static void ExportBibliographyConfiguration (SvXMLExport &rExport)
 Export the configuration element for bibliography indices. More...
 

Private Member Functions

SvXMLExportGetExport ()
 
XMLTextParagraphExportGetParaExport ()
 
void ExportIndexStart (const css::uno::Reference< css::text::XDocumentIndex > &rSection)
 export an index start element. More...
 
void ExportIndexHeaderStart (const css::uno::Reference< css::text::XTextSection > &rSection)
 export an index header start element. More...
 
void ExportRegularSectionStart (const css::uno::Reference< css::text::XTextSection > &rSection)
 export a proper section (and source elements) More...
 
void ExportTableOfContentStart (const css::uno::Reference< css::beans::XPropertySet > &rSection)
 export a table of content (and source element) More...
 
void ExportTableIndexStart (const css::uno::Reference< css::beans::XPropertySet > &rSection)
 export a table index (and source element) More...
 
void ExportObjectIndexStart (const css::uno::Reference< css::beans::XPropertySet > &rSection)
 export an object index (and source element) More...
 
void ExportIllustrationIndexStart (const css::uno::Reference< css::beans::XPropertySet > &rSection)
 export an illustration index (and source element) More...
 
void ExportAlphabeticalIndexStart (const css::uno::Reference< css::beans::XPropertySet > &rSection)
 export an alphabetical/keyword index (and source element) More...
 
void ExportUserIndexStart (const css::uno::Reference< css::beans::XPropertySet > &rSection)
 export a user index (and source element) More...
 
void ExportBibliographyStart (const css::uno::Reference< css::beans::XPropertySet > &rIndex)
 export the bibliography (and source element) More...
 
void ExportBaseIndexStart (::xmloff::token::XMLTokenEnum eElement, const css::uno::Reference< css::beans::XPropertySet > &rSection)
 Export the index element start (for all index types). More...
 
void ExportBaseIndexSource (SectionTypeEnum eType, const css::uno::Reference< css::beans::XPropertySet > &rSection)
 Export the index source element (common for all index types). More...
 
void ExportBaseIndexBody (SectionTypeEnum eType, const css::uno::Reference< css::beans::XPropertySet > &rSection)
 Export the index body (common for all index types). More...
 
void ExportTableAndIllustrationIndexSourceAttributes (const css::uno::Reference< css::beans::XPropertySet > &rSection)
 Helper method to export common attributes for table and illustration indices. More...
 
bool ExportIndexTemplate (SectionTypeEnum eType, sal_Int32 nLevel, const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > &rValues)
 export one template for the specific index type More...
 
void ExportIndexTemplateElement (SectionTypeEnum eType, const css::uno::Sequence< css::beans::PropertyValue > &rValues)
 export a single template element (e.g. span or tab-stop) More...
 
void ExportLevelParagraphStyles (css::uno::Reference< css::container::XIndexReplace > const &xStyles)
 export level paragraph styles More...
 
void ExportBoolean (const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const OUString &sPropertyName, enum ::xmloff::token::XMLTokenEnum eAttributeName, bool bDefault, bool bInvert=false)
 helper to export boolean properties More...
 

Static Private Member Functions

static bool GetIndex (const css::uno::Reference< css::text::XTextSection > &rSection, css::uno::Reference< css::text::XDocumentIndex > &rIndex)
 If this section is an index, the index is written in the rIndex parameter. More...
 
static enum SectionTypeEnum MapSectionType (std::u16string_view rSectionName)
 map service name to section type More...
 

Private Attributes

SvXMLExportrExport
 
XMLTextParagraphExportrParaExport
 
bool bHeadingDummiesExported
 

Detailed Description

This class handles the export of sections and indices (which are, internally, just sections).

It is intended to be used only from within the XMLTextParagraphExport class.

Definition at line 66 of file XMLSectionExport.hxx.

Constructor & Destructor Documentation

◆ XMLSectionExport()

XMLSectionExport::XMLSectionExport ( SvXMLExport rExp,
XMLTextParagraphExport rParaExp 
)

Definition at line 67 of file XMLSectionExport.cxx.

Member Function Documentation

◆ ExportAlphabeticalIndexStart()

void XMLSectionExport::ExportAlphabeticalIndexStart ( const css::uno::Reference< css::beans::XPropertySet > &  rSection)
private

◆ ExportBaseIndexBody()

void XMLSectionExport::ExportBaseIndexBody ( SectionTypeEnum  eType,
const css::uno::Reference< css::beans::XPropertySet > &  rSection 
)
private

◆ ExportBaseIndexSource()

void XMLSectionExport::ExportBaseIndexSource ( SectionTypeEnum  eType,
const css::uno::Reference< css::beans::XPropertySet > &  rSection 
)
private

◆ ExportBaseIndexStart()

void XMLSectionExport::ExportBaseIndexStart ( ::xmloff::token::XMLTokenEnum  eElement,
const css::uno::Reference< css::beans::XPropertySet > &  rSection 
)
private

◆ ExportBibliographyConfiguration()

void XMLSectionExport::ExportBibliographyConfiguration ( SvXMLExport rExport)
static

◆ ExportBibliographyStart()

void XMLSectionExport::ExportBibliographyStart ( const css::uno::Reference< css::beans::XPropertySet > &  rIndex)
private

export the bibliography (and source element)

Definition at line 686 of file XMLSectionExport.cxx.

References ExportBaseIndexBody(), ExportBaseIndexSource(), ExportBaseIndexStart(), TEXT_SECTION_TYPE_BIBLIOGRAPHY, and xmloff::token::XML_BIBLIOGRAPHY.

Referenced by ExportIndexStart().

◆ ExportBoolean()

void XMLSectionExport::ExportBoolean ( const css::uno::Reference< css::beans::XPropertySet > &  rPropSet,
const OUString &  sPropertyName,
enum ::xmloff::token::XMLTokenEnum  eAttributeName,
bool  bDefault,
bool  bInvert = false 
)
private

◆ ExportIllustrationIndexStart()

void XMLSectionExport::ExportIllustrationIndexStart ( const css::uno::Reference< css::beans::XPropertySet > &  rSection)
private

◆ ExportIndexHeaderStart()

void XMLSectionExport::ExportIndexHeaderStart ( const css::uno::Reference< css::text::XTextSection > &  rSection)
private

◆ ExportIndexStart()

void XMLSectionExport::ExportIndexStart ( const css::uno::Reference< css::text::XDocumentIndex > &  rSection)
private

◆ ExportIndexTemplate()

bool XMLSectionExport::ExportIndexTemplate ( SectionTypeEnum  eType,
sal_Int32  nLevel,
const css::uno::Reference< css::beans::XPropertySet > &  rPropSet,
const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > &  rValues 
)
private

◆ ExportIndexTemplateElement()

void XMLSectionExport::ExportIndexTemplateElement ( SectionTypeEnum  eType,
const css::uno::Sequence< css::beans::PropertyValue > &  rValues 
)
private

export a single template element (e.g. span or tab-stop)

Definition at line 1156 of file XMLSectionExport.cxx.

References aBibliographyDataFieldMap, SvXMLExport::AddAttribute(), aTemplateParamMap, aTemplateTypeMap, SvXMLExport::Characters(), SvXMLUnitConverter::convertEnum(), SvXMLUnitConverter::convertMeasureToXML(), eType, GetExport(), SvXMLExport::GetMM100UnitConverter(), SvXMLExport::getSaneDefaultVersion(), xmloff::token::GetXMLToken(), XMLTextFieldExport::MapChapterDisplayFormat(), nNamespace, nToken, SvtSaveOptions::ODFSVER_010, SvtSaveOptions::ODFSVER_011, SvtSaveOptions::ODFSVER_012, SvtSaveOptions::ODFSVER_013, rExport, TEXT_SECTION_TYPE_ALPHABETICAL, TEXT_SECTION_TYPE_ILLUSTRATION, TEXT_SECTION_TYPE_OBJECT, TEXT_SECTION_TYPE_TABLE, TEXT_SECTION_TYPE_TOC, TEXT_SECTION_TYPE_USER, xmloff::token::XML_BIBLIOGRAPHY_DATA_FIELD, xmloff::token::XML_DISPLAY, xmloff::token::XML_FALSE, xmloff::token::XML_INDEX_ENTRY_BIBLIOGRAPHY, xmloff::token::XML_INDEX_ENTRY_CHAPTER, xmloff::token::XML_INDEX_ENTRY_LINK_END, xmloff::token::XML_INDEX_ENTRY_LINK_START, xmloff::token::XML_INDEX_ENTRY_PAGE_NUMBER, xmloff::token::XML_INDEX_ENTRY_SPAN, xmloff::token::XML_INDEX_ENTRY_TAB_STOP, xmloff::token::XML_INDEX_ENTRY_TEXT, xmloff::token::XML_LEADER_CHAR, xmloff::token::XML_LEFT, XML_NAMESPACE_LO_EXT, XML_NAMESPACE_STYLE, XML_NAMESPACE_TEXT, xmloff::token::XML_OUTLINE_LEVEL, xmloff::token::XML_POSITION, xmloff::token::XML_RIGHT, xmloff::token::XML_STYLE_NAME, xmloff::token::XML_TOKEN_INVALID, xmloff::token::XML_TYPE, and xmloff::token::XML_WITH_TAB.

Referenced by ExportIndexTemplate().

◆ ExportLevelParagraphStyles()

void XMLSectionExport::ExportLevelParagraphStyles ( css::uno::Reference< css::container::XIndexReplace > const &  xStyles)
private

◆ ExportMasterDocHeadingDummies()

void XMLSectionExport::ExportMasterDocHeadingDummies ( )

export a heading for every level.

This is used by master documents to not lose the heading information if master documents are exported without section contents

Definition at line 1795 of file XMLSectionExport.cxx.

References SvXMLExport::AddAttribute(), aProperties, bHeadingDummiesExported, GetExport(), SvXMLExport::GetModel(), nCount, rExport, xmloff::token::XML_H, xmloff::token::XML_LEVEL, XML_NAMESPACE_TEXT, and xmloff::token::XML_STYLE_NAME.

◆ ExportObjectIndexStart()

void XMLSectionExport::ExportObjectIndexStart ( const css::uno::Reference< css::beans::XPropertySet > &  rSection)
private

◆ ExportRegularSectionStart()

void XMLSectionExport::ExportRegularSectionStart ( const css::uno::Reference< css::text::XTextSection > &  rSection)
private

◆ ExportSectionEnd()

void XMLSectionExport::ExportSectionEnd ( const css::uno::Reference< css::text::XTextSection > &  rSection,
bool  bAutoStyles 
)

◆ ExportSectionStart()

void XMLSectionExport::ExportSectionStart ( const css::uno::Reference< css::text::XTextSection > &  rSection,
bool  bAutoStyles 
)

export section or index start and source elements.

This method handles the section styles, and delegates to the appropriate section or index method.

Definition at line 77 of file XMLSectionExport.cxx.

References XMLTextParagraphExport::Add(), SvXMLExport::AddAttribute(), SvXMLExport::AddAttributeXmlId(), ExportIndexHeaderStart(), ExportIndexStart(), ExportRegularSectionStart(), GetExport(), GetIndex(), GetParaExport(), TEXT_SECTION, XML_NAMESPACE_TEXT, and xmloff::token::XML_STYLE_NAME.

◆ ExportTableAndIllustrationIndexSourceAttributes()

void XMLSectionExport::ExportTableAndIllustrationIndexSourceAttributes ( const css::uno::Reference< css::beans::XPropertySet > &  rSection)
private

◆ ExportTableIndexStart()

void XMLSectionExport::ExportTableIndexStart ( const css::uno::Reference< css::beans::XPropertySet > &  rSection)
private

◆ ExportTableOfContentStart()

void XMLSectionExport::ExportTableOfContentStart ( const css::uno::Reference< css::beans::XPropertySet > &  rSection)
private

◆ ExportUserIndexStart()

void XMLSectionExport::ExportUserIndexStart ( const css::uno::Reference< css::beans::XPropertySet > &  rSection)
private

◆ GetExport()

SvXMLExport & XMLSectionExport::GetExport ( )
inlineprivate

◆ GetIndex()

bool XMLSectionExport::GetIndex ( const css::uno::Reference< css::text::XTextSection > &  rSection,
css::uno::Reference< css::text::XDocumentIndex > &  rIndex 
)
staticprivate

If this section is an index, the index is written in the rIndex parameter.

The return value is sal_True for all "special" sections.

Thus we have: return sal_False: regular section return sal_True, xIndex is empty: index header section return sal_True, xIndex is set: index section

Definition at line 123 of file XMLSectionExport.cxx.

References Any.

Referenced by ExportSectionEnd(), and ExportSectionStart().

◆ GetParaExport()

XMLTextParagraphExport & XMLSectionExport::GetParaExport ( )
inlineprivate

Definition at line 137 of file XMLSectionExport.hxx.

References rParaExport.

Referenced by ExportSectionStart().

◆ IsInSection()

bool XMLSectionExport::IsInSection ( const css::uno::Reference< css::text::XTextSection > &  rEnclosingSection,
const css::uno::Reference< css::text::XTextContent > &  rContent,
bool  bDefault 
)
static

Determine whether rContent is contained in rEnclosingSection.

If the current section of rContent can not be determined, return bDefault.

Parameters
bDefaultreturn value if this content doesn't support the section property

Definition at line 1756 of file XMLSectionExport.cxx.

References Any.

Referenced by XMLTextParagraphExport::exportTextContentEnumeration().

◆ IsMuteSection() [1/2]

bool XMLSectionExport::IsMuteSection ( const css::uno::Reference< css::text::XTextContent > &  rSection,
bool  bDefault 
) const

XTextContent-version of IsMuteSection(Reference<XTextSection>&) returns true for all non-section elements.

Parameters
bDefaultreturn value if this content doesn't support the section property

◆ IsMuteSection() [2/2]

bool XMLSectionExport::IsMuteSection ( const css::uno::Reference< css::text::XTextSection > &  rSection) const

Should the content of this section be exported? (E.g.

linked sections in global documents are not always exported)

◆ MapSectionType()

enum SectionTypeEnum XMLSectionExport::MapSectionType ( std::u16string_view  rSectionName)
staticprivate

map service name to section type

Definition at line 330 of file XMLSectionExport.cxx.

References aIndexTypeMap, SvXMLUnitConverter::convertEnum(), eType, and TEXT_SECTION_TYPE_UNKNOWN.

Referenced by ExportIndexStart(), and ExportSectionEnd().

Member Data Documentation

◆ bHeadingDummiesExported

bool XMLSectionExport::bHeadingDummiesExported
private

Definition at line 71 of file XMLSectionExport.hxx.

Referenced by ExportMasterDocHeadingDummies().

◆ rExport

SvXMLExport& XMLSectionExport::rExport
private

◆ rParaExport

XMLTextParagraphExport& XMLSectionExport::rParaExport
private

Definition at line 69 of file XMLSectionExport.hxx.

Referenced by GetParaExport().


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