openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1412154 [3/3] - in /incubator/ooo/branches/alg/aw080/main: filter/inc/filter/msfilter/ filter/source/msfilter/ offapi/com/sun/star/drawing/ oox/inc/oox/drawingml/ oox/source/drawingml/ oox/source/export/ oox/source/token/ sd/source/filter/...
Date Wed, 21 Nov 2012 15:42:29 GMT
Modified: incubator/ooo/branches/alg/aw080/main/svx/inc/svx/unoshape.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/inc/svx/unoshape.hxx?rev=1412154&r1=1412153&r2=1412154&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/inc/svx/unoshape.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/inc/svx/unoshape.hxx Wed Nov 21 15:42:23 2012
@@ -834,7 +834,9 @@ public:
 	SvxCustomShape( SdrObject* pObj ) throw ();
 	// overide these for special property handling in subcasses. Return true if property is
handled
     //virtual bool setPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertyMapEntry*
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);
-    virtual bool getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry*
pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException,
::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+    // TTTT: Should be obsolete, was only used for rotation angle
+    // virtual bool getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry*
pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException,
::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
 
 
 	virtual ~SvxCustomShape() throw ();

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShape2d.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShape2d.cxx?rev=1412154&r1=1412153&r2=1412154&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShape2d.cxx
(original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShape2d.cxx
Wed Nov 21 15:42:23 2012
@@ -473,8 +473,8 @@ sal_Bool EnhancedCustomShape2d::ConvertS
 			const com::sun::star::beans::PropertyValue& rPropVal = rHandleProperties[ i ];
 
 			const rtl::OUString	sPosition			( RTL_CONSTASCII_USTRINGPARAM( "Position" ) );
-//			const rtl::OUString	sMirroredX			( RTL_CONSTASCII_USTRINGPARAM( "MirroredX" ) );
-//			const rtl::OUString	sMirroredY			( RTL_CONSTASCII_USTRINGPARAM( "MirroredY" ) );
+			const rtl::OUString	sMirroredX			( RTL_CONSTASCII_USTRINGPARAM( "MirroredX" ) );
+			const rtl::OUString	sMirroredY			( RTL_CONSTASCII_USTRINGPARAM( "MirroredY" ) );
 			const rtl::OUString	sSwitched			( RTL_CONSTASCII_USTRINGPARAM( "Switched" ) );
 			const rtl::OUString	sPolar				( RTL_CONSTASCII_USTRINGPARAM( "Polar" ) );
 //			const rtl::OUString	sMap				( RTL_CONSTASCII_USTRINGPARAM( "Map" ) );
@@ -494,24 +494,24 @@ sal_Bool EnhancedCustomShape2d::ConvertS
 				if ( rPropVal.Value >>= rDestinationHandle.aPosition )
 					bRetValue = sal_True;
 			}
-//			else if ( rPropVal.Name.equals( sMirroredX ) )
-//			{
-//				sal_Bool bMirroredX = sal_Bool();
-//				if ( rPropVal.Value >>= bMirroredX )
-//				{
-//					if ( bMirroredX )
-//						rDestinationHandle.nFlags |= HANDLE_FLAGS_MIRRORED_X;
-//				}
-//			}
-//			else if ( rPropVal.Name.equals( sMirroredY ) )
-//			{
-//				sal_Bool bMirroredY = sal_Bool();
-//				if ( rPropVal.Value >>= bMirroredY )
-//				{
-//					if ( bMirroredY )
-//						rDestinationHandle.nFlags |= HANDLE_FLAGS_MIRRORED_Y;
-//				}
-//			}
+			else if ( rPropVal.Name.equals( sMirroredX ) )
+			{
+				sal_Bool bMirroredX = sal_Bool();
+				if ( rPropVal.Value >>= bMirroredX )
+				{
+					if ( bMirroredX )
+						rDestinationHandle.nFlags |= HANDLE_FLAGS_MIRRORED_X;
+				}
+			}
+			else if ( rPropVal.Name.equals( sMirroredY ) )
+			{
+				sal_Bool bMirroredY = sal_Bool();
+				if ( rPropVal.Value >>= bMirroredY )
+				{
+					if ( bMirroredY )
+						rDestinationHandle.nFlags |= HANDLE_FLAGS_MIRRORED_Y;
+				}
+			}
 			else if ( rPropVal.Name.equals( sSwitched ) )
 			{
 				sal_Bool bSwitched = sal_Bool();
@@ -743,6 +743,7 @@ EnhancedCustomShape2d::EnhancedCustomSha
 	maLogicScale = basegfx::absolute(pCustomShapeObj->getSdrObjectScale());
 
 	const rtl::OUString	sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
+    // TTTT: MirroredX/Y removed
 //	const rtl::OUString sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
 //	const rtl::OUString sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
 
@@ -753,6 +754,7 @@ EnhancedCustomShape2d::EnhancedCustomSha
 		*pAny >>= sShapeType;
 	meSpType = EnhancedCustomShapeTypeNames::Get( sShapeType );
 
+// TTTT:
 //	pAny = rGeometryItem.GetPropertyValueByName( sMirroredX );
 //	if ( pAny )
 //		*pAny >>= bFlipH;

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShape3d.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShape3d.cxx?rev=1412154&r1=1412153&r2=1412154&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShape3d.cxx
(original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShape3d.cxx
Wed Nov 21 15:42:23 2012
@@ -309,8 +309,8 @@ SdrObject* EnhancedCustomShape3d::Create
 
     if(GetBool(rGeometryItem, sExtrusion, false))
 	{
-		const bool bIsMirroredX(rCustomShape.IsMirroredX());
-		const bool bIsMirroredY(rCustomShape.IsMirroredY());
+		const bool bIsMirroredX(rShape2d.isMirroredX()); // TTTT: rCustomShape.IsMirroredX());
Check if rShape2d is correct here
+		const bool bIsMirroredY(rShape2d.isMirroredY()); // TTTT: rCustomShape.IsMirroredY());
And if needed at all...
         basegfx::B2DRange aSnapRange(basegfx::B2DRange::getUnitB2DRange());
 		SfxItemSet aSet(rCustomShape.GetMergedItemSet());
         std::vector< E3dCompoundObject* > aPlaceholderObjectList;
@@ -671,7 +671,8 @@ SdrObject* EnhancedCustomShape3d::Create
 
             GetRotateAngle(rGeometryItem, fXRotate, fYRotate);
 			
-            const double fZRotate(rCustomShape.GetObjectRotation() * F_PI180);
+            // TTTT: const double fZRotate(rCustomShape.GetObjectRotation() * F_PI180);
+            const double fZRotate(rCustomShape.getSdrObjectRotate());
 
             if(0.0 != fZRotate)
             {
@@ -881,7 +882,8 @@ basegfx::B2DRange EnhancedCustomShape3d:
 	
     GetRotateAngle(rGeometryItem, fXRotate, fYRotate);
 
-    double fZRotate(-rCustomShape.GetObjectRotation() * F_PI180);
+    // TTTT: double fZRotate(-rCustomShape.GetObjectRotation() * F_PI180);
+    double fZRotate(-rCustomShape.getSdrObjectRotate());
 
 	// rotating bound volume
 	basegfx::B3DHomMatrix aMatrix;
@@ -893,12 +895,12 @@ basegfx::B2DRange EnhancedCustomShape3d:
 		aMatrix.rotate(0.0, 0.0, fZRotate);
     }
 
-	if(rCustomShape.IsMirroredX())
+	if(rCustomShape.isMirroredX()) // TTTT: rCustomShape.IsMirroredX()) check if rCustomShape
is correct
     {
 		aMatrix.scale(-1.0, 1.0, 1.0);
     }
 
-	if(rCustomShape.IsMirroredY())
+	if(rCustomShape.isMirroredY()) // TTTT: rCustomShape.IsMirroredY()) and if needed at all
     {
 		aMatrix.scale(1.0, -1.0, 1.0);
     }

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdoashp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdoashp.cxx?rev=1412154&r1=1412153&r2=1412154&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdoashp.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdoashp.cxx Wed Nov 21 15:42:23
2012
@@ -442,53 +442,55 @@ bool SdrObjCustomShape::UseNoFillStyle()
 	return bRet;
 }
 
-bool SdrObjCustomShape::IsMirroredX() const
-{
-	bool bMirroredX = false;
-	SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem(
SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
-	const rtl::OUString	sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
-	com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredX );
-	if ( pAny )
-		*pAny >>= bMirroredX;
-	return bMirroredX;
-}
-bool SdrObjCustomShape::IsMirroredY() const
-{
-	bool bMirroredY = false;
-	SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem(
SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
-	const rtl::OUString	sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
-	com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredY );
-	if ( pAny )
-		*pAny >>= bMirroredY;
-	return bMirroredY;
-}
-void SdrObjCustomShape::SetMirroredX( const bool bMirrorX )
-{
-	SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem(
SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
-	const rtl::OUString	sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
-	//com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredX );
-	PropertyValue aPropVal;
-	aPropVal.Name = sMirroredX;
-	aPropVal.Value <<= bMirrorX;
-	aGeometryItem.SetPropertyValue( aPropVal );
-	SetMergedItem( aGeometryItem );
-}
-void SdrObjCustomShape::SetMirroredY( const bool bMirrorY )
-{
-	SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem(
SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
-	const rtl::OUString	sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
-	//com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredY );
-	PropertyValue aPropVal;
-	aPropVal.Name = sMirroredY;
-	aPropVal.Value <<= bMirrorY;
-	aGeometryItem.SetPropertyValue( aPropVal );
-	SetMergedItem( aGeometryItem );
-}
-
-double SdrObjCustomShape::GetObjectRotation() const
-{
-	return fObjectRotation;
-}
+// TTTT: MirroredX/Y removed
+//bool SdrObjCustomShape::IsMirroredX() const
+//{
+//	bool bMirroredX = false;
+//	SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem(
SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+//	const rtl::OUString	sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
+//	com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredX );
+//	if ( pAny )
+//		*pAny >>= bMirroredX;
+//	return bMirroredX;
+//}
+//bool SdrObjCustomShape::IsMirroredY() const
+//{
+//	bool bMirroredY = false;
+//	SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem(
SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+//	const rtl::OUString	sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
+//	com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredY );
+//	if ( pAny )
+//		*pAny >>= bMirroredY;
+//	return bMirroredY;
+//}
+//void SdrObjCustomShape::SetMirroredX( const bool bMirrorX )
+//{
+//	SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem(
SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+//	const rtl::OUString	sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
+//	//com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredX );
+//	PropertyValue aPropVal;
+//	aPropVal.Name = sMirroredX;
+//	aPropVal.Value <<= bMirrorX;
+//	aGeometryItem.SetPropertyValue( aPropVal );
+//	SetMergedItem( aGeometryItem );
+//}
+//void SdrObjCustomShape::SetMirroredY( const bool bMirrorY )
+//{
+//	SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem(
SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+//	const rtl::OUString	sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
+//	//com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredY );
+//	PropertyValue aPropVal;
+//	aPropVal.Name = sMirroredY;
+//	aPropVal.Value <<= bMirrorY;
+//	aGeometryItem.SetPropertyValue( aPropVal );
+//	SetMergedItem( aGeometryItem );
+//}
+
+// TTTT: Probably obsolete
+//double SdrObjCustomShape::GetObjectRotation() const
+//{
+//	return fObjectRotation;
+//}
 
 double SdrObjCustomShape::GetExtraTextRotation() const
 {
@@ -625,7 +627,7 @@ sdr::properties::BaseProperties* SdrObjC
 
 SdrObjCustomShape::SdrObjCustomShape(SdrModel& rSdrModel) 
 :	SdrTextObj(rSdrModel, basegfx::B2DHomMatrix(), OBJ_TEXT, true),
-	fObjectRotation( 0.0 ),
+	// TTTT: fObjectRotation( 0.0 ),
 	mpLastShadowGeometry(0)
 {
 }
@@ -649,7 +651,7 @@ void SdrObjCustomShape::copyDataFromSdrO
 
 			// copy local data
 			aName = pSource->aName;
-			fObjectRotation = pSource->fObjectRotation;
+			// TTTT: fObjectRotation = pSource->fObjectRotation;
 			InvalidateRenderGeometry();
 		}
 		else
@@ -1650,7 +1652,7 @@ bool SdrObjCustomShape::IsDefaultGeometr
 
 void SdrObjCustomShape::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
 {
-	rInfo.mbResizeFreeAllowed = 0.0 == fObjectRotation;
+	rInfo.mbResizeFreeAllowed = basegfx::fTools::equalZero(getSdrObjectRotate()); // TTTT: 0.0
== fObjectRotation;
 	rInfo.mbResizePropAllowed = true;
 	rInfo.mbRotateFreeAllowed = true;
 	rInfo.mbRotate90Allowed = true;
@@ -2000,9 +2002,11 @@ void SdrObjCustomShape::DragCreateObject
 	sal_uInt32 nDefaultObjectSizeWidth = 3000;		// default width from SDOptions ?
 	sal_uInt32 nDefaultObjectSizeHeight= 3000;
 
-	if ( ImpVerticalSwitch( *this ) )
+	if ( ImpVerticalSwitch( *this ) ) // TTTT: What is this good for?
 	{
-		SetMirroredX( aRange.getMinX() > aRange.getMaxX() );
+        // TTTT: Not possible, maybe (if needed) need to use rStat.GetNow() - rStat.GetStart()
+        // to detect mirroring
+		// SetMirroredX( aRange.getMinX() > aRange.getMaxX() );
 
 		aRange = basegfx::B2DRange( rStat.GetNow(), basegfx::B2DTuple( nDefaultObjectSizeWidth,
nDefaultObjectSizeHeight ) );
 		// subtracting the horizontal difference of the latest handle from shape position
@@ -2722,35 +2726,57 @@ SdrObjGeoData* SdrObjCustomShape::NewGeo
 
 void SdrObjCustomShape::SaveGeoData(SdrObjGeoData& rGeo) const
 {
-	SdrTextObj::SaveGeoData( rGeo );
-	SdrAShapeObjGeoData& rAGeo=(SdrAShapeObjGeoData&)rGeo;
-	rAGeo.fObjectRotation = fObjectRotation;
-	rAGeo.bMirroredX = IsMirroredX();
-	rAGeo.bMirroredY = IsMirroredY();
+    // call parent
+    SdrTextObj::SaveGeoData( rGeo );
 
-	const rtl::OUString	sAdjustmentValues( RTL_CONSTASCII_USTRINGPARAM ( "AdjustmentValues"
) );
-	Any* pAny( ( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) ).GetPropertyValueByName( sAdjustmentValues ) );
-	if ( pAny )
-		*pAny >>= rAGeo.aAdjustmentSeq;
+    SdrAShapeObjGeoData* pSdrAShapeObjGeoData = dynamic_cast< SdrAShapeObjGeoData* >(&rGeo);
+
+    if(pSdrAShapeObjGeoData)
+    {
+    // TTTT: Should be obsolete
+    //rAGeo.fObjectRotation = fObjectRotation;
+    
+    // TTTT: MirrorX/Y removed
+	//rAGeo.bMirroredX = IsMirroredX();
+	//rAGeo.bMirroredY = IsMirroredY();
+
+        const rtl::OUString	sAdjustmentValues(RTL_CONSTASCII_USTRINGPARAM("AdjustmentValues"));
+        Any* pAny(((SdrCustomShapeGeometryItem&)GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY)).GetPropertyValueByName(sAdjustmentValues));
+
+        if(pAny)
+        {
+            *pAny >>= pSdrAShapeObjGeoData->aAdjustmentSeq;
+        }
+    }
 }
 
 void SdrObjCustomShape::RestGeoData(const SdrObjGeoData& rGeo)
 {
-	SdrTextObj::RestGeoData( rGeo );
-	SdrAShapeObjGeoData& rAGeo=(SdrAShapeObjGeoData&)rGeo;
-	fObjectRotation = rAGeo.fObjectRotation;
-	SetMirroredX( rAGeo.bMirroredX );
-	SetMirroredY( rAGeo.bMirroredY );
+    // call parent
+    SdrTextObj::RestGeoData( rGeo );
 
-	SdrCustomShapeGeometryItem rGeometryItem = (SdrCustomShapeGeometryItem&)GetMergedItem(
SDRATTR_CUSTOMSHAPE_GEOMETRY );
-	const rtl::OUString	sAdjustmentValues( RTL_CONSTASCII_USTRINGPARAM ( "AdjustmentValues"
) );
-	PropertyValue aPropVal;
-	aPropVal.Name = sAdjustmentValues;
-	aPropVal.Value <<= rAGeo.aAdjustmentSeq;
-	rGeometryItem.SetPropertyValue( aPropVal );
-	SetMergedItem( rGeometryItem );
+    const SdrAShapeObjGeoData* pSdrAShapeObjGeoData = dynamic_cast< const SdrAShapeObjGeoData*
>(&rGeo);
 
-	InvalidateRenderGeometry();
+    if(pSdrAShapeObjGeoData)
+    {
+    // TTTT: Should be obsolete
+    //fObjectRotation = rAGeo.fObjectRotation;
+    
+    // TTTT: MirrorX/Y removed
+	//SetMirroredX( rAGeo.bMirroredX );
+	//SetMirroredY( rAGeo.bMirroredY );
+
+        SdrCustomShapeGeometryItem rGeometryItem = (SdrCustomShapeGeometryItem&)GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY);
+        const rtl::OUString	sAdjustmentValues(RTL_CONSTASCII_USTRINGPARAM("AdjustmentValues"));
+        PropertyValue aPropVal;
+    
+        aPropVal.Name = sAdjustmentValues;
+        aPropVal.Value <<= pSdrAShapeObjGeoData->aAdjustmentSeq;
+        rGeometryItem.SetPropertyValue(aPropVal);
+        SetMergedItem(rGeometryItem);
+
+        InvalidateRenderGeometry();
+    }
 }
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdview.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdview.cxx?rev=1412154&r1=1412153&r2=1412154&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdview.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdview.cxx Wed Nov 21 15:42:23
2012
@@ -1430,14 +1430,16 @@ Pointer SdrView::GetPreferedPointer(cons
 
 	const bool bMarkHit(SDRHIT_MARKEDOBJECT == eHit);
 	const SdrHdl* pHdl = aVEvt.mpHdl;
+    const bool bHandleFound(0 != pHdl); // remember pointer from handle, handle may be destroyed
before used below
 
 	// Nun die Pointer fuer Dragging checken
 	if(pHdl || bMarkHit) 
 	{
-		const SdrHdlKind eHdl(pHdl  ? pHdl->GetKind() : HDL_MOVE);
+		const SdrHdlKind eHdl(pHdl ? pHdl->GetKind() : HDL_MOVE);
 		const bool bCorner(pHdl && pHdl->IsCornerHdl());
 		const bool bVertex(pHdl && pHdl->IsVertexHdl());
 		const bool bMov(HDL_MOVE == eHdl);
+        const Pointer aHdlPointer(pHdl  ? pHdl->GetPointer() : Pointer(POINTER_ARROW));
 		
 		if(bMov && (SDRDRAG_MOVE == GetDragMode() || SDRDRAG_RESIZE == GetDragMode() ||
IsMarkedHitMovesAlways())) 
 		{
@@ -1624,9 +1626,9 @@ Pointer SdrView::GetPreferedPointer(cons
 			}
 		}
 
-		if(pHdl) 
+		if(bHandleFound) 
 		{
-			return pHdl->GetPointer();
+			return aHdlPointer;
 		}
 
 		if(bMov) 

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx?rev=1412154&r1=1412153&r2=1412154&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx Wed Nov 21 15:42:23
2012
@@ -1921,158 +1921,170 @@ OUString SAL_CALL SvxCustomShape::getSha
 
 //------------------------------------------------------------------1----
 
-Polygon Rect2Poly(const Rectangle& rRect, long aOldRotation, long aOldShear) // TTTT
needed?
-{
-	Polygon aPol(5);
-	aPol[0]=rRect.TopLeft();
-	aPol[1]=rRect.TopRight();
-	aPol[2]=rRect.BottomRight();
-	aPol[3]=rRect.BottomLeft();
-	aPol[4]=rRect.TopLeft();
-	
-    if (aOldShear) 
-        ShearPoly(aPol,rRect.TopLeft(),tan(aOldShear*nPi180));
-	
-    if (aOldRotation) 
-        RotatePoly(aPol,rRect.TopLeft(),sin(aOldRotation*nPi180), cos(aOldRotation*nPi180));
-
-	return aPol;
-}
-
-void Poly2Rect(const Polygon& rPol, Rectangle& rRect, long& rRotation, long&
rShear) // TTTT needed?
-{
-	rRotation=GetAngle(rPol[1]-rPol[0]);
-	rShear=NormAngle360(rRotation);
-	// Drehung ist damit im Kasten
-
-	Point aPt1(rPol[1]-rPol[0]);
-	if (rRotation) RotatePoint(aPt1,Point(0,0),-sin(rRotation*nPi180), cos(rRotation*nPi180));
// -Sin fuer Rueckdrehung
-	long nWdt=aPt1.X();
-
-	Point aPt0(rPol[0]);
-	Point aPt3(rPol[3]-rPol[0]);
-	if (rRotation) RotatePoint(aPt3,Point(0,0),-sin(rRotation*nPi180), cos(rRotation*nPi180));
// -Sin fuer Rueckdrehung
-	long nHgt=aPt3.Y();
-
-	if(aPt3.X())
-	{
-		// #i74358# the axes are not orthogonal, so for getting the correct height, 
-		// calculate the length of aPt3
-
-		// #i74358# this change was wrong, in the field of the old geometry stuff
-		// it is not an error. The new height always is the same as before; shear
-		// does not change object height at all. This is different from the interactions,
-		// but obviously wanted in the old versions.
-		//
-		// nHgt = static_cast< long >(sqrt(static_cast< double >(aPt3.X() * aPt3.X()
+ aPt3.Y() * aPt3.Y())));
-	}
-
-    long nShW=GetAngle(aPt3);
-	nShW-=27000; // ShearWink wird zur Senkrechten gemessen
-	nShW=-nShW;  // Negieren, denn '+' ist Rechtskursivierung
-
-	bool bMirr=aPt3.Y()<0;
-	if (bMirr) { // "Punktetausch" bei Spiegelung
-		nHgt=-nHgt;
-		nShW+=18000;
-		aPt0=rPol[3];
-	}
-	nShW=NormAngle180(nShW);
-	if (nShW<-9000 || nShW>9000) {
-		nShW=NormAngle180(nShW+18000);
-	}
-	const long SDRMAXSHEAR(8900);
-	if (nShW<-SDRMAXSHEAR) nShW=-SDRMAXSHEAR; // ShearWinkel begrenzen auf +/- 89.00 deg
-	if (nShW>SDRMAXSHEAR)  nShW=SDRMAXSHEAR;
-	rShear=nShW;
-	Point aRU(aPt0);
-	aRU.X()+=nWdt;
-	aRU.Y()+=nHgt;
-	rRect=Rectangle(aPt0,aRU);
-}
+// TTTT: Not needed
+//Polygon Rect2Poly(const Rectangle& rRect, long aOldRotation, long aOldShear) // TTTT
needed?
+//{
+//	Polygon aPol(5);
+//	aPol[0]=rRect.TopLeft();
+//	aPol[1]=rRect.TopRight();
+//	aPol[2]=rRect.BottomRight();
+//	aPol[3]=rRect.BottomLeft();
+//	aPol[4]=rRect.TopLeft();
+//	
+//    if (aOldShear) 
+//        ShearPoly(aPol,rRect.TopLeft(),tan(aOldShear*nPi180));
+//	
+//    if (aOldRotation) 
+//        RotatePoly(aPol,rRect.TopLeft(),sin(aOldRotation*nPi180), cos(aOldRotation*nPi180));
+//
+//	return aPol;
+//}
+//
+//void Poly2Rect(const Polygon& rPol, Rectangle& rRect, long& rRotation, long&
rShear) // TTTT needed?
+//{
+//	rRotation=GetAngle(rPol[1]-rPol[0]);
+//	rShear=NormAngle360(rRotation);
+//	// Drehung ist damit im Kasten
+//
+//	Point aPt1(rPol[1]-rPol[0]);
+//	if (rRotation) RotatePoint(aPt1,Point(0,0),-sin(rRotation*nPi180), cos(rRotation*nPi180));
// -Sin fuer Rueckdrehung
+//	long nWdt=aPt1.X();
+//
+//	Point aPt0(rPol[0]);
+//	Point aPt3(rPol[3]-rPol[0]);
+//	if (rRotation) RotatePoint(aPt3,Point(0,0),-sin(rRotation*nPi180), cos(rRotation*nPi180));
// -Sin fuer Rueckdrehung
+//	long nHgt=aPt3.Y();
+//
+//	if(aPt3.X())
+//	{
+//		// #i74358# the axes are not orthogonal, so for getting the correct height, 
+//		// calculate the length of aPt3
+//
+//		// #i74358# this change was wrong, in the field of the old geometry stuff
+//		// it is not an error. The new height always is the same as before; shear
+//		// does not change object height at all. This is different from the interactions,
+//		// but obviously wanted in the old versions.
+//		//
+//		// nHgt = static_cast< long >(sqrt(static_cast< double >(aPt3.X() * aPt3.X()
+ aPt3.Y() * aPt3.Y())));
+//	}
+//
+//    long nShW=GetAngle(aPt3);
+//	nShW-=27000; // ShearWink wird zur Senkrechten gemessen
+//	nShW=-nShW;  // Negieren, denn '+' ist Rechtskursivierung
+//
+//	bool bMirr=aPt3.Y()<0;
+//	if (bMirr) { // "Punktetausch" bei Spiegelung
+//		nHgt=-nHgt;
+//		nShW+=18000;
+//		aPt0=rPol[3];
+//	}
+//	nShW=NormAngle180(nShW);
+//	if (nShW<-9000 || nShW>9000) {
+//		nShW=NormAngle180(nShW+18000);
+//	}
+//	const long SDRMAXSHEAR(8900);
+//	if (nShW<-SDRMAXSHEAR) nShW=-SDRMAXSHEAR; // ShearWinkel begrenzen auf +/- 89.00 deg
+//	if (nShW>SDRMAXSHEAR)  nShW=SDRMAXSHEAR;
+//	rShear=nShW;
+//	Point aRU(aPt0);
+//	aRU.X()+=nWdt;
+//	aRU.Y()+=nHgt;
+//	rRect=Rectangle(aPt0,aRU);
+//}
 
 awt::Point SAL_CALL SvxCustomShape::getPosition() throw(uno::RuntimeException)
 {
-	OGuard aGuard( Application::GetSolarMutex() );
-	if ( mpModel && mpObj.is() )
-	{
-		sal_Bool bMirroredX = sal_False;
-		sal_Bool bMirroredY = sal_False;
-
-		if ( mpObj.is() )
-		{
-			bMirroredX = ( ((SdrObjCustomShape*)mpObj.get())->IsMirroredX() );
-			bMirroredY = ( ((SdrObjCustomShape*)mpObj.get())->IsMirroredY() );
-		}
-		// get aRect, this is the unrotated snaprect
-		Rectangle aRect(sdr::legacy::GetLogicRect(*((SdrObjCustomShape*)mpObj.get())));
-		Rectangle aRectangle( aRect );
-
-		if ( bMirroredX || bMirroredY )
-		{	
-			// we have to retrieve the unmirrored rect
-			long aRotation(sdr::legacy::GetRotateAngle(*mpObj.get()));
-			long aShear(sdr::legacy::GetShearAngleX(*mpObj.get()));
-
-			if ( bMirroredX )
-			{
-				Polygon aPol( Rect2Poly( aRect, aRotation, aShear ) );
-				Rectangle aBoundRect( aPol.GetBoundRect() );
-
-				Point aRef1( ( aBoundRect.Left() + aBoundRect.Right() ) >> 1, aBoundRect.Top()
);
-				Point aRef2( aRef1.X(), aRef1.Y() + 1000 );
-				sal_uInt16 i;
-				sal_uInt16 nPntAnz=aPol.GetSize();
-				for (i=0; i<nPntAnz; i++)
-				{
-					MirrorPoint(aPol[i],aRef1,aRef2);
-				}
-				// Polygon wenden und etwas schieben
-				Polygon aPol0(aPol);
-				aPol[0]=aPol0[1];
-				aPol[1]=aPol0[0];
-				aPol[2]=aPol0[3];
-				aPol[3]=aPol0[2];
-				aPol[4]=aPol0[1];
-				Poly2Rect(aPol,aRectangle,aRotation, aShear);
-			}
-			if ( bMirroredY )
-			{
-				Polygon aPol( Rect2Poly( aRectangle, aRotation, aShear ) );
-				Rectangle aBoundRect( aPol.GetBoundRect() );
-
-				Point aRef1( aBoundRect.Left(), ( aBoundRect.Top() + aBoundRect.Bottom() ) >> 1
);
-				Point aRef2( aRef1.X() + 1000, aRef1.Y() );
-				sal_uInt16 i;
-				sal_uInt16 nPntAnz=aPol.GetSize();
-				for (i=0; i<nPntAnz; i++)
-				{
-					MirrorPoint(aPol[i],aRef1,aRef2);
-				}
-				// Polygon wenden und etwas schieben
-				Polygon aPol0(aPol);
-				aPol[0]=aPol0[1];
-				aPol[1]=aPol0[0];
-				aPol[2]=aPol0[3];
-				aPol[3]=aPol0[2];
-				aPol[4]=aPol0[1];
-				Poly2Rect( aPol, aRectangle, aRotation, aShear );
-			}
-		}
-
-		basegfx::B2DPoint aPt( aRectangle.Left(), aRectangle.Top() );
-
-        if(isWriterAnchorUsed())
-        {
-			aPt -= mpObj->GetAnchorPos();
-        }
-
-		ForceMetricTo100th_mm(aPt);
-
-		return ::com::sun::star::awt::Point( basegfx::fround(aPt.getX()), basegfx::fround(aPt.getY())
);
-	}
-	else
-		return SvxShape::getPosition();
+    // TTTT: All exceptions because of mirroring should be obsolete
+    return SvxShape::getPosition();
+
+	//OGuard aGuard( Application::GetSolarMutex() );
+	//if ( mpModel && mpObj.is() )
+	//{
+	//	sal_Bool bMirroredX = sal_False;
+	//	sal_Bool bMirroredY = sal_False;
+    //
+	//	if ( mpObj.is() )
+	//	{
+    //        const SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< const SdrObjCustomShape*
>(mpObj.get());
+    //
+    //        if(pSdrObjCustomShape)
+    //        {
+    //            bMirroredX = isMirroredX();
+    //            bMirroredY = isMirroredY();
+    //        }
+    //        // TTTT:
+	//		//bMirroredX = ( ((SdrObjCustomShape*)mpObj.get())->IsMirroredX() );
+	//		//bMirroredY = ( ((SdrObjCustomShape*)mpObj.get())->IsMirroredY() );
+	//	}
+	//	// get aRect, this is the unrotated snaprect
+	//	Rectangle aRect(sdr::legacy::GetLogicRect(*((SdrObjCustomShape*)mpObj.get())));
+	//	Rectangle aRectangle( aRect );
+    //
+	//	if ( bMirroredX || bMirroredY )
+	//	{	
+	//		// we have to retrieve the unmirrored rect
+	//		long aRotation(sdr::legacy::GetRotateAngle(*mpObj.get()));
+	//		long aShear(sdr::legacy::GetShearAngleX(*mpObj.get()));
+    //
+	//		if ( bMirroredX )
+	//		{
+	//			Polygon aPol( Rect2Poly( aRect, aRotation, aShear ) );
+	//			Rectangle aBoundRect( aPol.GetBoundRect() );
+    //
+	//			Point aRef1( ( aBoundRect.Left() + aBoundRect.Right() ) >> 1, aBoundRect.Top()
);
+	//			Point aRef2( aRef1.X(), aRef1.Y() + 1000 );
+	//			sal_uInt16 i;
+	//			sal_uInt16 nPntAnz=aPol.GetSize();
+	//			for (i=0; i<nPntAnz; i++)
+	//			{
+	//				MirrorPoint(aPol[i],aRef1,aRef2);
+	//			}
+	//			// Polygon wenden und etwas schieben
+	//			Polygon aPol0(aPol);
+	//			aPol[0]=aPol0[1];
+	//			aPol[1]=aPol0[0];
+	//			aPol[2]=aPol0[3];
+	//			aPol[3]=aPol0[2];
+	//			aPol[4]=aPol0[1];
+	//			Poly2Rect(aPol,aRectangle,aRotation, aShear);
+	//		}
+	//		if ( bMirroredY )
+	//		{
+	//			Polygon aPol( Rect2Poly( aRectangle, aRotation, aShear ) );
+	//			Rectangle aBoundRect( aPol.GetBoundRect() );
+    //
+	//			Point aRef1( aBoundRect.Left(), ( aBoundRect.Top() + aBoundRect.Bottom() ) >>
1 );
+	//			Point aRef2( aRef1.X() + 1000, aRef1.Y() );
+	//			sal_uInt16 i;
+	//			sal_uInt16 nPntAnz=aPol.GetSize();
+	//			for (i=0; i<nPntAnz; i++)
+	//			{
+	//				MirrorPoint(aPol[i],aRef1,aRef2);
+	//			}
+	//			// Polygon wenden und etwas schieben
+	//			Polygon aPol0(aPol);
+	//			aPol[0]=aPol0[1];
+	//			aPol[1]=aPol0[0];
+	//			aPol[2]=aPol0[3];
+	//			aPol[3]=aPol0[2];
+	//			aPol[4]=aPol0[1];
+	//			Poly2Rect( aPol, aRectangle, aRotation, aShear );
+	//		}
+	//	}
+    //
+	//	basegfx::B2DPoint aPt( aRectangle.Left(), aRectangle.Top() );
+    //
+    //    if(isWriterAnchorUsed())
+    //    {
+	//		aPt -= mpObj->GetAnchorPos();
+    //    }
+    //
+	//	ForceMetricTo100th_mm(aPt);
+    //
+	//	return ::com::sun::star::awt::Point( basegfx::fround(aPt.getX()), basegfx::fround(aPt.getY())
);
+	//}
+	//else
+	//	return SvxShape::getPosition();
 }
 
 //----------------------------------------------------------------------
