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