From 4cec874df4958a8f21021e40b3f06c58734560fc Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 8 Mar 2023 08:02:55 +0100 Subject: sw floattable: partially re-enable widow / orphan control in tables Widow / orphan control in DOCX tables were disabled in commit 8b13da71aedd094de0d351a4bd5ad43fdb4bddde (tdf#128959 DOCX import: fix missing text lines in tables, 2020-01-28). That workaround helped with the particular bugdoc, but it also disabled widow / orphan handling in general, and breaks e.g. orig-nocompat.docx from tdf#61594, because the second page's last row is meant to contain 6 lines with widow control enabled, but the model has widow control disabled, so the layout can't work properly. Fix the problem by improving the layout's WidowsAndOrphans::FindWidows() to handle conflicting widow / orphan control requirements in a fixed table row height context, so the writerfilter/ change from the above commit can be reverted without re-introducing tdf#128959. An alternative would be to keep the layout unchanged and limit the writerfilter/ change to fixed height rows, but that still feels like a (more specific) workaround. (cherry picked from commit 65dd1525e826006f78f86688032459dbd7ab4bb4) Change-Id: I8378d356e116774275dff337d17b19bd79c84c1c --- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 9 --------- 1 file changed, 9 deletions(-) (limited to 'writerfilter') diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 7550cc6ff0f7..8246e5eade06 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -2639,15 +2639,6 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con } } } - - // fix table paragraph properties - if (xTextRange.is() && xParaProps && m_nTableDepth > 0 && !m_bIsInComments) - { - // tdf#128959 table paragraphs haven't got window and orphan controls - uno::Any aAny(static_cast(0)); - xParaProps->setPropertyValue("ParaOrphans", aAny); - xParaProps->setPropertyValue("ParaWidows", aAny); - } } if( !bKeepLastParagraphProperties ) rAppendContext.pLastParagraphProperties = pToBeSavedProperties; -- cgit