summaryrefslogtreecommitdiff
authorMiklos Vajna <vmiklos@suse.cz>2013-05-06 11:01:27 (GMT)
committer Miklos Vajna <vmiklos@suse.cz>2013-05-06 11:02:26 (GMT)
commit4144cd5a851466778004af9de98dbcfb019067bb (patch) (side-by-side diff)
tree5378119856dd4b0a6b955100ee03d15a1c27a146
parente50ef531021ea2322ebaf5109f6fe758e65d27b0 (diff)
downloadcore-4144cd5a851466778004af9de98dbcfb019067bb.zip
core-4144cd5a851466778004af9de98dbcfb019067bb.tar.gz
fdo#42144 WW8 export: avoid writing pointless empty footers
Regression from 1348288905ffa75d3634eee4392ba4660d28cdb9 (mismerge, I guess), when header was enabled, actually empty footer was exported, even in case footer was disabled. Change-Id: Ied55dc2a9f0faef87689c07935a47db384d37e1a
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--sw/qa/extras/ww8export/data/fdo42144.odtbin0 -> 9425 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export.cxx9
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx2
3 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8export/data/fdo42144.odt b/sw/qa/extras/ww8export/data/fdo42144.odt
new file mode 100644
index 0000000..be94900
--- a/dev/null
+++ b/sw/qa/extras/ww8export/data/fdo42144.odt
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index 65fcfe2..0c2f769 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -25,6 +25,7 @@ public:
void testZoom();
void test56513();
void testNewPageStylesTable();
+ void testFdo42144();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -46,6 +47,7 @@ void Test::run()
{"zoom.doc", &Test::testZoom},
{"fdo56513.doc", &Test::test56513},
{"new-page-styles.doc", &Test::testNewPageStylesTable},
+ {"fdo42144.odt", &Test::testFdo42144},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -140,6 +142,13 @@ void Test::testNewPageStylesTable()
CPPUNIT_ASSERT_EQUAL(OUString("Sigma Space Performance Goals: Next Year (Page 3)*******"), parseDump("/root/page[3]/header/txt/text()"));
}
+void Test::testFdo42144()
+{
+ // Footer wasn't disabled -- instead empty footer was exported.
+ uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<sal_Bool>(xStyle, "FooterIsOn")));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 17fb01c..8397093 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1183,7 +1183,7 @@ void WW8_WrPlcSepx::OutHeaderFooter( WW8Export& rWrt, bool bHeader,
else if ( rWrt.bWrtWW8 )
{
pTxtPos->Append( rCpPos );
- if (rWrt.bHasHdr && nBreakCode!=0)
+ if ((bHeader? rWrt.bHasHdr : rWrt.bHasFtr) && nBreakCode!=0)
{
rWrt.WriteStringAsPara( aEmptyStr ); // Empty paragraph for empty header/footer
rWrt.WriteStringAsPara( aEmptyStr ); // a CR that WW8 needs for end of the stream