You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2013/03/21 16:49:05 UTC

svn commit: r1459369 - in /openoffice/branches/sidebar/main/svx: inc/svx/svdogrp.hxx source/sidebar/possize/PosSizePropertyPanel.cxx source/svdraw/svdedtv1.cxx source/svdraw/svdogrp.cxx

Author: alg
Date: Thu Mar 21 15:49:04 2013
New Revision: 1459369

URL: http://svn.apache.org/r1459369
Log:
i121795 Corrected some stuff regarding grouped objects or multiselections and rotation

Modified:
    openoffice/branches/sidebar/main/svx/inc/svx/svdogrp.hxx
    openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
    openoffice/branches/sidebar/main/svx/source/svdraw/svdedtv1.cxx
    openoffice/branches/sidebar/main/svx/source/svdraw/svdogrp.cxx

Modified: openoffice/branches/sidebar/main/svx/inc/svx/svdogrp.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/inc/svx/svdogrp.hxx?rev=1459369&r1=1459368&r2=1459369&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/inc/svx/svdogrp.hxx (original)
+++ openoffice/branches/sidebar/main/svx/inc/svx/svdogrp.hxx Thu Mar 21 15:49:04 2013
@@ -48,9 +48,6 @@ protected:
 	virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
 
     SdrObjList*					pSub;    // Subliste (Kinder)
-	long						nDrehWink;
-	long						nShearWink;
-
 	Point						aRefPoint; // Referenzpunkt innerhalb der Objektgruppe
 	FASTBOOL					bRefPoint; // Ist ein RefPoint gesetzt?
 

Modified: openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx?rev=1459369&r1=1459368&r2=1459369&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx (original)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx Thu Mar 21 15:49:04 2013
@@ -649,19 +649,18 @@ void PosSizePropertyPanel::NotifyItemUpd
             {
                 pWidthItem = dynamic_cast< const SfxUInt32Item* >(pState);
 
-                if (pWidthItem)
-                {				
+                if(pWidthItem)
+                {
                     long mlOldWidth1 = pWidthItem->GetValue();
 
                     mlOldWidth1 = Fraction( mlOldWidth1 ) / maUIScale;
                     SetMetricValue( *mpMtrWidth, mlOldWidth1, mePoolUnit );
                     mlOldWidth = mlOldWidth1;
+                    break;
                 }
             }
-            else
-            {
-                mpMtrWidth->SetText( String());
-            }
+
+            mpMtrWidth->SetText( String());
             break;
             
         case SID_ATTR_TRANSFORM_HEIGHT:
@@ -676,156 +675,174 @@ void PosSizePropertyPanel::NotifyItemUpd
                     mlOldHeight1 = Fraction( mlOldHeight1 ) / maUIScale;
                     SetMetricValue( *mpMtrHeight, mlOldHeight1, mePoolUnit );
                     mlOldHeight = mlOldHeight1;
+                    break;
                 }
             }
-            else
-            {
-                mpMtrHeight->SetText( String());
-            }
+
+            mpMtrHeight->SetText( String());
             break;
 
         case SID_ATTR_TRANSFORM_POS_X:
-        {
-            const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState);
-
-            if (SFX_ITEM_AVAILABLE == eState && pItem)
-            {
-                long nTmp = pItem->GetValue(); 
-                nTmp = Fraction( nTmp ) / maUIScale;
-                SetMetricValue( *mpMtrPosX, nTmp, mePoolUnit );
-            }
-            else
+            if(SFX_ITEM_AVAILABLE == eState)
             {
-                mpMtrPosX->SetText( String());
+                const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState);
+
+                if(pItem)
+                {
+                    long nTmp = pItem->GetValue(); 
+                    nTmp = Fraction( nTmp ) / maUIScale;
+                    SetMetricValue( *mpMtrPosX, nTmp, mePoolUnit );
+                    break;
+                }
             }
+
+            mpMtrPosX->SetText( String());
             break;
-        }
-        
-        case SID_ATTR_TRANSFORM_POS_Y:
-        {
-            const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState);
 
-            if (SFX_ITEM_AVAILABLE == eState && pItem)
-            {
-                long nTmp = pItem->GetValue(); 
-                nTmp = Fraction( nTmp ) / maUIScale;
-                SetMetricValue( *mpMtrPosY, nTmp, mePoolUnit );
-            }
-            else
+        case SID_ATTR_TRANSFORM_POS_Y:
+            if(SFX_ITEM_AVAILABLE == eState)
             {
-                mpMtrPosY->SetText( String());
+                const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState);
+
+                if(pItem)
+                {
+                    long nTmp = pItem->GetValue(); 
+                    nTmp = Fraction( nTmp ) / maUIScale;
+                    SetMetricValue( *mpMtrPosY, nTmp, mePoolUnit );
+                    break;
+                }
             }
+
+            mpMtrPosY->SetText( String());
             break;
-        }
-        
+
         case SID_ATTR_TRANSFORM_ROT_X:
             if (SFX_ITEM_AVAILABLE == eState)
             {
-                mlRotX = ((const SfxInt32Item*)pState)->GetValue(); 
-                mlRotX = Fraction( mlRotX ) / maUIScale;
+                const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState);
+
+                if(pItem)
+                {
+                    mlRotX = pItem->GetValue(); 
+                    mlRotX = Fraction( mlRotX ) / maUIScale;
+                }
             }
             break;
 
         case SID_ATTR_TRANSFORM_ROT_Y:
             if (SFX_ITEM_AVAILABLE == eState)
             {
-                mlRotY = ((const SfxInt32Item*)pState)->GetValue(); 
-                mlRotY = Fraction( mlRotY ) / maUIScale;
+                const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState);
+
+                if(pItem)
+                {
+                    mlRotY = pItem->GetValue(); 
+                    mlRotY = Fraction( mlRotY ) / maUIScale;
+                }
             }
             break;
 
         case SID_ATTR_TRANSFORM_PROTECT_POS:
-        {
-            const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
-
-            if (SFX_ITEM_AVAILABLE == eState && pItem)
-            {
-                // record the state of position protect
-                mbPositionProtected = pItem->GetValue();
-            }
-            else
+            if(SFX_ITEM_AVAILABLE == eState)
             {
-                mbPositionProtected = false;
+                const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
+
+                if(pItem)
+                {
+                    // record the state of position protect
+                    mbPositionProtected = pItem->GetValue();
+                    break;
+                }
             }
+
+            mbPositionProtected = false;
             break;
-        }
 
         case SID_ATTR_TRANSFORM_PROTECT_SIZE:
-        {
-            const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
-
-            if (SFX_ITEM_AVAILABLE == eState && pItem)
-            {
-                // record the state of size protect
-                mbSizeProtected = pItem->GetValue();
-            }
-            else
+            if(SFX_ITEM_AVAILABLE == eState)
             {
-                mbSizeProtected = false;
+                const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
+
+                if(pItem)
+                {
+                    // record the state of size protect
+                    mbSizeProtected = pItem->GetValue();
+                    break;
+                }
             }
+
+            mbSizeProtected = false;
             break;
-        }
 
         case SID_ATTR_TRANSFORM_AUTOWIDTH:
-        {
-            const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
-
-            if (SFX_ITEM_AVAILABLE == eState && pItem)
+            if(SFX_ITEM_AVAILABLE == eState)
             {
-                mbAutoWidth = pItem->GetValue();
+                const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
+
+                if(pItem)
+                {
+                    mbAutoWidth = pItem->GetValue();
+                }
             }
             break;
-        }
 
         case SID_ATTR_TRANSFORM_AUTOHEIGHT:
