Kaydet (Commit) 7146d8bc authored tarafından Miklos Vajna's avatar Miklos Vajna

MSWordExportBase::OutputSectionBreaks: avoid fake section breaks

Regression from ee9f23bb (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
üst 0f21977d
...@@ -2532,7 +2532,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo77718, "fdo77718.docx") ...@@ -2532,7 +2532,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo77718, "fdo77718.docx")
DECLARE_OOXMLEXPORT_TEST(testTableCurruption, "tableCurrupt.docx") DECLARE_OOXMLEXPORT_TEST(testTableCurruption, "tableCurrupt.docx")
{ {
xmlDocPtr pXmlDoc = parseExport("word/header4.xml"); xmlDocPtr pXmlDoc = parseExport("word/header2.xml");
if (!pXmlDoc) if (!pXmlDoc)
return; return;
CPPUNIT_ASSERT(pXmlDoc) ; CPPUNIT_ASSERT(pXmlDoc) ;
...@@ -2635,7 +2635,7 @@ DECLARE_OOXMLEXPORT_TEST(testOLEObjectinHeader, "2129393649.docx") ...@@ -2635,7 +2635,7 @@ DECLARE_OOXMLEXPORT_TEST(testOLEObjectinHeader, "2129393649.docx")
// Problem was relationship entry for oleobject from header was // Problem was relationship entry for oleobject from header was
// exported into document.xml.rels file because of this rels file // exported into document.xml.rels file because of this rels file
// for headers were missing from document/word/rels. // 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) if(!pXmlDoc)
return; return;
...@@ -2971,12 +2971,12 @@ DECLARE_OOXMLEXPORT_TEST(testContentTypeOLE, "fdo77759.docx") ...@@ -2971,12 +2971,12 @@ DECLARE_OOXMLEXPORT_TEST(testContentTypeOLE, "fdo77759.docx")
DECLARE_OOXMLEXPORT_TEST(testfdo78420, "fdo78420.docx") DECLARE_OOXMLEXPORT_TEST(testfdo78420, "fdo78420.docx")
{ {
xmlDocPtr pXmlHeader = parseExport("word/header3.xml"); xmlDocPtr pXmlHeader = parseExport("word/header2.xml");
if (!pXmlHeader) if (!pXmlHeader)
return; return;
xmlDocPtr pXmlHeaderRels = parseExport("word/_rels/header3.xml.rels"); xmlDocPtr pXmlHeaderRels = parseExport("word/_rels/header2.xml.rels");
if(!pXmlHeaderRels) if(!pXmlHeaderRels)
return; return;
...@@ -3409,6 +3409,13 @@ DECLARE_OOXMLEXPORT_TEST(testPlausableBorder, "plausable-border.docx") ...@@ -3409,6 +3409,13 @@ DECLARE_OOXMLEXPORT_TEST(testPlausableBorder, "plausable-border.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); 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") DECLARE_OOXMLEXPORT_TEST(testfdo80897 , "fdo80897.docx")
{ {
xmlDocPtr pXmlDoc = parseExport(); xmlDocPtr pXmlDoc = parseExport();
......
...@@ -443,7 +443,7 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode ...@@ -443,7 +443,7 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode
if ( isCellOpen && ( pAktPageDesc->GetName() != pPageDesc->GetName() ) ) if ( isCellOpen && ( pAktPageDesc->GetName() != pPageDesc->GetName() ) )
pSet = NULL; pSet = NULL;
} }
else else if (!sw::util::IsPlausableSingleWordSection(pAktPageDesc->GetFirstMaster(), pPageDesc->GetMaster()))
{ {
bBreakSet = true; bBreakSet = true;
bNewPageDesc = true; bNewPageDesc = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment