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