[Libreoffice-commits] core.git: sw/qa sw/source
Justin Luth
justin_luth at sil.org
Mon Mar 6 09:26:14 UTC 2017
dev/null |binary
sw/qa/extras/ww8export/data/tdf99120.doc |binary
sw/qa/extras/ww8export/ww8export2.cxx | 9 +++++++++
sw/qa/extras/ww8import/ww8import.cxx | 9 ---------
sw/source/filter/ww8/wrtw8sty.cxx | 1 +
5 files changed, 10 insertions(+), 9 deletions(-)
New commits:
commit b3afee4b61740b20bb7430bd6bbe25023f705f3a
Author: Justin Luth <justin_luth at sil.org>
Date: Sat Mar 4 22:07:46 2017 +0300
doc/docx: make unit test for tdf#99120 round-tripable
When a page description is chained to a non-chained follow,
it will only be used for a single page. Thus it might be able
to be combined into the follow as a titlePage instead.
However, if this page description has distinct even/odd pages,
don't merge it as a titlepage.
Change-Id: I62237a48c062e7c393a5224285a23597c479c1c9
Reviewed-on: https://gerrit.libreoffice.org/34889
Reviewed-by: Justin Luth <justin_luth at sil.org>
Tested-by: Justin Luth <justin_luth at sil.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/sw/qa/extras/ww8import/data/tdf99120.doc b/sw/qa/extras/ww8export/data/tdf99120.doc
similarity index 100%
rename from sw/qa/extras/ww8import/data/tdf99120.doc
rename to sw/qa/extras/ww8export/data/tdf99120.doc
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index d5050cc..bb70ccf 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -27,6 +27,15 @@ public:
}
};
+DECLARE_WW8EXPORT_TEST(testTdf99120, "tdf99120.doc")
+{
+ CPPUNIT_ASSERT_EQUAL(OUString("Section 1, odd."), parseDump("/root/page[1]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Section 1, even."), parseDump("/root/page[2]/header/txt/text()"));
+ // This failed: the header was empty on the 3rd page, as the first page header was shown.
+ CPPUNIT_ASSERT_EQUAL(OUString("Section 2, odd."), parseDump("/root/page[3]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Section 2, even."), parseDump("/root/page[4]/header/txt/text()"));
+}
+
DECLARE_WW8EXPORT_TEST(testTdf41542_borderlessPadding, "tdf41542_borderlessPadding.odt")
{
// the page style's borderless padding should force this to 3 pages, not 1
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 79c323f..3727c58 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -56,15 +56,6 @@ DECLARE_WW8IMPORT_TEST(testFloatingTableSectionColumns, "floating-table-section-
CPPUNIT_ASSERT( tableWidth.toInt32() > 10000 );
}
-DECLARE_WW8IMPORT_TEST(testTdf99120, "tdf99120.doc")
-{
- CPPUNIT_ASSERT_EQUAL(OUString("Section 1, odd."), parseDump("/root/page[1]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Section 1, even."), parseDump("/root/page[2]/header/txt/text()"));
- // This failed: the header was empty on the 3rd page, as the first page header was shown.
- CPPUNIT_ASSERT_EQUAL(OUString("Section 2, odd."), parseDump("/root/page[3]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Section 2, even."), parseDump("/root/page[4]/header/txt/text()"));
-}
-
DECLARE_WW8IMPORT_TEST(testTdf106291, "tdf106291.doc")
{
// Table cell was merged vertically instead of horizontally -> had incorrect dimensions
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 66f0cf5..ee2d376 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1619,6 +1619,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
// in checking heuristics here.
if ( !titlePage && pPd->GetFollow() && pPd != pPd->GetFollow() &&
pPd->GetFollow()->GetFollow() == pPd->GetFollow() &&
+ pPd->IsHeaderShared() && pPd->IsFooterShared() &&
( !rSepInfo.pPDNd || pPd->IsFollowNextPageOfNode( *rSepInfo.pPDNd ) ) )
{
const SwPageDesc *pFollow = pPd->GetFollow();
More information about the Libreoffice-commits
mailing list