diff options
-rw-r--r-- | oox/inc/oox/drawingml/shape.hxx | 6 | ||||
-rw-r--r-- | oox/source/drawingml/customshapegeometry.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/customshapeproperties.cxx | 5 | ||||
-rw-r--r-- | oox/source/drawingml/shape.cxx | 26 | ||||
-rw-r--r-- | oox/source/drawingml/transform2dcontext.cxx | 5 |
5 files changed, 23 insertions, 21 deletions
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx index d6cab48f6bb5..fdbda167e69a 100644 --- a/oox/inc/oox/drawingml/shape.hxx +++ b/oox/inc/oox/drawingml/shape.hxx @@ -116,6 +116,9 @@ public: table::TablePropertiesPtr getTableProperties(); + void setChildPosition( com::sun::star::awt::Point nPosition ){ maChPosition = nPosition; } + void setChildSize( com::sun::star::awt::Size aSize ){ maChSize = aSize; } + void setPosition( com::sun::star::awt::Point nPosition ){ maPosition = nPosition; } void setSize( com::sun::star::awt::Size aSize ){ maSize = aSize; } void setRotation( sal_Int32 nRotation ) { mnRotation = nRotation; } @@ -182,6 +185,9 @@ protected: ShapeIdMap* pShapeMap ); std::vector< ShapePtr > maChildren; // only used for group shapes + com::sun::star::awt::Size maChSize; // only used for group shapes + com::sun::star::awt::Point maChPosition; // only used for group shapes + TextBodyPtr mpTextBody; LinePropertiesPtr mpLinePropertiesPtr; FillPropertiesPtr mpFillPropertiesPtr; diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx index a0fcc3142f51..9917c8c40614 100644 --- a/oox/source/drawingml/customshapegeometry.cxx +++ b/oox/source/drawingml/customshapegeometry.cxx @@ -403,7 +403,7 @@ static EnhancedCustomShapeParameter GetAdjCoordinate( CustomShapeProperties& rCu } if ( ( n >= '0' ) && ( n <= '9' ) ) { // seems to be a ST_Coordinate - aRet.Value = Any( rValue.toInt32() ); + aRet.Value = Any( (sal_Int32)(rValue.toInt32() / 5) ); aRet.Type = EnhancedCustomShapeParameterType::NORMAL; } else diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx index d296a4041fb9..265c4f8b5ebb 100644 --- a/oox/source/drawingml/customshapeproperties.cxx +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -131,6 +131,11 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi aAdjustmentVal.State = PropertyState_DIRECT_VALUE; aAdjustmentSeq[ nAdjustmentIndex ] = aAdjustmentVal; } + } else { + EnhancedCustomShapeAdjustmentValue aAdjustmentVal; + aAdjustmentVal.Value <<= (*aIter).maFormula.toInt32(); + aAdjustmentVal.State = PropertyState_DIRECT_VALUE; + aAdjustmentSeq[ 0 ] = aAdjustmentVal; } aIter++; } diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index f0ae2ec2a7a3..2cc18319dc8d 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -223,24 +223,14 @@ void Shape::addChildren( { awt::Rectangle aShapeRect; awt::Rectangle* pShapeRect = 0; - if ( ( nGlobalLeft != SAL_MAX_INT32 ) && ( nGlobalRight != SAL_MIN_INT32 ) && ( nGlobalTop != SAL_MAX_INT32 ) && ( nGlobalBottom != SAL_MIN_INT32 ) ) - { - sal_Int32 nGlobalWidth = nGlobalRight - nGlobalLeft; - sal_Int32 nGlobalHeight = nGlobalBottom - nGlobalTop; - if ( nGlobalWidth && nGlobalHeight ) - { - double fWidth = (*aIter)->maSize.Width; - double fHeight= (*aIter)->maSize.Height; - double fXScale = (double)rClientRect.Width / (double)nGlobalWidth; - double fYScale = (double)rClientRect.Height / (double)nGlobalHeight; - aShapeRect.X = static_cast< sal_Int32 >( ( ( (*aIter)->maPosition.X - nGlobalLeft ) * fXScale ) + rClientRect.X ); - aShapeRect.Y = static_cast< sal_Int32 >( ( ( (*aIter)->maPosition.Y - nGlobalTop ) * fYScale ) + rClientRect.Y ); - fWidth *= fXScale; - fHeight *= fYScale; - aShapeRect.Width = static_cast< sal_Int32 >( fWidth ); - aShapeRect.Height = static_cast< sal_Int32 >( fHeight ); - pShapeRect = &aShapeRect; - } + Shape& rChild = *(*aIter); + + if ( rChild.maSize.Width != maSize.Width || rChild.maSize.Height != maSize.Height || rChild.maPosition.X != maPosition.X || rChild.maPosition.Y != maPosition.Y ) { + aShapeRect.X = maPosition.X + rChild.maPosition.X - maChPosition.X; + aShapeRect.Y = maPosition.Y + rChild.maPosition.Y - maChPosition.Y; + aShapeRect.Width = maSize.Width + rChild.maSize.Width - maChSize.Width; + aShapeRect.Height = maSize.Height + rChild.maSize.Height - maChSize.Height; + pShapeRect = &aShapeRect; } (*aIter++)->addShape( rFilterBase, pTheme, rxShapes, pShapeRect, pShapeMap ); } diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx index 43748bd1089a..a089ce62b570 100644 --- a/oox/source/drawingml/transform2dcontext.cxx +++ b/oox/source/drawingml/transform2dcontext.cxx @@ -64,11 +64,12 @@ Reference< XFastContextHandler > Transform2DContext::createFastChildContext( sal case NMSP_DRAWINGML|XML_ext: // horz/vert size mrShape.setSize( Size( xAttribs->getOptionalValue( XML_cx ).toInt32(), xAttribs->getOptionalValue( XML_cy ).toInt32() ) ); break; -/* todo: what to do? case NMSP_DRAWINGML|XML_chOff: // horz/vert translation of children + mrShape.setChildPosition( Point( xAttribs->getOptionalValue( XML_x ).toInt32(), xAttribs->getOptionalValue( XML_y ).toInt32() ) ); + break; case NMSP_DRAWINGML|XML_chExt: // horz/vert size of children + mrShape.setChildSize( Size( xAttribs->getOptionalValue( XML_cx ).toInt32(), xAttribs->getOptionalValue( XML_cy ).toInt32() ) ); break; -*/ } return 0; |