[Libreoffice-commits] core.git: sw/source

Justin Luth justin_luth at sil.org
Wed Oct 25 08:23:50 UTC 2017


 sw/source/filter/ww8/attributeoutputbase.hxx |    2 +-
 sw/source/filter/ww8/wrtw8sty.cxx            |   12 ++++++++++++
 sw/source/filter/ww8/ww8attributeoutput.hxx  |    3 +++
 3 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit e46d27a692f43192ba29f03c473f43bb16c1444f
Author: Justin Luth <justin_luth at sil.org>
Date:   Fri Oct 20 21:20:08 2017 +0300

    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 at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

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.


More information about the Libreoffice-commits mailing list