oox smartart: add support for syncing font heights of multiple shapes

Desktop / LibreOffice - Miklos Vajna [collabora.com] - 11 September 2020 18:07 UTC

When 2 or more shapes have their text set to autofit and they have a constraint like:



Then make sure that the automatic font size is the same for all shapes and all content fits, by using the smallest scaling factor from all relevant shapes.

Some rework is needed, because normally oox::drawingml::Shapes don't have access to their parents, at the same time there can be multiple SmartArts on a single slide, so storing the grouping info in the filter is problematic, too. Solve this by storing the grouping in the toplevel oox::drawingml::Shape and exposing them in XmlFilterBase just during the time the children of the toplevel shape of the SmartArt are added.

This works, because we know SmartArts can't be nested.

Change-Id: I6c591eadc7166c7c42752650afdb7ee1e416cff6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102490

1bd3474c7c79 oox smartart: add support for syncing font heights of multiple shapes
include/oox/core/xmlfilterbase.hxx | 12 +++++
include/oox/drawingml/shape.hxx | 8 +++
oox/source/core/xmlfilterbase.cxx | 8 +++
oox/source/drawingml/diagram/diagram.cxx | 9 +++-
oox/source/drawingml/diagram/diagram.hxx | 14 ++++--
.../drawingml/diagram/diagramlayoutatoms.cxx | 26 +++++++++-
.../drawingml/diagram/diagramlayoutatoms.hxx | 12 +++--
oox/source/drawingml/shape.cxx | 55 +++++++++++++++++++++
oox/source/ppt/pptshape.cxx | 13 +++++
sd/qa/unit/data/pptx/smartart-autofit-sync.pptx | Bin 0 -> 45546 bytes
sd/qa/unit/import-tests-smartart.cxx | 30 +++++++++++
11 files changed, 176 insertions(+), 11 deletions(-)

Upstream: cgit.freedesktop.org


  • Share