summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf108714.docxbin1310 -> 1361 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx19
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx8
3 files changed, 19 insertions, 8 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf108714.docx b/sw/qa/extras/ooxmlimport/data/tdf108714.docx
index e564d44a648b..cee4176aa8e0 100644
--- a/sw/qa/extras/ooxmlimport/data/tdf108714.docx
+++ b/sw/qa/extras/ooxmlimport/data/tdf108714.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 260fabb4b690..ed0f0c926cf2 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1409,8 +1409,8 @@ DECLARE_OOXMLIMPORT_TEST(testTdf108806, "tdf108806.docx")
DECLARE_OOXMLIMPORT_TEST(testTdf108714, "tdf108714.docx")
{
- CPPUNIT_ASSERT_EQUAL(4, getParagraphs());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Page break is absent - we lost bug-to-bug compatibility with Word", 3, getPages());
+ CPPUNIT_ASSERT_EQUAL(6, getParagraphs());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Page break is absent - we lost bug-to-bug compatibility with Word", 4, getPages());
// The second (empty) paragraph must be at first page, despite the <w:br> element was before it.
// That's because Word treats such break as first element in first run of following paragraph:
@@ -1443,12 +1443,23 @@ DECLARE_OOXMLIMPORT_TEST(testTdf108714, "tdf108714.docx")
CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, breakType);
paragraph = getParagraph(3);
- CPPUNIT_ASSERT_EQUAL(OUString("Paragraph 2"), paragraph->getString());
+ CPPUNIT_ASSERT_EQUAL(OUString("Paragraph 3"), paragraph->getString());
breakType = getProperty<style::BreakType>(paragraph, "BreakType");
CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, breakType);
paragraph = getParagraph(4);
- CPPUNIT_ASSERT_EQUAL(OUString("Paragraph 3"), paragraph->getString());
+ CPPUNIT_ASSERT_EQUAL(OUString("Paragraph 4"), paragraph->getString());
+ breakType = getProperty<style::BreakType>(paragraph, "BreakType");
+ CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, breakType);
+
+ // A table with immediately following break
+ uno::Reference<text::XTextContent> table = getParagraphOrTable(5);
+ getCell(table, "A1", "Paragraph 5 in table");
+ breakType = getProperty<style::BreakType>(table, "BreakType");
+ CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, breakType);
+
+ paragraph = getParagraph(6);
+ CPPUNIT_ASSERT_EQUAL(OUString("Paragraph 6"), paragraph->getString());
breakType = getProperty<style::BreakType>(paragraph, "BreakType");
CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, breakType);
}
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 042998559336..84d2a65ad6e0 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -371,6 +371,10 @@ void OOXMLFastContextHandler::startCharacterGroup()
mpParserState->setInCharacterGroup(true);
mpParserState->resolveCharacterProperties(*mpStream);
}
+
+ // tdf#108714 : if we have a postponed break information,
+ // then apply it now, before any other paragraph content.
+ mpParserState->resolvePostponedBreak(*mpStream);
}
}
@@ -397,10 +401,6 @@ void OOXMLFastContextHandler::startParagraphGroup()
{
mpStream->startParagraphGroup();
mpParserState->setInParagraphGroup(true);
-
- // tdf#108714 : if we have a postponed break information,
- // then apply it now, before any other paragraph content.
- mpParserState->resolvePostponedBreak(*mpStream);
}
}
}