summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/layout/data/tdf128959.docxbin0 -> 24490 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx23
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx10
3 files changed, 31 insertions, 2 deletions
diff --git a/sw/qa/extras/layout/data/tdf128959.docx b/sw/qa/extras/layout/data/tdf128959.docx
new file mode 100644
index 000000000000..f22f66504478
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf128959.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index d0e45b7e066b..b93da5407984 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -81,6 +81,7 @@ public:
void testBtlrCell();
void testImageComment();
void testWriterImageNoCapture();
+ void testTdf128959();
CPPUNIT_TEST_SUITE(SwLayoutWriter);
CPPUNIT_TEST(testRedlineFootnotes);
@@ -125,6 +126,7 @@ public:
CPPUNIT_TEST(testBtlrCell);
CPPUNIT_TEST(testImageComment);
CPPUNIT_TEST(testWriterImageNoCapture);
+ CPPUNIT_TEST(testTdf128959);
CPPUNIT_TEST_SUITE_END();
private:
@@ -2975,6 +2977,27 @@ void SwLayoutWriter::testWriterImageNoCapture()
CPPUNIT_ASSERT_LESS(nPageLeft, nImageLeft);
}
+void SwLayoutWriter::testTdf128959()
+{
+ // no orphan/widow control in table cells
+ SwDoc* pDocument = createDoc("tdf128959.docx");
+ CPPUNIT_ASSERT(pDocument);
+ discardDumpedLayout();
+ xmlDocPtr pXmlDoc = parseLayoutDump();
+
+ // first two lines of the paragraph in the split table cell on the first page
+ // (these lines were completely lost)
+ assertXPath(
+ pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/LineBreak[1]", "Line",
+ "a)Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue ");
+ assertXPath(
+ pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/LineBreak[2]", "Line",
+ "massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit ");
+ // last line of the paragraph in the split table cell on the second page
+ assertXPath(pXmlDoc, "/root/page[2]/body/tab[1]/row[1]/cell[1]/txt[1]/LineBreak[1]", "Line",
+ "amet commodo magna eros quis urna.");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwLayoutWriter);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index b0559a737cc4..bcfd5a152887 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1568,17 +1568,23 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
}
}
- // tdf#90069 in tables, apply paragraph level character style also on
- // paragraph level to support its copy during insertion of new table rows
+ // fix table paragraph properties
if ( xParaProps && m_nTableDepth > 0 )
{
uno::Sequence< beans::PropertyValue > aValues = pParaContext->GetPropertyValues(false);
+ // tdf#90069 in tables, apply paragraph level character style also on
+ // paragraph level to support its copy during insertion of new table rows
for( const auto& rProp : aValues )
{
if ( rProp.Name.startsWith("Char") && rProp.Name != "CharStyleName" && rProp.Name != "CharInteropGrabBag" )
xParaProps->setPropertyValue( rProp.Name, rProp.Value );
}
+
+ // tdf#128959 table paragraphs haven't got window and orphan controls
+ uno::Any aAny = uno::makeAny(static_cast<sal_Int8>(0));
+ xParaProps->setPropertyValue("ParaOrphans", aAny);
+ xParaProps->setPropertyValue("ParaWidows", aAny);
}
}
if( !bKeepLastParagraphProperties )