Kaydet (Commit) 0a6c609b authored tarafından Justin Luth's avatar Justin Luth

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: 's avatarJustin Luth <justin_luth@sil.org>
üst b0c758b4
This diff was suppressed by a .gitattributes entry.
......@@ -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);
......
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment