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