Kaydet (Commit) 603a8414 authored tarafından Grzegorz Araminowicz's avatar Grzegorz Araminowicz Kaydeden (comit) Jan Holesovsky

SmartArt: layout diagram

Change-Id: I854703ea3cb09ace2d0b01a47d9f07bb7a98b70e
Reviewed-on: https://gerrit.libreoffice.org/39172Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst 2bdfeb0b
...@@ -317,6 +317,8 @@ void Diagram::addTo( const ShapePtr & pParentShape ) ...@@ -317,6 +317,8 @@ void Diagram::addTo( const ShapePtr & pParentShape )
// collect data, init maps // collect data, init maps
build( ); build( );
pParentShape->setChildSize(pParentShape->getSize());
// create Shape hierarchy // create Shape hierarchy
ShapeCreationVisitor aCreationVisitor(pParentShape, *this); ShapeCreationVisitor aCreationVisitor(pParentShape, *this);
if( mpLayout->getNode() ) if( mpLayout->getNode() )
......
...@@ -271,6 +271,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, ...@@ -271,6 +271,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
break; break;
case XML_lin: case XML_lin:
case XML_snake:
{ {
if( rShape->getChildren().empty() ) if( rShape->getChildren().empty() )
{ {
...@@ -300,8 +301,8 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, ...@@ -300,8 +301,8 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
aCurrPos.Y + sz.Height); aCurrPos.Y + sz.Height);
// HACK: the spacing is arbitrary // HACK: the spacing is arbitrary
aCurrPos.X += nIncX*(sz.Width+5); aCurrPos.X += nIncX*(sz.Width+50);
aCurrPos.Y += nIncY*(sz.Height+5); aCurrPos.Y += nIncY*(sz.Height+50);
++aCurrShape; ++aCurrShape;
} }
...@@ -311,7 +312,6 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, ...@@ -311,7 +312,6 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
} }
case XML_pyra: case XML_pyra:
case XML_snake:
break; break;
case XML_sp: case XML_sp:
...@@ -331,8 +331,8 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, ...@@ -331,8 +331,8 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
// HACK - count chars & paragraphs to come up with *some* // HACK - count chars & paragraphs to come up with *some*
// notion of necessary size // notion of necessary size
const sal_Int32 nHackyFontHeight=50; const sal_Int32 nHackyFontHeight=500;
const sal_Int32 nHackyFontWidth=20; const sal_Int32 nHackyFontWidth=400;
awt::Size aTotalSize; awt::Size aTotalSize;
for( size_t nPara=0; nPara<pTextBody->getParagraphs().size(); ++nPara ) 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 ...@@ -489,6 +489,12 @@ bool LayoutNode::setupShape( const ShapePtr& rShape, const Diagram& rDgm, sal_uI
rShape->getShapeStyleRefs()[XML_fontRef].maPhClr = rColor.maTextFillColor; 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 // even if no data node found, successful anyway. it's
// contained at the layoutnode // contained at the layoutnode
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment