summaryrefslogtreecommitdiff
path: root/oox/source/ppt
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-09-11 17:30:27 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-09-11 20:07:17 +0200
commit1bd3474c7c7945e1182dfbaca89be05ea98dd3e8 (patch)
tree2a8908c145c132cf8d635a1051b10f129a6a8b13 /oox/source/ppt
parente9b9044f7b7b44b45dd582885cad0b0a7d44f88b (diff)
oox smartart: add support for syncing font heights of multiple shapes
When 2 or more shapes have their text set to autofit and they have a constraint like: <dgm:constr type="primFontSz" for="des" forName="node" op="equ"/> 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 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'oox/source/ppt')
-rw-r--r--oox/source/ppt/pptshape.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index d017b4348d93..96ca319f2a8e 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -409,10 +409,23 @@ void PPTShape::addShape(
// if this is a group shape, we have to add also each child shape
Reference<XShapes> xShapes(xShape, UNO_QUERY);
if (xShapes.is())
+ {
+ if (meFrameType == FRAMETYPE_DIAGRAM)
+ {
+ rFilterBase.setDiagramFontHeights(&getDiagramFontHeights());
+ }
addChildren( rFilterBase, *this, pTheme, xShapes, pShapeMap, aTransformation );
+ if (meFrameType == FRAMETYPE_DIAGRAM)
+ {
+ rFilterBase.setDiagramFontHeights(nullptr);
+ }
+ }
if (meFrameType == FRAMETYPE_DIAGRAM)
+ {
keepDiagramCompatibilityInfo();
+ syncDiagramFontHeights();
+ }
}
}
catch (const Exception&)