diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-04-04 11:51:38 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-04-04 11:51:38 +0000 |
commit | 18449c5d104af1d6d57ccf5614ba15c4590883d5 (patch) | |
tree | 2e998721551f0a671f699197d721d7255b82e440 /svx/source/unodraw/unoshap2.cxx | |
parent | 53d0375280d323ea01f06c13080cf5f6c00310f9 (diff) |
INTEGRATION: CWS impress140 (1.68.40); FILE MERGED
2008/04/03 15:10:39 cl 1.68.40.1: #i87804# reverted faulty optimization for custom shapes setPropertyValue
Diffstat (limited to 'svx/source/unodraw/unoshap2.cxx')
-rw-r--r-- | svx/source/unodraw/unoshap2.cxx | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 32e8f3fbd1..54e1016219 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -4,9 +4,9 @@ * * $RCSfile: unoshap2.cxx,v $ * - * $Revision: 1.68 $ + * $Revision: 1.69 $ * - * last change: $Author: rt $ $Date: 2008-03-12 10:11:58 $ + * last change: $Author: kz $ $Date: 2008-04-04 12:51:38 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -2120,25 +2120,34 @@ void SAL_CALL SvxCustomShape::setSize( const awt::Size& rSize ) //---------------------------------------------------------------------- -bool SvxCustomShape::setPropertyValueImpl( const SfxItemPropertyMap* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) +//---------------------------------------------------------------------- +void SAL_CALL SvxCustomShape::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) + throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, com::sun::star::beans::PropertyVetoException, com::sun::star::lang::IllegalArgumentException) { - switch( pProperty->nWID ) - { - case SDRATTR_CUSTOMSHAPE_GEOMETRY: - { - SdrObjCustomShape* pObject = static_cast< SdrObjCustomShape* >( mpObj.get() ); + OGuard aGuard( Application::GetSolarMutex() ); + SdrObject* pObject = mpObj.get(); - sal_Bool bMirroredX = pObject->IsMirroredX(); - sal_Bool bMirroredY = pObject->IsMirroredY(); + sal_Bool bCustomShapeGeometry = pObject && aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CustomShapeGeometry" ) ); - SvxShapeText::setPropertyValueImpl( pProperty, rValue ); + sal_Bool bMirroredX = sal_False; + sal_Bool bMirroredY = sal_False; - pObject->MergeDefaultAttributes(0); + if ( bCustomShapeGeometry ) + { + bMirroredX = ( ((SdrObjCustomShape*)pObject)->IsMirroredX() ); + bMirroredY = ( ((SdrObjCustomShape*)pObject)->IsMirroredY() ); + } + + SvxShape::setPropertyValue( aPropertyName, aValue ); + + if ( bCustomShapeGeometry ) + { + ((SdrObjCustomShape*)pObject)->MergeDefaultAttributes(0); Rectangle aRect( pObject->GetSnapRect() ); // #i38892# - bool bNeedsMirrorX = pObject->IsMirroredX() != bMirroredX; - bool bNeedsMirrorY = pObject->IsMirroredY() != bMirroredY; + bool bNeedsMirrorX = ((SdrObjCustomShape*)pObject)->IsMirroredX() != bMirroredX; + bool bNeedsMirrorY = ((SdrObjCustomShape*)pObject)->IsMirroredY() != bMirroredY; boost::scoped_ptr< SdrGluePointList > pListCopy; if( bNeedsMirrorX || bNeedsMirrorY ) @@ -2155,7 +2164,7 @@ bool SvxCustomShape::setPropertyValueImpl( const SfxItemPropertyMap* pProperty, pObject->NbcMirror( aTop, aBottom ); // NbcMirroring is flipping the current mirror state, // so we have to set the correct state again - pObject->SetMirroredX( bMirroredX ? sal_False : sal_True ); + ((SdrObjCustomShape*)pObject)->SetMirroredX( bMirroredX ? sal_False : sal_True ); } if ( bNeedsMirrorY ) { @@ -2164,7 +2173,7 @@ bool SvxCustomShape::setPropertyValueImpl( const SfxItemPropertyMap* pProperty, pObject->NbcMirror( aLeft, aRight ); // NbcMirroring is flipping the current mirror state, // so we have to set the correct state again - pObject->SetMirroredY( bMirroredY ? sal_False : sal_True ); + ((SdrObjCustomShape*)pObject)->SetMirroredY( bMirroredY ? sal_False : sal_True ); } if( pListCopy ) @@ -2173,10 +2182,6 @@ bool SvxCustomShape::setPropertyValueImpl( const SfxItemPropertyMap* pProperty, if(pNewList) *pNewList = *pListCopy; } - return true; - } - default: - return SvxShapeText::setPropertyValueImpl( pProperty, rValue ); } } |