sw/qa/extras/ww8export/data/tdf122429_header.doc |binary sw/qa/extras/ww8export/ww8export3.cxx | 9 +++++++++ sw/source/filter/ww8/wrtw8sty.cxx | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-)
New commits: commit 0a6c609bdc89dd0317d3f5013c13d85d50d30669 Author: Justin Luth <justin_l...@sil.org> AuthorDate: Thu Jan 3 20:23:54 2019 +0300 Commit: Justin Luth <justin_l...@sil.org> CommitDate: Mon Jan 7 19:48:45 2019 +0100 tdf#122429/tdf#122431 ww8export: export H/F to default section Just like bug 121374 for DOCX, which was just fixed in LO62, DOC apparently also sometimes can miss out on headers and footers. It wouldn't be terrible to duplicate headers/footers unnecessarily, but it is terrible to have them disappear. If the last SectPr has no idea about the section start, it can't know whether it is continuous or started with a page break. In that case, just ensure that the header and footer are explicitly written out. RTF continues to work without this in all known cases. Change-Id: I93f2b08535a3548c0a9e9bcdb6ee2cd965dc8367 Reviewed-on: https://gerrit.libreoffice.org/65840 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_l...@sil.org> diff --git a/sw/qa/extras/ww8export/data/tdf122429_header.doc b/sw/qa/extras/ww8export/data/tdf122429_header.doc new file mode 100644 index 000000000000..37afc067b02a Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf122429_header.doc differ diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index e85ec0efa18f..ccf79c83e300 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -46,6 +46,15 @@ DECLARE_WW8EXPORT_TEST(testTdf37778_readonlySection, "tdf37778_readonlySection.d CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of Sections", sal_Int32(0), xSections->getCount()); } +DECLARE_WW8EXPORT_TEST(testTdf122429_header, "tdf122429_header.doc") +{ + uno::Reference<container::XNameAccess> pageStyles = getStyles("PageStyles"); + uno::Reference<style::XStyle> pageStyle(pageStyles->getByName("Default Style"), uno::UNO_QUERY); + bool headerIsOn = getProperty<bool>(pageStyle, "HeaderIsOn"); + CPPUNIT_ASSERT(headerIsOn); +} + + DECLARE_WW8EXPORT_TEST(testFdo53985, "fdo53985.doc") { uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 286a613e8e62..b5ee75531701 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1555,7 +1555,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt } if ( reinterpret_cast<SwSectionFormat*>(sal_IntPtr(-1)) == rSepInfo.pSectionFormat ) - bEnsureHeaderFooterWritten |= !rSepInfo.pPDNd && GetExportFormat() == ExportFormat::DOCX; + bEnsureHeaderFooterWritten |= !rSepInfo.pPDNd && GetExportFormat() != ExportFormat::RTF; else { if ( nBreakCode == 0 ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits