sw/qa/extras/ooxmlexport/ooxmlexport21.cxx | 2 +- sw/qa/writerfilter/dmapper/GraphicImport.cxx | 2 +- sw/source/writerfilter/dmapper/GraphicImport.cxx | 12 ------------ 3 files changed, 2 insertions(+), 14 deletions(-)
New commits: commit da249b2c386f0e16a0e63e38ec363c4a5ffd8fdb Author: Justin Luth <jl...@mail.com> AuthorDate: Fri Aug 2 14:50:09 2024 -0400 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Thu Aug 15 09:00:52 2024 +0200 tdf#162211 writerfilter: don't discard layoutInCell I DON'T KNOW IF I REALLY WANT TO SUBMIT THIS PATCH. I'VE ALREADY DECIDED IT IS BEST TO CHANGE THE IMPORT TO MATCH REALITY, AND KILLING layoutInCell CERTAINLY DOES THAT. The Ok button on the UI is the real convincer... although one unit test had beneficial side effects. It is very tempting to turn off "layoutInCell". After all, MSO has rather bizarre exceptions to the rule, and the whole concept in general is competely unnecessary (except to fix their horrible initial implementations). But by discarding layoutInCell, we are going in the opposite direction of Microsoft, who in compat15 (2013+), treats layoutInCell as true regardless of whether it is set to on or off. However, there still is one downside to preserving layoutInCell. In LO's UI, when looking at the properties, it will change the values to enforce layoutInCell, so pressing OK will shift an outlying shape. shape - FRAME/FRAME -fdo68607.docx [same] -test_segfault_while_save.docx [zOrder is fixed somehow] -layout-in-cell-wrapnone-column.docx [same] make CppunitTest_sw_writerfilter_dmapper \ CPPUNIT_TEST_NAME=testLayoutInCellWrapnoneColumn Change-Id: I6d66cb2f14507847e346443d42879a60025bc9d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171437 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx index 1dfc27e14584..170e04f26c89 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx @@ -659,7 +659,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153909_followTextFlow, "tdf153909_followTextFlow // given a compat12 VML document with wrap-through blue rect that doesn't mention allowInCell // Although MSO's UI reports "layoutInCell" for the rectangle, it isn't specified or honored - CPPUNIT_ASSERT(!getProperty<bool>(getShape(1), u"IsFollowingTextFlow"_ustr)); + CPPUNIT_ASSERT_EQUAL(isExported(), getProperty<bool>(getShape(1), u"IsFollowingTextFlow"_ustr)); xmlDocUniquePtr pDump = parseLayoutDump(); sal_Int32 nRectBottom diff --git a/sw/qa/writerfilter/dmapper/GraphicImport.cxx b/sw/qa/writerfilter/dmapper/GraphicImport.cxx index e3e79e8e9d9a..b2d3f6daa583 100644 --- a/sw/qa/writerfilter/dmapper/GraphicImport.cxx +++ b/sw/qa/writerfilter/dmapper/GraphicImport.cxx @@ -346,7 +346,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLayoutInCellWrapnoneColumn) // Without the accompanying fix in place, this test would have failed, the shape was not allowed // to leave the cell, leading to incorrect layout. CPPUNIT_ASSERT(xShape->getPropertyValue(u"IsFollowingTextFlow"_ustr) >>= bFollowingTextFlow); - CPPUNIT_ASSERT(!bFollowingTextFlow); + CPPUNIT_ASSERT(bFollowingTextFlow); // dump the layout uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); diff --git a/sw/source/writerfilter/dmapper/GraphicImport.cxx b/sw/source/writerfilter/dmapper/GraphicImport.cxx index f1032185d43a..2ba0799cbcd2 100644 --- a/sw/source/writerfilter/dmapper/GraphicImport.cxx +++ b/sw/source/writerfilter/dmapper/GraphicImport.cxx @@ -1296,18 +1296,6 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) // But they aren't Writer pictures, either (which are already handled above). uno::Reference< beans::XPropertySet > xShapeProps(m_xShape, uno::UNO_QUERY_THROW); - if (m_pImpl->m_nWrap == text::WrapTextMode_THROUGH - && m_pImpl->m_bLayoutInCell && m_pImpl->m_rDomainMapper.IsInTable() - && m_pImpl->m_nHoriRelation == text::RelOrientation::FRAME - && m_pImpl->m_nVertRelation == text::RelOrientation::FRAME) - { - // wrapThrough paragraph-positioned shape is not constrained by the cell - m_pImpl->m_bLayoutInCell = false; - // TODO: But we should not go in this direction. MSO in compat15 - // ignores layoutInCell, always treating it as TRUE, not false, - // which is the opposite of what is happening here. - } - if (m_pImpl->m_nHoriRelation == text::RelOrientation::FRAME && (m_pImpl->m_nHoriOrient == text::HoriOrientation::LEFT || m_pImpl->m_nHoriOrient == text::HoriOrientation::RIGHT