impress193: #162822# fixed font size problem with presentation objects and flipping problem of freeform shapes
This commit is contained in:
parent
558e6bbbcd
commit
96c2ec5749
4 changed files with 19 additions and 3 deletions
|
@ -133,6 +133,8 @@ public:
|
|||
OptValue< GeomRect >& getTextRect(){ return maTextRect; };
|
||||
std::vector< Path2D >& getPath2DList(){ return maPath2DList; };
|
||||
std::vector< com::sun::star::drawing::EnhancedCustomShapeSegment >& getSegments(){ return maSegments; };
|
||||
void setMirroredX( sal_Bool bMirroredX ) { mbMirroredX = bMirroredX; };
|
||||
void setMirroredY( sal_Bool bMirroredY ) { mbMirroredY = bMirroredY; };
|
||||
|
||||
double getValue( const std::vector< CustomShapeGuide >&, sal_uInt32 nIndex ) const;
|
||||
static sal_Int32 SetCustomShapeGuideValue( std::vector< CustomShapeGuide >& rGuideList, const CustomShapeGuide& rGuide );
|
||||
|
@ -150,6 +152,8 @@ private:
|
|||
|
||||
std::vector< com::sun::star::drawing::EnhancedCustomShapeSegment >
|
||||
maSegments;
|
||||
sal_Bool mbMirroredX;
|
||||
sal_Bool mbMirroredY;
|
||||
};
|
||||
|
||||
} }
|
||||
|
|
|
@ -50,6 +50,8 @@ using namespace ::com::sun::star::drawing;
|
|||
namespace oox { namespace drawingml {
|
||||
|
||||
CustomShapeProperties::CustomShapeProperties()
|
||||
: mbMirroredX ( sal_False )
|
||||
, mbMirroredY ( sal_False )
|
||||
{
|
||||
}
|
||||
CustomShapeProperties::~CustomShapeProperties()
|
||||
|
@ -149,7 +151,8 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
|
|||
sal_uInt32 i;
|
||||
PropertyMap aPropertyMap;
|
||||
aPropertyMap[ PROP_Type ] <<= CREATE_OUSTRING( "non-primitive" );
|
||||
|
||||
aPropertyMap[ PROP_MirroredX ] <<= Any( mbMirroredX );
|
||||
aPropertyMap[ PROP_MirroredY ] <<= Any( mbMirroredY );
|
||||
awt::Size aSize( xShape->getSize() );
|
||||
awt::Rectangle aViewBox( 0, 0, aSize.Width * 360, aSize.Height * 360 );
|
||||
if ( maPath2DList.size() )
|
||||
|
|
|
@ -260,6 +260,7 @@ Reference< XShape > Shape::createAndInsert(
|
|||
OUString aServiceName = rServiceName;
|
||||
if( mxCreateCallback.get() )
|
||||
aServiceName = mxCreateCallback->onCreateXShape( aServiceName, awt::Rectangle( aPosition.X / 360, aPosition.Y / 360, aSize.Width / 360, aSize.Height / 360 ) );
|
||||
sal_Bool bIsCustomShape = aServiceName == OUString::createFromAscii( "com.sun.star.drawing.CustomShape" );
|
||||
|
||||
basegfx::B2DHomMatrix aTransformation;
|
||||
if( aSize.Width != 1 || aSize.Height != 1)
|
||||
|
@ -279,7 +280,7 @@ Reference< XShape > Shape::createAndInsert(
|
|||
// center object at origin
|
||||
aTransformation.translate( -aCenter.getX(), -aCenter.getY() );
|
||||
|
||||
if( mbFlipH || mbFlipV)
|
||||
if( !bIsCustomShape && ( mbFlipH || mbFlipV ) )
|
||||
{
|
||||
// mirror around object's center
|
||||
aTransformation.scale( mbFlipH ? -1.0 : 1.0, mbFlipV ? -1.0 : 1.0 );
|
||||
|
@ -469,8 +470,14 @@ Reference< XShape > Shape::createAndInsert(
|
|||
if( aServiceName != OUString::createFromAscii( "com.sun.star.drawing.GroupShape" ) )
|
||||
aPropSet.setProperties( aShapeProperties );
|
||||
|
||||
if( aServiceName == OUString::createFromAscii( "com.sun.star.drawing.CustomShape" ) )
|
||||
if( bIsCustomShape )
|
||||
{
|
||||
if ( mbFlipH )
|
||||
mpCustomShapePropertiesPtr->setMirroredX( sal_True );
|
||||
if ( mbFlipV )
|
||||
mpCustomShapePropertiesPtr->setMirroredY( sal_True );
|
||||
mpCustomShapePropertiesPtr->pushToPropSet( rFilterBase, xSet, mxShape );
|
||||
}
|
||||
|
||||
// in some cases, we don't have any text body.
|
||||
if( getTextBody() )
|
||||
|
|
|
@ -257,6 +257,8 @@ MaxFieldCount
|
|||
MaxTextLen
|
||||
MediaType
|
||||
MinorTickmarks
|
||||
MirroredX
|
||||
MirroredY
|
||||
MissingValueTreatment
|
||||
Model
|
||||
MultiLine
|
||||
|
|
Loading…
Reference in a new issue