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 
58 SdrObjGroup::SdrObjGroup(SdrModel& rSdrModel, SdrObjGroup const & rSource)
59 : SdrObject(rSdrModel, rSource),
60  SdrObjList()
61 {
62  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  aRefPoint = rSource.aRefPoint;
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 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 aOutRect;
218  }
219 }
220 
222 {
223  return new SdrObjGroup(rTargetModel, *this);
224 }
225 
227 {
228  OUStringBuffer sName;
229 
230  if(0 == GetObjCount())
231  {
232  sName.append(SvxResId(STR_ObjNameSingulGRUPEMPTY));
233  }
234  else
235  {
236  sName.append(SvxResId(STR_ObjNameSingulGRUP));
237  }
238 
239  const OUString aName(GetName());
240 
241  if (!aName.isEmpty())
242  {
243  sName.append(' ');
244  sName.append('\'');
245  sName.append(aName);
246  sName.append('\'');
247  }
248 
249  return sName.makeStringAndClear();
250 }
251 
252 
254 {
255  if(0 == GetObjCount())
256  return SvxResId(STR_ObjNamePluralGRUPEMPTY);
257  return SvxResId(STR_ObjNamePluralGRUP);
258 }
259 
260 
262 {
263  // TODO: unnecessary, because we use the Rects from the SubList
264 }
265 
267 {
268  basegfx::B2DPolyPolygon aRetval;
269  const size_t nObjCount(GetObjCount());
270 
271  for(size_t a = 0; a < nObjCount; ++a)
272  {
273  SdrObject* pObj(GetObj(a));
274  aRetval.append(pObj->TakeXorPoly());
275  }
276 
277  if(!aRetval.count())
278  {
281  }
282 
283  return aRetval;
284 }
285 
287 {
288  return false;
289 }
290 
291 
293 {
294  return false;
295 }
296 
297 
299 {
300  Degree100 nRetval(0);
301 
302  if(0 != GetObjCount())
303  {
304  SdrObject* pObj(GetObj(0));
305 
306  nRetval = pObj->GetRotateAngle();
307  }
308 
309  return nRetval;
310 }
311 
312 
313 Degree100 SdrObjGroup::GetShearAngle(bool /*bVertical*/) const
314 {
315  Degree100 nRetval(0);
316 
317  if(0 != GetObjCount())
318  {
319  SdrObject* pObj(GetObj(0));
320 
321  nRetval = pObj->GetShearAngle();
322  }
323 
324  return nRetval;
325 }
326 
327 
329 {
331  tools::Long nMulX=rRect.Right()-rRect.Left();
332  tools::Long nDivX=aOld.Right()-aOld.Left();
333  tools::Long nMulY=rRect.Bottom()-rRect.Top();
334  tools::Long nDivY=aOld.Bottom()-aOld.Top();
335  if (nDivX==0) { nMulX=1; nDivX=1; }
336  if (nDivY==0) { nMulY=1; nDivY=1; }
337  if (nMulX!=nDivX || nMulY!=nDivY) {
338  Fraction aX(nMulX,nDivX);
339  Fraction aY(nMulY,nDivY);
340  NbcResize(aOld.TopLeft(),aX,aY);
341  }
342  if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) {
343  NbcMove(Size(rRect.Left()-aOld.Left(),rRect.Top()-aOld.Top()));
344  }
345 }
346 
347 
349 {
350  NbcSetSnapRect(rRect);
351 }
352 
353 
354 void SdrObjGroup::NbcMove(const Size& rSiz)
355 {
356  aRefPoint.Move(rSiz);
357  const size_t nObjCount(GetObjCount());
358 
359  if(0 != nObjCount)
360  {
361  for (size_t i=0; i<nObjCount; ++i)
362  {
363  SdrObject* pObj(GetObj(i));
364  pObj->NbcMove(rSiz);
365  }
366  }
367  else
368  {
369  aOutRect.Move(rSiz);
370  SetRectsDirty();
371  }
372 }
373 
374 
375 void SdrObjGroup::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
376 {
377  bool bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
378  bool bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
379  if (bXMirr || bYMirr) {
380  Point aRef1(GetSnapRect().Center());
381  if (bXMirr) {
382  Point aRef2(aRef1);
383  aRef2.AdjustY( 1 );
384  NbcMirrorGluePoints(aRef1,aRef2);
385  }
386  if (bYMirr) {
387  Point aRef2(aRef1);
388  aRef2.AdjustX( 1 );
389  NbcMirrorGluePoints(aRef1,aRef2);
390  }
391  }
392 
393  ResizePoint(aRefPoint,rRef,xFact,yFact);
394 
395  const size_t nObjCount(GetObjCount());
396  if(0 != nObjCount)
397  {
398  for (size_t i=0; i<nObjCount; ++i)
399  {
400  SdrObject* pObj(GetObj(i));
401  pObj->NbcResize(rRef,xFact,yFact);
402  }
403  }
404  else
405  {
406  ResizeRect(aOutRect,rRef,xFact,yFact);
407  SetRectsDirty();
408  }
409 }
410 
411 
412 void SdrObjGroup::NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
413 {
414  SetGlueReallyAbsolute(true);
415  RotatePoint(aRefPoint,rRef,sn,cs);
416  const size_t nObjCount(GetObjCount());
417 
418  for (size_t i=0; i<nObjCount; ++i)
419  {
420  SdrObject* pObj(GetObj(i));
421  pObj->NbcRotate(rRef,nAngle,sn,cs);
422  }
423 
424  NbcRotateGluePoints(rRef,nAngle,sn,cs);
425  SetGlueReallyAbsolute(false);
426 }
427 
428 
429 void SdrObjGroup::NbcMirror(const Point& rRef1, const Point& rRef2)
430 {
431  SetGlueReallyAbsolute(true);
432  MirrorPoint(aRefPoint,rRef1,rRef2); // implementation missing in SvdEtc!
433  const size_t nObjCount(GetObjCount());
434 
435  for (size_t i=0; i<nObjCount; ++i)
436  {
437  SdrObject* pObj(GetObj(i));
438  pObj->NbcMirror(rRef1,rRef2);
439  }
440 
441  NbcMirrorGluePoints(rRef1,rRef2);
442  SetGlueReallyAbsolute(false);
443 }
444 
445 
446 void SdrObjGroup::NbcShear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear)
447 {
448  SetGlueReallyAbsolute(true);
449  ShearPoint(aRefPoint,rRef,tn);
450  const size_t nObjCount(GetObjCount());
451 
452  for (size_t i=0; i<nObjCount; ++i)
453  {
454  SdrObject* pObj(GetObj(i));
455  pObj->NbcShear(rRef,nAngle,tn,bVShear);
456  }
457 
458  NbcShearGluePoints(rRef,tn,bVShear);
459  SetGlueReallyAbsolute(false);
460 }
461 
462 
463 void SdrObjGroup::NbcSetAnchorPos(const Point& rPnt)
464 {
465  aAnchor=rPnt;
466  Size aSiz(rPnt.X()-aAnchor.X(),rPnt.Y()-aAnchor.Y());
467  aRefPoint.Move(aSiz);
468  const size_t nObjCount(GetObjCount());
469 
470  for (size_t i=0; i<nObjCount; ++i)
471  {
472  SdrObject* pObj(GetObj(i));
473  pObj->NbcSetAnchorPos(rPnt);
474  }
475 }
476 
477 
479 {
480  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
482  if (aOld.IsEmpty())
483  {
484  Fraction aX(1,1);
485  Fraction aY(1,1);
486  Resize(aOld.TopLeft(),aX,aY);
487  }
488  else
489  {
490  tools::Long nMulX=rRect.Right()-rRect.Left();
491  tools::Long nDivX=aOld.Right()-aOld.Left();
492  tools::Long nMulY=rRect.Bottom()-rRect.Top();
493  tools::Long nDivY=aOld.Bottom()-aOld.Top();
494  if (nDivX==0) { nMulX=1; nDivX=1; }
495  if (nDivY==0) { nMulY=1; nDivY=1; }
496  if (nMulX!=nDivX || nMulY!=nDivY) {
497  Fraction aX(nMulX,nDivX);
498  Fraction aY(nMulY,nDivY);
499  Resize(aOld.TopLeft(),aX,aY);
500  }
501  }
502  if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) {
503  Move(Size(rRect.Left()-aOld.Left(),rRect.Top()-aOld.Top()));
504  }
505 
506  SetChanged();
509 }
510 
511 
513 {
514  SetSnapRect(rRect);
515 }
516 
517 
518 void SdrObjGroup::Move(const Size& rSiz)
519 {
520  if (rSiz.Width()==0 && rSiz.Height()==0)
521  return;
522 
523  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
524  aRefPoint.Move(rSiz);
525  const size_t nObjCount(GetObjCount());
526 
527  if(0 != nObjCount)
528  {
529  // first move the connectors, then everything else
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  for (size_t i=0; i<nObjCount; ++i)
538  {
539  SdrObject* pObj(GetObj(i));
540  if (!pObj->IsEdgeObj())
541  pObj->Move(rSiz);
542  }
543  }
544  else
545  {
546  aOutRect.Move(rSiz);
547  SetRectsDirty();
548  }
549 
550  SetChanged();
553 }
554 
555 
556 void SdrObjGroup::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative)
557 {
558  if (xFact.GetNumerator()==xFact.GetDenominator() && yFact.GetNumerator()==yFact.GetDenominator())
559  return;
560 
561  bool bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
562  bool bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
563  if (bXMirr || bYMirr) {
564  Point aRef1(GetSnapRect().Center());
565  if (bXMirr) {
566  Point aRef2(aRef1);
567  aRef2.AdjustY( 1 );
568  NbcMirrorGluePoints(aRef1,aRef2);
569  }
570  if (bYMirr) {
571  Point aRef2(aRef1);
572  aRef2.AdjustX( 1 );
573  NbcMirrorGluePoints(aRef1,aRef2);
574  }
575  }
576  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
577  ResizePoint(aRefPoint,rRef,xFact,yFact);
578  const size_t nObjCount(GetObjCount());
579 
580  if(0 != nObjCount)
581  {
582  // move the connectors first, everything else afterwards
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  for (size_t i=0; i<nObjCount; ++i)
591  {
592  SdrObject* pObj(GetObj(i));
593  if (!pObj->IsEdgeObj())
594  pObj->Resize(rRef,xFact,yFact,bUnsetRelative);
595  }
596  }
597  else
598  {
599  ResizeRect(aOutRect,rRef,xFact,yFact);
600  SetRectsDirty();
601  }
602 
603  SetChanged();
606 }
607 
608 
609 void SdrObjGroup::Rotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
610 {
611  if (nAngle==0_deg100)
612  return;
613 
614  SetGlueReallyAbsolute(true);
615  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
616  RotatePoint(aRefPoint,rRef,sn,cs);
617  // move the connectors first, everything else afterwards
618  const size_t nObjCount(GetObjCount());
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  for (size_t i=0; i<nObjCount; ++i)
628  {
629  SdrObject* pObj(GetObj(i));
630  if (!pObj->IsEdgeObj())
631  pObj->Rotate(rRef,nAngle,sn,cs);
632  }
633 
634  NbcRotateGluePoints(rRef,nAngle,sn,cs);
635  SetGlueReallyAbsolute(false);
636  SetChanged();
639 }
640 
641 
642 void SdrObjGroup::Mirror(const Point& rRef1, const Point& rRef2)
643 {
644  SetGlueReallyAbsolute(true);
645  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
646  MirrorPoint(aRefPoint,rRef1,rRef2); // implementation missing in SvdEtc!
647  // move the connectors first, everything else afterwards
648  const size_t nObjCount(GetObjCount());
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  for (size_t i=0; i<nObjCount; ++i)
658  {
659  SdrObject* pObj(GetObj(i));
660  if (!pObj->IsEdgeObj())
661  pObj->Mirror(rRef1,rRef2);
662  }
663 
664  NbcMirrorGluePoints(rRef1,rRef2);
665  SetGlueReallyAbsolute(false);
666  SetChanged();
669 }
670 
671 
672 void SdrObjGroup::Shear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear)
673 {
674  if (nAngle==0_deg100)
675  return;
676 
677  SetGlueReallyAbsolute(true);
678  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
679  ShearPoint(aRefPoint,rRef,tn);
680  // move the connectors first, everything else afterwards
681  const size_t nObjCount(GetObjCount());
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  for (size_t i=0; i<nObjCount; ++i)
691  {
692  SdrObject* pObj(GetObj(i));
693  if (!pObj->IsEdgeObj())
694  pObj->Shear(rRef,nAngle,tn,bVShear);
695  }
696 
697  NbcShearGluePoints(rRef,tn,bVShear);
698  SetGlueReallyAbsolute(false);
699  SetChanged();
702 
703 }
704 
705 
706 void SdrObjGroup::SetAnchorPos(const Point& rPnt)
707 {
708  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
709  bool bChg=aAnchor!=rPnt;
710  aAnchor=rPnt;
711  Size aSiz(rPnt.X()-aAnchor.X(),rPnt.Y()-aAnchor.Y());
712  aRefPoint.Move(aSiz);
713  // move the connectors first, everything else afterwards
714  const size_t nObjCount(GetObjCount());
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  for (size_t i=0; i<nObjCount; ++i)
724  {
725  SdrObject* pObj(GetObj(i));
726  if (!pObj->IsEdgeObj())
727  pObj->SetAnchorPos(rPnt);
728  }
729 
730  if (bChg)
731  {
732  SetChanged();
735  }
736 }
737 
738 
739 void SdrObjGroup::NbcSetRelativePos(const Point& rPnt)
740 {
741  Point aRelPos0(GetSnapRect().TopLeft()-aAnchor);
742  Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
743  NbcMove(aSiz); // this also calls SetRectsDirty()
744 }
745 
746 void SdrObjGroup::SetRelativePos(const Point& rPnt)
747 {
748  Point aRelPos0(GetSnapRect().TopLeft()-aAnchor);
749  Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
750  if (aSiz.Width()!=0 || aSiz.Height()!=0) Move(aSiz); // this also calls SetRectsDirty() and Broadcast, ...
751 }
752 
754 {
756 }
757 
758 SdrObjectUniquePtr SdrObjGroup::DoConvertToPolyObj(bool bBezier, bool bAddText) const
759 {
761  const size_t nObjCount(GetObjCount());
762 
763  for(size_t a=0; a < nObjCount; ++a)
764  {
765  SdrObject* pIterObj(GetObj(a));
766  SdrObjectUniquePtr pResult(pIterObj->DoConvertToPolyObj(bBezier, bAddText));
767 
768  // pResult can be NULL e.g. for empty objects
769  if( pResult )
770  pGroup->GetSubList()->NbcInsertObject(pResult.release());
771  }
772 
773  return pGroup;
774 }
775 
777 {
778  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SdrObjGroup"));
779  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
780 
781  SdrObject::dumpAsXml(pWriter);
782  SdrObjList::dumpAsXml(pWriter);
783 
784  (void)xmlTextWriterEndElement(pWriter);
785 }
786 
787 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void NbcSetAnchorPos(const Point &rPnt) override
Definition: svdogrp.cxx:463
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1579
Point TopLeft() const
virtual bool BegCreate(SdrDragStat &rStat) override
Every object must be able to create itself interactively.
Definition: svdogrp.cxx:292
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1105
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
Definition: svdobj.cxx:637
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
Definition: svdogrp.cxx:446
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:758
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
Definition: svdobj.cxx:1531
void ShearPoint(Point &rPnt, const Point &rRef, double tn, bool bVShear=false)
Definition: svdtrans.hxx:123
struct _xmlTextWriter * xmlTextWriterPtr
SdrObjUserCall * pUserCall
Definition: svdobj.hxx:876
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: svdogrp.cxx:266
virtual void SetBoundRectDirty() override
Definition: svdogrp.cxx:148
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage)
Definition: svdobj.cxx:523
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: svdogrp.cxx:261
const tools::Rectangle & GetAllObjBoundRect() const
Definition: svdpage.cxx:700
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdobj.cxx:1418
void ResizePoint(Point &rPnt, const Point &rRef, const Fraction &xFract, const Fraction &yFract)
Definition: svdtrans.hxx:107
abstract object (SdrObject)
Definition: svdobjkind.hxx:27
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:1448
bool IsEdgeObj() const
Definition: svdobj.hxx:745
long Long
virtual void NbcSetLayer(SdrLayerID nLayer) override
Definition: svdogrp.cxx:172
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const
Definition: svdobj.cxx:2594
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1507
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:2283
void CopyObjects(const SdrObjList &rSrcList)
Definition: svdpage.cxx:138
void NbcMirrorGluePoints(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:2303
Center
SdrObjKind
Definition: svdobjkind.hxx:24
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
Definition: svdogrp.cxx:429
bool IsEmpty() const
Provides information about various ZObject properties.
Definition: svdobj.hxx:196
virtual Degree100 GetShearAngle(bool bVertical=false) const override
Definition: svdogrp.cxx:313
tools::Long Left() const
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
Definition: svdogrp.cxx:286
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:266
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:25
virtual void SetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1625
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdogrp.cxx:375
tools::Long Bottom() const
bool bClosedObj
Definition: svdobj.hxx:894
SdrObjGroup(SdrModel &rSdrModel)
Definition: svdogrp.cxx:50
o3tl::strong_int< sal_uInt8, struct SdrLayerIDTag > SdrLayerID
Definition: svdtypes.hxx:57
virtual void SetRelativePos(const Point &rPnt) override
Definition: svdogrp.cxx:746
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
Definition: svdogrp.cxx:672
virtual Degree100 GetRotateAngle() const override
Definition: svdogrp.cxx:298
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: svdogrp.cxx:776
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:412
int i
uno_Any a
OUString sName
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdpage.cxx:1060
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1476
virtual SdrObjGroup * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdogrp.cxx:221
tools::Rectangle aOutRect
Definition: svdobj.hxx:874
void BroadcastObjectChange() const
Definition: svdobj.cxx:982
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:1693
void MirrorPoint(Point &rPnt, const Point &rRef1, const Point &rRef2)
Definition: svdtrans.cxx:105
tools::Long Width() const
void NbcShearGluePoints(const Point &rRef, double tn, bool bVShear)
Definition: svdobj.cxx:2313
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:276
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:328
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:1514
virtual void SetLogicRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:512
tools::Long Top() const
Abstract DrawObject.
Definition: svdobj.hxx:260
virtual void Mirror(const Point &rRef1, const Point &rRef2) override
Definition: svdogrp.cxx:642
virtual SdrObject * getSdrObjectFromSdrObjList() const override
Definition: svdogrp.cxx:91
virtual void Mirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1570
OUString GetName() const
Definition: svdobj.cxx:775
Point aAnchor
Definition: svdobj.hxx:875
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
Definition: svdogrp.cxx:181
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:651
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
Definition: svdogrp.cxx:609
virtual SdrObjList * getChildrenOfSdrObject() const override
Definition: svdogrp.cxx:96
virtual OUString TakeObjNamePlural() const override
Definition: svdogrp.cxx:253
virtual void SetSnapRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:478
virtual void NbcReformatText() override
Definition: svdogrp.cxx:753
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
virtual const tools::Rectangle & GetLastBoundRect() const
Definition: svdobj.cxx:945
void RotatePoint(Point &rPnt, const Point &rRef, double sn, double cs)
Definition: svdtrans.hxx:115
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: svdogrp.cxx:45
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:348
sal_uInt32 count() const
Point aRefPoint
Definition: svdogrp.hxx:39
sal_Int32 GetDenominator() const
virtual void NbcSetRelativePos(const Point &rPnt) override
The relative position of a SdrObject is the distance of the upper left corner of the logic bounding r...
Definition: svdogrp.cxx:739
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdogrp.cxx:354
virtual void SetAnchorPos(const Point &rPnt) override
Definition: svdogrp.cxx:706
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdobj.cxx:1412
OUString aName
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdobj.cxx:1754
tools::Long Height() const
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true) override
Definition: svdogrp.cxx:556
sal_Int32 GetNumerator() const
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
Definition: svdobj.hxx:98
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:1559
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:509
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:1618
virtual Degree100 GetRotateAngle() const
Definition: svdobj.cxx:1688
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:1006
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:2718
virtual void Move(const Size &rSiz) override
Definition: svdogrp.cxx:518
virtual SdrObjKind GetObjIdentifier() const override
Definition: svdogrp.cxx:154
void NbcRotateGluePoints(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:2293
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:668
virtual SdrPage * getSdrPageFromSdrObjList() const override
Definition: svdogrp.cxx:86
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo