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