Kaydet (Commit) f95f0ce1 authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#108714: Also support paragraph-level (line) breaks

Change-Id: Ida55015363cac3ae29b82a60a9b9a5f1b39086a2
Reviewed-on: https://gerrit.libreoffice.org/39675Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst db474104
......@@ -1359,8 +1359,10 @@ DECLARE_OOXMLIMPORT_TEST(testTdf108714, "tdf108714.docx")
CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, breakType);
// A table with immediately following break
// Line breaks in block and paragraph levels must be taken into account
// Several successive out-of-place w:br's must produce required amount of breaks
uno::Reference<text::XTextContent> table = getParagraphOrTable(5);
getCell(table, "A1", "Paragraph 5 in table");
getCell(table, "A1", "\n\n\n\nParagraph 5 in table");
breakType = getProperty<style::BreakType>(table, "BreakType");
CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, breakType);
......
......@@ -214,17 +214,17 @@ void OOXMLParserState::setTableProperties(const OOXMLPropertySet::Pointer_t& pPr
// tdf#108714
void OOXMLParserState::resolvePostponedBreak(Stream & rStream)
{
if (mpPostponedBreak)
for (const auto & rBreak: mvPostponedBreaks)
{
OOXMLBreakHandler aBreakHandler(rStream);
mpPostponedBreak->resolve(aBreakHandler);
mpPostponedBreak.reset();
rBreak->resolve(aBreakHandler);
}
mvPostponedBreaks.clear();
}
void OOXMLParserState::setPostponedBreak(const OOXMLPropertySet::Pointer_t & pProps)
{
mpPostponedBreak = pProps;
mvPostponedBreaks.push_back(pProps);
}
void OOXMLParserState::startTable()
......
......@@ -59,7 +59,7 @@ class OOXMLParserState final
bool savedInCharacterGroup;
bool savedLastParagraphInSection;
std::vector<SavedAlternateState> maSavedAlternateStates;
OOXMLPropertySet::Pointer_t mpPostponedBreak;
std::vector<OOXMLPropertySet::Pointer_t> mvPostponedBreaks;
public:
typedef std::shared_ptr<OOXMLParserState> Pointer_t;
......
......@@ -14178,6 +14178,11 @@
<attribute name="rsidRDefault">
<data type="string"/>
</attribute>
<!-- tdf#108714 : allow <w:br> at paragraph level (despite this is illegal according to ECMA-376-1:2016) - bug-to-bug compatibility with Word -->
<element name="br">
<ref name="CT_Br_OutOfOrder"/>
</element>
<!-- end tdf#108714 -->
</define>
<define name="ST_TblWidth">
<choice>
......
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