diff options
author | Justin Luth <justin_luth@sil.org> | 2019-01-03 20:23:54 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2019-01-07 19:48:45 +0100 |
commit | 0a6c609bdc89dd0317d3f5013c13d85d50d30669 (patch) | |
tree | 9ede1423f65726c258e9048b5e7790036c064827 /sw | |
parent | b0c758b407deea0d87b51687601af48126d871c9 (diff) |
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_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ww8export/data/tdf122429_header.doc | bin | 0 -> 122368 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export3.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf122429_header.doc b/sw/qa/extras/ww8export/data/tdf122429_header.doc Binary files differnew file mode 100644 index 000000000000..37afc067b02a --- /dev/null +++ b/sw/qa/extras/ww8export/data/tdf122429_header.doc 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 ) |