-        {
-            const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
-
-            if (SFX_ITEM_AVAILABLE == eState && pItem)
+            if(SFX_ITEM_AVAILABLE == eState)
             {
-                mbAutoHeight = pItem->GetValue();
+                const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
+
+                if(pItem)
+                {
+                    mbAutoHeight = pItem->GetValue();
+                }
             }
             break;
-        }
 
         case SID_ATTR_TRANSFORM_ANGLE:
             if (eState >= SFX_ITEM_AVAILABLE)
             {
-                long nTmp = ((const SfxInt32Item*)pState)->GetValue(); 
-                mpMtrAngle->SetValue( nTmp );
-                mpDial->SetRotation( nTmp );
-                switch(nTmp)
-                {
-                    case 0:
-                        mpMtrAngle->SelectEntryPos(0);
-                        break;
-                    case 4500:
-                        mpMtrAngle->SelectEntryPos(1);
-                        break;
-                    case 9000:
-                        mpMtrAngle->SelectEntryPos(2);
-                        break;
-                    case 13500:
-                        mpMtrAngle->SelectEntryPos(3);
-                        break;
-                    case 18000:
-                        mpMtrAngle->SelectEntryPos(4);
-                        break;
-                    case 22500:
-                        mpMtrAngle->SelectEntryPos(5);
-                        break;
-                    case 27000:
-                        mpMtrAngle->SelectEntryPos(6);
-                        break;
-                    case 315000:
-                        mpMtrAngle->SelectEntryPos(7);
+                const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState);
+
+                if(pItem)
+                {
+                    long nTmp = pItem->GetValue(); 
+
+                    mpMtrAngle->SetValue( nTmp );
+                    mpDial->SetRotation( nTmp );
+
+                    switch(nTmp)
+                    {
+                        case 0:
+                            mpMtrAngle->SelectEntryPos(0);
+                            break;
+                        case 4500:
+                            mpMtrAngle->SelectEntryPos(1);
+                            break;
+                        case 9000:
+                            mpMtrAngle->SelectEntryPos(2);
+                            break;
+                        case 13500:
+                            mpMtrAngle->SelectEntryPos(3);
+                            break;
+                        case 18000:
+                            mpMtrAngle->SelectEntryPos(4);
+                            break;
+                        case 22500:
+                            mpMtrAngle->SelectEntryPos(5);
+                            break;
+                        case 27000:
+                            mpMtrAngle->SelectEntryPos(6);
+                            break;
+                        case 315000:
+                            mpMtrAngle->SelectEntryPos(7);
+                    }
+
+                    break;
                 }
             }
-            else
-            {
-                mpMtrAngle->SetText( String() );
-                mpDial->SetRotation( 0 );
-            }
+
+            mpMtrAngle->SetText( String() );
+            mpDial->SetRotation( 0 );
             break;
             
         case SID_ATTR_METRIC:

Modified: openoffice/branches/sidebar/main/svx/source/svdraw/svdedtv1.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/svdraw/svdedtv1.cxx?rev=1459369&r1=1459368&r2=1459369&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/svdraw/svdedtv1.cxx (original)
+++ openoffice/branches/sidebar/main/svx/source/svdraw/svdedtv1.cxx Thu Mar 21 15:49:04 2013
@@ -298,20 +298,31 @@ void SdrEditView::ResizeMultMarkedObj(co
 
 long SdrEditView::GetMarkedObjRotate() const
 {
-	sal_Bool b1st=sal_True;
-	sal_Bool bOk=sal_True;
-	long nWink=0;
-	sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
-	for (sal_uIntPtr nm=0; nm<nMarkAnz && bOk; nm++) {
-		SdrMark* pM=GetSdrMarkByIndex(nm);
-		SdrObject* pO=pM->GetMarkedSdrObj();
-		long nWink2=pO->GetRotateAngle();
-		if (b1st) nWink=nWink2;
-		else if (nWink2!=nWink) bOk=sal_False;
-		b1st=sal_False;
-	}
-	if (!bOk) nWink=0;
-	return nWink;
+    long nRetval(0);
+
+    if(GetMarkedObjectCount())
+    {
+        SdrMark* pM = GetSdrMarkByIndex(0);
+        SdrObject* pO = pM->GetMarkedSdrObj();
+
+        nRetval = pO->GetRotateAngle();
+    }
+
+    return nRetval;
+	//sal_Bool b1st=sal_True;
+	//sal_Bool bOk=sal_True;
+	//long nWink=0;
+	//sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
+	//for (sal_uIntPtr nm=0; nm<nMarkAnz && bOk; nm++) {
+	//	SdrMark* pM=GetSdrMarkByIndex(nm);
+	//	SdrObject* pO=pM->GetMarkedSdrObj();
+	//	long nWink2=pO->GetRotateAngle();
+	//	if (b1st) nWink=nWink2;
+	//	else if (nWink2!=nWink) bOk=sal_False;
+	//	b1st=sal_False;
+	//}
+	//if (!bOk) nWink=0;
+	//return nWink;
 }
 
 void SdrEditView::RotateMarkedObj(const Point& rRef, long nWink, bool bCopy)

Modified: openoffice/branches/sidebar/main/svx/source/svdraw/svdogrp.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/svdraw/svdogrp.cxx?rev=1459369&r1=1459368&r2=1459369&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/svdraw/svdogrp.cxx (original)
+++ openoffice/branches/sidebar/main/svx/source/svdraw/svdogrp.cxx Thu Mar 21 15:49:04 2013
@@ -97,8 +97,6 @@ SdrObjGroup::SdrObjGroup()
 	pSub->SetOwnerObj(this);
 	pSub->SetListKind(SDROBJLIST_GROUPOBJ);
 	bRefPoint=sal_False;
-	nDrehWink=0;
-	nShearWink=0;
 	bClosedObj=sal_False;
 }
 
