oox/source/drawingml/fillproperties.cxx | 4 +++- sd/qa/unit/data/pptx/tdf156649.pptx |binary sd/qa/unit/export-tests.cxx | 14 ++++++++++++++ sw/qa/core/layout/flycnt.cxx | 8 ++++++++ sw/source/core/layout/tabfrm.cxx | 4 +++- sw/source/core/text/txtfly.cxx | 17 +++++++++++++++++ 6 files changed, 45 insertions(+), 2 deletions(-)
New commits: commit 8ac547a463c4061961f924e858a377525ea821b1 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Sep 7 08:25:18 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Sep 8 12:54:20 2023 +0200 sw floattable, nesting: fix position of the inner follow table The bugdoc was no longer crashing, but the inner table's follow part on page 2 was not visible. The problem was that lcl_ArrangeLowers() didn't try to update the fly's position when the cell's position changed, now we do this for split flys. The other problem was that as SwTextFly::GetTop() is called by SwTextFly::InitAnchoredObjList(), the inner flys were ignored while collecting the intersecting fly frames for a paragraph, leading to an overlap between the inner follow fly and the inner anchor text. This is now fixed by explicitly checking for the splitfly-in-splitfly case. With this, the ODT bugdoc now renders correctly when opened. (This is related to tdf#55160.) Change-Id: I60997e7913984872319250b0fb1cb91e02512800 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156632 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins (cherry picked from commit 3aa3f0a1638a8d8006955b62bb647526768be3d8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156607 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/core/layout/flycnt.cxx b/sw/qa/core/layout/flycnt.cxx index 0839e6a34b36..797d5d8c5691 100644 --- a/sw/qa/core/layout/flycnt.cxx +++ b/sw/qa/core/layout/flycnt.cxx @@ -1060,6 +1060,14 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyNested) CPPUNIT_ASSERT(pPage2Fly1); CPPUNIT_ASSERT(pPage2Fly1->GetAnchorFrameContainingAnchPos()->IsInFly()); CPPUNIT_ASSERT(pPage2Fly1->GetPrecede()); + + // Without the accompanying fix in place, this test would have failed with: + // - Expected greater than: 6204 + // - Actual : 1725 + // i.e. the inner follow fly had a bad position, it was outside the page rectangle, it was not + // rendered and this way the inner anchor had no fly portion, either. + CPPUNIT_ASSERT_GREATER(pPage2->getFrameArea().Top(), pPage2Fly1->getFrameArea().Top()); + auto pPage2Fly2 = rPage2Objs[1]->DynCastFlyFrame()->DynCastFlyAtContentFrame(); CPPUNIT_ASSERT(pPage2Fly2); CPPUNIT_ASSERT(!pPage2Fly2->GetAnchorFrameContainingAnchPos()->IsInFly()); diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index e592467751b7..f7e889094adc 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -5303,10 +5303,12 @@ static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, tools::Long lYStart, bool bI // on the object positioning. // #i52904# - no direct move of objects, // whose vertical position doesn't depend on anchor frame. + // Also move split flys directly, otherwise the follows would not be moved + // at all. const bool bDirectMove = FAR_AWAY != pFly->getFrameArea().Top() && bVertPosDepOnAnchor && - !pFly->ConsiderObjWrapInfluenceOnObjPos(); + (!pFly->ConsiderObjWrapInfluenceOnObjPos() || pFly->IsFlySplitAllowed()); if ( bDirectMove ) { { diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index e5bf03162db4..a290ac4d2010 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -679,6 +679,23 @@ bool SwTextFly::GetTop( const SwAnchoredObject* _pAnchoredObj, bool bEvade = !mpCurrAnchoredObj || Is_Lower_Of( mpCurrAnchoredObj->DynCastFlyFrame(), pNew); + auto pFly = _pAnchoredObj->DynCastFlyFrame(); + if (pFly && pFly->IsFlySplitAllowed()) + { + // Check if _pAnchoredObj is a split fly inside an other split fly. Always collect such + // flys, otherwise the inner anchor text will overlap with the inner fly. + SwFrame* pFlyAnchor = const_cast<SwAnchoredObject*>(_pAnchoredObj) + ->GetAnchorFrameContainingAnchPos(); + if (pFlyAnchor && pFlyAnchor->IsInFly()) + { + auto pOuterFly = pFlyAnchor->FindFlyFrame(); + if (pOuterFly && pOuterFly->IsFlySplitAllowed()) + { + return true; + } + } + } + if ( !bEvade ) { // We are currently inside a fly frame and pNew is not commit 7a0b8513d76e12154fe85744b9acc03c369b42c6 Author: Sarper Akdemir <sarper.akdemir.ext...@allotropia.de> AuthorDate: Thu Sep 7 13:53:25 2023 +0300 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Sep 8 12:54:07 2023 +0200 tdf#156649: oox: correct import alphaModFix for custom shapes alphaModFix should be imported into PROP_FillTransparency for custom shapes. Change-Id: I19621e424a64b097d5e6881877d60de253be636d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156660 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir.ext...@allotropia.de> (cherry picked from commit b0e8ce9967acf3a759e5b85c4a0d16d7dad275fe) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156605 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index e1c73748f919..365f38f5ddb2 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -866,7 +866,9 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe if ( maBlipProps.moAlphaModFix.has_value() ) { - rPropMap.setProperty(PROP_Transparency, static_cast<sal_Int16>(100 - (maBlipProps.moAlphaModFix.value() / PER_PERCENT))); + rPropMap.setProperty( + mbIsCustomShape ? PROP_FillTransparence : PROP_Transparency, + static_cast<sal_Int16>(100 - (maBlipProps.moAlphaModFix.value() / PER_PERCENT))); } } rPropMap.setProperty(PROP_GraphicColorMode, eColorMode); diff --git a/sd/qa/unit/data/pptx/tdf156649.pptx b/sd/qa/unit/data/pptx/tdf156649.pptx new file mode 100644 index 000000000000..2b3b12a9a092 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf156649.pptx differ diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 61f6736fc33f..92971d4b4221 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -1577,6 +1577,20 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf140714) CPPUNIT_ASSERT_EQUAL(OUString{ "com.sun.star.drawing.CustomShape" }, xShape->getShapeType()); } +CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf156649) +{ + createSdImpressDoc("pptx/tdf156649.pptx"); + saveAndReload("Impress Office Open XML"); + + auto xShapeProps(getShapeFromPage(0, 0)); + // Without the fix in place, this test would have failed with + //- Expected: 55 + //- Actual : 0 + // i.e. alphaModFix wasn't imported as fill transparency for the custom shape + CPPUNIT_ASSERT_EQUAL(sal_Int16(55), + xShapeProps->getPropertyValue("FillTransparence").get<sal_Int16>()); +} + CPPUNIT_TEST_FIXTURE(SdExportTest, testMasterPageBackgroundFullSize) { createSdImpressDoc("odp/background.odp");