summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-07-28 16:58:38 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-07-28 17:06:44 +0200
commit7146d8bcd96f844dc0239a5b29a6b36c3cb5a2cc (patch)
treee152d7c7f09491146e4be0a5b671a642ff01cee3
parent0f21977d1d17170913d49987f070b9581395d7dd (diff)
MSWordExportBase::OutputSectionBreaks: avoid fake section breaks
Regression from ee9f23bb94b4c2c8c4db6466ecca272a092e9492 (docx export: invalid sectPr added at the beginning of the doc, 2013-01-10), the problem was that we even tried to generate section breaks at places where the two page styles are in practice the same. Change-Id: Iccf91ce542d9b075b93da25bcd42236db667e3d4
-rw-r--r--sw/qa/extras/ooxmlexport/data/unwanted-section-break.docxbin0 -> 15710 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx15
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx2
3 files changed, 12 insertions, 5 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/unwanted-section-break.docx b/sw/qa/extras/ooxmlexport/data/unwanted-section-break.docx
new file mode 100644
index 000000000000..a8565742f507
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/unwanted-section-break.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 1fdc15e7c517..77d8b4c4420d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2532,7 +2532,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo77718, "fdo77718.docx")
DECLARE_OOXMLEXPORT_TEST(testTableCurruption, "tableCurrupt.docx")
{
- xmlDocPtr pXmlDoc = parseExport("word/header4.xml");
+ xmlDocPtr pXmlDoc = parseExport("word/header2.xml");
if (!pXmlDoc)
return;
CPPUNIT_ASSERT(pXmlDoc) ;
@@ -2635,7 +2635,7 @@ DECLARE_OOXMLEXPORT_TEST(testOLEObjectinHeader, "2129393649.docx")
// Problem was relationship entry for oleobject from header was
// exported into document.xml.rels file because of this rels file
// for headers were missing from document/word/rels.
- xmlDocPtr pXmlDoc = parseExport("word/_rels/header3.xml.rels");
+ xmlDocPtr pXmlDoc = parseExport("word/_rels/header1.xml.rels");
if(!pXmlDoc)
return;
@@ -2971,12 +2971,12 @@ DECLARE_OOXMLEXPORT_TEST(testContentTypeOLE, "fdo77759.docx")
DECLARE_OOXMLEXPORT_TEST(testfdo78420, "fdo78420.docx")
{
- xmlDocPtr pXmlHeader = parseExport("word/header3.xml");
+ xmlDocPtr pXmlHeader = parseExport("word/header2.xml");
if (!pXmlHeader)
return;
- xmlDocPtr pXmlHeaderRels = parseExport("word/_rels/header3.xml.rels");
+ xmlDocPtr pXmlHeaderRels = parseExport("word/_rels/header2.xml.rels");
if(!pXmlHeaderRels)
return;
@@ -3409,6 +3409,13 @@ DECLARE_OOXMLEXPORT_TEST(testPlausableBorder, "plausable-border.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1);
}
+DECLARE_OOXMLEXPORT_TEST(testUnwantedSectionBreak, "unwanted-section-break.docx")
+{
+ if (xmlDocPtr pXmlDoc = parseExport())
+ // This was 2: an additional sectPr was added to the document.
+ assertXPath(pXmlDoc, "//w:sectPr", 1);
+}
+
DECLARE_OOXMLEXPORT_TEST(testfdo80897 , "fdo80897.docx")
{
xmlDocPtr pXmlDoc = parseExport();
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 6de7aecfa8b0..e831bf7d7098 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -443,7 +443,7 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode
if ( isCellOpen && ( pAktPageDesc->GetName() != pPageDesc->GetName() ) )
pSet = NULL;
}
- else
+ else if (!sw::util::IsPlausableSingleWordSection(pAktPageDesc->GetFirstMaster(), pPageDesc->GetMaster()))
{
bBreakSet = true;
bNewPageDesc = true;