summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-10-20 21:20:08 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-10-25 10:23:29 +0200
commite46d27a692f43192ba29f03c473f43bb16c1444f (patch)
tree65188f4f3372d6c7e82e43202254c995ed4550c4
parent00b28ffe72284464c99e30a4bfb163f475f248b1 (diff)
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>
-rw-r--r--sw/source/filter/ww8/attributeoutputbase.hxx2
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx12
-rw-r--r--sw/source/filter/ww8/ww8attributeoutput.hxx3
3 files changed, 16 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index 1cbe3a1a5376..5327be3a819a 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -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
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 8be9b2d1ca44..7a45f8e20524 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -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
diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx
index 84525b6a165d..9a4701d49199 100644
--- a/sw/source/filter/ww8/ww8attributeoutput.hxx
+++ b/sw/source/filter/ww8/ww8attributeoutput.hxx
@@ -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.