[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sw/qa sw/source
Justin Luth
justin_luth at sil.org
Tue Mar 7 04:43:20 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 b967275f34fbfb86f02937dc35a97defa0c3a996
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.
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>
Conflicts:
sw/qa/extras/ww8import/ww8import.cxx
Change-Id: I62237a48c062e7c393a5224285a23597c479c1c9
Reviewed-on: https://gerrit.libreoffice.org/34929
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Justin Luth <justin_luth at sil.org>
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 3259d23..d7512db 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 b26c3db..6c6b08f 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()"));
-}
-
// tests should only be added to ww8IMPORT *if* they fail round-tripping in ww8EXPORT
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 0b139cf..12b0b22 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1621,6 +1621,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