[Libreoffice-commits] .: oox/source
Muthu Subramanian
sumuthu at kemper.freedesktop.org
Fri Dec 2 08:50:47 PST 2011
oox/source/drawingml/shape.cxx | 22 ++++++++++++----------
oox/source/drawingml/shapepropertiescontext.cxx | 7 +++++++
2 files changed, 19 insertions(+), 10 deletions(-)
New commits:
commit 30b052e7b65434d2a78ab36d8f4475abe0c86a2a
Author: Muthu Subramanian <sumuthu at suse.com>
Date: Fri Dec 2 22:48:27 2011 +0530
n#719989/97: Connector shape fixes.
Note that rotation needs to be done post flipping.
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index d716823..2b81eac 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -509,6 +509,18 @@ Reference< XShape > Shape::createAndInsert(
aFillProperties.pushToPropMap( aShapeProps, rGraphicHelper, mnRotation, nFillPhClr );
aLineProperties.pushToPropMap( aShapeProps, rGraphicHelper, nLinePhClr );
+ // Moved here because the properties like Flip needs to be applied before
+ // applying the rotation property
+ if( bIsCustomShape )
+ {
+ if ( mbFlipH )
+ mpCustomShapePropertiesPtr->setMirroredX( sal_True );
+ if ( mbFlipV )
+ mpCustomShapePropertiesPtr->setMirroredY( sal_True );
+ OSL_TRACE("==cscode== shape name: '%s'", rtl::OUStringToOString(msName, RTL_TEXTENCODING_UTF8 ).getStr());
+ mpCustomShapePropertiesPtr->pushToPropSet( rFilterBase, xSet, mxShape );
+ }
+
// applying autogrowheight property before setting shape size, because
// the shape size might be changed if currently autogrowheight is true
// we must also check that the PropertySet supports the property.
@@ -522,16 +534,6 @@ Reference< XShape > Shape::createAndInsert(
if( aServiceName != OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GroupShape")) )
PropertySet( xSet ).setProperties( aShapeProps );
- if( bIsCustomShape )
- {
- if ( mbFlipH )
- mpCustomShapePropertiesPtr->setMirroredX( sal_True );
- if ( mbFlipV )
- mpCustomShapePropertiesPtr->setMirroredY( sal_True );
- OSL_TRACE("==cscode== shape name: '%s'", rtl::OUStringToOString(msName, RTL_TEXTENCODING_UTF8 ).getStr());
- mpCustomShapePropertiesPtr->pushToPropSet( rFilterBase, xSet, mxShape );
- }
-
// in some cases, we don't have any text body.
if( getTextBody() )
{
diff --git a/oox/source/drawingml/shapepropertiescontext.cxx b/oox/source/drawingml/shapepropertiescontext.cxx
index a6687bc..1d2a216 100644
--- a/oox/source/drawingml/shapepropertiescontext.cxx
+++ b/oox/source/drawingml/shapepropertiescontext.cxx
@@ -81,11 +81,18 @@ Reference< XFastContextHandler > ShapePropertiesContext::createFastChildContext(
case A_TOKEN( prstGeom ): // preset geometry "CT_PresetGeometry2D"
{
sal_Int32 nToken = xAttribs->getOptionalValueToken( XML_prst, 0 );
+ // TODO: Move the following checks to a separate place or as a separate function
if ( nToken == XML_line )
{
static const OUString sLineShape( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.LineShape" ) );
mrShape.getServiceName() = sLineShape;
}
+ if( ( nToken >= XML_bentConnector2 && nToken <= XML_bentConnector5 ) ||
+ nToken == XML_straightConnector1 )
+ {
+ static const OUString sCustomShape( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.CustomShape" ) );
+ mrShape.getServiceName() = sCustomShape;
+ }
xRet.set( new PresetShapeGeometryContext( *this, xAttribs, *(mrShape.getCustomShapeProperties()) ) );
}
break;
More information about the Libreoffice-commits
mailing list