diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-02-22 17:12:04 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-02-22 19:30:16 +0100 |
commit | 333e9ea15bb57cf1c87ac2ea150de1e3fd79cfcb (patch) | |
tree | 3b10300cd97c0b0883d68ac1e4a102af2f599b84 /oox/source/drawingml | |
parent | 8777fc78ce7913b774d1c6ef660c7668c6c7b526 (diff) |
oox smartart, picture strip: handle bitmap fill of pres nodes
There were two problems here:
1) We did not import bitmap fill from presentation nodes.
2) Presentation nodes contained properties with reference semantics, so
if you set a bitmap fill for a first and a second shape, then at the end
both shapes contained the second bitmap.
With this, both bitmaps are imported exactly once.
Change-Id: I098a006eb3f58a338400663d57888ca671ed9909
Reviewed-on: https://gerrit.libreoffice.org/68218
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'oox/source/drawingml')
-rw-r--r-- | oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/diagram/layoutatomvisitors.cxx | 3 | ||||
-rw-r--r-- | oox/source/drawingml/shape.cxx | 6 |
3 files changed, 11 insertions, 0 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index 1d6259ef698a..4cf36186322c 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -1258,6 +1258,8 @@ bool LayoutNode::setupShape( const ShapePtr& rShape, const dgm::Point* pPresNode " processing shape type " << rShape->getCustomShapeProperties()->getShapePresetType() << " for layout node named \"" << msName << "\""); + if (pPresNode->mpShape) + rShape->getFillProperties().assignUsed(pPresNode->mpShape->getFillProperties()); } // TODO(Q1): apply styling & coloring - take presentation diff --git a/oox/source/drawingml/diagram/layoutatomvisitors.cxx b/oox/source/drawingml/diagram/layoutatomvisitors.cxx index a73b6566bafe..ff37f816d789 100644 --- a/oox/source/drawingml/diagram/layoutatomvisitors.cxx +++ b/oox/source/drawingml/diagram/layoutatomvisitors.cxx @@ -272,6 +272,9 @@ void ShapeTemplateVisitor::visit(ShapeAtom& rAtom) // TODO(F3): cloned shape shares all properties by reference, // don't change them! mpShape.reset(new Shape(pCurrShape)); + // Fill properties have to be changed as sometimes only the presentation node contains the blip + // fill, unshare those. + mpShape->cloneFillProperties(); } void ShapeLayoutingVisitor::defaultVisit(LayoutAtom const & rAtom) diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index b01aa8ac51ce..ac137e6f7d2f 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1796,6 +1796,12 @@ uno::Sequence< uno::Sequence< uno::Any > > Shape::resolveRelationshipsOfTypeFro return xRelListTemp; } +void Shape::cloneFillProperties() +{ + auto pFillProperties = std::make_shared<FillProperties>(); + pFillProperties->assignUsed(*mpFillPropertiesPtr); + mpFillPropertiesPtr = pFillProperties; +} } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |