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