tdf#105381 ww8export: support footnote numbering per page

This is only for the benefit of MSOffice, LO already uses
Dop.rncFootnote for this, but MSO requires this section sprm.
LO import currently ignores sprmSRncFtn.

Endnotes in LO do not currently support .eNum, so we can't
support MSO's rncRstSect for sprmSRncEdn, leaving only
the default - so no use writing that out.

Change-Id: Iaff703e806d1cb62bc5990eb1cdfe323705bf7ee
Reviewed-on: https://gerrit.libreoffice.org/43622
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
This commit is contained in:
Justin Luth
2017-10-20 21:20:08 +03:00
committed by Miklos Vajna
parent 00b28ffe72
commit e46d27a692
3 changed files with 16 additions and 1 deletions

View File

@@ -183,7 +183,7 @@ public:
/// docx requires footnoteRef/endnoteRef tag at the beginning of each of them
virtual bool FootnoteEndnoteRefTag() { return false; };
/// for docx footnotePr/endnotePr inside sectPr
/// for footnote/endnote section properties
virtual void SectFootnoteEndnotePr() {};
/// for docx w:commentReference

View File

@@ -1317,6 +1317,18 @@ void WW8AttributeOutput::StartSection()
m_rWW8Export.pO->clear();
}
void WW8AttributeOutput::SectFootnoteEndnotePr()
{
const SwFootnoteInfo& rInfo = m_rWW8Export.m_pDoc->GetFootnoteInfo();
m_rWW8Export.InsUInt16( NS_sprm::sprmSRncFtn );
switch( rInfo.eNum )
{
case FTNNUM_PAGE: m_rWW8Export.pO->push_back( (sal_uInt8) /*rncRstPage*/ 2 ); break;
case FTNNUM_CHAPTER: m_rWW8Export.pO->push_back( (sal_uInt8) /*rncRstSect*/ 1 ); break;
default: m_rWW8Export.pO->push_back( (sal_uInt8) /*rncCont*/ 0 ); break;
}
}
void WW8AttributeOutput::SectionFormProtection( bool bProtected )
{
//If the document is to be exported as protected, then if a segment

View File

@@ -153,6 +153,9 @@ public:
/// Start of the section properties.
virtual void StartSection() override;
// footnote / endnote section properties
virtual void SectFootnoteEndnotePr() override;
/// End of the section properties.
///
/// No-op for binary filters.