summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorGrzegorz Araminowicz <g.araminowicz@gmail.com>2017-06-23 15:11:08 +0200
committerJan Holesovsky <kendy@collabora.com>2017-06-26 10:18:18 +0200
commit603a8414454ab963b5907085d6642dcfd432ce34 (patch)
tree3d55fc22ecee9873ea217237f3f7d4505f2f2df5 /oox
parent2bdfeb0b0973ebb7c4d9c410e22df2a56deef5bc (diff)
SmartArt: layout diagram
Change-Id: I854703ea3cb09ace2d0b01a47d9f07bb7a98b70e Reviewed-on: https://gerrit.libreoffice.org/39172 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/diagram/diagram.cxx2
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.cxx16
2 files changed, 13 insertions, 5 deletions
diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx
index a72988627602..3272e47da5fe 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -317,6 +317,8 @@ void Diagram::addTo( const ShapePtr & pParentShape )
// collect data, init maps
build( );
+ pParentShape->setChildSize(pParentShape->getSize());
+
// create Shape hierarchy
ShapeCreationVisitor aCreationVisitor(pParentShape, *this);
if( mpLayout->getNode() )
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 46510dee0126..d77020ad7ab7 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -271,6 +271,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
break;
case XML_lin:
+ case XML_snake:
{
if( rShape->getChildren().empty() )
{
@@ -300,8 +301,8 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
aCurrPos.Y + sz.Height);
// HACK: the spacing is arbitrary
- aCurrPos.X += nIncX*(sz.Width+5);
- aCurrPos.Y += nIncY*(sz.Height+5);
+ aCurrPos.X += nIncX*(sz.Width+50);
+ aCurrPos.Y += nIncY*(sz.Height+50);
++aCurrShape;
}
@@ -311,7 +312,6 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
}
case XML_pyra:
- case XML_snake:
break;
case XML_sp:
@@ -331,8 +331,8 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
// HACK - count chars & paragraphs to come up with *some*
// notion of necessary size
- const sal_Int32 nHackyFontHeight=50;
- const sal_Int32 nHackyFontWidth=20;
+ const sal_Int32 nHackyFontHeight=500;
+ const sal_Int32 nHackyFontWidth=400;
awt::Size aTotalSize;
for( size_t nPara=0; nPara<pTextBody->getParagraphs().size(); ++nPara )
{
@@ -489,6 +489,12 @@ bool LayoutNode::setupShape( const ShapePtr& rShape, const Diagram& rDgm, sal_uI
rShape->getShapeStyleRefs()[XML_fontRef].maPhClr = rColor.maTextFillColor;
}
}
+ else
+ {
+ // if no style label apply at least some fill color
+ rShape->getShapeStyleRefs()[XML_fillRef].maPhClr.setScrgbClr(0, 0, 0);
+ rShape->getShapeStyleRefs()[XML_fillRef].mnThemedIdx = 2;
+ }
// even if no data node found, successful anyway. it's
// contained at the layoutnode