Kaydet (Commit) 31454f6d authored tarafından Grzegorz Araminowicz's avatar Grzegorz Araminowicz Kaydeden (comit) Miklos Vajna

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: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst 87ed39e4
......@@ -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 );
......
......@@ -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;
}
......
......@@ -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.
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment