Builds up the TOC body, as OpenOffice.org requires the <text:index-body> tag to be present and filled when initially opening the document. More...
#include <ODe_TOC_Listener.h>
Public Member Functions | |
ODe_TOC_Listener (ODe_AuxiliaryData &rAuxiliaryData) | |
Constructor. | |
virtual void | insertText (const UT_UTF8String &rText) |
virtual void | insertTabChar () |
virtual void | openBlock (const PP_AttrProp *pAP, ODe_ListenerAction &rAction) |
virtual void | closeBlock () |
Private Attributes | |
bool | m_bInTOCBlock |
ODe_AuxiliaryData & | m_rAuxiliaryData |
Builds up the TOC body, as OpenOffice.org requires the <text:index-body> tag to be present and filled when initially opening the document.
Without it, it will show an empty TOC until the user regenerates it, which is not that pretty.
Unfortunately, we can't generate an 100% accurate preview. We can't for example output page numbers, as they only exist in AbiWord's layout classes and not in its PieceTable. Exporting the header outline is the best we can do as long as we don't store all generated TOC data in the PieceTable.
ODe_TOC_Listener::ODe_TOC_Listener | ( | ODe_AuxiliaryData & | rAuxiliaryData | ) |
Constructor.
void ODe_TOC_Listener::closeBlock | ( | ) | [virtual] |
Reimplemented from ODe_AbiDocListenerImpl.
References m_bInTOCBlock, ODe_AuxiliaryData::m_pTOCContents, m_rAuxiliaryData, ODe_writeUTF8String(), and UT_return_if_fail.
void ODe_TOC_Listener::insertTabChar | ( | ) | [virtual] |
Reimplemented from ODe_AbiDocListenerImpl.
References m_bInTOCBlock, ODe_AuxiliaryData::m_pTOCContents, m_rAuxiliaryData, ODe_writeUTF8String(), and UT_return_if_fail.
void ODe_TOC_Listener::insertText | ( | const UT_UTF8String & | rText | ) | [virtual] |
Reimplemented from ODe_AbiDocListenerImpl.
References UT_UTF8String::length(), m_bInTOCBlock, ODe_AuxiliaryData::m_pTOCContents, m_rAuxiliaryData, ODe_writeUTF8String(), and UT_return_if_fail.
void ODe_TOC_Listener::openBlock | ( | const PP_AttrProp * | pAP, | |
ODe_ListenerAction & | rAction | |||
) | [virtual] |
Reimplemented from ODe_AbiDocListenerImpl.
References ODe_AbiDocListenerImpl::_printSpacesOffset(), ODe_Style_Style::convertStyleToNCName(), UT_UTF8String::escapeXML(), gchar, PP_AttrProp::getAttribute(), ODe_HeadingStyles::getHeadingOutlineLevel(), m_bInTOCBlock, ODe_AuxiliaryData::m_headingStyles, ODe_AuxiliaryData::m_mDestStyles, ODe_AuxiliaryData::m_pTOCContents, m_rAuxiliaryData, ODe_writeUTF8String(), UT_ASSERT_HARMLESS, and UT_return_if_fail.
bool ODe_TOC_Listener::m_bInTOCBlock [private] |
Referenced by closeBlock(), insertTabChar(), insertText(), and openBlock().
Referenced by closeBlock(), insertTabChar(), insertText(), and openBlock().