Kaydet (Commit) 12a5ff41 authored tarafından Armin Le Grand's avatar Armin Le Grand

#119920# added handling of missing TextRotateAngle for CustomShape import for ooxml import

üst 19116761
......@@ -130,6 +130,9 @@ public:
void setMirroredX( sal_Bool bMirroredX ) { mbMirroredX = bMirroredX; };
void setMirroredY( sal_Bool bMirroredY ) { mbMirroredY = bMirroredY; };
// #119920# Add missing extra text rotation
void setTextRotation(sal_Int32 nTextRotation) { mnTextRotation = nTextRotation; }
double getValue( const std::vector< CustomShapeGuide >&, sal_uInt32 nIndex ) const;
static sal_Int32 SetCustomShapeGuideValue( std::vector< CustomShapeGuide >& rGuideList, const CustomShapeGuide& rGuide );
static sal_Int32 GetCustomShapeGuideValue( const std::vector< CustomShapeGuide >& rGuideList, const rtl::OUString& rFormulaName );
......@@ -148,6 +151,9 @@ private:
maSegments;
sal_Bool mbMirroredX;
sal_Bool mbMirroredY;
// #119920# Add missing extra text rotation
sal_Int32 mnTextRotation;
};
} }
......
......@@ -45,6 +45,7 @@ namespace oox { namespace drawingml {
CustomShapeProperties::CustomShapeProperties()
: mbMirroredX ( sal_False )
, mbMirroredY ( sal_False )
, mnTextRotation(0) // #119920# Add missing extra text rotation
{
}
CustomShapeProperties::~CustomShapeProperties()
......@@ -94,6 +95,22 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
if( xDefaulter.is() )
xDefaulter->createCustomShapeDefaults( maShapePresetType );
PropertyMap aPropertyMap;
aPropertyMap[ PROP_MirroredX ] <<= Any( mbMirroredX );
aPropertyMap[ PROP_MirroredY ] <<= Any( mbMirroredY );
if(mnTextRotation)
{
// #119920# Handle missing text rotation
aPropertyMap[ PROP_TextRotateAngle ] <<= Any(mnTextRotation);
}
// converting the vector to a sequence
Sequence< PropertyValue > aSeq = aPropertyMap.makePropertyValueSequence();
PropertySet aPropSet( xPropSet );
aPropSet.setProperty( PROP_CustomShapeGeometry, aSeq );
if ( maAdjustmentGuideList.size() )
{
const OUString sType = CREATE_OUSTRING( "Type" );
......@@ -146,6 +163,12 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
aPropertyMap[ PROP_Type ] <<= CREATE_OUSTRING( "non-primitive" );
aPropertyMap[ PROP_MirroredX ] <<= Any( mbMirroredX );
aPropertyMap[ PROP_MirroredY ] <<= Any( mbMirroredY );
if(mnTextRotation)
{
aPropertyMap[ PROP_TextRotation ] <<= Any(mnTextRotation);
}
awt::Size aSize( xShape->getSize() );
awt::Rectangle aViewBox( 0, 0, aSize.Width * 360, aSize.Height * 360 );
if ( maPath2DList.size() )
......
......@@ -475,6 +475,18 @@ Reference< XShape > Shape::createAndInsert(
mpCustomShapePropertiesPtr->setMirroredX( sal_True );
if ( mbFlipV )
mpCustomShapePropertiesPtr->setMirroredY( sal_True );
// #119920 Handle missing text rotation
if(getTextBody())
{
const sal_Int32 nTextRotation(getTextBody()->getTextProperties().moRotation.get(0));
if(nTextRotation)
{
mpCustomShapePropertiesPtr->setTextRotation((nTextRotation * -1) / 60000);
}
}
mpCustomShapePropertiesPtr->pushToPropSet( rFilterBase, xSet, mxShape );
}
......
......@@ -445,6 +445,7 @@ TextLeftDistance
TextLowerDistance
TextOverlap
TextRightDistance
TextRotateAngle
TextRotation
TextUpperDistance
TextVerticalAdjust
......
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