summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Araminowicz <grzegorz.araminowicz@collabora.com>2019-04-09 13:25:11 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-04-10 09:04:09 +0200
commit31454f6de1246dd465c3de2b52396a827e84ea4b (patch)
tree0fa0020c576bd7c53fa2557c5f548753ac463f7d
parent87ed39e4de4a2dccbc40fdfb7edfd87d2d524d3d (diff)
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 <vmiklos@collabora.com>
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.cxx4
-rw-r--r--oox/source/drawingml/diagram/layoutatomvisitors.cxx6
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx7
3 files changed, 12 insertions, 5 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 336760575339..9b7d5323e518 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -221,7 +221,7 @@ namespace oox { namespace drawingml {
IteratorAttr::IteratorAttr( )
: mnAxis( 0 )
, mnCnt( -1 )
- , mbHideLastTrans( false )
+ , mbHideLastTrans( true )
, mnPtType( 0 )
, mnSt( 0 )
, mnStep( 1 )
@@ -233,7 +233,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 a45317f9ffe4..b93c06c6a636 100644
--- a/oox/source/drawingml/diagram/layoutatomvisitors.cxx
+++ b/oox/source/drawingml/diagram/layoutatomvisitors.cxx
@@ -48,10 +48,10 @@ void ShapeCreationVisitor::visit(AlgAtom& rAtom)
void ShapeCreationVisitor::visit(ForEachAtom& rAtom)
{
- 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 f163068560ef..33bdf6532966 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -397,6 +397,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());
+ // 10 children: 5 shapes, 5 connectors
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10), xGroup->getCount());
+
//FIXME : so far this only introduce the test document, but the actual importer was not fixed yet.
}