summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2019-01-04 19:28:28 +0300
committerJustin Luth <justin_luth@sil.org>2019-01-08 20:19:25 +0100
commit13ed75dd3f84d38cce8f46792af560a5090ec180 (patch)
tree9e5165e052c8e0057188d2ed6c73c0281a2079c9
parent8249fc75a28fe6434a9b60c50487e8f2a2e1e588 (diff)
tdf#122460 ww8export: always export H/F to first section
Normally the first section is considered a BreakCode == 2, which guarantees that the headers/footers will attempt to be written. In the cases where it isn't, the very first section definitely needs to include any possible Headers/Footers. This was already done for DOCX via bug 78606 in LO 5.0. Both DOCX and RTF seem to ignore this first aSect, so this change won't affect them. Change-Id: Ie08eedea9202f0922e0e505a92fe4a66ef6c4a24 Reviewed-on: https://gerrit.libreoffice.org/65859 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
-rw-r--r--sw/qa/extras/ww8export/data/tdf122460_header.odtbin0 -> 9753 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx7
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx2
3 files changed, 8 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf122460_header.odt b/sw/qa/extras/ww8export/data/tdf122460_header.odt
new file mode 100644
index 000000000000..420121dc9a4d
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf122460_header.odt
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index ccf79c83e300..60bf801b25ef 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -54,6 +54,13 @@ DECLARE_WW8EXPORT_TEST(testTdf122429_header, "tdf122429_header.doc")
CPPUNIT_ASSERT(headerIsOn);
}
+DECLARE_WW8EXPORT_TEST(testTdf122460_header, "tdf122460_header.odt")
+{
+ 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")
{
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index b5ee75531701..af39bf4ef063 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1012,7 +1012,7 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport )
AppendSection( *static_cast<const SwFormatPageDesc*>(pI), *pNd, pFormat, nRstLnNum );
}
else
- AppendSection( rExport.m_pCurrentPageDesc, pFormat, nRstLnNum );
+ AppendSection( rExport.m_pCurrentPageDesc, pFormat, nRstLnNum, /*bIsFirstParagraph=*/true );
}
WW8_WrPlcSepx::WW8_WrPlcSepx( MSWordExportBase& rExport )