oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 4 ++-- oox/source/drawingml/diagram/diagramlayoutatoms.hxx | 5 ----- oox/source/drawingml/diagram/layoutatomvisitors.cxx | 12 ++++-------- oox/source/drawingml/diagram/layoutnodecontext.cxx | 1 - sd/qa/unit/import-tests-smartart.cxx | 7 +++++++ 5 files changed, 13 insertions(+), 16 deletions(-)
New commits: commit 583a3140c01e6140022b846e6b067c2846812e56 Author: Grzegorz Araminowicz <grzegorz.araminow...@collabora.com> AuthorDate: Mon Jun 24 16:31:48 2019 +0200 Commit: Grzegorz Araminowicz <grzegorz.araminow...@collabora.com> CommitDate: Thu Jul 11 07:25:21 2019 +0200 SmartArt: move setting shape aspect ratio to alg atom visit it allows to correctly follow if/else nodes instead of using once assigned alg atom Change-Id: I8c321b638524df3ca68242da6300bc8c2a838bbf Reviewed-on: https://gerrit.libreoffice.org/74648 Tested-by: Jenkins Reviewed-by: Grzegorz Araminowicz <grzegorz.araminow...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/75385 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.hxx b/oox/source/drawingml/diagram/diagramlayoutatoms.hxx index 842acc0757f6..4dcee899a4c0 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.hxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.hxx @@ -274,10 +274,6 @@ public: const LayoutNode* getParentLayoutNode() const; - void setAlgAtom(AlgAtomPtr pAlgAtom) { mpAlgAtom = pAlgAtom; } - - AlgAtomPtr getAlgAtom() const { return mpAlgAtom.lock(); } - private: const Diagram& mrDgm; VarMap mVariables; @@ -286,7 +282,6 @@ private: ShapePtr mpExistingShape; ShapeLevelMap mpNodeShapes; sal_Int32 mnChildOrder; - std::weak_ptr<AlgAtom> mpAlgAtom; }; typedef std::shared_ptr< LayoutNode > LayoutNodePtr; diff --git a/oox/source/drawingml/diagram/layoutatomvisitors.cxx b/oox/source/drawingml/diagram/layoutatomvisitors.cxx index 5d6f0065241d..aa1d21b179f1 100644 --- a/oox/source/drawingml/diagram/layoutatomvisitors.cxx +++ b/oox/source/drawingml/diagram/layoutatomvisitors.cxx @@ -43,7 +43,7 @@ void ShapeCreationVisitor::visit(ConstraintAtom& /*rAtom*/) void ShapeCreationVisitor::visit(AlgAtom& rAtom) { - defaultVisit(rAtom); + mpParentShape->setAspectRatio(rAtom.getAspectRatio()); } void ShapeCreationVisitor::visit(ForEachAtom& rAtom) @@ -140,8 +140,6 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom) if (rAtom.setupShape(pShape, pNewNode)) { pShape->setInternalName(rAtom.getName()); - if (AlgAtomPtr pAlgAtom = rAtom.getAlgAtom()) - pShape->setAspectRatio(pAlgAtom->getAspectRatio()); rAtom.addNodeShape(pShape, mnCurrLevel); } } @@ -161,8 +159,6 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom) if (rAtom.setupShape(pShape, pNewNode)) { pShape->setInternalName(rAtom.getName()); - if (AlgAtomPtr pAlgAtom = rAtom.getAlgAtom()) - pShape->setAspectRatio(pAlgAtom->getAspectRatio()); pCurrParent->addChild(pShape); pCurrParent = pShape; rAtom.addNodeShape(pShape, mnCurrLevel); diff --git a/oox/source/drawingml/diagram/layoutnodecontext.cxx b/oox/source/drawingml/diagram/layoutnodecontext.cxx index 0d022ca41504..27b5917b1ac9 100644 --- a/oox/source/drawingml/diagram/layoutnodecontext.cxx +++ b/oox/source/drawingml/diagram/layoutnodecontext.cxx @@ -234,7 +234,6 @@ LayoutNodeContext::onCreateContext( ::sal_Int32 aElement, // CT_Algorithm AlgAtomPtr pAtom( new AlgAtom(mpNode->getLayoutNode()) ); LayoutAtom::connect(mpNode, pAtom); - mpNode->getLayoutNode().setAlgAtom(pAtom); return new AlgorithmContext( *this, rAttribs, pAtom ); } case DGM_TOKEN( choose ): commit 4ddc21029514865d706d84f7fdf3fa47a172d95c Author: Grzegorz Araminowicz <grzegorz.araminow...@collabora.com> AuthorDate: Tue Apr 9 13:25:11 2019 +0200 Commit: Grzegorz Araminowicz <grzegorz.araminow...@collabora.com> CommitDate: Thu Jul 11 07:25:08 2019 +0200 SmartArt: omit last atom in forEach loop only when necessary now all transition arrows are created in cycle diagrams Change-Id: I69e932f0060786b702dbecae72245bb624fa602b Reviewed-on: https://gerrit.libreoffice.org/70457 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/75384 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Grzegorz Araminowicz <grzegorz.araminow...@collabora.com> diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index 63aceb0df920..909efaebf751 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -228,7 +228,7 @@ namespace oox { namespace drawingml { IteratorAttr::IteratorAttr( ) : mnAxis( 0 ) , mnCnt( -1 ) - , mbHideLastTrans( false ) + , mbHideLastTrans( true ) , mnPtType( 0 ) , mnSt( 0 ) , mnStep( 1 ) @@ -240,7 +240,7 @@ void IteratorAttr::loadFromXAttr( const Reference< XFastAttributeList >& xAttr ) AttributeList attr( xAttr ); mnAxis = xAttr->getOptionalValueToken( XML_axis, 0 ); mnCnt = attr.getInteger( XML_cnt, -1 ); - mbHideLastTrans = attr.getBool( XML_hideLastTrans, false ); + mbHideLastTrans = attr.getBool( XML_hideLastTrans, true ); mnPtType = xAttr->getOptionalValueToken( XML_ptType, 0 ); mnSt = attr.getInteger( XML_st, 0 ); mnStep = attr.getInteger( XML_step, 1 ); diff --git a/oox/source/drawingml/diagram/layoutatomvisitors.cxx b/oox/source/drawingml/diagram/layoutatomvisitors.cxx index d7c8448666fb..5d6f0065241d 100644 --- a/oox/source/drawingml/diagram/layoutatomvisitors.cxx +++ b/oox/source/drawingml/diagram/layoutatomvisitors.cxx @@ -55,10 +55,10 @@ void ShapeCreationVisitor::visit(ForEachAtom& rAtom) return; } - if (rAtom.iterator().mnAxis == XML_followSib) + if (rAtom.iterator().mbHideLastTrans && rAtom.iterator().mnAxis == XML_followSib) { - // If the axis is the follow sibling, then the last atom should not be - // visited. + // If last transition is hidden and the axis is the follow sibling, + // then the last atom should not be visited. if (mnCurrIdx + mnCurrStep >= mnCurrCnt) return; } diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index 59d09a7d4204..b32ce6855e60 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -318,6 +318,13 @@ void SdImportTestSmartArt::testChevron() void SdImportTestSmartArt::testCycle() { + sd::DrawDocShellRef xDocShRef = loadURL( + m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-cycle.pptx"), PPTX); + uno::Reference<drawing::XShapes> xGroup(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY); + CPPUNIT_ASSERT(xGroup.is()); + // 11 children: background, 5 shapes, 5 connectors + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(11), xGroup->getCount()); + //FIXME : so far this only introduce the test document, but the actual importer was not fixed yet. } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits