[Libreoffice-commits] core.git: oox/source sd/qa
Grzegorz Araminowicz (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 10 07:04:31 UTC 2019
oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 4 ++--
oox/source/drawingml/diagram/layoutatomvisitors.cxx | 6 +++---
sd/qa/unit/import-tests-smartart.cxx | 7 +++++++
3 files changed, 12 insertions(+), 5 deletions(-)
New commits:
commit 31454f6de1246dd465c3de2b52396a827e84ea4b
Author: Grzegorz Araminowicz <grzegorz.araminowicz at collabora.com>
AuthorDate: Tue Apr 9 13:25:11 2019 +0200
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Apr 10 09:04:09 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 <vmiklos at collabora.com>
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.
}
More information about the Libreoffice-commits
mailing list