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