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 2012/08/06 11:32:19 UTC
svn commit: r1369760 - in /incubator/ooo/trunk/main:
filter/source/msfilter/msdffimp.cxx svx/source/svdraw/svdmodel.cxx
svx/source/svdraw/svdoedge.cxx svx/source/svdraw/svdpage.cxx
Author: alg
Date: Mon Aug 6 09:32:18 2012
New Revision: 1369760
URL: http://svn.apache.org/viewvc?rev=1369760&view=rev
Log:
#120437# Connector corrections in groups and PPT imports
Modified:
incubator/ooo/trunk/main/filter/source/msfilter/msdffimp.cxx
incubator/ooo/trunk/main/svx/source/svdraw/svdmodel.cxx
incubator/ooo/trunk/main/svx/source/svdraw/svdoedge.cxx
incubator/ooo/trunk/main/svx/source/svdraw/svdpage.cxx
Modified: incubator/ooo/trunk/main/filter/source/msfilter/msdffimp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/msfilter/msdffimp.cxx?rev=1369760&r1=1369759&r2=1369760&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/msfilter/msdffimp.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/msfilter/msdffimp.cxx Mon Aug 6 09:32:18 2012
@@ -4730,6 +4730,9 @@ SdrObject* SvxMSDffManager::ImportShape(
RotatePoint(aPoint1, aCenter, ss, cc);
RotatePoint(aPoint2, aCenter, ss, cc);
+
+ // #120437# reset rotation, it is part of the path and shall not be applied again
+ nObjectRotation = 0;
}
// Linie innerhalb des Bereiches zurechtdrehen/spiegeln
@@ -4738,14 +4741,19 @@ SdrObject* SvxMSDffManager::ImportShape(
sal_Int32 n = aPoint1.X();
aPoint1.X() = aPoint2.X();
aPoint2.X() = n;
+
+ // #120437# reset hor filp
+ nSpFlags &= ~SP_FFLIPH;
}
if ( nSpFlags & SP_FFLIPV )
{
sal_Int32 n = aPoint1.Y();
aPoint1.Y() = aPoint2.Y();
aPoint2.Y() = n;
+
+ // #120437# reset ver filp
+ nSpFlags &= ~SP_FFLIPV;
}
- nSpFlags &= ~( SP_FFLIPV | SP_FFLIPH );
pRet->NbcSetPoint(aPoint1, 0L); // Startpunkt
pRet->NbcSetPoint(aPoint2, 1L); // Endpunkt
Modified: incubator/ooo/trunk/main/svx/source/svdraw/svdmodel.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/svdmodel.cxx?rev=1369760&r1=1369759&r2=1369760&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/svdmodel.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/svdmodel.cxx Mon Aug 6 09:32:18 2012
@@ -1899,13 +1899,15 @@ void SdrModel::setLock( sal_Bool bLock )
{
if( mbModelLocked != bLock )
{
- if( sal_False == bLock )
+ // #120437# need to set first, else ImpReformatAllEdgeObjects will do nothing
+ mbModelLocked = bLock;
+
+ if( sal_False == bLock )
{
// ReformatAllTextObjects(); #103122# due to a typo in the above if, this code was never
// executed, so I remove it until we discover that we need it here
ImpReformatAllEdgeObjects(); // #103122#
}
- mbModelLocked = bLock;
}
}
Modified: incubator/ooo/trunk/main/svx/source/svdraw/svdoedge.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/svdoedge.cxx?rev=1369760&r1=1369759&r2=1369760&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/svdoedge.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/svdoedge.cxx Mon Aug 6 09:32:18 2012
@@ -471,7 +471,11 @@ void SdrEdgeObj::ConnectToNode(FASTBOOL
if (pObj!=NULL) {
pObj->AddListener(*this);
rCon.pObj=pObj;
- ImpDirtyEdgeTrack();
+
+ // #120437# If connection is set, reset bEdgeTrackUserDefined
+ bEdgeTrackUserDefined = false;
+
+ ImpDirtyEdgeTrack();
}
}
@@ -548,8 +552,11 @@ void SdrEdgeObj::ImpUndirtyEdgeTrack()
void SdrEdgeObj::ImpRecalcEdgeTrack()
{
- if ( bEdgeTrackUserDefined && (GetModel() && GetModel()->isLocked()) )
+ // #120437# if bEdgeTrackUserDefined, do not recalculate. Also not when model locked
+ if(bEdgeTrackUserDefined || !GetModel() || GetModel()->isLocked())
+ {
return;
+ }
// #110649#
if(IsBoundRectCalculationRunning())
@@ -564,17 +571,17 @@ void SdrEdgeObj::ImpRecalcEdgeTrack()
{
// avoid re-layout during imports/API call sequences
// #i45294# but calc EdgeTrack and secure properties there
- ((SdrEdgeObj*)this)->mbBoundRectCalculationRunning = sal_True;
+ mbBoundRectCalculationRunning = sal_True;
*pEdgeTrack=ImpCalcEdgeTrack(*pEdgeTrack,aCon1,aCon2,&aEdgeInfo);
ImpSetAttrToEdgeInfo();
bEdgeTrackDirty=sal_False;
- ((SdrEdgeObj*)this)->mbBoundRectCalculationRunning = sal_False;
+ mbBoundRectCalculationRunning = sal_False;
}
else
{
// To not run in a depth loop, use a coloring algorythm on
// SdrEdgeObj BoundRect calculations
- ((SdrEdgeObj*)this)->mbBoundRectCalculationRunning = sal_True;
+ mbBoundRectCalculationRunning = sal_True;
Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetCurrentBoundRect();
SetRectsDirty();
@@ -590,7 +597,7 @@ void SdrEdgeObj::ImpRecalcEdgeTrack()
SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
// #110649#
- ((SdrEdgeObj*)this)->mbBoundRectCalculationRunning = sal_False;
+ mbBoundRectCalculationRunning = sal_False;
}
}
@@ -2261,65 +2268,95 @@ void SdrEdgeObj::NbcResize(const Point&
}
// #54102# added rotation support
-void SdrEdgeObj::NbcRotate(const Point& rRef, long /* nWink */, double sn, double cs)
+void SdrEdgeObj::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
{
- // handle start and end point if not connected
- FASTBOOL bCon1=aCon1.pObj!=NULL && aCon1.pObj->GetPage()==pPage;
- FASTBOOL bCon2=aCon2.pObj!=NULL && aCon2.pObj->GetPage()==pPage;
-
- if(!bCon1 && pEdgeTrack)
+ if(bEdgeTrackUserDefined)
{
- RotatePoint((*pEdgeTrack)[0],rRef,sn,cs);
- ImpDirtyEdgeTrack();
+ // #120437# special handling when track is imported, apply
+ // transformation directly to imported track.
+ SdrTextObj::NbcRotate(rRef, nWink, sn, cs);
+ RotateXPoly(*pEdgeTrack, rRef, sn, cs);
}
-
- if(!bCon2 && pEdgeTrack)
+ else
{
- sal_uInt16 nPntAnz = pEdgeTrack->GetPointCount();
- RotatePoint((*pEdgeTrack)[sal_uInt16(nPntAnz-1)],rRef,sn,cs);
- ImpDirtyEdgeTrack();
+ // handle start and end point if not connected
+ FASTBOOL bCon1=aCon1.pObj!=NULL && aCon1.pObj->GetPage()==pPage;
+ FASTBOOL bCon2=aCon2.pObj!=NULL && aCon2.pObj->GetPage()==pPage;
+
+ if(!bCon1 && pEdgeTrack)
+ {
+ RotatePoint((*pEdgeTrack)[0],rRef,sn,cs);
+ ImpDirtyEdgeTrack();
+ }
+
+ if(!bCon2 && pEdgeTrack)
+ {
+ sal_uInt16 nPntAnz = pEdgeTrack->GetPointCount();
+ RotatePoint((*pEdgeTrack)[sal_uInt16(nPntAnz-1)],rRef,sn,cs);
+ ImpDirtyEdgeTrack();
+ }
}
}
// #54102# added mirror support
void SdrEdgeObj::NbcMirror(const Point& rRef1, const Point& rRef2)
{
- // handle start and end point if not connected
- FASTBOOL bCon1=aCon1.pObj!=NULL && aCon1.pObj->GetPage()==pPage;
- FASTBOOL bCon2=aCon2.pObj!=NULL && aCon2.pObj->GetPage()==pPage;
-
- if(!bCon1 && pEdgeTrack)
+ if(bEdgeTrackUserDefined)
{
- MirrorPoint((*pEdgeTrack)[0],rRef1,rRef2);
- ImpDirtyEdgeTrack();
+ // #120437# special handling when track is imported, apply
+ // transformation directly to imported track.
+ SdrTextObj::NbcMirror(rRef1, rRef2);
+ MirrorXPoly(*pEdgeTrack, rRef1, rRef2);
}
-
- if(!bCon2 && pEdgeTrack)
+ else
{
- sal_uInt16 nPntAnz = pEdgeTrack->GetPointCount();
- MirrorPoint((*pEdgeTrack)[sal_uInt16(nPntAnz-1)],rRef1,rRef2);
- ImpDirtyEdgeTrack();
+ // handle start and end point if not connected
+ FASTBOOL bCon1=aCon1.pObj!=NULL && aCon1.pObj->GetPage()==pPage;
+ FASTBOOL bCon2=aCon2.pObj!=NULL && aCon2.pObj->GetPage()==pPage;
+
+ if(!bCon1 && pEdgeTrack)
+ {
+ MirrorPoint((*pEdgeTrack)[0],rRef1,rRef2);
+ ImpDirtyEdgeTrack();
+ }
+
+ if(!bCon2 && pEdgeTrack)
+ {
+ sal_uInt16 nPntAnz = pEdgeTrack->GetPointCount();
+ MirrorPoint((*pEdgeTrack)[sal_uInt16(nPntAnz-1)],rRef1,rRef2);
+ ImpDirtyEdgeTrack();
+ }
}
}
// #54102# added shear support
-void SdrEdgeObj::NbcShear(const Point& rRef, long /* nWink */, double tn, FASTBOOL bVShear)
+void SdrEdgeObj::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
{
- // handle start and end point if not connected
- FASTBOOL bCon1=aCon1.pObj!=NULL && aCon1.pObj->GetPage()==pPage;
- FASTBOOL bCon2=aCon2.pObj!=NULL && aCon2.pObj->GetPage()==pPage;
-
- if(!bCon1 && pEdgeTrack)
+ if(bEdgeTrackUserDefined)
{
- ShearPoint((*pEdgeTrack)[0],rRef,tn,bVShear);
- ImpDirtyEdgeTrack();
+ // #120437# special handling when track is imported, apply
+ // transformation directly to imported track.
+ SdrTextObj::NbcShear(rRef, nWink, tn, bVShear);
+ ShearXPoly(*pEdgeTrack, rRef, tn, bVShear);
}
-
- if(!bCon2 && pEdgeTrack)
+ else
{
- sal_uInt16 nPntAnz = pEdgeTrack->GetPointCount();
- ShearPoint((*pEdgeTrack)[sal_uInt16(nPntAnz-1)],rRef,tn,bVShear);
- ImpDirtyEdgeTrack();
+ // handle start and end point if not connected
+ FASTBOOL bCon1=aCon1.pObj!=NULL && aCon1.pObj->GetPage()==pPage;
+ FASTBOOL bCon2=aCon2.pObj!=NULL && aCon2.pObj->GetPage()==pPage;
+
+ if(!bCon1 && pEdgeTrack)
+ {
+ ShearPoint((*pEdgeTrack)[0],rRef,tn,bVShear);
+ ImpDirtyEdgeTrack();
+ }
+
+ if(!bCon2 && pEdgeTrack)
+ {
+ sal_uInt16 nPntAnz = pEdgeTrack->GetPointCount();
+ ShearPoint((*pEdgeTrack)[sal_uInt16(nPntAnz-1)],rRef,tn,bVShear);
+ ImpDirtyEdgeTrack();
+ }
}
}
Modified: incubator/ooo/trunk/main/svx/source/svdraw/svdpage.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/svdpage.cxx?rev=1369760&r1=1369759&r2=1369760&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/svdpage.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/svdpage.cxx Mon Aug 6 09:32:18 2012
@@ -727,14 +727,17 @@ void SdrObjList::ReformatAllTextObjects(
*/
void SdrObjList::ReformatAllEdgeObjects()
{
- const sal_uInt32 nCount=GetObjCount();
- sal_uInt32 nObj;
+ // #120437# go over whole hierarchy, not only over object level null (seen from grouping)
+ SdrObjListIter aIter(*this, IM_DEEPNOGROUPS);
- for( nObj = 0; nObj < nCount; nObj++ )
+ while(aIter.IsMore())
{
- SdrObject* pObj = GetObj(nObj);
- if( pObj->ISA(SdrEdgeObj) )
- static_cast<SdrEdgeObj*>(pObj)->Reformat();
+ SdrEdgeObj* pSdrEdgeObj = dynamic_cast< SdrEdgeObj* >(aIter.Next());
+
+ if(pSdrEdgeObj)
+ {
+ pSdrEdgeObj->Reformat();
+ }
}
}
@@ -1815,7 +1818,9 @@ void SdrPage::SetInserted( bool bIns )
{
mbInserted = bIns;
- SdrObjListIter aIter( *this, IM_FLAT );
+ // #120437# go over whole hierarchy, not only over object level null (seen from grouping)
+ SdrObjListIter aIter(*this, IM_DEEPNOGROUPS);
+
while ( aIter.IsMore() )
{
SdrObject* pObj = aIter.Next();