[Libreoffice-commits] .: sw/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Sat Sep 3 04:27:40 PDT 2011


 sw/source/filter/ww8/rtfattributeoutput.cxx |    4 +++-
 sw/source/filter/ww8/rtfattributeoutput.hxx |    2 +-
 sw/source/filter/ww8/rtfexport.cxx          |    9 ++++-----
 sw/source/filter/ww8/rtfexport.hxx          |    2 +-
 4 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 7ea4e2e0f8019348379896d4f4f4d2298f11ded7
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Sat Sep 3 13:22:00 2011 +0200

    Related: fdo#38966 RTF export has to write titlepg before all headerf/footerf
    
    Previously it was written only before the first headerf/footerf, which
    made the non-first headerf/footerf to be ignored.

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index fbd7206..ab89690 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1466,7 +1466,7 @@ void RtfAttributeOutput::WriteBookmarks_Impl( std::vector< rtl::OUString >& rSta
     rEnds.clear();
 }
 
-void RtfAttributeOutput::WriteHeaderFooter_Impl( const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr )
+void RtfAttributeOutput::WriteHeaderFooter_Impl( const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr, bool bTitlepg )
 {
     OStringBuffer aSectionBreaks = m_aSectionBreaks;
     m_aSectionBreaks.setLength(0);
@@ -1475,6 +1475,8 @@ void RtfAttributeOutput::WriteHeaderFooter_Impl( const SwFrmFmt& rFmt, bool bHea
 
     m_aSectionHeaders.append(bHeader ? OOO_STRING_SVTOOLS_RTF_HEADERY : OOO_STRING_SVTOOLS_RTF_FOOTERY);
     m_aSectionHeaders.append((sal_Int32)m_rExport.pAktPageDesc->GetMaster().GetULSpace().GetUpper());
+    if (bTitlepg)
+        m_aSectionHeaders.append(OOO_STRING_SVTOOLS_RTF_TITLEPG);
     m_aSectionHeaders.append('{');
     m_aSectionHeaders.append(pStr);
     m_bBufferSectionHeaders = true;
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
index fcf43b7..4ac68be 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -219,7 +219,7 @@ public:
 
     void WriteField_Impl( const SwField* pFld, ww::eField eType, const String& rFldCmd, sal_uInt8 nMode );
     void WriteBookmarks_Impl( std::vector< rtl::OUString >& rStarts, std::vector< rtl::OUString >& rEnds );
-    void WriteHeaderFooter_Impl( const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr );
+    void WriteHeaderFooter_Impl( const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr, bool bTitlepg );
 
 protected:
     /// Output frames - the implementation.
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index ba3be68..271220f 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -310,7 +310,7 @@ void RtfExport::WriteHeadersFooters( sal_uInt8 nHeadFootFlags,
         WriteHeaderFooter( rFmt, true, OOO_STRING_SVTOOLS_RTF_HEADER );
 
     if ( nHeadFootFlags & nsHdFtFlags::WW8_HEADER_FIRST )
-        WriteHeaderFooter( rFirstPageFmt, true, OOO_STRING_SVTOOLS_RTF_HEADERF );
+        WriteHeaderFooter( rFirstPageFmt, true, OOO_STRING_SVTOOLS_RTF_HEADERF, true );
 
     // footers
     if ( nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_EVEN )
@@ -320,7 +320,7 @@ void RtfExport::WriteHeadersFooters( sal_uInt8 nHeadFootFlags,
         WriteHeaderFooter( rFmt, false, OOO_STRING_SVTOOLS_RTF_FOOTER );
 
     if ( nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_FIRST )
-        WriteHeaderFooter( rFirstPageFmt, false, OOO_STRING_SVTOOLS_RTF_FOOTERF );
+        WriteHeaderFooter( rFirstPageFmt, false, OOO_STRING_SVTOOLS_RTF_FOOTERF, true );
 }
 
 void RtfExport::OutputField( const SwField* pFld, ww::eField eFldType, const String& rFldCmd, sal_uInt8 nMode )
@@ -1206,7 +1206,6 @@ void RtfExport::OutPageDescription( const SwPageDesc& rPgDsc, sal_Bool bWriteRes
     if( pAktPageDesc != &rPgDsc )
     {
         pAktPageDesc = &rPgDsc;
-        Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG;
         if( pAktPageDesc->GetMaster().GetAttrSet().GetItemState( RES_HEADER,
                     sal_False, &pItem ) == SFX_ITEM_SET )
             WriteHeaderFooter(*pItem, true);
@@ -1253,11 +1252,11 @@ void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader)
     OSL_TRACE("%s end", OSL_THIS_FUNC);
 }
 
-void RtfExport::WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr)
+void RtfExport::WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr, bool bTitlepg)
 {
     OSL_TRACE("%s start", OSL_THIS_FUNC);
 
-    m_pAttrOutput->WriteHeaderFooter_Impl( rFmt, bHeader, pStr );
+    m_pAttrOutput->WriteHeaderFooter_Impl( rFmt, bHeader, pStr, bTitlepg );
 
     OSL_TRACE("%s end", OSL_THIS_FUNC);
 }
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index 60b6c34..a64beaa 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -209,7 +209,7 @@ private:
     /// This is necessary to have the numbering table ready before the main text is being processed.
     void BuildNumbering();
     void WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader);
-    void WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr);
+    void WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr, bool bTitlepg = false);
 
     RtfColorTbl m_aColTbl;
     RtfStyleTbl m_aStyTbl;


More information about the Libreoffice-commits mailing list