xref: /AOO41X/main/svx/source/svdraw/svdogrp.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_svx.hxx"
30*cdf0e10cSrcweir #include <sfx2/linkmgr.hxx>
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir #include <ucbhelper/content.hxx>
33*cdf0e10cSrcweir #include <ucbhelper/contentbroker.hxx>
34*cdf0e10cSrcweir #include <unotools/datetime.hxx>
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir #include <svx/svdogrp.hxx>
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir #include <sfx2/lnkbase.hxx>
39*cdf0e10cSrcweir #include <tools/urlobj.hxx>
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir #include <svl/urihelper.hxx>
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir #include <svx/xpool.hxx>
44*cdf0e10cSrcweir #include <svx/xpoly.hxx>
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir #include <svx/svdmodel.hxx>
47*cdf0e10cSrcweir #include <svx/svdpage.hxx>
48*cdf0e10cSrcweir #include "svx/svditer.hxx"
49*cdf0e10cSrcweir #include <svx/svdobj.hxx>
50*cdf0e10cSrcweir #include <svx/svdtrans.hxx>
51*cdf0e10cSrcweir #include <svx/svdetc.hxx>
52*cdf0e10cSrcweir #include <svx/svdattrx.hxx>  // NotPersistItems
53*cdf0e10cSrcweir #include <svx/svdoedge.hxx>  // #32383# Die Verbinder nach Move nochmal anbroadcasten
54*cdf0e10cSrcweir #include "svx/svdglob.hxx"   // StringCache
55*cdf0e10cSrcweir #include "svx/svdstr.hrc"    // Objektname
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir #include <svx/svxids.hrc>
58*cdf0e10cSrcweir #include <svl/whiter.hxx>
59*cdf0e10cSrcweir #include <svx/svdpool.hxx>
60*cdf0e10cSrcweir #include <svx/sdr/properties/groupproperties.hxx>
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir // #110094#
63*cdf0e10cSrcweir #include <svx/sdr/contact/viewcontactofgroup.hxx>
64*cdf0e10cSrcweir #include <basegfx/range/b2drange.hxx>
65*cdf0e10cSrcweir #include <basegfx/polygon/b2dpolygontools.hxx>
66*cdf0e10cSrcweir #include <basegfx/polygon/b2dpolygon.hxx>
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
69*cdf0e10cSrcweir //
70*cdf0e10cSrcweir //   @@@@  @@@@@  @@@@@@   @@@@  @@@@@   @@@@  @@  @@ @@@@@
71*cdf0e10cSrcweir //  @@  @@ @@  @@     @@  @@     @@  @@ @@  @@ @@  @@ @@  @@
72*cdf0e10cSrcweir //  @@  @@ @@@@@      @@  @@ @@@ @@@@@  @@  @@ @@  @@ @@@@@
73*cdf0e10cSrcweir //  @@  @@ @@  @@ @@  @@  @@  @@ @@  @@ @@  @@ @@  @@ @@
74*cdf0e10cSrcweir //   @@@@  @@@@@   @@@@    @@@@@ @@  @@  @@@@   @@@@  @@
75*cdf0e10cSrcweir //
76*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
79*cdf0e10cSrcweir // BaseProperties section
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir sdr::properties::BaseProperties* SdrObjGroup::CreateObjectSpecificProperties()
82*cdf0e10cSrcweir {
83*cdf0e10cSrcweir 	return new sdr::properties::GroupProperties(*this);
84*cdf0e10cSrcweir }
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
87*cdf0e10cSrcweir // #110094# DrawContact section
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir sdr::contact::ViewContact* SdrObjGroup::CreateObjectSpecificViewContact()
90*cdf0e10cSrcweir {
91*cdf0e10cSrcweir 	return new sdr::contact::ViewContactOfGroup(*this);
92*cdf0e10cSrcweir }
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir TYPEINIT1(SdrObjGroup,SdrObject);
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir SdrObjGroup::SdrObjGroup()
99*cdf0e10cSrcweir {
100*cdf0e10cSrcweir 	pSub=new SdrObjList(NULL,NULL);
101*cdf0e10cSrcweir 	pSub->SetOwnerObj(this);
102*cdf0e10cSrcweir 	pSub->SetListKind(SDROBJLIST_GROUPOBJ);
103*cdf0e10cSrcweir 	bRefPoint=sal_False;
104*cdf0e10cSrcweir 	nDrehWink=0;
105*cdf0e10cSrcweir 	nShearWink=0;
106*cdf0e10cSrcweir 	bClosedObj=sal_False;
107*cdf0e10cSrcweir }
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir SdrObjGroup::~SdrObjGroup()
111*cdf0e10cSrcweir {
112*cdf0e10cSrcweir 	delete pSub;
113*cdf0e10cSrcweir }
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir void SdrObjGroup::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
116*cdf0e10cSrcweir {
117*cdf0e10cSrcweir 	rInfo.bNoContortion=sal_False;
118*cdf0e10cSrcweir 	SdrObjList* pOL=pSub;
119*cdf0e10cSrcweir 	sal_uIntPtr nObjAnz=pOL->GetObjCount();
120*cdf0e10cSrcweir 	for (sal_uIntPtr i=0; i<nObjAnz; i++) {
121*cdf0e10cSrcweir 		SdrObject* pObj=pOL->GetObj(i);
122*cdf0e10cSrcweir 		SdrObjTransformInfoRec aInfo;
123*cdf0e10cSrcweir 		pObj->TakeObjInfo(aInfo);
124*cdf0e10cSrcweir 		if (!aInfo.bMoveAllowed            ) rInfo.bMoveAllowed            =sal_False;
125*cdf0e10cSrcweir 		if (!aInfo.bResizeFreeAllowed      ) rInfo.bResizeFreeAllowed      =sal_False;
126*cdf0e10cSrcweir 		if (!aInfo.bResizePropAllowed      ) rInfo.bResizePropAllowed      =sal_False;
127*cdf0e10cSrcweir 		if (!aInfo.bRotateFreeAllowed      ) rInfo.bRotateFreeAllowed      =sal_False;
128*cdf0e10cSrcweir 		if (!aInfo.bRotate90Allowed        ) rInfo.bRotate90Allowed        =sal_False;
129*cdf0e10cSrcweir 		if (!aInfo.bMirrorFreeAllowed      ) rInfo.bMirrorFreeAllowed      =sal_False;
130*cdf0e10cSrcweir 		if (!aInfo.bMirror45Allowed        ) rInfo.bMirror45Allowed        =sal_False;
131*cdf0e10cSrcweir 		if (!aInfo.bMirror90Allowed        ) rInfo.bMirror90Allowed        =sal_False;
132*cdf0e10cSrcweir 		if (!aInfo.bShearAllowed           ) rInfo.bShearAllowed           =sal_False;
133*cdf0e10cSrcweir 		if (!aInfo.bEdgeRadiusAllowed	   ) rInfo.bEdgeRadiusAllowed	   =sal_False;
134*cdf0e10cSrcweir 		if (!aInfo.bNoOrthoDesired         ) rInfo.bNoOrthoDesired         =sal_False;
135*cdf0e10cSrcweir 		if (aInfo.bNoContortion            ) rInfo.bNoContortion           =sal_True;
136*cdf0e10cSrcweir 		if (!aInfo.bCanConvToPath          ) rInfo.bCanConvToPath          =sal_False;
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir 		if(!aInfo.bCanConvToContour)
139*cdf0e10cSrcweir 			rInfo.bCanConvToContour = sal_False;
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir 		if (!aInfo.bCanConvToPoly          ) rInfo.bCanConvToPoly          =sal_False;
142*cdf0e10cSrcweir 		if (!aInfo.bCanConvToPathLineToArea) rInfo.bCanConvToPathLineToArea=sal_False;
143*cdf0e10cSrcweir 		if (!aInfo.bCanConvToPolyLineToArea) rInfo.bCanConvToPolyLineToArea=sal_False;
144*cdf0e10cSrcweir 	}
145*cdf0e10cSrcweir 	if (nObjAnz==0) {
146*cdf0e10cSrcweir 		rInfo.bRotateFreeAllowed=sal_False;
147*cdf0e10cSrcweir 		rInfo.bRotate90Allowed  =sal_False;
148*cdf0e10cSrcweir 		rInfo.bMirrorFreeAllowed=sal_False;
149*cdf0e10cSrcweir 		rInfo.bMirror45Allowed  =sal_False;
150*cdf0e10cSrcweir 		rInfo.bMirror90Allowed  =sal_False;
151*cdf0e10cSrcweir 		rInfo.bTransparenceAllowed = sal_False;
152*cdf0e10cSrcweir 		rInfo.bGradientAllowed = sal_False;
153*cdf0e10cSrcweir 		rInfo.bShearAllowed     =sal_False;
154*cdf0e10cSrcweir 		rInfo.bEdgeRadiusAllowed=sal_False;
155*cdf0e10cSrcweir 		rInfo.bNoContortion     =sal_True;
156*cdf0e10cSrcweir 	}
157*cdf0e10cSrcweir 	if(nObjAnz != 1)
158*cdf0e10cSrcweir 	{
159*cdf0e10cSrcweir 		// only allowed if single object selected
160*cdf0e10cSrcweir 		rInfo.bTransparenceAllowed = sal_False;
161*cdf0e10cSrcweir 		rInfo.bGradientAllowed = sal_False;
162*cdf0e10cSrcweir 	}
163*cdf0e10cSrcweir }
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir void SdrObjGroup::SetBoundRectDirty()
167*cdf0e10cSrcweir {
168*cdf0e10cSrcweir     // avoid resetting aOutRect which in case of this object is model data,
169*cdf0e10cSrcweir     // not re-creatable view data
170*cdf0e10cSrcweir }
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir sal_uInt16 SdrObjGroup::GetObjIdentifier() const
173*cdf0e10cSrcweir {
174*cdf0e10cSrcweir 	return sal_uInt16(OBJ_GRUP);
175*cdf0e10cSrcweir }
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir 
178*cdf0e10cSrcweir SdrLayerID SdrObjGroup::GetLayer() const
179*cdf0e10cSrcweir {
180*cdf0e10cSrcweir 	FASTBOOL b1st=sal_True;
181*cdf0e10cSrcweir 	SdrLayerID nLay=SdrLayerID(SdrObject::GetLayer());
182*cdf0e10cSrcweir 	SdrObjList* pOL=pSub;
183*cdf0e10cSrcweir 	sal_uIntPtr nObjAnz=pOL->GetObjCount();
184*cdf0e10cSrcweir 	for (sal_uIntPtr i=0; i<nObjAnz; i++) {
185*cdf0e10cSrcweir 		SdrLayerID nLay1=pOL->GetObj(i)->GetLayer();
186*cdf0e10cSrcweir 		if (b1st) { nLay=nLay1; b1st=sal_False; }
187*cdf0e10cSrcweir 		else if (nLay1!=nLay) return 0;
188*cdf0e10cSrcweir 	}
189*cdf0e10cSrcweir 	return nLay;
190*cdf0e10cSrcweir }
191*cdf0e10cSrcweir 
192*cdf0e10cSrcweir 
193*cdf0e10cSrcweir void SdrObjGroup::NbcSetLayer(SdrLayerID nLayer)
194*cdf0e10cSrcweir {
195*cdf0e10cSrcweir 	SdrObject::NbcSetLayer(nLayer);
196*cdf0e10cSrcweir 	SdrObjList* pOL=pSub;
197*cdf0e10cSrcweir 	sal_uIntPtr nObjAnz=pOL->GetObjCount();
198*cdf0e10cSrcweir 	for (sal_uIntPtr i=0; i<nObjAnz; i++) {
199*cdf0e10cSrcweir 		pOL->GetObj(i)->NbcSetLayer(nLayer);
200*cdf0e10cSrcweir 	}
201*cdf0e10cSrcweir }
202*cdf0e10cSrcweir 
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir void SdrObjGroup::SetObjList(SdrObjList* pNewObjList)
205*cdf0e10cSrcweir {
206*cdf0e10cSrcweir 	SdrObject::SetObjList(pNewObjList);
207*cdf0e10cSrcweir 	pSub->SetUpList(pNewObjList);
208*cdf0e10cSrcweir }
209*cdf0e10cSrcweir 
210*cdf0e10cSrcweir 
211*cdf0e10cSrcweir void SdrObjGroup::SetPage(SdrPage* pNewPage)
212*cdf0e10cSrcweir {
213*cdf0e10cSrcweir 	SdrObject::SetPage(pNewPage);
214*cdf0e10cSrcweir 	pSub->SetPage(pNewPage);
215*cdf0e10cSrcweir }
216*cdf0e10cSrcweir 
217*cdf0e10cSrcweir 
218*cdf0e10cSrcweir void SdrObjGroup::SetModel(SdrModel* pNewModel)
219*cdf0e10cSrcweir {
220*cdf0e10cSrcweir 	if(pNewModel!=pModel)
221*cdf0e10cSrcweir 	{
222*cdf0e10cSrcweir 		// #i30648#
223*cdf0e10cSrcweir 		// This method also needs to migrate the used ItemSet
224*cdf0e10cSrcweir 		// when the destination model uses a different pool
225*cdf0e10cSrcweir 		// than the current one. Else it is possible to create
226*cdf0e10cSrcweir 		// SdrObjGroups which reference the old pool which might
227*cdf0e10cSrcweir 		// be destroyed (as the bug shows).
228*cdf0e10cSrcweir 		SdrModel* pOldModel = pModel;
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir 		// test for correct pool in ItemSet; move to new pool if necessary
231*cdf0e10cSrcweir 		if(pNewModel && GetObjectItemPool() && GetObjectItemPool() != &pNewModel->GetItemPool())
232*cdf0e10cSrcweir 		{
233*cdf0e10cSrcweir 			MigrateItemPool(GetObjectItemPool(), &pNewModel->GetItemPool(), pNewModel);
234*cdf0e10cSrcweir 		}
235*cdf0e10cSrcweir 
236*cdf0e10cSrcweir 		// call parent
237*cdf0e10cSrcweir 		SdrObject::SetModel(pNewModel);
238*cdf0e10cSrcweir 
239*cdf0e10cSrcweir 		// set new model at content
240*cdf0e10cSrcweir 		pSub->SetModel(pNewModel);
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir 		// modify properties
243*cdf0e10cSrcweir 		GetProperties().SetModel(pOldModel, pNewModel);
244*cdf0e10cSrcweir 	}
245*cdf0e10cSrcweir }
246*cdf0e10cSrcweir 
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir FASTBOOL SdrObjGroup::HasRefPoint() const
249*cdf0e10cSrcweir {
250*cdf0e10cSrcweir 	return bRefPoint;
251*cdf0e10cSrcweir }
252*cdf0e10cSrcweir 
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir Point SdrObjGroup::GetRefPoint() const
255*cdf0e10cSrcweir {
256*cdf0e10cSrcweir 	return aRefPoint;
257*cdf0e10cSrcweir }
258*cdf0e10cSrcweir 
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir void SdrObjGroup::SetRefPoint(const Point& rPnt)
261*cdf0e10cSrcweir {
262*cdf0e10cSrcweir 	bRefPoint=sal_True;
263*cdf0e10cSrcweir 	aRefPoint=rPnt;
264*cdf0e10cSrcweir }
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir 
267*cdf0e10cSrcweir SdrObjList* SdrObjGroup::GetSubList() const
268*cdf0e10cSrcweir {
269*cdf0e10cSrcweir 	return pSub;
270*cdf0e10cSrcweir }
271*cdf0e10cSrcweir 
272*cdf0e10cSrcweir const Rectangle& SdrObjGroup::GetCurrentBoundRect() const
273*cdf0e10cSrcweir {
274*cdf0e10cSrcweir     // --> OD 2007-02-01 #144962#
275*cdf0e10cSrcweir     // <aOutRect> has to contain the bounding rectangle
276*cdf0e10cSrcweir     if ( pSub->GetObjCount()!=0 )
277*cdf0e10cSrcweir     {
278*cdf0e10cSrcweir         const_cast<SdrObjGroup*>(this)->aOutRect = pSub->GetAllObjBoundRect();
279*cdf0e10cSrcweir     }
280*cdf0e10cSrcweir 
281*cdf0e10cSrcweir     return aOutRect;
282*cdf0e10cSrcweir     // <--
283*cdf0e10cSrcweir }
284*cdf0e10cSrcweir 
285*cdf0e10cSrcweir const Rectangle& SdrObjGroup::GetSnapRect() const
286*cdf0e10cSrcweir {
287*cdf0e10cSrcweir     // --> OD 2007-02-01 #144962#
288*cdf0e10cSrcweir     // <aOutRect> has to contain the bounding rectangle
289*cdf0e10cSrcweir     if ( pSub->GetObjCount()!=0 )
290*cdf0e10cSrcweir     {
291*cdf0e10cSrcweir         return pSub->GetAllObjSnapRect();
292*cdf0e10cSrcweir     }
293*cdf0e10cSrcweir     else
294*cdf0e10cSrcweir     {
295*cdf0e10cSrcweir         return aOutRect;
296*cdf0e10cSrcweir     }
297*cdf0e10cSrcweir     // <--
298*cdf0e10cSrcweir }
299*cdf0e10cSrcweir 
300*cdf0e10cSrcweir void SdrObjGroup::operator=(const SdrObject& rObj)
301*cdf0e10cSrcweir {
302*cdf0e10cSrcweir 	if(rObj.IsGroupObject())
303*cdf0e10cSrcweir 	{
304*cdf0e10cSrcweir 		// copy SdrObject stuff
305*cdf0e10cSrcweir 		SdrObject::operator=(rObj);
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir 		// #i36404#
308*cdf0e10cSrcweir 		// copy SubList, init model and page first
309*cdf0e10cSrcweir 		SdrObjList& rSourceSubList = *rObj.GetSubList();
310*cdf0e10cSrcweir 		pSub->SetPage(rSourceSubList.GetPage());
311*cdf0e10cSrcweir 		pSub->SetModel(rSourceSubList.GetModel());
312*cdf0e10cSrcweir 		pSub->CopyObjects(*rObj.GetSubList());
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir 		// copy local paremeters
315*cdf0e10cSrcweir 		nDrehWink  =((SdrObjGroup&)rObj).nDrehWink;
316*cdf0e10cSrcweir 		nShearWink =((SdrObjGroup&)rObj).nShearWink;
317*cdf0e10cSrcweir 		aRefPoint  =((SdrObjGroup&)rObj).aRefPoint;
318*cdf0e10cSrcweir 		bRefPoint  =((SdrObjGroup&)rObj).bRefPoint;
319*cdf0e10cSrcweir 	}
320*cdf0e10cSrcweir }
321*cdf0e10cSrcweir 
322*cdf0e10cSrcweir 
323*cdf0e10cSrcweir void SdrObjGroup::TakeObjNameSingul(XubString& rName) const
324*cdf0e10cSrcweir {
325*cdf0e10cSrcweir 	if(!pSub->GetObjCount())
326*cdf0e10cSrcweir 	{
327*cdf0e10cSrcweir 		rName = ImpGetResStr(STR_ObjNameSingulGRUPEMPTY);
328*cdf0e10cSrcweir 	}
329*cdf0e10cSrcweir 	else
330*cdf0e10cSrcweir 	{
331*cdf0e10cSrcweir 		rName = ImpGetResStr(STR_ObjNameSingulGRUP);
332*cdf0e10cSrcweir 	}
333*cdf0e10cSrcweir 
334*cdf0e10cSrcweir 	const String aName(GetName());
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir 	if(aName.Len())
337*cdf0e10cSrcweir 	{
338*cdf0e10cSrcweir 		rName += sal_Unicode(' ');
339*cdf0e10cSrcweir 		rName += sal_Unicode('\'');
340*cdf0e10cSrcweir 		rName += aName;
341*cdf0e10cSrcweir 		rName += sal_Unicode('\'');
342*cdf0e10cSrcweir 	}
343*cdf0e10cSrcweir }
344*cdf0e10cSrcweir 
345*cdf0e10cSrcweir 
346*cdf0e10cSrcweir void SdrObjGroup::TakeObjNamePlural(XubString& rName) const
347*cdf0e10cSrcweir {
348*cdf0e10cSrcweir 	if (pSub->GetObjCount()==0) {
349*cdf0e10cSrcweir 		rName=ImpGetResStr(STR_ObjNamePluralGRUPEMPTY);
350*cdf0e10cSrcweir 	} else {
351*cdf0e10cSrcweir 		rName=ImpGetResStr(STR_ObjNamePluralGRUP);
352*cdf0e10cSrcweir 	}
353*cdf0e10cSrcweir }
354*cdf0e10cSrcweir 
355*cdf0e10cSrcweir 
356*cdf0e10cSrcweir void SdrObjGroup::RecalcSnapRect()
357*cdf0e10cSrcweir {
358*cdf0e10cSrcweir 	// nicht erforderlich, da die Rects von der SubList verwendet werden.
359*cdf0e10cSrcweir }
360*cdf0e10cSrcweir 
361*cdf0e10cSrcweir basegfx::B2DPolyPolygon SdrObjGroup::TakeXorPoly() const
362*cdf0e10cSrcweir {
363*cdf0e10cSrcweir 	basegfx::B2DPolyPolygon aRetval;
364*cdf0e10cSrcweir 	const sal_uInt32 nObjCount(pSub->GetObjCount());
365*cdf0e10cSrcweir 
366*cdf0e10cSrcweir 	for(sal_uInt32 a(0L); a < nObjCount; a++)
367*cdf0e10cSrcweir 	{
368*cdf0e10cSrcweir 		SdrObject* pObj = pSub->GetObj(a);
369*cdf0e10cSrcweir 		aRetval.append(pObj->TakeXorPoly());
370*cdf0e10cSrcweir 	}
371*cdf0e10cSrcweir 
372*cdf0e10cSrcweir 	if(!aRetval.count())
373*cdf0e10cSrcweir 	{
374*cdf0e10cSrcweir 		const basegfx::B2DRange aRange(aOutRect.Left(), aOutRect.Top(), aOutRect.Right(), aOutRect.Bottom());
375*cdf0e10cSrcweir 		aRetval.append(basegfx::tools::createPolygonFromRect(aRange));
376*cdf0e10cSrcweir 	}
377*cdf0e10cSrcweir 
378*cdf0e10cSrcweir 	return aRetval;
379*cdf0e10cSrcweir }
380*cdf0e10cSrcweir 
381*cdf0e10cSrcweir bool SdrObjGroup::beginSpecialDrag(SdrDragStat& /*rDrag*/) const
382*cdf0e10cSrcweir {
383*cdf0e10cSrcweir 	return false;
384*cdf0e10cSrcweir }
385*cdf0e10cSrcweir 
386*cdf0e10cSrcweir 
387*cdf0e10cSrcweir FASTBOOL SdrObjGroup::BegCreate(SdrDragStat& /*rStat*/)
388*cdf0e10cSrcweir {
389*cdf0e10cSrcweir 	return sal_False;
390*cdf0e10cSrcweir }
391*cdf0e10cSrcweir 
392*cdf0e10cSrcweir 
393*cdf0e10cSrcweir long SdrObjGroup::GetRotateAngle() const
394*cdf0e10cSrcweir {
395*cdf0e10cSrcweir 	return nDrehWink;
396*cdf0e10cSrcweir }
397*cdf0e10cSrcweir 
398*cdf0e10cSrcweir 
399*cdf0e10cSrcweir long SdrObjGroup::GetShearAngle(FASTBOOL /*bVertical*/) const
400*cdf0e10cSrcweir {
401*cdf0e10cSrcweir 	return nShearWink;
402*cdf0e10cSrcweir }
403*cdf0e10cSrcweir 
404*cdf0e10cSrcweir 
405*cdf0e10cSrcweir void SdrObjGroup::NbcSetSnapRect(const Rectangle& rRect)
406*cdf0e10cSrcweir {
407*cdf0e10cSrcweir 	Rectangle aOld(GetSnapRect());
408*cdf0e10cSrcweir 	long nMulX=rRect.Right()-rRect.Left();
409*cdf0e10cSrcweir 	long nDivX=aOld.Right()-aOld.Left();
410*cdf0e10cSrcweir 	long nMulY=rRect.Bottom()-rRect.Top();
411*cdf0e10cSrcweir 	long nDivY=aOld.Bottom()-aOld.Top();
412*cdf0e10cSrcweir 	if (nDivX==0) { nMulX=1; nDivX=1; }
413*cdf0e10cSrcweir 	if (nDivY==0) { nMulY=1; nDivY=1; }
414*cdf0e10cSrcweir 	if (nMulX!=nDivX || nMulY!=nDivY) {
415*cdf0e10cSrcweir 		Fraction aX(nMulX,nDivX);
416*cdf0e10cSrcweir 		Fraction aY(nMulY,nDivY);
417*cdf0e10cSrcweir 		NbcResize(aOld.TopLeft(),aX,aY);
418*cdf0e10cSrcweir 	}
419*cdf0e10cSrcweir 	if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) {
420*cdf0e10cSrcweir 		NbcMove(Size(rRect.Left()-aOld.Left(),rRect.Top()-aOld.Top()));
421*cdf0e10cSrcweir 	}
422*cdf0e10cSrcweir }
423*cdf0e10cSrcweir 
424*cdf0e10cSrcweir 
425*cdf0e10cSrcweir void SdrObjGroup::NbcSetLogicRect(const Rectangle& rRect)
426*cdf0e10cSrcweir {
427*cdf0e10cSrcweir 	NbcSetSnapRect(rRect);
428*cdf0e10cSrcweir }
429*cdf0e10cSrcweir 
430*cdf0e10cSrcweir 
431*cdf0e10cSrcweir void SdrObjGroup::NbcMove(const Size& rSiz)
432*cdf0e10cSrcweir {
433*cdf0e10cSrcweir 	MovePoint(aRefPoint,rSiz);
434*cdf0e10cSrcweir 	if (pSub->GetObjCount()!=0) {
435*cdf0e10cSrcweir 		SdrObjList* pOL=pSub;
436*cdf0e10cSrcweir 		sal_uIntPtr nObjAnz=pOL->GetObjCount();
437*cdf0e10cSrcweir 		for (sal_uIntPtr i=0; i<nObjAnz; i++) {
438*cdf0e10cSrcweir 			SdrObject* pObj=pOL->GetObj(i);
439*cdf0e10cSrcweir 			pObj->NbcMove(rSiz);
440*cdf0e10cSrcweir 		}
441*cdf0e10cSrcweir 	} else {
442*cdf0e10cSrcweir 		MoveRect(aOutRect,rSiz);
443*cdf0e10cSrcweir 		SetRectsDirty();
444*cdf0e10cSrcweir 	}
445*cdf0e10cSrcweir }
446*cdf0e10cSrcweir 
447*cdf0e10cSrcweir 
448*cdf0e10cSrcweir void SdrObjGroup::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
449*cdf0e10cSrcweir {
450*cdf0e10cSrcweir 	FASTBOOL bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
451*cdf0e10cSrcweir 	FASTBOOL bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
452*cdf0e10cSrcweir 	if (bXMirr || bYMirr) {
453*cdf0e10cSrcweir 		Point aRef1(GetSnapRect().Center());
454*cdf0e10cSrcweir 		if (bXMirr) {
455*cdf0e10cSrcweir 			Point aRef2(aRef1);
456*cdf0e10cSrcweir 			aRef2.Y()++;
457*cdf0e10cSrcweir 			NbcMirrorGluePoints(aRef1,aRef2);
458*cdf0e10cSrcweir 		}
459*cdf0e10cSrcweir 		if (bYMirr) {
460*cdf0e10cSrcweir 			Point aRef2(aRef1);
461*cdf0e10cSrcweir 			aRef2.X()++;
462*cdf0e10cSrcweir 			NbcMirrorGluePoints(aRef1,aRef2);
463*cdf0e10cSrcweir 		}
464*cdf0e10cSrcweir 	}
465*cdf0e10cSrcweir 	ResizePoint(aRefPoint,rRef,xFact,yFact);
466*cdf0e10cSrcweir 	if (pSub->GetObjCount()!=0) {
467*cdf0e10cSrcweir 		SdrObjList* pOL=pSub;
468*cdf0e10cSrcweir 		sal_uIntPtr nObjAnz=pOL->GetObjCount();
469*cdf0e10cSrcweir 		for (sal_uIntPtr i=0; i<nObjAnz; i++) {
470*cdf0e10cSrcweir 			SdrObject* pObj=pOL->GetObj(i);
471*cdf0e10cSrcweir 			pObj->NbcResize(rRef,xFact,yFact);
472*cdf0e10cSrcweir 		}
473*cdf0e10cSrcweir 	} else {
474*cdf0e10cSrcweir 		ResizeRect(aOutRect,rRef,xFact,yFact);
475*cdf0e10cSrcweir 		SetRectsDirty();
476*cdf0e10cSrcweir 	}
477*cdf0e10cSrcweir }
478*cdf0e10cSrcweir 
479*cdf0e10cSrcweir 
480*cdf0e10cSrcweir void SdrObjGroup::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
481*cdf0e10cSrcweir {
482*cdf0e10cSrcweir 	SetGlueReallyAbsolute(sal_True);
483*cdf0e10cSrcweir 	nDrehWink=NormAngle360(nDrehWink+nWink);
484*cdf0e10cSrcweir 	RotatePoint(aRefPoint,rRef,sn,cs);
485*cdf0e10cSrcweir 	SdrObjList* pOL=pSub;
486*cdf0e10cSrcweir 	sal_uIntPtr nObjAnz=pOL->GetObjCount();
487*cdf0e10cSrcweir 	for (sal_uIntPtr i=0; i<nObjAnz; i++) {
488*cdf0e10cSrcweir 		SdrObject* pObj=pOL->GetObj(i);
489*cdf0e10cSrcweir 		pObj->NbcRotate(rRef,nWink,sn,cs);
490*cdf0e10cSrcweir 	}
491*cdf0e10cSrcweir 	NbcRotateGluePoints(rRef,nWink,sn,cs);
492*cdf0e10cSrcweir 	SetGlueReallyAbsolute(sal_False);
493*cdf0e10cSrcweir }
494*cdf0e10cSrcweir 
495*cdf0e10cSrcweir 
496*cdf0e10cSrcweir void SdrObjGroup::NbcMirror(const Point& rRef1, const Point& rRef2)
497*cdf0e10cSrcweir {
498*cdf0e10cSrcweir 	SetGlueReallyAbsolute(sal_True);
499*cdf0e10cSrcweir 	MirrorPoint(aRefPoint,rRef1,rRef2); // fehlende Implementation in SvdEtc !!!
500*cdf0e10cSrcweir 	SdrObjList* pOL=pSub;
501*cdf0e10cSrcweir 	sal_uIntPtr nObjAnz=pOL->GetObjCount();
502*cdf0e10cSrcweir 	for (sal_uIntPtr i=0; i<nObjAnz; i++) {
503*cdf0e10cSrcweir 		SdrObject* pObj=pOL->GetObj(i);
504*cdf0e10cSrcweir 		pObj->NbcMirror(rRef1,rRef2);
505*cdf0e10cSrcweir 	}
506*cdf0e10cSrcweir 	NbcMirrorGluePoints(rRef1,rRef2);
507*cdf0e10cSrcweir 	SetGlueReallyAbsolute(sal_False);
508*cdf0e10cSrcweir }
509*cdf0e10cSrcweir 
510*cdf0e10cSrcweir 
511*cdf0e10cSrcweir void SdrObjGroup::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
512*cdf0e10cSrcweir {
513*cdf0e10cSrcweir 	SetGlueReallyAbsolute(sal_True);
514*cdf0e10cSrcweir 	nShearWink+=nWink;
515*cdf0e10cSrcweir 	ShearPoint(aRefPoint,rRef,tn);
516*cdf0e10cSrcweir 	SdrObjList* pOL=pSub;
517*cdf0e10cSrcweir 	sal_uIntPtr nObjAnz=pOL->GetObjCount();
518*cdf0e10cSrcweir 	for (sal_uIntPtr i=0; i<nObjAnz; i++) {
519*cdf0e10cSrcweir 		SdrObject* pObj=pOL->GetObj(i);
520*cdf0e10cSrcweir 		pObj->NbcShear(rRef,nWink,tn,bVShear);
521*cdf0e10cSrcweir 	}
522*cdf0e10cSrcweir 	NbcShearGluePoints(rRef,nWink,tn,bVShear);
523*cdf0e10cSrcweir 	SetGlueReallyAbsolute(sal_False);
524*cdf0e10cSrcweir }
525*cdf0e10cSrcweir 
526*cdf0e10cSrcweir 
527*cdf0e10cSrcweir void SdrObjGroup::NbcSetAnchorPos(const Point& rPnt)
528*cdf0e10cSrcweir {
529*cdf0e10cSrcweir 	aAnchor=rPnt;
530*cdf0e10cSrcweir 	Size aSiz(rPnt.X()-aAnchor.X(),rPnt.Y()-aAnchor.Y());
531*cdf0e10cSrcweir 	MovePoint(aRefPoint,aSiz);
532*cdf0e10cSrcweir 	SdrObjList* pOL=pSub;
533*cdf0e10cSrcweir 	sal_uIntPtr nObjAnz=pOL->GetObjCount();
534*cdf0e10cSrcweir 	for (sal_uIntPtr i=0; i<nObjAnz; i++) {
535*cdf0e10cSrcweir 		SdrObject* pObj=pOL->GetObj(i);
536*cdf0e10cSrcweir 		pObj->NbcSetAnchorPos(rPnt);
537*cdf0e10cSrcweir 	}
538*cdf0e10cSrcweir }
539*cdf0e10cSrcweir 
540*cdf0e10cSrcweir 
541*cdf0e10cSrcweir void SdrObjGroup::SetSnapRect(const Rectangle& rRect)
542*cdf0e10cSrcweir {
543*cdf0e10cSrcweir 	Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
544*cdf0e10cSrcweir 	Rectangle aOld(GetSnapRect());
545*cdf0e10cSrcweir 	long nMulX=rRect.Right()-rRect.Left();
546*cdf0e10cSrcweir 	long nDivX=aOld.Right()-aOld.Left();
547*cdf0e10cSrcweir 	long nMulY=rRect.Bottom()-rRect.Top();
548*cdf0e10cSrcweir 	long nDivY=aOld.Bottom()-aOld.Top();
549*cdf0e10cSrcweir 	if (nDivX==0) { nMulX=1; nDivX=1; }
550*cdf0e10cSrcweir 	if (nDivY==0) { nMulY=1; nDivY=1; }
551*cdf0e10cSrcweir 	if (nMulX!=nDivX || nMulY!=nDivY) {
552*cdf0e10cSrcweir 		Fraction aX(nMulX,nDivX);
553*cdf0e10cSrcweir 		Fraction aY(nMulY,nDivY);
554*cdf0e10cSrcweir 		Resize(aOld.TopLeft(),aX,aY);
555*cdf0e10cSrcweir 	}
556*cdf0e10cSrcweir 	if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) {
557*cdf0e10cSrcweir 		Move(Size(rRect.Left()-aOld.Left(),rRect.Top()-aOld.Top()));
558*cdf0e10cSrcweir 	}
559*cdf0e10cSrcweir 
560*cdf0e10cSrcweir 	SetChanged();
561*cdf0e10cSrcweir 	BroadcastObjectChange();
562*cdf0e10cSrcweir 	SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
563*cdf0e10cSrcweir }
564*cdf0e10cSrcweir 
565*cdf0e10cSrcweir 
566*cdf0e10cSrcweir void SdrObjGroup::SetLogicRect(const Rectangle& rRect)
567*cdf0e10cSrcweir {
568*cdf0e10cSrcweir 	SetSnapRect(rRect);
569*cdf0e10cSrcweir }
570*cdf0e10cSrcweir 
571*cdf0e10cSrcweir 
572*cdf0e10cSrcweir void SdrObjGroup::Move(const Size& rSiz)
573*cdf0e10cSrcweir {
574*cdf0e10cSrcweir 	if (rSiz.Width()!=0 || rSiz.Height()!=0) {
575*cdf0e10cSrcweir 		Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
576*cdf0e10cSrcweir 		MovePoint(aRefPoint,rSiz);
577*cdf0e10cSrcweir 		if (pSub->GetObjCount()!=0) {
578*cdf0e10cSrcweir 			// #32383# Erst die Verbinder verschieben, dann den Rest
579*cdf0e10cSrcweir 			SdrObjList* pOL=pSub;
580*cdf0e10cSrcweir 			sal_uIntPtr nObjAnz=pOL->GetObjCount();
581*cdf0e10cSrcweir 			sal_uIntPtr i;
582*cdf0e10cSrcweir 			for (i=0; i<nObjAnz; i++) {
583*cdf0e10cSrcweir 				SdrObject* pObj=pOL->GetObj(i);
584*cdf0e10cSrcweir 				if (pObj->IsEdgeObj()) pObj->Move(rSiz);
585*cdf0e10cSrcweir 			}
586*cdf0e10cSrcweir 			for (i=0; i<nObjAnz; i++) {
587*cdf0e10cSrcweir 				SdrObject* pObj=pOL->GetObj(i);
588*cdf0e10cSrcweir 				if (!pObj->IsEdgeObj()) pObj->Move(rSiz);
589*cdf0e10cSrcweir 			}
590*cdf0e10cSrcweir 		} else {
591*cdf0e10cSrcweir 			// #110094#-14 SendRepaintBroadcast();
592*cdf0e10cSrcweir 			MoveRect(aOutRect,rSiz);
593*cdf0e10cSrcweir 			SetRectsDirty();
594*cdf0e10cSrcweir 		}
595*cdf0e10cSrcweir 
596*cdf0e10cSrcweir 		SetChanged();
597*cdf0e10cSrcweir 		BroadcastObjectChange();
598*cdf0e10cSrcweir 		SendUserCall(SDRUSERCALL_MOVEONLY,aBoundRect0);
599*cdf0e10cSrcweir 	}
600*cdf0e10cSrcweir }
601*cdf0e10cSrcweir 
602*cdf0e10cSrcweir 
603*cdf0e10cSrcweir void SdrObjGroup::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
604*cdf0e10cSrcweir {
605*cdf0e10cSrcweir 	if (xFact.GetNumerator()!=xFact.GetDenominator() || yFact.GetNumerator()!=yFact.GetDenominator()) {
606*cdf0e10cSrcweir 		FASTBOOL bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
607*cdf0e10cSrcweir 		FASTBOOL bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
608*cdf0e10cSrcweir 		if (bXMirr || bYMirr) {
609*cdf0e10cSrcweir 			Point aRef1(GetSnapRect().Center());
610*cdf0e10cSrcweir 			if (bXMirr) {
611*cdf0e10cSrcweir 				Point aRef2(aRef1);
612*cdf0e10cSrcweir 				aRef2.Y()++;
613*cdf0e10cSrcweir 				NbcMirrorGluePoints(aRef1,aRef2);
614*cdf0e10cSrcweir 			}
615*cdf0e10cSrcweir 			if (bYMirr) {
616*cdf0e10cSrcweir 				Point aRef2(aRef1);
617*cdf0e10cSrcweir 				aRef2.X()++;
618*cdf0e10cSrcweir 				NbcMirrorGluePoints(aRef1,aRef2);
619*cdf0e10cSrcweir 			}
620*cdf0e10cSrcweir 		}
621*cdf0e10cSrcweir 		Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
622*cdf0e10cSrcweir 		ResizePoint(aRefPoint,rRef,xFact,yFact);
623*cdf0e10cSrcweir 		if (pSub->GetObjCount()!=0) {
624*cdf0e10cSrcweir 			// #32383# Erst die Verbinder verschieben, dann den Rest
625*cdf0e10cSrcweir 			SdrObjList* pOL=pSub;
626*cdf0e10cSrcweir 			sal_uIntPtr nObjAnz=pOL->GetObjCount();
627*cdf0e10cSrcweir 			sal_uIntPtr i;
628*cdf0e10cSrcweir 			for (i=0; i<nObjAnz; i++) {
629*cdf0e10cSrcweir 				SdrObject* pObj=pOL->GetObj(i);
630*cdf0e10cSrcweir 				if (pObj->IsEdgeObj()) pObj->Resize(rRef,xFact,yFact);
631*cdf0e10cSrcweir 			}
632*cdf0e10cSrcweir 			for (i=0; i<nObjAnz; i++) {
633*cdf0e10cSrcweir 				SdrObject* pObj=pOL->GetObj(i);
634*cdf0e10cSrcweir 				if (!pObj->IsEdgeObj()) pObj->Resize(rRef,xFact,yFact);
635*cdf0e10cSrcweir 			}
636*cdf0e10cSrcweir 		} else {
637*cdf0e10cSrcweir 			// #110094#-14 SendRepaintBroadcast();
638*cdf0e10cSrcweir 			ResizeRect(aOutRect,rRef,xFact,yFact);
639*cdf0e10cSrcweir 			SetRectsDirty();
640*cdf0e10cSrcweir 		}
641*cdf0e10cSrcweir 
642*cdf0e10cSrcweir 		SetChanged();
643*cdf0e10cSrcweir 		BroadcastObjectChange();
644*cdf0e10cSrcweir 		SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
645*cdf0e10cSrcweir 	}
646*cdf0e10cSrcweir }
647*cdf0e10cSrcweir 
648*cdf0e10cSrcweir 
649*cdf0e10cSrcweir void SdrObjGroup::Rotate(const Point& rRef, long nWink, double sn, double cs)
650*cdf0e10cSrcweir {
651*cdf0e10cSrcweir 	if (nWink!=0) {
652*cdf0e10cSrcweir 		SetGlueReallyAbsolute(sal_True);
653*cdf0e10cSrcweir 		Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
654*cdf0e10cSrcweir 		nDrehWink=NormAngle360(nDrehWink+nWink);
655*cdf0e10cSrcweir 		RotatePoint(aRefPoint,rRef,sn,cs);
656*cdf0e10cSrcweir 		// #32383# Erst die Verbinder verschieben, dann den Rest
657*cdf0e10cSrcweir 		SdrObjList* pOL=pSub;
658*cdf0e10cSrcweir 		sal_uIntPtr nObjAnz=pOL->GetObjCount();
659*cdf0e10cSrcweir 		sal_uIntPtr i;
660*cdf0e10cSrcweir 		for (i=0; i<nObjAnz; i++) {
661*cdf0e10cSrcweir 			SdrObject* pObj=pOL->GetObj(i);
662*cdf0e10cSrcweir 			if (pObj->IsEdgeObj()) pObj->Rotate(rRef,nWink,sn,cs);
663*cdf0e10cSrcweir 		}
664*cdf0e10cSrcweir 		for (i=0; i<nObjAnz; i++) {
665*cdf0e10cSrcweir 			SdrObject* pObj=pOL->GetObj(i);
666*cdf0e10cSrcweir 			if (!pObj->IsEdgeObj()) pObj->Rotate(rRef,nWink,sn,cs);
667*cdf0e10cSrcweir 		}
668*cdf0e10cSrcweir 		NbcRotateGluePoints(rRef,nWink,sn,cs);
669*cdf0e10cSrcweir 		SetGlueReallyAbsolute(sal_False);
670*cdf0e10cSrcweir 		SetChanged();
671*cdf0e10cSrcweir 		BroadcastObjectChange();
672*cdf0e10cSrcweir 		SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
673*cdf0e10cSrcweir 	}
674*cdf0e10cSrcweir }
675*cdf0e10cSrcweir 
676*cdf0e10cSrcweir 
677*cdf0e10cSrcweir void SdrObjGroup::Mirror(const Point& rRef1, const Point& rRef2)
678*cdf0e10cSrcweir {
679*cdf0e10cSrcweir 	SetGlueReallyAbsolute(sal_True);
680*cdf0e10cSrcweir 	Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
681*cdf0e10cSrcweir 	MirrorPoint(aRefPoint,rRef1,rRef2); // fehlende Implementation in SvdEtc !!!
682*cdf0e10cSrcweir 	// #32383# Erst die Verbinder verschieben, dann den Rest
683*cdf0e10cSrcweir 	SdrObjList* pOL=pSub;
684*cdf0e10cSrcweir 	sal_uIntPtr nObjAnz=pOL->GetObjCount();
685*cdf0e10cSrcweir 	sal_uIntPtr i;
686*cdf0e10cSrcweir 	for (i=0; i<nObjAnz; i++) {
687*cdf0e10cSrcweir 		SdrObject* pObj=pOL->GetObj(i);
688*cdf0e10cSrcweir 		if (pObj->IsEdgeObj()) pObj->Mirror(rRef1,rRef2);
689*cdf0e10cSrcweir 	}
690*cdf0e10cSrcweir 	for (i=0; i<nObjAnz; i++) {
691*cdf0e10cSrcweir 		SdrObject* pObj=pOL->GetObj(i);
692*cdf0e10cSrcweir 		if (!pObj->IsEdgeObj()) pObj->Mirror(rRef1,rRef2);
693*cdf0e10cSrcweir 	}
694*cdf0e10cSrcweir 	NbcMirrorGluePoints(rRef1,rRef2);
695*cdf0e10cSrcweir 	SetGlueReallyAbsolute(sal_False);
696*cdf0e10cSrcweir 	SetChanged();
697*cdf0e10cSrcweir 	BroadcastObjectChange();
698*cdf0e10cSrcweir 	SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
699*cdf0e10cSrcweir }
700*cdf0e10cSrcweir 
701*cdf0e10cSrcweir 
702*cdf0e10cSrcweir void SdrObjGroup::Shear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
703*cdf0e10cSrcweir {
704*cdf0e10cSrcweir 	if (nWink!=0) {
705*cdf0e10cSrcweir 		SetGlueReallyAbsolute(sal_True);
706*cdf0e10cSrcweir 		Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
707*cdf0e10cSrcweir 		nShearWink+=nWink;
708*cdf0e10cSrcweir 		ShearPoint(aRefPoint,rRef,tn);
709*cdf0e10cSrcweir 		// #32383# Erst die Verbinder verschieben, dann den Rest
710*cdf0e10cSrcweir 		SdrObjList* pOL=pSub;
711*cdf0e10cSrcweir 		sal_uIntPtr nObjAnz=pOL->GetObjCount();
712*cdf0e10cSrcweir 		sal_uIntPtr i;
713*cdf0e10cSrcweir 		for (i=0; i<nObjAnz; i++) {
714*cdf0e10cSrcweir 			SdrObject* pObj=pOL->GetObj(i);
715*cdf0e10cSrcweir 			if (pObj->IsEdgeObj()) pObj->Shear(rRef,nWink,tn,bVShear);
716*cdf0e10cSrcweir 		}
717*cdf0e10cSrcweir 		for (i=0; i<nObjAnz; i++) {
718*cdf0e10cSrcweir 			SdrObject* pObj=pOL->GetObj(i);
719*cdf0e10cSrcweir 			if (!pObj->IsEdgeObj()) pObj->Shear(rRef,nWink,tn,bVShear);
720*cdf0e10cSrcweir 		}
721*cdf0e10cSrcweir 		NbcShearGluePoints(rRef,nWink,tn,bVShear);
722*cdf0e10cSrcweir 		SetGlueReallyAbsolute(sal_False);
723*cdf0e10cSrcweir 		SetChanged();
724*cdf0e10cSrcweir 		BroadcastObjectChange();
725*cdf0e10cSrcweir 		SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
726*cdf0e10cSrcweir 	}
727*cdf0e10cSrcweir }
728*cdf0e10cSrcweir 
729*cdf0e10cSrcweir 
730*cdf0e10cSrcweir void SdrObjGroup::SetAnchorPos(const Point& rPnt)
731*cdf0e10cSrcweir {
732*cdf0e10cSrcweir 	Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
733*cdf0e10cSrcweir 	FASTBOOL bChg=aAnchor!=rPnt;
734*cdf0e10cSrcweir 	aAnchor=rPnt;
735*cdf0e10cSrcweir 	Size aSiz(rPnt.X()-aAnchor.X(),rPnt.Y()-aAnchor.Y());
736*cdf0e10cSrcweir 	MovePoint(aRefPoint,aSiz);
737*cdf0e10cSrcweir 	// #32383# Erst die Verbinder verschieben, dann den Rest
738*cdf0e10cSrcweir 	SdrObjList* pOL=pSub;
739*cdf0e10cSrcweir 	sal_uIntPtr nObjAnz=pOL->GetObjCount();
740*cdf0e10cSrcweir 	sal_uIntPtr i;
741*cdf0e10cSrcweir 	for (i=0; i<nObjAnz; i++) {
742*cdf0e10cSrcweir 		SdrObject* pObj=pOL->GetObj(i);
743*cdf0e10cSrcweir 		if (pObj->IsEdgeObj()) pObj->SetAnchorPos(rPnt);
744*cdf0e10cSrcweir 	}
745*cdf0e10cSrcweir 	for (i=0; i<nObjAnz; i++) {
746*cdf0e10cSrcweir 		SdrObject* pObj=pOL->GetObj(i);
747*cdf0e10cSrcweir 		if (!pObj->IsEdgeObj()) pObj->SetAnchorPos(rPnt);
748*cdf0e10cSrcweir 	}
749*cdf0e10cSrcweir 	if (bChg) {
750*cdf0e10cSrcweir 		SetChanged();
751*cdf0e10cSrcweir 		BroadcastObjectChange();
752*cdf0e10cSrcweir 		SendUserCall(SDRUSERCALL_MOVEONLY,aBoundRect0);
753*cdf0e10cSrcweir 	}
754*cdf0e10cSrcweir }
755*cdf0e10cSrcweir 
756*cdf0e10cSrcweir 
757*cdf0e10cSrcweir 
758*cdf0e10cSrcweir void SdrObjGroup::NbcSetRelativePos(const Point& rPnt)
759*cdf0e10cSrcweir {
760*cdf0e10cSrcweir 	Point aRelPos0(GetSnapRect().TopLeft()-aAnchor);
761*cdf0e10cSrcweir 	Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
762*cdf0e10cSrcweir 	NbcMove(aSiz); // Der ruft auch das SetRectsDirty()
763*cdf0e10cSrcweir }
764*cdf0e10cSrcweir 
765*cdf0e10cSrcweir void SdrObjGroup::SetRelativePos(const Point& rPnt)
766*cdf0e10cSrcweir {
767*cdf0e10cSrcweir 	Point aRelPos0(GetSnapRect().TopLeft()-aAnchor);
768*cdf0e10cSrcweir 	Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
769*cdf0e10cSrcweir 	if (aSiz.Width()!=0 || aSiz.Height()!=0) Move(aSiz); // Der ruft auch das SetRectsDirty() und Broadcast, ...
770*cdf0e10cSrcweir }
771*cdf0e10cSrcweir 
772*cdf0e10cSrcweir void SdrObjGroup::NbcReformatText()
773*cdf0e10cSrcweir {
774*cdf0e10cSrcweir 	pSub->NbcReformatAllTextObjects();
775*cdf0e10cSrcweir }
776*cdf0e10cSrcweir 
777*cdf0e10cSrcweir void SdrObjGroup::ReformatText()
778*cdf0e10cSrcweir {
779*cdf0e10cSrcweir 	pSub->ReformatAllTextObjects();
780*cdf0e10cSrcweir }
781*cdf0e10cSrcweir 
782*cdf0e10cSrcweir SdrObject* SdrObjGroup::DoConvertToPolyObj(sal_Bool bBezier) const
783*cdf0e10cSrcweir {
784*cdf0e10cSrcweir 	SdrObject* pGroup = new SdrObjGroup;
785*cdf0e10cSrcweir 	pGroup->SetModel(GetModel());
786*cdf0e10cSrcweir 
787*cdf0e10cSrcweir 	for(sal_uInt32 a=0;a<pSub->GetObjCount();a++)
788*cdf0e10cSrcweir 	{
789*cdf0e10cSrcweir 		SdrObject* pIterObj = pSub->GetObj(a);
790*cdf0e10cSrcweir         SdrObject* pResult = pIterObj->DoConvertToPolyObj(bBezier);
791*cdf0e10cSrcweir 
792*cdf0e10cSrcweir         // pResult can be NULL e.g. for empty objects
793*cdf0e10cSrcweir         if( pResult )
794*cdf0e10cSrcweir             pGroup->GetSubList()->NbcInsertObject(pResult);
795*cdf0e10cSrcweir 	}
796*cdf0e10cSrcweir 
797*cdf0e10cSrcweir 	return pGroup;
798*cdf0e10cSrcweir }
799*cdf0e10cSrcweir 
800*cdf0e10cSrcweir // eof
801