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 
124 
126 {
127  // avoid resetting aOutRect which in case of this object is model data,
128  // not re-creatable view data
129 }
130 
132 {
133  return sal_uInt16(OBJ_GRUP);
134 }
135 
136 
138 {
139  bool b1st = true;
141  const size_t nObjCount(GetObjCount());
142  for (size_t i=0; i<nObjCount; ++i) {
143  SdrLayerID nLay1(GetObj(i)->GetLayer());
144  if (b1st) { nLay=nLay1; b1st = false; }
145  else if (nLay1!=nLay) return SdrLayerID(0);
146  }
147  return nLay;
148 }
149 
151 {
152  SdrObject::NbcSetLayer(nLayer);
153  const size_t nObjCount(GetObjCount());
154  for (size_t i=0; i<nObjCount; ++i) {
155  GetObj(i)->NbcSetLayer(nLayer);
156  }
157 }
158 
160 {
161  // call parent
162  SdrObject::handlePageChange(pOldPage, pNewPage);
163 
164  for(size_t i(0); i < GetObjCount(); i++)
165  {
166  GetObj(i)->handlePageChange(pOldPage, pNewPage);
167  }
168 }
169 
171 {
172  return const_cast< SdrObjGroup* >(this);
173 }
174 
176 {
177  // <aOutRect> has to contain the bounding rectangle
178  if(0 != GetObjCount())
179  {
180  const_cast< SdrObjGroup* >(this)->aOutRect = GetAllObjBoundRect();
181  }
182 
183  return aOutRect;
184 }
185 
187 {
188  // <aOutRect> has to contain the bounding rectangle
189  if(0 != GetObjCount())
190  {
191  return GetAllObjSnapRect();
192  }
193  else
194  {
195  return aOutRect;
196  }
197 }
198 
200 {
201  return CloneHelper< SdrObjGroup >(rTargetModel);
202 }
203 
205 {
206  if( this == &rObj )
207  return *this;
208 
209  // copy SdrObject stuff
210  SdrObject::operator=(rObj);
211 
212  // copy child SdrObjects
213  if(nullptr != rObj.GetSubList())
214  {
215  // #i36404# Copy SubList, init model and page first
216  const SdrObjList& rSourceSubList(*rObj.GetSubList());
217 
218  CopyObjects(rSourceSubList);
219 
220  // tdf#116979: needed here, we need bSnapRectDirty to be true
221  // which it is after using SdrObject::operator= (see above),
222  // but set to false again using CopyObjects
223  SetRectsDirty();
224  }
225 
226  // copy local parameters
227  aRefPoint = rObj.aRefPoint;
228  return *this;
229 }
230 
231 
233 {
234  OUStringBuffer sName;
235 
236  if(0 == GetObjCount())
237  {
238  sName.append(SvxResId(STR_ObjNameSingulGRUPEMPTY));
239  }
240  else
241  {
242  sName.append(SvxResId(STR_ObjNameSingulGRUP));
243  }
244 
245  const OUString aName(GetName());
246 
247  if (!aName.isEmpty())
248  {
249  sName.append(' ');
250  sName.append('\'');
251  sName.append(aName);
252  sName.append('\'');
253  }
254 
255  return sName.makeStringAndClear();
256 }
257 
258 
260 {
261  if(0 == GetObjCount())
262  return SvxResId(STR_ObjNamePluralGRUPEMPTY);
263  return SvxResId(STR_ObjNamePluralGRUP);
264 }
265 
266 
268 {
269  // TODO: unnecessary, because we use the Rects from the SubList
270 }
271 
273 {
274  basegfx::B2DPolyPolygon aRetval;
275  const size_t nObjCount(GetObjCount());
276 
277  for(size_t a = 0; a < nObjCount; ++a)
278  {
279  SdrObject* pObj(GetObj(a));
280  aRetval.append(pObj->TakeXorPoly());
281  }
282 
283  if(!aRetval.count())
284  {
287  }
288 
289  return aRetval;
290 }
291 
293 {
294  return false;
295 }
296 
297 
299 {
300  return false;
301 }
302 
303 
305 {
306  long nRetval(0);
307 
308  if(0 != GetObjCount())
309  {
310  SdrObject* pObj(GetObj(0));
311 
312  nRetval = pObj->GetRotateAngle();
313  }
314 
315  return nRetval;
316 }
317 
318 
319 long SdrObjGroup::GetShearAngle(bool /*bVertical*/) const
320 {
321  long nRetval(0);
322 
323  if(0 != GetObjCount())
324  {
325  SdrObject* pObj(GetObj(0));
326 
327  nRetval = pObj->GetShearAngle();
328  }
329 
330  return nRetval;
331 }
332 
333 
335 {
337  long nMulX=rRect.Right()-rRect.Left();
338  long nDivX=aOld.Right()-aOld.Left();
339  long nMulY=rRect.Bottom()-rRect.Top();
340  long nDivY=aOld.Bottom()-aOld.Top();
341  if (nDivX==0) { nMulX=1; nDivX=1; }
342  if (nDivY==0) { nMulY=1; nDivY=1; }
343  if (nMulX!=nDivX || nMulY!=nDivY) {
344  Fraction aX(nMulX,nDivX);
345  Fraction aY(nMulY,nDivY);
346  NbcResize(aOld.TopLeft(),aX,aY);
347  }
348  if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) {
349  NbcMove(Size(rRect.Left()-aOld.Left(),rRect.Top()-aOld.Top()));
350  }
351 }
352 
353 
355 {
356  NbcSetSnapRect(rRect);
357 }
358 
359 
360 void SdrObjGroup::NbcMove(const Size& rSiz)
361 {
362  aRefPoint.Move(rSiz);
363  const size_t nObjCount(GetObjCount());
364 
365  if(0 != nObjCount)
366  {
367  for (size_t i=0; i<nObjCount; ++i)
368  {
369  SdrObject* pObj(GetObj(i));
370  pObj->NbcMove(rSiz);
371  }
372  }
373  else
374  {
375  aOutRect.Move(rSiz);
376  SetRectsDirty();
377  }
378 }
379 
380 
381 void SdrObjGroup::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
382 {
383  bool bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
384  bool bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
385  if (bXMirr || bYMirr) {
386  Point aRef1(GetSnapRect().Center());
387  if (bXMirr) {
388  Point aRef2(aRef1);
389  aRef2.AdjustY( 1 );
390  NbcMirrorGluePoints(aRef1,aRef2);
391  }
392  if (bYMirr) {
393  Point aRef2(aRef1);
394  aRef2.AdjustX( 1 );
395  NbcMirrorGluePoints(aRef1,aRef2);
396  }
397  }
398 
399  ResizePoint(aRefPoint,rRef,xFact,yFact);
400 
401  const size_t nObjCount(GetObjCount());
402  if(0 != nObjCount)
403  {
404  for (size_t i=0; i<nObjCount; ++i)
405  {
406  SdrObject* pObj(GetObj(i));
407  pObj->NbcResize(rRef,xFact,yFact);
408  }
409  }
410  else
411  {
412  ResizeRect(aOutRect,rRef,xFact,yFact);
413  SetRectsDirty();
414  }
415 }
416 
417 
418 void SdrObjGroup::NbcRotate(const Point& rRef, long nAngle, double sn, double cs)
419 {
420  SetGlueReallyAbsolute(true);
421  RotatePoint(aRefPoint,rRef,sn,cs);
422  const size_t nObjCount(GetObjCount());
423 
424  for (size_t i=0; i<nObjCount; ++i)
425  {
426  SdrObject* pObj(GetObj(i));
427  pObj->NbcRotate(rRef,nAngle,sn,cs);
428  }
429 
430  NbcRotateGluePoints(rRef,nAngle,sn,cs);
431  SetGlueReallyAbsolute(false);
432 }
433 
434 
435 void SdrObjGroup::NbcMirror(const Point& rRef1, const Point& rRef2)
436 {
437  SetGlueReallyAbsolute(true);
438  MirrorPoint(aRefPoint,rRef1,rRef2); // implementation missing in SvdEtc!
439  const size_t nObjCount(GetObjCount());
440 
441  for (size_t i=0; i<nObjCount; ++i)
442  {
443  SdrObject* pObj(GetObj(i));
444  pObj->NbcMirror(rRef1,rRef2);
445  }
446 
447  NbcMirrorGluePoints(rRef1,rRef2);
448  SetGlueReallyAbsolute(false);
449 }
450 
451 
452 void SdrObjGroup::NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear)
453 {
454  SetGlueReallyAbsolute(true);
455  ShearPoint(aRefPoint,rRef,tn);
456  const size_t nObjCount(GetObjCount());
457 
458  for (size_t i=0; i<nObjCount; ++i)
459  {
460  SdrObject* pObj(GetObj(i));
461  pObj->NbcShear(rRef,nAngle,tn,bVShear);
462  }
463 
464  NbcShearGluePoints(rRef,tn,bVShear);
465  SetGlueReallyAbsolute(false);
466 }
467 
468 
469 void SdrObjGroup::NbcSetAnchorPos(const Point& rPnt)
470 {
471  aAnchor=rPnt;
472  Size aSiz(rPnt.X()-aAnchor.X(),rPnt.Y()-aAnchor.Y());
473  aRefPoint.Move(aSiz);
474  const size_t nObjCount(GetObjCount());
475 
476  for (size_t i=0; i<nObjCount; ++i)
477  {
478  SdrObject* pObj(GetObj(i));
479  pObj->NbcSetAnchorPos(rPnt);
480  }
481 }
482 
483 
485 {
486  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
488  if (aOld.IsEmpty())
489  {
490  Fraction aX(1,1);
491  Fraction aY(1,1);
492  Resize(aOld.TopLeft(),aX,aY);
493  }
494  else
495  {
496  long nMulX=rRect.Right()-rRect.Left();
497  long nDivX=aOld.Right()-aOld.Left();
498  long nMulY=rRect.Bottom()-rRect.Top();
499  long nDivY=aOld.Bottom()-aOld.Top();
500  if (nDivX==0) { nMulX=1; nDivX=1; }
501  if (nDivY==0) { nMulY=1; nDivY=1; }
502  if (nMulX!=nDivX || nMulY!=nDivY) {
503  Fraction aX(nMulX,nDivX);
504  Fraction aY(nMulY,nDivY);
505  Resize(aOld.TopLeft(),aX,aY);
506  }
507  }
508  if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) {
509  Move(Size(rRect.Left()-aOld.Left(),rRect.Top()-aOld.Top()));
510  }
511 
512  SetChanged();
515 }
516 
517 
519 {
520  SetSnapRect(rRect);
521 }
522 
523 
524 void SdrObjGroup::Move(const Size& rSiz)
525 {
526  if (rSiz.Width()!=0 || rSiz.Height()!=0) {
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 
561 void SdrObjGroup::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative)
562 {
563  if (xFact.GetNumerator()!=xFact.GetDenominator() || yFact.GetNumerator()!=yFact.GetDenominator()) {
564  bool bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
565  bool bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
566  if (bXMirr || bYMirr) {
567  Point aRef1(GetSnapRect().Center());
568  if (bXMirr) {
569  Point aRef2(aRef1);
570  aRef2.AdjustY( 1 );
571  NbcMirrorGluePoints(aRef1,aRef2);
572  }
573  if (bYMirr) {
574  Point aRef2(aRef1);
575  aRef2.AdjustX( 1 );
576  NbcMirrorGluePoints(aRef1,aRef2);
577  }
578  }
579  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
580  ResizePoint(aRefPoint,rRef,xFact,yFact);
581  const size_t nObjCount(GetObjCount());
582 
583  if(0 != nObjCount)
584  {
585  // move the connectors first, everything else afterwards
586  for (size_t i=0; i<nObjCount; ++i)
587  {
588  SdrObject* pObj(GetObj(i));
589  if (pObj->IsEdgeObj())
590  pObj->Resize(rRef,xFact,yFact,bUnsetRelative);
591  }
592 
593  for (size_t i=0; i<nObjCount; ++i)
594  {
595  SdrObject* pObj(GetObj(i));
596  if (!pObj->IsEdgeObj())
597  pObj->Resize(rRef,xFact,yFact,bUnsetRelative);
598  }
599  }
600  else
601  {
602  ResizeRect(aOutRect,rRef,xFact,yFact);
603  SetRectsDirty();
604  }
605 
606  SetChanged();
609  }
610 }
611 
612 
613 void SdrObjGroup::Rotate(const Point& rRef, long nAngle, double sn, double cs)
614 {
615  if (nAngle==0)
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, long nAngle, double tn, bool bVShear)
677 {
678  if (nAngle==0)
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:469
Point TopLeft() const
long Width() const
virtual bool BegCreate(SdrDragStat &rStat) override
Every object must be able to create itself interactively.
Definition: svdogrp.cxx:298
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1067
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
Definition: svdobj.cxx:563
virtual void Shear(const Point &rRef, long nAngle, double tn, bool bVShear) override
Definition: svdogrp.cxx:676
void NbcReformatAllTextObjects()
reformat all text objects, e.g. when changing printer
Definition: svdpage.cxx:703
virtual SdrLayerID GetLayer() const override
Definition: svdogrp.cxx:137
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:1484
void ShearPoint(Point &rPnt, const Point &rRef, double tn, bool bVShear=false)
Definition: svdtrans.hxx:122
SdrObjGroup & operator=(const SdrObjGroup &rObj)
Definition: svdogrp.cxx:204
struct _xmlTextWriter * xmlTextWriterPtr
SdrObjUserCall * pUserCall
Definition: svdobj.hxx:924
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: svdogrp.cxx:272
virtual void SetBoundRectDirty() override
Definition: svdogrp.cxx:125
virtual long GetRotateAngle() const override
Definition: svdogrp.cxx:304
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:267
const tools::Rectangle & GetAllObjBoundRect() const
Definition: svdpage.cxx:688
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdobj.cxx:1380
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:613
bool IsEdgeObj() const
Definition: svdobj.hxx:795
virtual void NbcSetLayer(SdrLayerID nLayer) override
Definition: svdogrp.cxx:150
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const
Definition: svdobj.cxx:2530
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:2219
void CopyObjects(const SdrObjList &rSrcList)
Definition: svdpage.cxx:143
void NbcMirrorGluePoints(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:2239
Center
virtual void Rotate(const Point &rRef, long nAngle, double sn, double cs)
Definition: svdobj.cxx:1511
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
Definition: svdogrp.cxx:435
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:131
long Right() const
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
Definition: svdogrp.cxx:292
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:263
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
virtual void SetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1577
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdogrp.cxx:381
bool bClosedObj
Definition: svdobj.hxx:942
long Top() const
SdrObjGroup(SdrModel &rSdrModel)
Definition: svdogrp.cxx:50
virtual void NbcRotate(const Point &rRef, long nAngle, double sn, double cs)
Definition: svdobj.cxx:1401
o3tl::strong_int< sal_uInt8, struct SdrLayerIDTag > SdrLayerID
Definition: svdtypes.hxx:59
virtual void SetRelativePos(const Point &rPnt) override
Definition: svdogrp.cxx:750
SdrObject & operator=(const SdrObject &rObj)
Definition: svdobj.cxx:979
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 NbcShear(const Point &rRef, long nAngle, double tn, bool bVShear) override
Definition: svdogrp.cxx:452
int i
uno_Any a
abstract object (SdrObject)
Definition: svdobj.hxx:118
OUString sName
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdpage.cxx:1049
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1429
virtual SdrObjGroup * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdogrp.cxx:199
tools::Rectangle aOutRect
Definition: svdobj.hxx:922
void BroadcastObjectChange() const
Definition: svdobj.cxx:905
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
virtual const tools::Rectangle & GetSnapRect() const override
Definition: svdogrp.cxx:186
void MirrorPoint(Point &rPnt, const Point &rRef1, const Point &rRef2)
Definition: svdtrans.cxx:104
void NbcShearGluePoints(const Point &rRef, double tn, bool bVShear)
Definition: svdobj.cxx:2249
virtual void NbcRotate(const Point &rRef, long nAngle, double sn, double cs) override
Definition: svdogrp.cxx:418
long Bottom() const
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:273
virtual long GetShearAngle(bool bVertical=false) const override
Definition: svdogrp.cxx:319
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:334
virtual long GetShearAngle(bool bVertical=false) const
Definition: svdobj.cxx:1645
virtual ~SdrObjGroup() override
Definition: svdogrp.cxx:58
virtual SdrObjList * GetSubList() const override
Definition: svdogrp.cxx:170
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1467
virtual void SetLogicRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:518
Abstract DrawObject.
Definition: svdobj.hxx:312
void NbcRotateGluePoints(const Point &rRef, long nAngle, double sn, double cs)
Definition: svdobj.cxx:2229
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:1522
OUString GetName() const
Definition: svdobj.cxx:698
Point aAnchor
Definition: svdobj.hxx:923
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
Definition: svdogrp.cxx:159
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:577
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
virtual SdrObjList * getChildrenOfSdrObject() const override
Definition: svdogrp.cxx:72
virtual OUString TakeObjNamePlural() const override
Definition: svdogrp.cxx:259
virtual void SetSnapRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:484
virtual void NbcReformatText() override
Definition: svdogrp.cxx:757
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
virtual void NbcShear(const Point &rRef, long nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1460
virtual const tools::Rectangle & GetLastBoundRect() const
Definition: svdobj.cxx:868
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:45
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:354
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:743
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdogrp.cxx:360
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:1374
OUString aName
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdobj.cxx:1706
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true) override
Definition: svdogrp.cxx:561
virtual long GetRotateAngle() const
Definition: svdobj.cxx:1640
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:435
virtual OUString TakeObjNameSingul() const override
Definition: svdogrp.cxx:232
virtual void Shear(const Point &rRef, long nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1531
virtual void NbcSetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1570
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:175
virtual void SetChanged()
Definition: svdobj.cxx:929
const tools::Rectangle & GetAllObjSnapRect() const
Definition: svdpage.cxx:679
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
Definition: svdobj.cxx:2654
virtual void Move(const Size &rSiz) override
Definition: svdogrp.cxx:524
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:594
virtual SdrPage * getSdrPageFromSdrObjList() const override
Definition: svdogrp.cxx:62