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 (const OUString &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 67 of file XMLSectionExport.hxx.

Constructor & Destructor Documentation

XMLSectionExport::XMLSectionExport ( SvXMLExport rExp,
XMLTextParagraphExport rParaExp 
)

Definition at line 68 of file XMLSectionExport.cxx.

Member Function Documentation

void XMLSectionExport::ExportAlphabeticalIndexStart ( const css::uno::Reference< css::beans::XPropertySet > &  rSection)
private
void XMLSectionExport::ExportBaseIndexBody ( SectionTypeEnum  eType,
const css::uno::Reference< css::beans::XPropertySet > &  rSection 
)
private
void XMLSectionExport::ExportBaseIndexSource ( SectionTypeEnum  eType,
const css::uno::Reference< css::beans::XPropertySet > &  rSection 
)
private
void XMLSectionExport::ExportBaseIndexStart ( ::xmloff::token::XMLTokenEnum  eElement,
const css::uno::Reference< css::beans::XPropertySet > &  rSection 
)
private
void XMLSectionExport::ExportBibliographyConfiguration ( SvXMLExport rExport)
static
void XMLSectionExport::ExportBibliographyStart ( const css::uno::Reference< css::beans::XPropertySet > &  rIndex)
private

export the bibliography (and source element)

Definition at line 687 of file XMLSectionExport.cxx.

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

Referenced by ExportIndexStart().

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
void XMLSectionExport::ExportIllustrationIndexStart ( const css::uno::Reference< css::beans::XPropertySet > &  rSection)
private
void XMLSectionExport::ExportIndexHeaderStart ( const css::uno::Reference< css::text::XTextSection > &  rSection)
private
void XMLSectionExport::ExportIndexStart ( const css::uno::Reference< css::text::XDocumentIndex > &  rSection)
private
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
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 1141 of file XMLSectionExport.cxx.

References SvXMLExport::AddAttribute(), assert(), SvXMLExport::Characters(), SvXMLUnitConverter::convertEnum(), SvXMLUnitConverter::convertMeasureToXML(), 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, XMLImageStyle::rValue, 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().

void XMLSectionExport::ExportLevelParagraphStyles ( css::uno::Reference< css::container::XIndexReplace > const &  xStyles)
private
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 1780 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.

void XMLSectionExport::ExportObjectIndexStart ( const css::uno::Reference< css::beans::XPropertySet > &  rSection)
private
void XMLSectionExport::ExportRegularSectionStart ( const css::uno::Reference< css::text::XTextSection > &  rSection)
private
void XMLSectionExport::ExportSectionEnd ( const css::uno::Reference< css::text::XTextSection > &  rSection,
bool  bAutoStyles 
)
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 78 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.

void XMLSectionExport::ExportTableAndIllustrationIndexSourceAttributes ( const css::uno::Reference< css::beans::XPropertySet > &  rSection)
private
void XMLSectionExport::ExportTableIndexStart ( const css::uno::Reference< css::beans::XPropertySet > &  rSection)
private
void XMLSectionExport::ExportTableOfContentStart ( const css::uno::Reference< css::beans::XPropertySet > &  rSection)
private
void XMLSectionExport::ExportUserIndexStart ( const css::uno::Reference< css::beans::XPropertySet > &  rSection)
private
SvXMLExport& XMLSectionExport::GetExport ( )
inlineprivate
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 124 of file XMLSectionExport.cxx.

References Any.

Referenced by ExportSectionEnd(), and ExportSectionStart().

XMLTextParagraphExport& XMLSectionExport::GetParaExport ( )
inlineprivate

Definition at line 138 of file XMLSectionExport.hxx.

References rParaExport.

Referenced by ExportSectionStart().

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 1741 of file XMLSectionExport.cxx.

References Any.

Referenced by XMLTextParagraphExport::exportTextContentEnumeration().

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)

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
enum SectionTypeEnum XMLSectionExport::MapSectionType ( const OUString &  rSectionName)
staticprivate

map service name to section type

Definition at line 331 of file XMLSectionExport.cxx.

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

Referenced by ExportIndexStart(), and ExportSectionEnd().

Member Data Documentation

bool XMLSectionExport::bHeadingDummiesExported
private

Definition at line 72 of file XMLSectionExport.hxx.

Referenced by ExportMasterDocHeadingDummies().

SvXMLExport& XMLSectionExport::rExport
private
XMLTextParagraphExport& XMLSectionExport::rParaExport
private

Definition at line 70 of file XMLSectionExport.hxx.

Referenced by GetParaExport().


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