include/oox/helper/attributelist.hxx |4 +
oox/source/drawingml/diagram/diagram.cxx |5 -
oox/source/drawingml/diagram/diagram.hxx |5 -
oox/source/drawingml/diagram/diagramlayoutatoms.cxx| 51 -
oox/source/drawingml/diagram/diagramlayoutatoms.hxx|2
oox/source/drawingml/diagram/layoutatomvisitorbase.cxx |2
oox/source/helper/attributelist.cxx| 13
7 files changed, 44 insertions(+), 38 deletions(-)
New commits:
commit f3e1a315cf95e6d798e031afdb9be879052f25f3
Author: Grzegorz Araminowicz
AuthorDate: Tue Jul 2 16:53:40 2019 +0200
Commit: Grzegorz Araminowicz
CommitDate: Thu Jul 11 09:00:59 2019 +0200
SmartArt: make if-node functions relative to current presentation node
* maxDepth calculates maximum depth of associated data node children
(instead of per-diagram max depth)
* cnt counts children of associated data node (instead of looking up presOf
node and if not found counting presentation node children)
Change-Id: Ifb50510acb9e6a3d2655197102060ec1c207075b
Reviewed-on: https://gerrit.libreoffice.org/75000
Tested-by: Jenkins
Reviewed-by: Grzegorz Araminowicz
Reviewed-on: https://gerrit.libreoffice.org/75391
Tested-by: Jenkins CollaboraOffice
diff --git a/include/oox/helper/attributelist.hxx
b/include/oox/helper/attributelist.hxx
index 524d7f769a51..2d65ad889699 100644
--- a/include/oox/helper/attributelist.hxx
+++ b/include/oox/helper/attributelist.hxx
@@ -20,6 +20,8 @@
#ifndef INCLUDED_OOX_HELPER_ATTRIBUTELIST_HXX
#define INCLUDED_OOX_HELPER_ATTRIBUTELIST_HXX
+#include
+
#include
#include
#include
@@ -164,6 +166,8 @@ public:
value if the attribute is missing or not convertible to a date/time
value. */
css::util::DateTime getDateTime( sal_Int32 nAttrToken, const
css::util::DateTime& rDefault ) const;
+std::vector getTokenList(sal_Int32 nAttrToken) const;
+
private:
css::uno::Reference< css::xml::sax::XFastAttributeList >
mxAttribs;
diff --git a/oox/source/drawingml/diagram/diagram.cxx
b/oox/source/drawingml/diagram/diagram.cxx
index c53b983526a9..5b0f9eac69ea 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -68,8 +68,7 @@ void Point::dump() const
} // dgm namespace
DiagramData::DiagramData() :
-mpFillProperties( new FillProperties ),
-mnMaxDepth(0)
+mpFillProperties( new FillProperties )
{
}
@@ -327,8 +326,6 @@ void Diagram::build( )
{
const sal_Int32 nDepth = calcDepth(elem.second.msSourceId,
getData()->getConnections());
elem.second.mnDepth = nDepth != 0 ? nDepth : -1;
-if (nDepth > getData()->getMaxDepth())
-getData()->setMaxDepth(nDepth);
}
}
#ifdef DEBUG_OOX_DIAGRAM
diff --git a/oox/source/drawingml/diagram/diagram.hxx
b/oox/source/drawingml/diagram/diagram.hxx
index 2e4ceae304c8..abe8e87fc8d7 100644
--- a/oox/source/drawingml/diagram/diagram.hxx
+++ b/oox/source/drawingml/diagram/diagram.hxx
@@ -189,10 +189,6 @@ public:
::std::vector ()
{ return maExtDrawings; }
const dgm::Point* getRootPoint() const;
-sal_Int32 getMaxDepth() const
-{ return mnMaxDepth; }
-void setMaxDepth(sal_Int32 nDepth)
-{ mnMaxDepth = nDepth; }
void dump() const;
private:
FillPropertiesPtr mpFillProperties;
@@ -202,7 +198,6 @@ private:
PointsNameMap maPointsPresNameMap;
ConnectionNameMap maConnectionNameMap;
StringMap maPresOfNameMap;
-sal_Int32 mnMaxDepth;
};
typedef std::shared_ptr< DiagramData > DiagramDataPtr;
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index b5c7a23738f7..503f141a4fa7 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -228,8 +228,7 @@ void setHierChildConnPosSize(const
oox::drawingml::ShapePtr& pShape)
namespace oox { namespace drawingml {
IteratorAttr::IteratorAttr( )
-: mnAxis( 0 )
-, mnCnt( -1 )
+: mnCnt( -1 )
, mbHideLastTrans( true )
, mnPtType( 0 )
, mnSt( 0 )
@@ -240,12 +239,15 @@ IteratorAttr::IteratorAttr( )
void IteratorAttr::loadFromXAttr( const Reference< XFastAttributeList >& xAttr
)
{
AttributeList attr( xAttr );
-mnAxis = xAttr->getOptionalValueToken( XML_axis, 0 );
+maAxis = attr.getTokenList(XML_axis);
mnCnt = attr.getInteger( XML_cnt, -1 );
mbHideLastTrans = attr.getBool( XML_hideLastTrans, true );
-mnPtType = xAttr->getOptionalValueToken( XML_ptType, 0 );
mnSt = attr.getInteger( XML_st, 0 );
mnStep = attr.getInteger( XML_step, 1 );
+
+// better to keep first token instead of error when multiple values
+std::vector aPtTypes = attr.getTokenList(XML_ptType);
+