[Libreoffice-commits] .: sw/source

Lubos Lunak llunak at kemper.freedesktop.org
Thu Feb 17 05:49:01 PST 2011


 sw/source/filter/ww8/attributeoutputbase.hxx |    3 +++
 sw/source/filter/ww8/docxattributeoutput.cxx |   11 +++++++++++
 sw/source/filter/ww8/docxattributeoutput.hxx |    3 +++
 sw/source/filter/ww8/wrtw8nds.cxx            |    2 ++
 4 files changed, 19 insertions(+)

New commits:
commit d151f113ff4d685ce3e323b4a3b5651d01813efc
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Thu Feb 17 14:35:29 2011 +0100

    write footnoteRef/endnoteRef tags as required

diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index 45a1574..96173de 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -170,6 +170,9 @@ public:
     /// Called after we end outputting the attributes.
     virtual void EndRunProperties( const SwRedlineData* pRedlineData ) = 0;
 
+    /// docx requires footnoteRef/endnoteRef tag at the beginning of each of them
+    virtual void FootnoteEndnoteRefTag() {};
+
     /// Output text (inside a run).
     virtual void RunText( const String& rText, rtl_TextEncoding eCharSet ) = 0;
 
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index a35f2d5..1b2db26 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -965,6 +965,14 @@ void DocxAttributeOutput::EndRunProperties( const SwRedlineData* /*pRedlineData*
     m_pSerializer->mergeTopMarks( sax_fastparser::MERGE_MARKS_PREPEND );
 }
 
+void DocxAttributeOutput::FootnoteEndnoteRefTag()
+{
+    if( m_footnoteEndnoteRefTag == 0 )
+        return;
+    m_pSerializer->singleElementNS( XML_w, m_footnoteEndnoteRefTag, FSEND );
+    m_footnoteEndnoteRefTag = 0;
+}
+
 /** Output sal_Unicode* as a run text (<t>the text</t>).
 
     When bMove is true, update rBegin to point _after_ the end of the text +
@@ -3347,6 +3355,8 @@ void DocxAttributeOutput::FootnotesEndnotes( bool bFootnotes )
                 FSEND );
 
         const SwNodeIndex* pIndex = (*i)->GetTxtFtn()->GetStartNode();
+        // tag required at the start of each footnote/endnote
+        m_footnoteEndnoteRefTag = bFootnotes ? XML_footnoteRef : XML_endnoteRef;
 
         m_rExport.WriteSpecialText( pIndex->GetIndex() + 1,
                 pIndex->GetNode().EndOfSectionIndex(),
@@ -4072,6 +4082,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
       m_pFlyAttrList( NULL ),
       m_pFootnotesList( new ::docx::FootnotesList() ),
       m_pEndnotesList( new ::docx::FootnotesList() ),
+      m_footnoteEndnoteRefTag( 0 ),
       m_pSectionInfo( NULL ),
       m_pRedlineData( NULL ),
       m_nRedlineId( 0 ),
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index dbffadc..8795614 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -101,6 +101,8 @@ public:
     /// Called after we end outputting the attributes.
     virtual void EndRunProperties( const SwRedlineData* pRedlineData );
 
+    virtual void FootnoteEndnoteRefTag();
+
     /// Output text (inside a run).
     virtual void RunText( const String& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8 );
     
@@ -536,6 +538,7 @@ private:
 
     ::docx::FootnotesList *m_pFootnotesList;
     ::docx::FootnotesList *m_pEndnotesList;
+    int m_footnoteEndnoteRefTag;
 
     const WW8_SepInfo *m_pSectionInfo;
 
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 11936dd..f5fe643 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1807,6 +1807,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
         const SwRedlineData* pRedlineData = aAttrIter.GetRedline( nAktPos );
 
         AttrOutput().StartRun( pRedlineData );
+        if( nTxtTyp == TXT_FTN || nTxtTyp == TXT_EDN )
+            AttrOutput().FootnoteEndnoteRefTag();
 
         xub_StrLen nNextAttr = GetNextPos( &aAttrIter, rNode, nAktPos );
 


More information about the Libreoffice-commits mailing list