LibreOffice Module svx (master)  1
svdogrp.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <svx/svdogrp.hxx>
21 
22 #include <svx/svdmodel.hxx>
23 #include <svx/svdpage.hxx>
24 #include <svx/svdobj.hxx>
25 #include <svx/svdtrans.hxx>
26 #include <svx/dialmgr.hxx>
27 #include <svx/strings.hrc>
28 
34 #include <libxml/xmlwriter.h>
35 #include <vcl/canvastools.hxx>
36 
37 // BaseProperties section
38 std::unique_ptr<sdr::properties::BaseProperties> SdrObjGroup::CreateObjectSpecificProperties()
39 {
40  return std::make_unique<sdr::properties::GroupProperties>(*this);
41 }
42 
43 // DrawContact section
44 std::unique_ptr<sdr::contact::ViewContact> SdrObjGroup::CreateObjectSpecificViewContact()
45 {
46  return std::make_unique<sdr::contact::ViewContactOfGroup>(*this);
47 }
48 
50 : SdrObject(rSdrModel),
51  SdrObjList(),
52  aRefPoint(0, 0)
53 {
54  bClosedObj=false;
55 }
56 
58 {
59 }
60 
62 {
63  return getSdrPageFromSdrObject();
64 }
65 
67 {
68  return const_cast< SdrObjGroup* >(this);
69 }
70 
72 {
73  return const_cast< SdrObjGroup* >(this);
74 }
75 
77 {
78  rInfo.bNoContortion=false;
79  const size_t nObjCount(GetObjCount());
80  for (size_t i=0; i<nObjCount; ++i) {
81  SdrObject* pObj(GetObj(i));
83  pObj->TakeObjInfo(aInfo);
84  if (!aInfo.bMoveAllowed ) rInfo.bMoveAllowed =false;
85  if (!aInfo.bResizeFreeAllowed ) rInfo.bResizeFreeAllowed =false;
86  if (!aInfo.bResizePropAllowed ) rInfo.bResizePropAllowed =false;
87  if (!aInfo.bRotateFreeAllowed ) rInfo.bRotateFreeAllowed =false;
88  if (!aInfo.bRotate90Allowed ) rInfo.bRotate90Allowed =false;
89  if (!aInfo.bMirrorFreeAllowed ) rInfo.bMirrorFreeAllowed =false;
90  if (!aInfo.bMirror45Allowed ) rInfo.bMirror45Allowed =false;
91  if (!aInfo.bMirror90Allowed ) rInfo.bMirror90Allowed =false;
92  if (!aInfo.bShearAllowed ) rInfo.bShearAllowed =false;
93  if (!aInfo.bEdgeRadiusAllowed ) rInfo.bEdgeRadiusAllowed =false;
94  if (!aInfo.bNoOrthoDesired ) rInfo.bNoOrthoDesired =false;
95  if (aInfo.bNoContortion ) rInfo.bNoContortion =true;
96  if (!aInfo.bCanConvToPath ) rInfo.bCanConvToPath =false;
97 
98  if(!aInfo.bCanConvToContour)
99  rInfo.bCanConvToContour = false;
100 
101  if (!aInfo.bCanConvToPoly ) rInfo.bCanConvToPoly =false;
102  if (!aInfo.bCanConvToPathLineToArea) rInfo.bCanConvToPathLineToArea=false;
103  if (!aInfo.bCanConvToPolyLineToArea) rInfo.bCanConvToPolyLineToArea=false;
104  }
105  if (nObjCount==0) {
106  rInfo.bRotateFreeAllowed=false;
107  rInfo.bRotate90Allowed =false;
108  rInfo.bMirrorFreeAllowed=false;
109  rInfo.bMirror45Allowed =false;
110  rInfo.bMirror90Allowed =false;
111  rInfo.bTransparenceAllowed = false;
112  rInfo.bShearAllowed =false;
113  rInfo.bEdgeRadiusAllowed=false;
114  rInfo.bNoContortion =true;
115  }
116  if(nObjCount != 1)
117  {
118  // only allowed if single object selected
119  rInfo.bTransparenceAllowed = false;
120  }
121 }
122 
123 
125 {
126  // avoid resetting aOutRect which in case of this object is model data,
127  // not re-creatable view data
128 }
129 
131 {
132  return sal_uInt16(OBJ_GRUP);
133 }
134 
135 
137 {
138  bool b1st = true;
140  const size_t nObjCount(GetObjCount());
141  for (size_t i=0; i<nObjCount; ++i) {
142  SdrLayerID nLay1(GetObj(i)->GetLayer());
143  if (b1st) { nLay=nLay1; b1st = false; }
144  else if (nLay1!=nLay) return SdrLayerID(0);
145  }
146  return nLay;
147 }
148 
150 {
151  SdrObject::NbcSetLayer(nLayer);
152  const size_t nObjCount(GetObjCount());
153  for (size_t i=0; i<nObjCount; ++i) {
154  GetObj(i)->NbcSetLayer(nLayer);
155  }
156 }
157 
159 {
160  // call parent
161  SdrObject::handlePageChange(pOldPage, pNewPage);
162 
163  for(size_t i(0); i < GetObjCount(); i++)
164  {
165  GetObj(i)->handlePageChange(pOldPage, pNewPage);
166  }
167 }
168 
170 {
171  return const_cast< SdrObjGroup* >(this);
172 }
173 
175 {
176  // <aOutRect> has to contain the bounding rectangle
177  if(0 != GetObjCount())
178  {
179  const_cast< SdrObjGroup* >(this)->aOutRect = GetAllObjBoundRect();
180  }
181 
182  return aOutRect;
183 }
184 
186 {
187  // <aOutRect> has to contain the bounding rectangle
188  if(0 != GetObjCount())
189  {
190  return GetAllObjSnapRect();
191  }
192  else
193  {
194  return aOutRect;
195  }
196 }
197 
199 {
200  return CloneHelper< SdrObjGroup >(rTargetModel);
201 }
202 
204 {
205  if( this == &rObj )
206  return *this;
207 
208  // copy SdrObject stuff
209  SdrObject::operator=(rObj);
210 
211  // copy child SdrObjects
212  if(nullptr != rObj.GetSubList())
213  {
214  // #i36404# Copy SubList, init model and page first
215  const SdrObjList& rSourceSubList(*rObj.GetSubList());
216 
217  CopyObjects(rSourceSubList);
218 
219  // tdf#116979: needed here, we need bSnapRectDirty to be true
220  // which it is after using SdrObject::operator= (see above),
221  // but set to false again using CopyObjects
222  SetRectsDirty();
223  }
224 
225  // copy local parameters
226  aRefPoint = rObj.aRefPoint;
227  return *this;
228 }
229 
230 
232 {
233  OUStringBuffer sName;
234 
235  if(0 == GetObjCount())
236  {
237  sName.append(SvxResId(STR_ObjNameSingulGRUPEMPTY));
238  }
239  else
240  {
241  sName.append(SvxResId(STR_ObjNameSingulGRUP));
242  }
243 
244  const OUString aName(GetName());
245 
246  if (!aName.isEmpty())
247  {
248  sName.append(' ');
249  sName.append('\'');
250  sName.append(aName);
251  sName.append('\'');
252  }
253 
254  return sName.makeStringAndClear();
255 }
256 
257 
259 {
260  if(0 == GetObjCount())
261  return SvxResId(STR_ObjNamePluralGRUPEMPTY);
262  return SvxResId(STR_ObjNamePluralGRUP);
263 }
264 
265 
267 {
268  // TODO: unnecessary, because we use the Rects from the SubList
269 }
270 
272 {
273  basegfx::B2DPolyPolygon aRetval;
274  const size_t nObjCount(GetObjCount());
275 
276  for(size_t a = 0; a < nObjCount; ++a)
277  {
278  SdrObject* pObj(GetObj(a));
279  aRetval.append(pObj->TakeXorPoly());
280  }
281 
282  if(!aRetval.count())
283  {
286  }
287 
288  return aRetval;
289 }
290 
292 {
293  return false;
294 }
295 
296 
298 {
299  return false;
300 }
301 
302 
304 {
305  long nRetval(0);
306 
307  if(0 != GetObjCount())
308  {
309  SdrObject* pObj(GetObj(0));
310 
311  nRetval = pObj->GetRotateAngle();
312  }
313 
314  return nRetval;
315 }
316 
317 
318 long SdrObjGroup::GetShearAngle(bool /*bVertical*/) const
319 {
320  long nRetval(0);
321 
322  if(0 != GetObjCount())
323  {
324  SdrObject* pObj(GetObj(0));
325 
326  nRetval = pObj->GetShearAngle();
327  }
328 
329  return nRetval;
330 }
331 
332 
334 {
336  long nMulX=rRect.Right()-rRect.Left();
337  long nDivX=aOld.Right()-aOld.Left();
338  long nMulY=rRect.Bottom()-rRect.Top();
339  long nDivY=aOld.Bottom()-aOld.Top();
340  if (nDivX==0) { nMulX=1; nDivX=1; }
341  if (nDivY==0) { nMulY=1; nDivY=1; }
342  if (nMulX!=nDivX || nMulY!=nDivY) {
343  Fraction aX(nMulX,nDivX);
344  Fraction aY(nMulY,nDivY);
345  NbcResize(aOld.TopLeft(),aX,aY);
346  }
347  if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) {
348  NbcMove(Size(rRect.Left()-aOld.Left(),rRect.Top()-aOld.Top()));
349  }
350 }
351 
352 
354 {
355  NbcSetSnapRect(rRect);
356 }
357 
358 
359 void SdrObjGroup::NbcMove(const Size& rSiz)
360 {
361  aRefPoint.Move(rSiz);
362  const size_t nObjCount(GetObjCount());
363 
364  if(0 != nObjCount)
365  {
366  for (size_t i=0; i<nObjCount; ++i)
367  {
368  SdrObject* pObj(GetObj(i));
369  pObj->NbcMove(rSiz);
370  }
371  }
372  else
373  {
374  aOutRect.Move(rSiz);
375  SetRectsDirty();
376  }
377 }
378 
379 
380 void SdrObjGroup::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
381 {
382  bool bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
383  bool bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
384  if (bXMirr || bYMirr) {
385  Point aRef1(GetSnapRect().Center());
386  if (bXMirr) {
387  Point aRef2(aRef1);
388  aRef2.AdjustY( 1 );
389  NbcMirrorGluePoints(aRef1,aRef2);
390  }
391  if (bYMirr) {
392  Point aRef2(aRef1);
393  aRef2.AdjustX( 1 );
394  NbcMirrorGluePoints(aRef1,aRef2);
395  }
396  }
397 
398  ResizePoint(aRefPoint,rRef,xFact,yFact);
399 
400  const size_t nObjCount(GetObjCount());
401  if(0 != nObjCount)
402  {
403  for (size_t i=0; i<nObjCount; ++i)
404  {
405  SdrObject* pObj(GetObj(i));
406  pObj->NbcResize(rRef,xFact,yFact);
407  }
408  }
409  else
410  {
411  ResizeRect(aOutRect,rRef,xFact,yFact);
412  SetRectsDirty();
413  }
414 }
415 
416 
417 void SdrObjGroup::NbcRotate(const Point& rRef, long nAngle, double sn, double cs)
418 {
419  SetGlueReallyAbsolute(true);
420  RotatePoint(aRefPoint,rRef,sn,cs);
421  const size_t nObjCount(GetObjCount());
422 
423  for (size_t i=0; i<nObjCount; ++i)
424  {
425  SdrObject* pObj(GetObj(i));
426  pObj->NbcRotate(rRef,nAngle,sn,cs);
427  }
428 
429  NbcRotateGluePoints(rRef,nAngle,sn,cs);
430  SetGlueReallyAbsolute(false);
431 }
432 
433 
434 void SdrObjGroup::NbcMirror(const Point& rRef1, const Point& rRef2)
435 {
436  SetGlueReallyAbsolute(true);
437  MirrorPoint(aRefPoint,rRef1,rRef2); // implementation missing in SvdEtc!
438  const size_t nObjCount(GetObjCount());
439 
440  for (size_t i=0; i<nObjCount; ++i)
441  {
442  SdrObject* pObj(GetObj(i));
443  pObj->NbcMirror(rRef1,rRef2);
444  }
445 
446  NbcMirrorGluePoints(rRef1,rRef2);
447  SetGlueReallyAbsolute(false);
448 }
449 
450 
451 void SdrObjGroup::NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear)
452 {
453  SetGlueReallyAbsolute(true);
454  ShearPoint(aRefPoint,rRef,tn);
455  const size_t nObjCount(GetObjCount());
456 
457  for (size_t i=0; i<nObjCount; ++i)
458  {
459  SdrObject* pObj(GetObj(i));
460  pObj->NbcShear(rRef,nAngle,tn,bVShear);
461  }
462 
463  NbcShearGluePoints(rRef,tn,bVShear);
464  SetGlueReallyAbsolute(false);
465 }
466 
467 
468 void SdrObjGroup::NbcSetAnchorPos(const Point& rPnt)
469 {
470  aAnchor=rPnt;
471  Size aSiz(rPnt.X()-aAnchor.X(),rPnt.Y()-aAnchor.Y());
472  aRefPoint.Move(aSiz);
473  const size_t nObjCount(GetObjCount());
474 
475  for (size_t i=0; i<nObjCount; ++i)
476  {
477  SdrObject* pObj(GetObj(i));
478  pObj->NbcSetAnchorPos(rPnt);
479  }
480 }
481 
482 
484 {
485  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
487  if (aOld.IsEmpty())
488  {
489  Fraction aX(1,1);
490  Fraction aY(1,1);
491  Resize(aOld.TopLeft(),aX,aY);
492  }
493  else
494  {
495  long nMulX=rRect.Right()-rRect.Left();
496  long nDivX=aOld.Right()-aOld.Left();
497  long nMulY=rRect.Bottom()-rRect.Top();
498  long nDivY=aOld.Bottom()-aOld.Top();
499  if (nDivX==0) { nMulX=1; nDivX=1; }
500  if (nDivY==0) { nMulY=1; nDivY=1; }
501  if (nMulX!=nDivX || nMulY!=nDivY) {
502  Fraction aX(nMulX,nDivX);
503  Fraction aY(nMulY,nDivY);
504  Resize(aOld.TopLeft(),aX,aY);
505  }
506  }
507  if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) {
508  Move(Size(rRect.Left()-aOld.Left(),rRect.Top()-aOld.Top()));
509  }
510 
511  SetChanged();
514 }
515 
516 
518 {
519  SetSnapRect(rRect);
520 }
521 
522 
523 void SdrObjGroup::Move(const Size& rSiz)
524 {
525  if (rSiz.Width()!=0 || rSiz.Height()!=0) {
526  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
527  aRefPoint.Move(rSiz);
528  const size_t nObjCount(GetObjCount());
529 
530  if(0 != nObjCount)
531  {
532  // first move the connectors, then everything else
533  for (size_t i=0; i<nObjCount; ++i)
534  {
535  SdrObject* pObj(GetObj(i));
536  if (pObj->IsEdgeObj())
537  pObj->Move(rSiz);
538  }
539 
540  for (size_t i=0; i<nObjCount; ++i)
541  {
542  SdrObject* pObj(GetObj(i));
543  if (!pObj->IsEdgeObj())
544  pObj->Move(rSiz);
545  }
546  }
547  else
548  {
549  aOutRect.Move(rSiz);
550  SetRectsDirty();
551  }
552 
553  SetChanged();
556  }
557 }
558 
559 
560 void SdrObjGroup::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative)
561 {
562  if (xFact.GetNumerator()!=xFact.GetDenominator() || yFact.GetNumerator()!=yFact.GetDenominator()) {
563  bool bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
564  bool bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
565  if (bXMirr || bYMirr) {
566  Point aRef1(GetSnapRect().Center());
567  if (bXMirr) {
568  Point aRef2(aRef1);
569  aRef2.AdjustY( 1 );
570  NbcMirrorGluePoints(aRef1,aRef2);
571  }
572  if (bYMirr) {
573  Point aRef2(aRef1);
574  aRef2.AdjustX( 1 );
575  NbcMirrorGluePoints(aRef1,aRef2);
576  }
577  }
578  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
579  ResizePoint(aRefPoint,rRef,xFact,yFact);
580  const size_t nObjCount(GetObjCount());
581 
582  if(0 != nObjCount)
583  {
584  // move the connectors first, everything else afterwards
585  for (size_t i=0; i<nObjCount; ++i)
586  {
587  SdrObject* pObj(GetObj(i));
588  if (pObj->IsEdgeObj())
589  pObj->Resize(rRef,xFact,yFact,bUnsetRelative);
590  }
591 
592  for (size_t i=0; i<nObjCount; ++i)
593  {
594  SdrObject* pObj(GetObj(i));
595  if (!pObj->IsEdgeObj())
596  pObj->Resize(rRef,xFact,yFact,bUnsetRelative);
597  }
598  }
599  else
600  {
601  ResizeRect(aOutRect,rRef,xFact,yFact);
602  SetRectsDirty();
603  }
604 
605  SetChanged();
608  }
609 }
610 
611 
612 void SdrObjGroup::Rotate(const Point& rRef, long nAngle, double sn, double cs)
613 {
614  if (nAngle==0)
615  return;
616 
617  SetGlueReallyAbsolute(true);
618  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
619  RotatePoint(aRefPoint,rRef,sn,cs);
620  // move the connectors first, everything else afterwards
621  const size_t nObjCount(GetObjCount());
622 
623  for (size_t i=0; i<nObjCount; ++i)
624  {
625  SdrObject* pObj(GetObj(i));
626  if (pObj->IsEdgeObj())
627  pObj->Rotate(rRef,nAngle,sn,cs);
628  }
629 
630  for (size_t i=0; i<nObjCount; ++i)
631  {
632  SdrObject* pObj(GetObj(i));
633  if (!pObj->IsEdgeObj())
634  pObj->Rotate(rRef,nAngle,sn,cs);
635  }
636 
637  NbcRotateGluePoints(rRef,nAngle,sn,cs);
638  SetGlueReallyAbsolute(false);
639  SetChanged();
642 }
643 
644 
645 void SdrObjGroup::Mirror(const Point& rRef1, const Point& rRef2)
646 {
647  SetGlueReallyAbsolute(true);
648  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
649  MirrorPoint(aRefPoint,rRef1,rRef2); // implementation missing in SvdEtc!
650  // move the connectors first, everything else afterwards
651  const size_t nObjCount(GetObjCount());
652 
653  for (size_t i=0; i<nObjCount; ++i)
654  {
655  SdrObject* pObj(GetObj(i));
656  if (pObj->IsEdgeObj())
657  pObj->Mirror(rRef1,rRef2);
658  }
659 
660  for (size_t i=0; i<nObjCount; ++i)
661  {
662  SdrObject* pObj(GetObj(i));
663  if (!pObj->IsEdgeObj())
664  pObj->Mirror(rRef1,rRef2);
665  }
666 
667  NbcMirrorGluePoints(rRef1,rRef2);
668  SetGlueReallyAbsolute(false);
669  SetChanged();
672 }
673 
674 
675 void SdrObjGroup::Shear(const Point& rRef, long nAngle, double tn, bool bVShear)
676 {
677  if (nAngle==0)
678  return;
679 
680  SetGlueReallyAbsolute(true);
681  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
682  ShearPoint(aRefPoint,rRef,tn);
683  // move the connectors first, everything else afterwards
684  const size_t nObjCount(GetObjCount());
685 
686  for (size_t i=0; i<nObjCount; ++i)
687  {
688  SdrObject* pObj(GetObj(i));
689  if (pObj->IsEdgeObj())
690  pObj->Shear(rRef,nAngle,tn,bVShear);
691  }
692 
693  for (size_t i=0; i<nObjCount; ++i)
694  {
695  SdrObject* pObj(GetObj(i));
696  if (!pObj->IsEdgeObj())
697  pObj->Shear(rRef,nAngle,tn,bVShear);
698  }
699 
700  NbcShearGluePoints(rRef,tn,bVShear);
701  SetGlueReallyAbsolute(false);
702  SetChanged();
705 
706 }
707 
708 
709 void SdrObjGroup::SetAnchorPos(const Point& rPnt)
710 {
711  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
712  bool bChg=aAnchor!=rPnt;
713  aAnchor=rPnt;
714  Size aSiz(rPnt.X()-aAnchor.X(),rPnt.Y()-aAnchor.Y());
715  aRefPoint.Move(aSiz);
716  // move the connectors first, everything else afterwards
717  const size_t nObjCount(GetObjCount());
718 
719  for (size_t i=0; i<nObjCount; ++i)
720  {
721  SdrObject* pObj(GetObj(i));
722  if (pObj->IsEdgeObj())
723  pObj->SetAnchorPos(rPnt);
724  }
725 
726  for (size_t i=0; i<nObjCount; ++i)
727  {
728  SdrObject* pObj(GetObj(i));
729  if (!pObj->IsEdgeObj())
730  pObj->SetAnchorPos(rPnt);
731  }
732 
733  if (bChg)
734  {
735  SetChanged();
738  }
739 }
740 
741 
742 void SdrObjGroup::NbcSetRelativePos(const Point& rPnt)
743 {
744  Point aRelPos0(GetSnapRect().TopLeft()-aAnchor);
745  Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
746  NbcMove(aSiz); // this also calls SetRectsDirty()
747 }
748 
749 void SdrObjGroup::SetRelativePos(const Point& rPnt)
750 {
751  Point aRelPos0(GetSnapRect().TopLeft()-aAnchor);
752  Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
753  if (aSiz.Width()!=0 || aSiz.Height()!=0) Move(aSiz); // this also calls SetRectsDirty() and Broadcast, ...
754 }
755 
757 {
759 }
760 
761 SdrObjectUniquePtr SdrObjGroup::DoConvertToPolyObj(bool bBezier, bool bAddText) const
762 {
764  const size_t nObjCount(GetObjCount());
765 
766  for(size_t a=0; a < nObjCount; ++a)
767  {
768  SdrObject* pIterObj(GetObj(a));
769  SdrObjectUniquePtr pResult(pIterObj->DoConvertToPolyObj(bBezier, bAddText));
770 
771  // pResult can be NULL e.g. for empty objects
772  if( pResult )
773  pGroup->GetSubList()->NbcInsertObject(pResult.release());
774  }
775 
776  return pGroup;
777 }
778 
780 {
781  xmlTextWriterStartElement(pWriter, BAD_CAST("SdrObjGroup"));
782  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
783 
784  SdrObject::dumpAsXml(pWriter);
785  SdrObjList::dumpAsXml(pWriter);
786 
787  xmlTextWriterEndElement(pWriter);
788 }
789 
790 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void NbcSetAnchorPos(const Point &rPnt) override
Definition: svdogrp.cxx:468
Point TopLeft() const
long Width() const
virtual bool BegCreate(SdrDragStat &rStat) override
Every object must be able to create itself interactively.
Definition: svdogrp.cxx:297
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1066
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
Definition: svdobj.cxx:562
virtual void Shear(const Point &rRef, long nAngle, double tn, bool bVShear) override
Definition: svdogrp.cxx:675
void NbcReformatAllTextObjects()
reformat all text objects, e.g. when changing printer
Definition: svdpage.cxx:711
virtual SdrLayerID GetLayer() const override
Definition: svdogrp.cxx:136
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override
Definition: svdogrp.cxx:761
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
Definition: svdobj.cxx:1483
void ShearPoint(Point &rPnt, const Point &rRef, double tn, bool bVShear=false)
Definition: svdtrans.hxx:122
SdrObjGroup & operator=(const SdrObjGroup &rObj)
Definition: svdogrp.cxx:203
struct _xmlTextWriter * xmlTextWriterPtr
SdrObjUserCall * pUserCall
Definition: svdobj.hxx:923
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: svdogrp.cxx:271
virtual void SetBoundRectDirty() override
Definition: svdogrp.cxx:124
virtual long GetRotateAngle() const override
Definition: svdogrp.cxx:303
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage)
Definition: svdobj.cxx:448
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: svdogrp.cxx:266
const tools::Rectangle & GetAllObjBoundRect() const
Definition: svdpage.cxx:696
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdobj.cxx:1379
void ResizePoint(Point &rPnt, const Point &rRef, const Fraction &xFract, const Fraction &yFract)
Definition: svdtrans.hxx:106
long Height() const
virtual void Rotate(const Point &rRef, long nAngle, double sn, double cs) override
Definition: svdogrp.cxx:612
bool IsEdgeObj() const
Definition: svdobj.hxx:794
virtual void NbcSetLayer(SdrLayerID nLayer) override
Definition: svdogrp.cxx:149
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const
Definition: svdobj.cxx:2524
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:766
size_t GetObjCount() const
Definition: svdpage.cxx:760
void SetGlueReallyAbsolute(bool bOn)
Definition: svdobj.cxx:2213
void CopyObjects(const SdrObjList &rSrcList)
Definition: svdpage.cxx:151
void NbcMirrorGluePoints(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:2233
Center
virtual void Rotate(const Point &rRef, long nAngle, double sn, double cs)
Definition: svdobj.cxx:1510
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
Definition: svdogrp.cxx:434
void Move(long nHorzMoveDelta, long nVertMoveDelta)
bool IsEmpty() const
Provides information about various ZObject properties.
Definition: svdobj.hxx:248
virtual sal_uInt16 GetObjIdentifier() const override
Definition: svdogrp.cxx:130
long Right() const
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
Definition: svdogrp.cxx:291
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:262
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
virtual void SetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1576
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdogrp.cxx:380
bool bClosedObj
Definition: svdobj.hxx:941
long Top() const
SdrObjGroup(SdrModel &rSdrModel)
Definition: svdogrp.cxx:49
virtual void NbcRotate(const Point &rRef, long nAngle, double sn, double cs)
Definition: svdobj.cxx:1400
o3tl::strong_int< sal_uInt8, struct SdrLayerIDTag > SdrLayerID
Definition: svdtypes.hxx:59
virtual void SetRelativePos(const Point &rPnt) override
Definition: svdogrp.cxx:749
SdrObject & operator=(const SdrObject &rObj)
Definition: svdobj.cxx:978
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: svdogrp.cxx:779
void ResizeRect(tools::Rectangle &rRect, const Point &rRef, const Fraction &rxFact, const Fraction &ryFact)
Definition: svdtrans.cxx:36
virtual void NbcShear(const Point &rRef, long nAngle, double tn, bool bVShear) override
Definition: svdogrp.cxx:451
int i
uno_Any a
abstract object (SdrObject)
Definition: svdobj.hxx:118
OUString sName
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdpage.cxx:1066
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1428
virtual SdrObjGroup * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdogrp.cxx:198
tools::Rectangle aOutRect
Definition: svdobj.hxx:921
void BroadcastObjectChange() const
Definition: svdobj.cxx:904
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
virtual const tools::Rectangle & GetSnapRect() const override
Definition: svdogrp.cxx:185
void MirrorPoint(Point &rPnt, const Point &rRef1, const Point &rRef2)
Definition: svdtrans.cxx:103
void NbcShearGluePoints(const Point &rRef, double tn, bool bVShear)
Definition: svdobj.cxx:2243
virtual void NbcRotate(const Point &rRef, long nAngle, double sn, double cs) override
Definition: svdogrp.cxx:417
long Bottom() const
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:272
virtual long GetShearAngle(bool bVertical=false) const override
Definition: svdogrp.cxx:318
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:333
virtual long GetShearAngle(bool bVertical=false) const
Definition: svdobj.cxx:1644
virtual ~SdrObjGroup() override
Definition: svdogrp.cxx:57
virtual SdrObjList * GetSubList() const override
Definition: svdogrp.cxx:169
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1466
virtual void SetLogicRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:517
Abstract DrawObject.
Definition: svdobj.hxx:312
void NbcRotateGluePoints(const Point &rRef, long nAngle, double sn, double cs)
Definition: svdobj.cxx:2223
virtual void Mirror(const Point &rRef1, const Point &rRef2) override
Definition: svdogrp.cxx:645
virtual SdrObject * getSdrObjectFromSdrObjList() const override
Definition: svdogrp.cxx:66
virtual void Mirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1521
OUString GetName() const
Definition: svdobj.cxx:697
Point aAnchor
Definition: svdobj.hxx:922
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
Definition: svdogrp.cxx:158
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:576
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
virtual SdrObjList * getChildrenOfSdrObject() const override
Definition: svdogrp.cxx:71
virtual OUString TakeObjNamePlural() const override
Definition: svdogrp.cxx:258
virtual void SetSnapRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:483
virtual void NbcReformatText() override
Definition: svdogrp.cxx:756
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
virtual void NbcShear(const Point &rRef, long nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1459
virtual const tools::Rectangle & GetLastBoundRect() const
Definition: svdobj.cxx:867
void RotatePoint(Point &rPnt, const Point &rRef, double sn, double cs)
Definition: svdtrans.hxx:114
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: svdogrp.cxx:44
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:353
sal_uInt32 count() const
Point aRefPoint
Definition: svdogrp.hxx:38
sal_Int32 GetDenominator() const
virtual void NbcSetRelativePos(const Point &rPnt) override
The relative position of a SdrObject is the distance of the upper left corner of the logic bounding r...
Definition: svdogrp.cxx:742
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdogrp.cxx:359
virtual void SetAnchorPos(const Point &rPnt) override
Definition: svdogrp.cxx:709
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdobj.cxx:1373
OUString aName
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdobj.cxx:1705
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true) override
Definition: svdogrp.cxx:560
virtual long GetRotateAngle() const
Definition: svdobj.cxx:1639
sal_Int32 GetNumerator() const
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
Definition: svdobj.hxx:114
long Left() const
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:434
virtual OUString TakeObjNameSingul() const override
Definition: svdogrp.cxx:231
virtual void Shear(const Point &rRef, long nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1530
virtual void NbcSetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1569
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:366
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: svdogrp.cxx:38
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdogrp.cxx:76
virtual const tools::Rectangle & GetCurrentBoundRect() const override
Definition: svdogrp.cxx:174
virtual void SetChanged()
Definition: svdobj.cxx:928
const tools::Rectangle & GetAllObjSnapRect() const
Definition: svdpage.cxx:687
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
Definition: svdobj.cxx:2648
virtual void Move(const Size &rSiz) override
Definition: svdogrp.cxx:523
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:593
virtual SdrPage * getSdrPageFromSdrObjList() const override
Definition: svdogrp.cxx:61