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