@@ -2101,83 +2113,87 @@ void SAL_CALL SvxCustomShape::setSize( c
 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)
 {
-	OGuard aGuard( Application::GetSolarMutex() );
-    SdrObject* pObject = mpObj.get();
-
-    const bool bCustomShapeGeometry(pObject && aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
"CustomShapeGeometry" ) ));
-	bool bMirroredX = false;
-	bool bMirroredY = false;
-
-	if ( bCustomShapeGeometry )
-	{
-		bMirroredX = ( ((SdrObjCustomShape*)pObject)->IsMirroredX() );
-		bMirroredY = ( ((SdrObjCustomShape*)pObject)->IsMirroredY() );
-	}
-
+    // TTTT: All exceptions because of mirroring should be obsolete
 	SvxShape::setPropertyValue( aPropertyName, aValue );
 
-	if ( bCustomShapeGeometry )
-	{
-		((SdrObjCustomShape*)pObject)->MergeDefaultAttributes(0);
-		const Rectangle aRect( sdr::legacy::GetSnapRect(*pObject) );
-
-		// #i38892#
-		const bool bNeedsMirrorX(((SdrObjCustomShape*)pObject)->IsMirroredX() != bMirroredX);
-		const bool bNeedsMirrorY(((SdrObjCustomShape*)pObject)->IsMirroredY() != bMirroredY);
-		boost::scoped_ptr< SdrGluePointList > pListCopy;
-
-		if( bNeedsMirrorX || bNeedsMirrorY )
-		{
-			const SdrGluePointList* pList = pObject->GetGluePointList();
-			if( pList )
-				pListCopy.reset( new SdrGluePointList(*pList) );
-		}
-
-        if ( bNeedsMirrorX )
-		{
-			Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() );
-			Point aBottom( aTop.X(), aTop.Y() + 1000 );
-			sdr::legacy::MirrorSdrObject(*pObject, aTop, aBottom );
-			// NbcMirroring is flipping the current mirror state,
-			// so we have to set the correct state again
-			((SdrObjCustomShape*)pObject)->SetMirroredX( bMirroredX ? sal_False : sal_True );
-		}
-		if ( bNeedsMirrorY )
-		{
-			Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
-			Point aRight( aLeft.X() + 1000, aLeft.Y() );
-			sdr::legacy::MirrorSdrObject(*pObject, aLeft, aRight );
-			// NbcMirroring is flipping the current mirror state,
-			// so we have to set the correct state again
-			((SdrObjCustomShape*)pObject)->SetMirroredY( bMirroredY ? sal_False : sal_True );
-		}
-
-		if( pListCopy )
-		{
-			SdrGluePointList* pNewList = const_cast< SdrGluePointList* >( pObject->GetGluePointList()
);
-			if(pNewList)
-				*pNewList = *pListCopy;
-		}
-	}
+    //OGuard aGuard( Application::GetSolarMutex() );
+    //SdrObject* pObject = mpObj.get();
+    //
+    //const bool bCustomShapeGeometry(pObject && aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
"CustomShapeGeometry" ) ));
+	//bool bMirroredX = false;
+	//bool bMirroredY = false;
+    //
+	//if ( bCustomShapeGeometry )
+	//{
+	//	bMirroredX = ( ((SdrObjCustomShape*)pObject)->IsMirroredX() );
+	//	bMirroredY = ( ((SdrObjCustomShape*)pObject)->IsMirroredY() );
+	//}
+    //
+	//SvxShape::setPropertyValue( aPropertyName, aValue );
+    //
+	//if ( bCustomShapeGeometry )
+	//{
+	//	((SdrObjCustomShape*)pObject)->MergeDefaultAttributes(0);
+	//	const Rectangle aRect( sdr::legacy::GetSnapRect(*pObject) );
+    //
+	//	// #i38892#
+	//	const bool bNeedsMirrorX(((SdrObjCustomShape*)pObject)->IsMirroredX() != bMirroredX);
+	//	const bool bNeedsMirrorY(((SdrObjCustomShape*)pObject)->IsMirroredY() != bMirroredY);
+	//	boost::scoped_ptr< SdrGluePointList > pListCopy;
+    //
+	//	if( bNeedsMirrorX || bNeedsMirrorY )
+	//	{
+	//		const SdrGluePointList* pList = pObject->GetGluePointList();
+	//		if( pList )
+	//			pListCopy.reset( new SdrGluePointList(*pList) );
+	//	}
+    //
+    //    if ( bNeedsMirrorX )
+	//	{
+	//		Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() );
+	//		Point aBottom( aTop.X(), aTop.Y() + 1000 );
+	//		sdr::legacy::MirrorSdrObject(*pObject, aTop, aBottom );
+	//		// NbcMirroring is flipping the current mirror state,
+	//		// so we have to set the correct state again
+	//		((SdrObjCustomShape*)pObject)->SetMirroredX( bMirroredX ? sal_False : sal_True );
+	//	}
+	//	if ( bNeedsMirrorY )
+	//	{
+	//		Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
+	//		Point aRight( aLeft.X() + 1000, aLeft.Y() );
+	//		sdr::legacy::MirrorSdrObject(*pObject, aLeft, aRight );
+	//		// NbcMirroring is flipping the current mirror state,
+	//		// so we have to set the correct state again
+	//		((SdrObjCustomShape*)pObject)->SetMirroredY( bMirroredY ? sal_False : sal_True );
+	//	}
+    //
+	//	if( pListCopy )
+	//	{
+	//		SdrGluePointList* pNewList = const_cast< SdrGluePointList* >( pObject->GetGluePointList()
);
+	//		if(pNewList)
+	//			*pNewList = *pListCopy;
+	//	}
+	//}
 }
 
