From 50d004fc8fe2c44516c52d22b40a221e8e3b587d Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 22 May 2020 17:58:22 +0200 Subject: smartart import: handle multiple in The TODO in the ColorFragmentHandler ctor was right: we only handled the last child, but there can be multiple one. Use them based on the index of a shape in a loop. Move the TODO to the only place which still assumes a single color in the color list. (cherry picked from commit 12bea6c897822964ad4705418da54411cb15749e) Conflicts: oox/source/drawingml/colorchoicecontext.cxx oox/source/drawingml/diagram/diagram.cxx sd/qa/unit/import-tests-smartart.cxx Change-Id: I1c5c4f82e621f1110ef06b0490ff79f82f60f214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95015 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- oox/source/drawingml/diagram/diagram.hxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'oox/source/drawingml/diagram/diagram.hxx') diff --git a/oox/source/drawingml/diagram/diagram.hxx b/oox/source/drawingml/diagram/diagram.hxx index 576c4007e29f..a674e248961e 100644 --- a/oox/source/drawingml/diagram/diagram.hxx +++ b/oox/source/drawingml/diagram/diagram.hxx @@ -22,6 +22,7 @@ #include #include +#include #include @@ -111,12 +112,15 @@ typedef std::map DiagramQStyleMap; struct DiagramColor { - oox::drawingml::Color maFillColor; - oox::drawingml::Color maLineColor; - oox::drawingml::Color maEffectColor; - oox::drawingml::Color maTextFillColor; - oox::drawingml::Color maTextLineColor; - oox::drawingml::Color maTextEffectColor; + std::vector maFillColors; + std::vector maLineColors; + std::vector maEffectColors; + std::vector maTextFillColors; + std::vector maTextLineColors; + std::vector maTextEffectColors; + + static const oox::drawingml::Color& + getColorByIndex(const std::vector& rColors, sal_Int32 nIndex); }; typedef std::map DiagramColorMap; -- cgit