coverity#705000 Unchecked dynamic_cast
Change-Id: Iae20a0ab45779483fc501e5ab982e38f38ba21b7 Reviewed-on: https://gerrit.libreoffice.org/8425 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -952,27 +952,29 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
|
||||
if ( ( ( rObjData.nSpFlags & SP_FFLIPV ) || mnFix16Angle || nTextRotationAngle ) && dynamic_cast< SdrObjCustomShape* >( pObj ) )
|
||||
{
|
||||
SdrObjCustomShape* pCustomShape = dynamic_cast< SdrObjCustomShape* >( pObj );
|
||||
|
||||
double fExtraTextRotation = 0.0;
|
||||
if ( mnFix16Angle && !( GetPropertyValue( DFF_Prop_FitTextToShape ) & 4 ) )
|
||||
{ // text is already rotated, we have to take back the object rotation if DFF_Prop_RotateText is false
|
||||
fExtraTextRotation = -mnFix16Angle;
|
||||
}
|
||||
if ( rObjData.nSpFlags & SP_FFLIPV ) // sj: in ppt the text is flipped, whereas in word the text
|
||||
{ // remains unchanged, so we have to take back the flipping here
|
||||
fExtraTextRotation += 18000.0; // because our core will flip text if the shape is flipped.
|
||||
}
|
||||
fExtraTextRotation += nTextRotationAngle;
|
||||
if ( !::basegfx::fTools::equalZero( fExtraTextRotation ) )
|
||||
if (pCustomShape)
|
||||
{
|
||||
fExtraTextRotation /= 100.0;
|
||||
SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
|
||||
const OUString sTextRotateAngle( "TextRotateAngle" );
|
||||
com::sun::star::beans::PropertyValue aPropVal;
|
||||
aPropVal.Name = sTextRotateAngle;
|
||||
aPropVal.Value <<= fExtraTextRotation;
|
||||
aGeometryItem.SetPropertyValue( aPropVal );
|
||||
pCustomShape->SetMergedItem( aGeometryItem );
|
||||
double fExtraTextRotation = 0.0;
|
||||
if ( mnFix16Angle && !( GetPropertyValue( DFF_Prop_FitTextToShape ) & 4 ) )
|
||||
{ // text is already rotated, we have to take back the object rotation if DFF_Prop_RotateText is false
|
||||
fExtraTextRotation = -mnFix16Angle;
|
||||
}
|
||||
if ( rObjData.nSpFlags & SP_FFLIPV ) // sj: in ppt the text is flipped, whereas in word the text
|
||||
{ // remains unchanged, so we have to take back the flipping here
|
||||
fExtraTextRotation += 18000.0; // because our core will flip text if the shape is flipped.
|
||||
}
|
||||
fExtraTextRotation += nTextRotationAngle;
|
||||
if ( !::basegfx::fTools::equalZero( fExtraTextRotation ) )
|
||||
{
|
||||
fExtraTextRotation /= 100.0;
|
||||
SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
|
||||
const OUString sTextRotateAngle( "TextRotateAngle" );
|
||||
com::sun::star::beans::PropertyValue aPropVal;
|
||||
aPropVal.Name = sTextRotateAngle;
|
||||
aPropVal.Value <<= fExtraTextRotation;
|
||||
aGeometryItem.SetPropertyValue( aPropVal );
|
||||
pCustomShape->SetMergedItem( aGeometryItem );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( mnFix16Angle )
|
||||
|
Reference in New Issue
Block a user