-bool SvxCustomShape::getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry*
pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException,
::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
-{
-	switch( pProperty->nWID )
-	{
-	    case SDRATTR_ROTATEANGLE:
-	    {
-		    double fAngle = static_cast<SdrObjCustomShape*>(mpObj.get())->GetObjectRotation();
-		    fAngle *= 100;
-		    rValue <<= (sal_Int32)fAngle;
-		    return true;
-	    }
-	    default:
-        {
-            return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
-	    }
-    }
-}
+// TTTT:
+//bool SvxCustomShape::getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry*
pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException,
::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+//{
+//	switch( pProperty->nWID )
+//	{
+//	    case SDRATTR_ROTATEANGLE:
+//	    {
+//		    double fAngle = static_cast<SdrObjCustomShape*>(mpObj.get())->GetObjectRotation();
+//		    fAngle *= 100;
+//		    rValue <<= (sal_Int32)fAngle;
+//		    return true;
+//	    }
+//	    default:
+//        {
+//            return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
+//	    }
+//    }
+//}
 //----------------------------------------------------------------------
 
 void SvxCustomShape::createCustomShapeDefaults( const rtl::OUString& rValueType ) throw
(::com::sun::star::uno::RuntimeException)

Modified: incubator/ooo/branches/alg/aw080/main/xmloff/inc/EnhancedCustomShapeToken.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/inc/EnhancedCustomShapeToken.hxx?rev=1412154&r1=1412153&r2=1412154&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/inc/EnhancedCustomShapeToken.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/inc/EnhancedCustomShapeToken.hxx Wed Nov
21 15:42:23 2012
@@ -92,9 +92,12 @@ namespace xmloff { namespace EnhancedCus
 		EAS_CustomShapeEngine,
 		EAS_CustomShapeData,
 		EAS_Type,
+        
+        //  TTTT: MirrorX/Y removed, but still used at import and for EnhancedCustomShapeHandle
 		EAS_MirroredX,
 		EAS_MirroredY,
-		EAS_ViewBox,
+		
+        EAS_ViewBox,
 		EAS_TextRotateAngle,
 		EAS_ExtrusionAllowed,
 		EAS_ConcentricGradientFillAllowed,

Modified: incubator/ooo/branches/alg/aw080/main/xmloff/inc/xmloff/xmltoken.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/inc/xmloff/xmltoken.hxx?rev=1412154&r1=1412153&r2=1412154&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/inc/xmloff/xmltoken.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/inc/xmloff/xmltoken.hxx Wed Nov 21 15:42:23
2012
@@ -2243,8 +2243,9 @@ namespace xmloff { namespace token {
 		XML_ENGINE,
 		XML_ENHANCED_GEOMETRY,
 		XML_TEXT_ROTATE_ANGLE,
-		XML_MIRROR_VERTICAL,
-		XML_MIRROR_HORIZONTAL,
+        //  TTTT: MirrorX/Y removed
+		//XML_MIRROR_VERTICAL,
+		//XML_MIRROR_HORIZONTAL,
 		XML_EXTRUSION_ALLOWED,
 		XML_TEXT_PATH_ALLOWED,
 		XML_CONCENTRIC_GRADIENT_FILL_ALLOWED,

Modified: incubator/ooo/branches/alg/aw080/main/xmloff/source/core/xmltoken.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/source/core/xmltoken.cxx?rev=1412154&r1=1412153&r2=1412154&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/source/core/xmltoken.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/source/core/xmltoken.cxx Wed Nov 21 15:42:23
2012
@@ -2254,8 +2254,9 @@ namespace xmloff { namespace token {
 		TOKEN( "engine" ,								XML_ENGINE ),
 		TOKEN( "enhanced-geometry" ,					XML_ENHANCED_GEOMETRY ),
 		TOKEN( "text-rotate-angle" ,					XML_TEXT_ROTATE_ANGLE ),
-		TOKEN( "mirror-vertical" ,						XML_MIRROR_VERTICAL ),
-		TOKEN( "mirror-horizontal" ,					XML_MIRROR_HORIZONTAL ),
+        //  TTTT: MirrorX/Y removed
+		//TOKEN( "mirror-vertical" ,						XML_MIRROR_VERTICAL ),
+		//TOKEN( "mirror-horizontal" ,					XML_MIRROR_HORIZONTAL ),
 		TOKEN( "extrusion-allowed" ,					XML_EXTRUSION_ALLOWED ),
 		TOKEN( "text-path-allowed" ,					XML_TEXT_PATH_ALLOWED ),
 		TOKEN( "concentric-gradient-fill-allowed" ,		XML_CONCENTRIC_GRADIENT_FILL_ALLOWED ),

Modified: incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/EnhancedCustomShapeToken.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/EnhancedCustomShapeToken.cxx?rev=1412154&r1=1412153&r2=1412154&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/EnhancedCustomShapeToken.cxx
(original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/EnhancedCustomShapeToken.cxx
Wed Nov 21 15:42:23 2012
@@ -115,9 +115,12 @@ static const TokenTable pTokenTableArray
 	{ "CustomShapeEngine",					EAS_CustomShapeEngine },
 	{ "CustomShapeData",					EAS_CustomShapeData },
 	{ "Type",								EAS_Type },
+    
+    // TTTT: MirrorX/Y removed, but still used at import and for EnhancedCustomShapeHandle
 	{ "MirroredX",							EAS_MirroredX },
 	{ "MirroredY",							EAS_MirroredY },
-	{ "ViewBox",							EAS_ViewBox },
+
+    { "ViewBox",							EAS_ViewBox },
 	{ "TextRotateAngle",					EAS_TextRotateAngle },
 	{ "ExtrusionAllowed",					EAS_ExtrusionAllowed },
 	{ "TextPathAllowed",					EAS_TextPathAllowed },
@@ -185,7 +188,7 @@ EnhancedCustomShapeTokenEnum EASGet( con
 		if ( !pHashMap )
 		{
 			TypeNameHashMap* pH = new TypeNameHashMap;
-			const TokenTable* pPtr = pTokenTableArray;
+			const TokenTable* pPtr = pTokenTableArray; //  TTTT: MirrorX/Y removed; when used here
reactivate above in the table
 			const TokenTable* pEnd = pPtr + ( sizeof( pTokenTableArray ) / sizeof( TokenTable ) );
 			for ( ; pPtr < pEnd; pPtr++ )
 				(*pH)[ pPtr->pS ] = pPtr->pE;

Modified: incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/shapeexport4.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/shapeexport4.cxx?rev=1412154&r1=1412153&r2=1412154&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/shapeexport4.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/shapeexport4.cxx Wed Nov 21 15:42:23
2012
@@ -487,22 +487,23 @@ void ImpExportEnhancedGeometry( SvXMLExp
 						rGeoProp.Value >>= aCustomShapeType;
 					}
 					break;
-					case EAS_MirroredX :
-					{
-						sal_Bool bMirroredX = sal_Bool();
-						if ( rGeoProp.Value >>= bMirroredX )
-							rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MIRROR_HORIZONTAL,
-								bMirroredX ? GetXMLToken( XML_TRUE ) : GetXMLToken( XML_FALSE ) );
-					}
-					break;
-					case EAS_MirroredY :
-					{
-						sal_Bool bMirroredY = sal_Bool();
-						if ( rGeoProp.Value >>= bMirroredY )
-							rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MIRROR_VERTICAL,
-								bMirroredY ? GetXMLToken( XML_TRUE ) : GetXMLToken( XML_FALSE ) );
-					}
-					break;
+                    //  TTTT: MirrorX/Y removed, no longer exported
+					//case EAS_MirroredX :
+					//{
+					//	sal_Bool bMirroredX = sal_Bool();
+					//	if ( rGeoProp.Value >>= bMirroredX )
+					//		rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MIRROR_HORIZONTAL,
+					//			bMirroredX ? GetXMLToken( XML_TRUE ) : GetXMLToken( XML_FALSE ) );
+					//}
+					//break;
+					//case EAS_MirroredY :
+					//{
+					//	sal_Bool bMirroredY = sal_Bool();
+					//	if ( rGeoProp.Value >>= bMirroredY )
+					//		rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MIRROR_VERTICAL,
+					//			bMirroredY ? GetXMLToken( XML_TRUE ) : GetXMLToken( XML_FALSE ) );
+					//}
+					//break;
 					case EAS_ViewBox :
 					{
 						awt::Rectangle aRect;

Modified: incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/ximpcustomshape.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/ximpcustomshape.cxx?rev=1412154&r1=1412153&r2=1412154&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/ximpcustomshape.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/ximpcustomshape.cxx Wed Nov 21
15:42:23 2012
@@ -52,6 +52,8 @@
 #include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
 #include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
 #include <com/sun/star/drawing/ProjectionMode.hpp>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
 #include <hash_map>
 
 using namespace ::com::sun::star;
@@ -65,7 +67,9 @@ XMLEnhancedCustomShapeContext::XMLEnhanc
 		SvXMLImportContext( rImport, nPrefix, rLocalName ),
 		mrUnitConverter( rImport.GetMM100UnitConverter() ),
 		mrxShape( rxShape ),
-		mrCustomShapeGeometry( rCustomShapeGeometry )
+		mrCustomShapeGeometry( rCustomShapeGeometry ),
+        mbCompatibilityMirroredX(false),
+        mbCompatibilityMirroredY(false)
 {
 }
 
@@ -827,13 +831,30 @@ void XMLEnhancedCustomShapeContext::Star
 				case EAS_type :
 					GetString( mrCustomShapeGeometry, rValue, EAS_Type );
 				break;
+
+                //  TTTT: MirrorX/Y removed, need to replace at import
 				case EAS_mirror_horizontal :
-					GetBool( mrCustomShapeGeometry, rValue, EAS_MirroredX );
-				break;
+                {
+                    sal_Bool bAttrBool(sal_False);
+                        
+                    if(SvXMLUnitConverter::convertBool(bAttrBool, rValue))
+                    {
+                        mbCompatibilityMirroredX = bAttrBool;
+                    }
+                    break;
+                }
 				case EAS_mirror_vertical :
-					GetBool( mrCustomShapeGeometry, rValue, EAS_MirroredY );
-				break;
-				case EAS_viewBox :
+                {
+                    sal_Bool bAttrBool(sal_False);
+                        
+                    if(SvXMLUnitConverter::convertBool(bAttrBool, rValue))
+                    {
+                        mbCompatibilityMirroredY = bAttrBool;
+                    }
+                    break;
+                }
+
+                case EAS_viewBox :
 				{
 					SdXMLImExViewBox aViewBox( rValue, GetImport().GetMM100UnitConverter() );
 					awt::Rectangle aRect( aViewBox.GetX(), aViewBox.GetY(), aViewBox.GetWidth(), aViewBox.GetHeight()
);
@@ -1278,6 +1299,49 @@ void XMLEnhancedCustomShapeContext::EndE
 	SdXMLCustomShapePropertyMerge( mrCustomShapeGeometry, maEquations, EASGet( EAS_Equations
) );
 	if  ( !maHandles.empty() )
 		SdXMLCustomShapePropertyMerge( mrCustomShapeGeometry, maHandles, EASGet( EAS_Handles )
);
+
+    if(mbCompatibilityMirroredX || mbCompatibilityMirroredY)
+    {
+        // when saved, this EnhancedCustomShapeGeometry was mirrored in X and/or Y. This
+        // will now be expressed in the transformation of the EnhancedCustomShape itself,
+        // so apply it to the already transformed object
+        uno::Reference< beans::XPropertySet > xPropSet(mrxShape, uno::UNO_QUERY);
+
+        if(xPropSet.is())
+        {
+            uno::Any aAny;
+            drawing::HomogenMatrix3 aMatrix;
+            basegfx::B2DHomMatrix aB2DMatrix;
+            const rtl::OUString aTrans(RTL_CONSTASCII_USTRINGPARAM("Transformation"));
+
+            // get UNO API Matrix from xShape
+            aAny = xPropSet->getPropertyValue(aTrans);
+            aAny >>= aMatrix;
+
+            // pre-apply mirrorings
+            aB2DMatrix.translate(-0.5, -0.5);
+
+            if(mbCompatibilityMirroredX)
+            {
+                aB2DMatrix.scale(-1.0, 1.0);
+            }
+
+            if(mbCompatibilityMirroredY)
+            {
+                aB2DMatrix.scale(1.0, -1.0);
+            }
+
+            aB2DMatrix.translate(0.5, 0.5);
+            
+            // apply already valid transformation
+            aB2DMatrix = basegfx::tools::UnoHomogenMatrix3ToB2DHomMatrix(aMatrix) * aB2DMatrix;
+
+            // transform back to UNO API matrix and set at xShape
+            basegfx::tools::B2DHomMatrixToUnoHomogenMatrix3(aB2DMatrix, aMatrix);
+            aAny <<= aMatrix;
+            xPropSet->setPropertyValue(aTrans, aAny);
+        }
+    }
 }
 
 SvXMLImportContext* XMLEnhancedCustomShapeContext::CreateChildContext( sal_uInt16 nPrefix,const
rtl::OUString& rLocalName,

Modified: incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/ximpcustomshape.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/ximpcustomshape.hxx?rev=1412154&r1=1412153&r2=1412154&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/ximpcustomshape.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/ximpcustomshape.hxx Wed Nov 21
15:42:23 2012
@@ -56,6 +56,10 @@ class XMLEnhancedCustomShapeContext : pu
 	std::vector< rtl::OUString > maEquations;
 	std::vector< rtl::OUString > maEquationNames;
 
+    /// bitfield
+    bool                    mbCompatibilityMirroredX : 1;
+    bool                    mbCompatibilityMirroredY : 1;
+
 public:
 
 	XMLEnhancedCustomShapeContext( SvXMLImport& rImport, ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShape > &, sal_uInt16 nPrefix,



Mime
View raw message