summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/diagram/diagram.hxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-09-11 17:30:27 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-09-15 14:39:02 +0200
commitc22ab1cba13d59d7982d8972ece7e8a64e9a74fa (patch)
treefea69aef87ac5ba7b88aaa155a440adee7a6961d /oox/source/drawingml/diagram/diagram.hxx
parent618b12b768eaffd40fcd98eb0ed55d0e7850b64c (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. (cherry picked from commit 1bd3474c7c7945e1182dfbaca89be05ea98dd3e8) Conflicts: include/oox/core/xmlfilterbase.hxx Change-Id: I6c591eadc7166c7c42752650afdb7ee1e416cff6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102711 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Diffstat (limited to 'oox/source/drawingml/diagram/diagram.hxx')
-rw-r--r--oox/source/drawingml/diagram/diagram.hxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/oox/source/drawingml/diagram/diagram.hxx b/oox/source/drawingml/diagram/diagram.hxx
index e7f5cc68378b..25fa10ed0635 100644
--- a/oox/source/drawingml/diagram/diagram.hxx
+++ b/oox/source/drawingml/diagram/diagram.hxx
@@ -49,7 +49,10 @@ typedef std::map<const dgm::Point*, ShapePtr> PresPointShapeMap;
class DiagramLayout
{
public:
- DiagramLayout(const Diagram& rDgm) : mrDgm(rDgm) {}
+ DiagramLayout(Diagram& rDgm)
+ : mrDgm(rDgm)
+ {
+ }
void setDefStyle( const OUString & sDefStyle )
{ msDefStyle = sDefStyle; }
void setMinVer( const OUString & sMinVer )
@@ -60,8 +63,7 @@ public:
{ msTitle = sTitle; }
void setDesc( const OUString & sDesc )
{ msDesc = sDesc; }
- const Diagram& getDiagram() const
- { return mrDgm; }
+ Diagram& getDiagram() { return mrDgm; }
LayoutNodePtr & getNode()
{ return mpNode; }
const LayoutNodePtr & getNode() const
@@ -80,7 +82,7 @@ public:
{ return maPresPointShapeMap; }
private:
- const Diagram& mrDgm;
+ Diagram& mrDgm;
OUString msDefStyle;
OUString msMinVer;
OUString msUniqueId;
@@ -128,6 +130,7 @@ typedef std::map<OUString,DiagramColor> DiagramColorMap;
class Diagram
{
public:
+ explicit Diagram(const ShapePtr& pShape);
void setData( const DiagramDataPtr & pData )
{ mpData = pData; }
const DiagramDataPtr& getData() const
@@ -146,7 +149,10 @@ public:
void addTo( const ShapePtr & pShape );
css::uno::Sequence<css::beans::PropertyValue> getDomsAsPropertyValues() const;
+ ShapePtr getShape() { return mpShape; }
+
private:
+ ShapePtr mpShape;
DiagramDataPtr mpData;
DiagramLayoutPtr mpLayout;
DiagramQStyleMap maStyles;