summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-01-10 13:39:02 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-01-11 09:04:48 +0100
commitdfc97dd381ef516ca4a7e99b29f9da1033a380f4 (patch)
tree1c1750d7cefc04e8f7e53a1c597cd6cd061f9140 /oox
parent1e3442983b44ad6042cb687dbb77bf174796a255 (diff)
oox smartart, org chart: handle multiple paragraphs on data node
This problem was similar to the one fixed in cfa76f538a44d4396574ece59e8a3953c22c6eb7 (oox smartart, accent process: handle multiple runs from a data point, 2018-11-21), but this there we handled multiple runs and this handles multiple paragraphs. It seems some smartart types allow multiple paragraphs in a diagram node, others only allow multiple runs. Org chart is in the former category. Change-Id: I281f01fdfa809d0a232d5da7fdaa23de7adcd627 Reviewed-on: https://gerrit.libreoffice.org/66066 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.cxx23
1 files changed, 13 insertions, 10 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index dd762a9bc77a..e768bebf362d 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -1047,16 +1047,19 @@ bool LayoutNode::setupShape( const ShapePtr& rShape, const dgm::Point* pPresNode
rShape->setTextBody(pTextBody);
}
- TextParagraph& rPara=pTextBody->addParagraph();
- if( aVecIter->second != -1 )
- rPara.getProperties().setLevel(aVecIter->second);
-
- std::shared_ptr<TextParagraph> pSourceParagraph
- = aDataNode2->second->mpShape->getTextBody()->getParagraphs().front();
- for (const auto& pRun : pSourceParagraph->getRuns())
- rPara.addRun(pRun);
- rPara.getProperties().apply(
- aDataNode2->second->mpShape->getTextBody()->getParagraphs().front()->getProperties());
+ const TextParagraphVector& rSourceParagraphs
+ = aDataNode2->second->mpShape->getTextBody()->getParagraphs();
+ for (const auto& pSourceParagraph : rSourceParagraphs)
+ {
+ TextParagraph& rPara = pTextBody->addParagraph();
+ if (aVecIter->second != -1)
+ rPara.getProperties().setLevel(aVecIter->second);
+
+ for (const auto& pRun : pSourceParagraph->getRuns())
+ rPara.addRun(pRun);
+ const TextBodyPtr& rBody = aDataNode2->second->mpShape->getTextBody();
+ rPara.getProperties().apply(rBody->getParagraphs().front()->getProperties());
+ }
}
++aVecIter;