summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-02-20 18:09:14 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-02-20 20:35:22 +0100
commit8193e697d286595aa62859011761adeb002244e3 (patch)
treea920ed54e3efdd1274948c575ff8735ed2a4b9ad /oox
parent3a85c2db176db708c0ff9401c40858eb60e80f1e (diff)
oox smartart, cycle matrix: fix fill and line props of shape
The topmost shape may not have 0 depth, but something larger. In that case at least it's safe to still use fill & line properties. The B1 quadrant of the test file now has the proper orange background, and B2's border is also properly orange. Change-Id: Iccc5f6993693a0f1cf8f50d163003c24d3ad690e Reviewed-on: https://gerrit.libreoffice.org/68104 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index b26c32b6fb4b..1d6259ef698a 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -1168,6 +1168,14 @@ bool LayoutNode::setupShape( const ShapePtr& rShape, const dgm::Point* pPresNode
pPresNode->msModelId);
if( aNodeName != mrDgm.getData()->getPresOfNameMap().end() )
{
+ // Calculate the depth of what is effectively the topmost element.
+ sal_Int32 nMinDepth = std::numeric_limits<sal_Int32>::max();
+ for (const auto& rPair : aNodeName->second)
+ {
+ if (rPair.second.mnDepth < nMinDepth)
+ nMinDepth = rPair.second.mnDepth;
+ }
+
for (const auto& rPair : aNodeName->second)
{
const DiagramData::SourceIdAndDepth& rItem = rPair.second;
@@ -1199,6 +1207,13 @@ bool LayoutNode::setupShape( const ShapePtr& rShape, const dgm::Point* pPresNode
<< " added for layout node named \"" << msName
<< "\"");
}
+ else if (rItem.mnDepth == nMinDepth)
+ {
+ // If no real topmost element, then take properties from the one that's the closest
+ // to topmost.
+ rShape->getLineProperties() = aDataNode2->second->mpShape->getLineProperties();
+ rShape->getFillProperties() = aDataNode2->second->mpShape->getFillProperties();
+ }
// append text with right outline level
if( aDataNode2->second->mpShape->getTextBody() &&