@@ -308,8 +306,6 @@ void SdrObjGroup::operator=(const SdrObj
 		pSub->CopyObjects(*rObj.GetSubList());
 
 		// copy local paremeters
-		nDrehWink  =((SdrObjGroup&)rObj).nDrehWink;
-		nShearWink =((SdrObjGroup&)rObj).nShearWink;
 		aRefPoint  =((SdrObjGroup&)rObj).aRefPoint;
 		bRefPoint  =((SdrObjGroup&)rObj).bRefPoint;
 	}
@@ -388,13 +384,33 @@ FASTBOOL SdrObjGroup::BegCreate(SdrDragS
 
 long SdrObjGroup::GetRotateAngle() const
 {
-	return nDrehWink;
+    const sal_uInt32 nObjCount(pSub->GetObjCount());
+    long nRetval(0);
+
+    if(nObjCount)
+    {
+        SdrObject* pObj = pSub->GetObj(0);
+
+        nRetval = pObj->GetRotateAngle();
+    }
+
+    return nRetval;
 }
 
 
 long SdrObjGroup::GetShearAngle(FASTBOOL /*bVertical*/) const
 {
-	return nShearWink;
+    const sal_uInt32 nObjCount(pSub->GetObjCount());
+    long nRetval(0);
+
+    if(nObjCount)
+    {
+        SdrObject* pObj = pSub->GetObj(0);
+
+        nRetval = pObj->GetShearAngle();
+    }
+
+    return nRetval;
 }
 
 
@@ -476,7 +492,6 @@ void SdrObjGroup::NbcResize(const Point&
 void SdrObjGroup::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
 {
 	SetGlueReallyAbsolute(sal_True);
-	nDrehWink=NormAngle360(nDrehWink+nWink);
 	RotatePoint(aRefPoint,rRef,sn,cs);
 	SdrObjList* pOL=pSub;
 	sal_uIntPtr nObjAnz=pOL->GetObjCount();
@@ -507,7 +522,6 @@ void SdrObjGroup::NbcMirror(const Point&
 void SdrObjGroup::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
 {
 	SetGlueReallyAbsolute(sal_True);
-	nShearWink+=nWink;
 	ShearPoint(aRefPoint,rRef,tn);
 	SdrObjList* pOL=pSub;
 	sal_uIntPtr nObjAnz=pOL->GetObjCount();
@@ -647,7 +661,6 @@ void SdrObjGroup::Rotate(const Point& rR
 	if (nWink!=0) {
 		SetGlueReallyAbsolute(sal_True);
 		Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
-		nDrehWink=NormAngle360(nDrehWink+nWink);
 		RotatePoint(aRefPoint,rRef,sn,cs);
 		// #32383# Erst die Verbinder verschieben, dann den Rest
 		SdrObjList* pOL=pSub;
@@ -700,7 +713,6 @@ void SdrObjGroup::Shear(const Point& rRe
 	if (nWink!=0) {
 		SetGlueReallyAbsolute(sal_True);
 		Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
-		nShearWink+=nWink;
 		ShearPoint(aRefPoint,rRef,tn);
 		// #32383# Erst die Verbinder verschieben, dann den Rest
 		SdrObjList* pOL=pSub;