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
33#include <libxml/xmlwriter.h>
34#include <vcl/canvastools.hxx>
36
37const std::shared_ptr< svx::diagram::IDiagramHelper >& SdrObjGroup::getDiagramHelper() const
38{
39 return mp_DiagramHelper;
40}
41
42// BaseProperties section
43std::unique_ptr<sdr::properties::BaseProperties> SdrObjGroup::CreateObjectSpecificProperties()
44{
45 return std::make_unique<sdr::properties::GroupProperties>(*this);
46}
47
48// DrawContact section
49std::unique_ptr<sdr::contact::ViewContact> SdrObjGroup::CreateObjectSpecificViewContact()
50{
51 return std::make_unique<sdr::contact::ViewContactOfGroup>(*this);
52}
53
55: SdrObject(rSdrModel)
56, SdrObjList()
57, maRefPoint(0, 0)
58, mp_DiagramHelper()
59{
60 m_bClosedObj=false;
61}
62
63SdrObjGroup::SdrObjGroup(SdrModel& rSdrModel, SdrObjGroup const & rSource)
64: SdrObject(rSdrModel, rSource)
65, SdrObjList()
66, maRefPoint(0, 0)
67, mp_DiagramHelper()
68{
69 m_bClosedObj=false;
70
71 // copy child SdrObjects
72 if(nullptr != rSource.GetSubList())
73 {
74 // #i36404# Copy SubList, init model and page first
75 const SdrObjList& rSourceSubList(*rSource.GetSubList());
76
77 CopyObjects(rSourceSubList);
78
79 // tdf#116979: needed here, we need bSnapRectDirty to be true
80 // which it is after using SdrObject::operator= (see above),
81 // but set to false again using CopyObjects
83 }
84
85 // copy local parameters
86 maRefPoint = rSource.maRefPoint;
87}
88
90{
91 // only for diagram, so do nothing for just groups
92 if(!isDiagram())
93 return;
94
96}
97
99{
100}
101
103{
105}
106
108{
109 return const_cast< SdrObjGroup* >(this);
110}
111
113{
114 return const_cast< SdrObjGroup* >(this);
115}
116
118{
119 rInfo.bNoContortion=false;
120 const size_t nObjCount(GetObjCount());
121 for (size_t i=0; i<nObjCount; ++i) {
122 SdrObject* pObj(GetObj(i));
124 pObj->TakeObjInfo(aInfo);
125 if (!aInfo.bMoveAllowed ) rInfo.bMoveAllowed =false;
126 if (!aInfo.bResizeFreeAllowed ) rInfo.bResizeFreeAllowed =false;
127 if (!aInfo.bResizePropAllowed ) rInfo.bResizePropAllowed =false;
128 if (!aInfo.bRotateFreeAllowed ) rInfo.bRotateFreeAllowed =false;
129 if (!aInfo.bRotate90Allowed ) rInfo.bRotate90Allowed =false;
130 if (!aInfo.bMirrorFreeAllowed ) rInfo.bMirrorFreeAllowed =false;
131 if (!aInfo.bMirror45Allowed ) rInfo.bMirror45Allowed =false;
132 if (!aInfo.bMirror90Allowed ) rInfo.bMirror90Allowed =false;
133 if (!aInfo.bShearAllowed ) rInfo.bShearAllowed =false;
134 if (!aInfo.bEdgeRadiusAllowed ) rInfo.bEdgeRadiusAllowed =false;
135 if (!aInfo.bNoOrthoDesired ) rInfo.bNoOrthoDesired =false;
136 if (aInfo.bNoContortion ) rInfo.bNoContortion =true;
137 if (!aInfo.bCanConvToPath ) rInfo.bCanConvToPath =false;
138
139 if(!aInfo.bCanConvToContour)
140 rInfo.bCanConvToContour = false;
141
142 if (!aInfo.bCanConvToPoly ) rInfo.bCanConvToPoly =false;
145 }
146 if (nObjCount==0) {
147 rInfo.bRotateFreeAllowed=false;
148 rInfo.bRotate90Allowed =false;
149 rInfo.bMirrorFreeAllowed=false;
150 rInfo.bMirror45Allowed =false;
151 rInfo.bMirror90Allowed =false;
152 rInfo.bTransparenceAllowed = false;
153 rInfo.bShearAllowed =false;
154 rInfo.bEdgeRadiusAllowed=false;
155 rInfo.bNoContortion =true;
156 }
157 if(nObjCount != 1)
158 {
159 // only allowed if single object selected
160 rInfo.bTransparenceAllowed = false;
161 }
162}
163
165{
166 // avoid resetting aOutRect which in case of this object is model data,
167 // not re-creatable view data
168}
169
171{
172 return SdrObjKind::Group;
173}
174
176{
177 bool b1st = true;
179 const size_t nObjCount(GetObjCount());
180 for (size_t i=0; i<nObjCount; ++i) {
181 SdrLayerID nLay1(GetObj(i)->GetLayer());
182 if (b1st) { nLay=nLay1; b1st = false; }
183 else if (nLay1!=nLay) return SdrLayerID(0);
184 }
185 return nLay;
186}
187
189{
191 const size_t nObjCount(GetObjCount());
192 for (size_t i=0; i<nObjCount; ++i) {
193 GetObj(i)->NbcSetLayer(nLayer);
194 }
195}
196
198{
199 // call parent
200 SdrObject::handlePageChange(pOldPage, pNewPage);
201
202 for(size_t i(0); i < GetObjCount(); i++)
203 {
204 GetObj(i)->handlePageChange(pOldPage, pNewPage);
205 }
206}
207
209{
210 return const_cast< SdrObjGroup* >(this);
211}
212
213static bool containsOOXData(const css::uno::Any& rVal)
214{
215 const css::uno::Sequence<css::beans::PropertyValue>& propList(rVal.get< css::uno::Sequence<css::beans::PropertyValue> >());
216 for (const auto& rProp : std::as_const(propList))
217 {
218 if(rProp.Name.startsWith("OOX"))
219 {
220 return true;
221 }
222 }
223
224 return false;
225}
226
227void SdrObjGroup::SetGrabBagItem(const css::uno::Any& rVal)
228{
229 // detect if the intention is to disable Diagram functionality
230 if(isDiagram() && !containsOOXData(rVal))
231 {
232 css::uno::Any aOld;
233 GetGrabBagItem(aOld);
234
235 if(containsOOXData(aOld))
236 {
237 mp_DiagramHelper.reset();
238 }
239 }
240
241 // call parent
243}
244
246{
247 // <aOutRect> has to contain the bounding rectangle
248 if(0 != GetObjCount())
249 {
251 }
252
253 return m_aOutRect;
254}
255
257{
258 // <aOutRect> has to contain the bounding rectangle
259 if(0 != GetObjCount())
260 {
261 return GetAllObjSnapRect();
262 }
263 else
264 {
265 return m_aOutRect;
266 }
267}
268
270{
271 return new SdrObjGroup(rTargetModel, *this);
272}
273
275{
276 OUString sName;
277
278 if(0 == GetObjCount())
279 {
280 sName = SvxResId(STR_ObjNameSingulGRUPEMPTY);
281 }
282 else
283 {
284 if(isDiagram())
285 sName = SvxResId(STR_ObjNameSingulDIAGRAM);
286 else
287 sName = SvxResId(STR_ObjNameSingulGRUP);
288 }
289
290 const OUString aName(GetName());
291
292 if (!aName.isEmpty())
293 sName += " '" + aName + "'";
294
295 return sName;
296}
297
298
300{
301 if(0 == GetObjCount())
302 return SvxResId(STR_ObjNamePluralGRUPEMPTY);
303 if(isDiagram())
304 return SvxResId(RID_GALLERYSTR_THEME_DIAGRAMS);
305 return SvxResId(STR_ObjNamePluralGRUP);
306}
307
308
310{
311 // TODO: unnecessary, because we use the Rects from the SubList
312}
313
315{
317 const size_t nObjCount(GetObjCount());
318
319 for(size_t a = 0; a < nObjCount; ++a)
320 {
321 SdrObject* pObj(GetObj(a));
322 aRetval.append(pObj->TakeXorPoly());
323 }
324
325 if(!aRetval.count())
326 {
329 }
330
331 return aRetval;
332}
333
335{
336 return false;
337}
338
339
341{
342 return false;
343}
344
345
347{
348 Degree100 nRetval(0);
349
350 if(0 != GetObjCount())
351 {
352 SdrObject* pObj(GetObj(0));
353
354 nRetval = pObj->GetRotateAngle();
355 }
356
357 return nRetval;
358}
359
360
361Degree100 SdrObjGroup::GetShearAngle(bool /*bVertical*/) const
362{
363 Degree100 nRetval(0);
364
365 if(0 != GetObjCount())
366 {
367 SdrObject* pObj(GetObj(0));
368
369 nRetval = pObj->GetShearAngle();
370 }
371
372 return nRetval;
373}
374
375
377{
379 tools::Long nMulX=rRect.Right()-rRect.Left();
380 tools::Long nDivX=aOld.Right()-aOld.Left();
381 tools::Long nMulY=rRect.Bottom()-rRect.Top();
382 tools::Long nDivY=aOld.Bottom()-aOld.Top();
383 if (nDivX==0) { nMulX=1; nDivX=1; }
384 if (nDivY==0) { nMulY=1; nDivY=1; }
385 if (nMulX!=nDivX || nMulY!=nDivY) {
386 Fraction aX(nMulX,nDivX);
387 Fraction aY(nMulY,nDivY);
388 NbcResize(aOld.TopLeft(),aX,aY);
389 }
390 if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) {
391 NbcMove(Size(rRect.Left()-aOld.Left(),rRect.Top()-aOld.Top()));
392 }
393}
394
395
397{
398 NbcSetSnapRect(rRect);
399}
400
401
402void SdrObjGroup::NbcMove(const Size& rSize)
403{
404 maRefPoint.Move(rSize);
405 const size_t nObjCount(GetObjCount());
406
407 if(0 != nObjCount)
408 {
409 for (size_t i=0; i<nObjCount; ++i)
410 {
411 SdrObject* pObj(GetObj(i));
412 pObj->NbcMove(rSize);
413 }
414 }
415 else
416 {
417 moveOutRectangle(rSize.Width(), rSize.Height());
419 }
420}
421
422
423void SdrObjGroup::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
424{
425 bool bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
426 bool bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
427 if (bXMirr || bYMirr) {
428 Point aRef1(GetSnapRect().Center());
429 if (bXMirr) {
430 Point aRef2(aRef1);
431 aRef2.AdjustY( 1 );
432 NbcMirrorGluePoints(aRef1,aRef2);
433 }
434 if (bYMirr) {
435 Point aRef2(aRef1);
436 aRef2.AdjustX( 1 );
437 NbcMirrorGluePoints(aRef1,aRef2);
438 }
439 }
440
441 ResizePoint(maRefPoint, rRef, xFact, yFact);
442
443 const size_t nObjCount(GetObjCount());
444 if(0 != nObjCount)
445 {
446 for (size_t i=0; i<nObjCount; ++i)
447 {
448 SdrObject* pObj(GetObj(i));
449 pObj->NbcResize(rRef,xFact,yFact);
450 }
451 }
452 else
453 {
454 auto aRectangle = getOutRectangle();
455 ResizeRect(aRectangle, rRef, xFact, yFact);
456 setOutRectangle(aRectangle);
457
459 }
460}
461
462
463void SdrObjGroup::NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
464{
466 RotatePoint(maRefPoint, rRef, sn, cs);
467 const size_t nObjCount(GetObjCount());
468
469 for (size_t i=0; i<nObjCount; ++i)
470 {
471 SdrObject* pObj(GetObj(i));
472 pObj->NbcRotate(rRef,nAngle,sn,cs);
473 }
474
475 NbcRotateGluePoints(rRef,nAngle,sn,cs);
477}
478
479
480void SdrObjGroup::NbcMirror(const Point& rRef1, const Point& rRef2)
481{
483 MirrorPoint(maRefPoint, rRef1, rRef2); // implementation missing in SvdEtc!
484 const size_t nObjCount(GetObjCount());
485
486 for (size_t i=0; i<nObjCount; ++i)
487 {
488 SdrObject* pObj(GetObj(i));
489 pObj->NbcMirror(rRef1,rRef2);
490 }
491
492 NbcMirrorGluePoints(rRef1,rRef2);
494}
495
496
497void SdrObjGroup::NbcShear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear)
498{
500 ShearPoint(maRefPoint, rRef, tn);
501 const size_t nObjCount(GetObjCount());
502
503 for (size_t i=0; i<nObjCount; ++i)
504 {
505 SdrObject* pObj(GetObj(i));
506 pObj->NbcShear(rRef,nAngle,tn,bVShear);
507 }
508
509 NbcShearGluePoints(rRef,tn,bVShear);
511}
512
513
514void SdrObjGroup::NbcSetAnchorPos(const Point& rPnt)
515{
516 m_aAnchor=rPnt;
517 Size aSiz(rPnt.X()-m_aAnchor.X(),rPnt.Y()-m_aAnchor.Y());
518 maRefPoint.Move(aSiz);
519 const size_t nObjCount(GetObjCount());
520
521 for (size_t i=0; i<nObjCount; ++i)
522 {
523 SdrObject* pObj(GetObj(i));
524 pObj->NbcSetAnchorPos(rPnt);
525 }
526}
527
528
530{
531 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
533 if (aOld.IsEmpty())
534 {
535 Fraction aX(1,1);
536 Fraction aY(1,1);
537 Resize(aOld.TopLeft(),aX,aY);
538 }
539 else
540 {
541 tools::Long nMulX=rRect.Right()-rRect.Left();
542 tools::Long nDivX=aOld.Right()-aOld.Left();
543 tools::Long nMulY=rRect.Bottom()-rRect.Top();
544 tools::Long nDivY=aOld.Bottom()-aOld.Top();
545 if (nDivX==0) { nMulX=1; nDivX=1; }
546 if (nDivY==0) { nMulY=1; nDivY=1; }
547 if (nMulX!=nDivX || nMulY!=nDivY) {
548 Fraction aX(nMulX,nDivX);
549 Fraction aY(nMulY,nDivY);
550 Resize(aOld.TopLeft(),aX,aY);
551 }
552 }
553 if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) {
554 Move(Size(rRect.Left()-aOld.Left(),rRect.Top()-aOld.Top()));
555 }
556
557 SetChanged();
560}
561
562
564{
565 SetSnapRect(rRect);
566}
567
568
569void SdrObjGroup::Move(const Size& rSiz)
570{
571 if (rSiz.Width()==0 && rSiz.Height()==0)
572 return;
573
574 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
575 maRefPoint.Move(rSiz);
576 const size_t nObjCount(GetObjCount());
577
578 if(0 != nObjCount)
579 {
580 // first move the connectors, then everything else
581 for (size_t i=0; i<nObjCount; ++i)
582 {
583 SdrObject* pObj(GetObj(i));
584 if (pObj->IsEdgeObj())
585 pObj->Move(rSiz);
586 }
587
588 for (size_t i=0; i<nObjCount; ++i)
589 {
590 SdrObject* pObj(GetObj(i));
591 if (!pObj->IsEdgeObj())
592 pObj->Move(rSiz);
593 }
594 }
595 else
596 {
597 moveOutRectangle(rSiz.Width(), rSiz.Height());
599 }
600
601 SetChanged();
604}
605
606
607void SdrObjGroup::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative)
608{
609 if (xFact.GetNumerator()==xFact.GetDenominator() && yFact.GetNumerator()==yFact.GetDenominator())
610 return;
611
612 bool bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
613 bool bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
614 if (bXMirr || bYMirr) {
615 Point aRef1(GetSnapRect().Center());
616 if (bXMirr) {
617 Point aRef2(aRef1);
618 aRef2.AdjustY( 1 );
619 NbcMirrorGluePoints(aRef1,aRef2);
620 }
621 if (bYMirr) {
622 Point aRef2(aRef1);
623 aRef2.AdjustX( 1 );
624 NbcMirrorGluePoints(aRef1,aRef2);
625 }
626 }
627 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
628 ResizePoint(maRefPoint, rRef, xFact, yFact);
629 const size_t nObjCount(GetObjCount());
630
631 if(0 != nObjCount)
632 {
633 // move the connectors first, everything else afterwards
634 for (size_t i=0; i<nObjCount; ++i)
635 {
636 SdrObject* pObj(GetObj(i));
637 if (pObj->IsEdgeObj())
638 pObj->Resize(rRef,xFact,yFact,bUnsetRelative);
639 }
640
641 for (size_t i=0; i<nObjCount; ++i)
642 {
643 SdrObject* pObj(GetObj(i));
644 if (!pObj->IsEdgeObj())
645 pObj->Resize(rRef,xFact,yFact,bUnsetRelative);
646 }
647 }
648 else
649 {
650 auto aRectangle = getOutRectangle();
651 ResizeRect(aRectangle, rRef, xFact, yFact);
652 setOutRectangle(aRectangle);
653
655 }
656
657 SetChanged();
660}
661
662
663void SdrObjGroup::Rotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
664{
665 if (nAngle==0_deg100)
666 return;
667
669 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
670 RotatePoint(maRefPoint, rRef, sn, cs);
671 // move the connectors first, everything else afterwards
672 const size_t nObjCount(GetObjCount());
673
674 for (size_t i=0; i<nObjCount; ++i)
675 {
676 SdrObject* pObj(GetObj(i));
677 if (pObj->IsEdgeObj())
678 pObj->Rotate(rRef,nAngle,sn,cs);
679 }
680
681 for (size_t i=0; i<nObjCount; ++i)
682 {
683 SdrObject* pObj(GetObj(i));
684 if (!pObj->IsEdgeObj())
685 pObj->Rotate(rRef,nAngle,sn,cs);
686 }
687
688 NbcRotateGluePoints(rRef,nAngle,sn,cs);
690 SetChanged();
693}
694
695
696void SdrObjGroup::Mirror(const Point& rRef1, const Point& rRef2)
697{
699 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
700 MirrorPoint(maRefPoint, rRef1, rRef2); // implementation missing in SvdEtc!
701 // move the connectors first, everything else afterwards
702 const size_t nObjCount(GetObjCount());
703
704 for (size_t i=0; i<nObjCount; ++i)
705 {
706 SdrObject* pObj(GetObj(i));
707 if (pObj->IsEdgeObj())
708 pObj->Mirror(rRef1,rRef2);
709 }
710
711 for (size_t i=0; i<nObjCount; ++i)
712 {
713 SdrObject* pObj(GetObj(i));
714 if (!pObj->IsEdgeObj())
715 pObj->Mirror(rRef1,rRef2);
716 }
717
718 NbcMirrorGluePoints(rRef1,rRef2);
720 SetChanged();
723}
724
725
726void SdrObjGroup::Shear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear)
727{
728 if (nAngle==0_deg100)
729 return;
730
732 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
733 ShearPoint(maRefPoint, rRef, tn);
734 // move the connectors first, everything else afterwards
735 const size_t nObjCount(GetObjCount());
736
737 for (size_t i=0; i<nObjCount; ++i)
738 {
739 SdrObject* pObj(GetObj(i));
740 if (pObj->IsEdgeObj())
741 pObj->Shear(rRef,nAngle,tn,bVShear);
742 }
743
744 for (size_t i=0; i<nObjCount; ++i)
745 {
746 SdrObject* pObj(GetObj(i));
747 if (!pObj->IsEdgeObj())
748 pObj->Shear(rRef,nAngle,tn,bVShear);
749 }
750
751 NbcShearGluePoints(rRef,tn,bVShear);
753 SetChanged();
756
757}
758
759
760void SdrObjGroup::SetAnchorPos(const Point& rPnt)
761{
762 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
763 bool bChg=m_aAnchor!=rPnt;
764 m_aAnchor=rPnt;
765 Size aSiz(rPnt.X()-m_aAnchor.X(),rPnt.Y()-m_aAnchor.Y());
766 maRefPoint.Move(aSiz);
767 // move the connectors first, everything else afterwards
768 const size_t nObjCount(GetObjCount());
769
770 for (size_t i=0; i<nObjCount; ++i)
771 {
772 SdrObject* pObj(GetObj(i));
773 if (pObj->IsEdgeObj())
774 pObj->SetAnchorPos(rPnt);
775 }
776
777 for (size_t i=0; i<nObjCount; ++i)
778 {
779 SdrObject* pObj(GetObj(i));
780 if (!pObj->IsEdgeObj())
781 pObj->SetAnchorPos(rPnt);
782 }
783
784 if (bChg)
785 {
786 SetChanged();
789 }
790}
791
792
793void SdrObjGroup::NbcSetRelativePos(const Point& rPnt)
794{
795 Point aRelPos0(GetSnapRect().TopLeft()-m_aAnchor);
796 Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
797 NbcMove(aSiz); // this also calls SetRectsDirty()
798}
799
800void SdrObjGroup::SetRelativePos(const Point& rPnt)
801{
802 Point aRelPos0(GetSnapRect().TopLeft()-m_aAnchor);
803 Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
804 if (aSiz.Width()!=0 || aSiz.Height()!=0) Move(aSiz); // this also calls SetRectsDirty() and Broadcast, ...
805}
806
808{
810}
811
813{
815 const size_t nObjCount(GetObjCount());
816
817 for(size_t a=0; a < nObjCount; ++a)
818 {
819 SdrObject* pIterObj(GetObj(a));
820 rtl::Reference<SdrObject> pResult(pIterObj->DoConvertToPolyObj(bBezier, bAddText));
821
822 // pResult can be NULL e.g. for empty objects
823 if( pResult )
824 pGroup->GetSubList()->NbcInsertObject(pResult.get());
825 }
826
827 return pGroup;
828}
829
831{
832 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SdrObjGroup"));
833 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
834
835 SdrObject::dumpAsXml(pWriter);
836 SdrObjList::dumpAsXml(pWriter);
837
838 (void)xmlTextWriterEndElement(pWriter);
839}
840
841/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 GetNumerator() const
sal_Int32 GetDenominator() const
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const override
Definition: svdogrp.cxx:812
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdogrp.cxx:402
virtual SdrLayerID GetLayer() const override
Definition: svdogrp.cxx:175
virtual SdrObjKind GetObjIdentifier() const override
Definition: svdogrp.cxx:170
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdogrp.cxx:423
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
Definition: svdogrp.cxx:663
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: svdogrp.cxx:309
virtual void NbcSetAnchorPos(const Point &rPnt) override
Definition: svdogrp.cxx:514
virtual void Move(const Size &rSiz) override
Definition: svdogrp.cxx:569
virtual const std::shared_ptr< svx::diagram::IDiagramHelper > & getDiagramHelper() const override
Definition: svdogrp.cxx:37
std::shared_ptr< svx::diagram::IDiagramHelper > mp_DiagramHelper
Definition: svdogrp.hxx:44
virtual void NbcSetLayer(SdrLayerID nLayer) override
Definition: svdogrp.cxx:188
virtual SdrObjList * getChildrenOfSdrObject() const override
Definition: svdogrp.cxx:112
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:793
virtual void Mirror(const Point &rRef1, const Point &rRef2) override
Definition: svdogrp.cxx:696
virtual ~SdrObjGroup() override
Definition: svdogrp.cxx:98
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: svdogrp.cxx:49
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
Definition: svdogrp.cxx:463
virtual Degree100 GetRotateAngle() const override
Definition: svdogrp.cxx:346
virtual void SetGrabBagItem(const css::uno::Any &rVal) override
Definition: svdogrp.cxx:227
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true) override
Definition: svdogrp.cxx:607
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
Definition: svdogrp.cxx:497
virtual Degree100 GetShearAngle(bool bVertical=false) const override
Definition: svdogrp.cxx:361
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: svdogrp.cxx:830
virtual void SetLogicRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:563
virtual void NbcReformatText() override
Definition: svdogrp.cxx:807
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: svdogrp.cxx:314
virtual const tools::Rectangle & GetCurrentBoundRect() const override
Definition: svdogrp.cxx:245
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:396
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdogrp.cxx:269
virtual SdrObject * getSdrObjectFromSdrObjList() const override
Definition: svdogrp.cxx:107
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
Definition: svdogrp.cxx:334
virtual bool BegCreate(SdrDragStat &rStat) override
Every object must be able to create itself interactively.
Definition: svdogrp.cxx:340
Point maRefPoint
Definition: svdogrp.hxx:39
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
Definition: svdogrp.cxx:480
virtual SdrObjList * GetSubList() const override
Definition: svdogrp.cxx:208
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
Definition: svdogrp.cxx:197
SdrObjGroup(SdrModel &rSdrModel)
Definition: svdogrp.cxx:54
virtual const tools::Rectangle & GetSnapRect() const override
Definition: svdogrp.cxx:256
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:376
virtual OUString TakeObjNameSingul() const override
Definition: svdogrp.cxx:274
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: svdogrp.cxx:89
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdogrp.cxx:117
virtual void SetBoundRectDirty() override
Definition: svdogrp.cxx:164
virtual OUString TakeObjNamePlural() const override
Definition: svdogrp.cxx:299
virtual void SetRelativePos(const Point &rPnt) override
Definition: svdogrp.cxx:800
virtual void SetAnchorPos(const Point &rPnt) override
Definition: svdogrp.cxx:760
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
Definition: svdogrp.cxx:726
virtual void SetSnapRect(const tools::Rectangle &rRect) override
Definition: svdogrp.cxx:529
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: svdogrp.cxx:43
virtual SdrPage * getSdrPageFromSdrObjList() const override
Definition: svdogrp.cxx:102
const tools::Rectangle & GetAllObjBoundRect() const
Definition: svdpage.cxx:740
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdpage.cxx:1114
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:822
size_t GetObjCount() const
Definition: svdpage.cxx:816
void CopyObjects(const SdrObjList &rSrcList)
Definition: svdpage.cxx:134
const tools::Rectangle & GetAllObjSnapRect() const
Definition: svdpage.cxx:731
void NbcReformatAllTextObjects()
reformat all text objects, e.g. when changing printer
Definition: svdpage.cxx:755
Provides information about various ZObject properties.
Definition: svdobj.hxx:197
Abstract DrawObject.
Definition: svdobj.hxx:261
void setOutRectangleConst(tools::Rectangle const &rRectangle) const
Definition: svdobj.cxx:3183
virtual void NbcSetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1638
virtual Degree100 GetShearAngle(bool bVertical=false) const
Definition: svdobj.cxx:1713
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdobj.cxx:1774
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const
Definition: svdobj.cxx:2642
virtual void SetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1645
virtual Degree100 GetRotateAngle() const
Definition: svdobj.cxx:1708
virtual void SetGrabBagItem(const css::uno::Any &rVal)
Definition: svdobj.cxx:894
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:662
const tools::Rectangle & getOutRectangle() const
Definition: svdobj.cxx:3178
void moveOutRectangle(sal_Int32 nXDelta, sal_Int32 nYDelta)
Definition: svdobj.cxx:3198
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdobj.cxx:1410
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1599
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1096
void BroadcastObjectChange() const
Definition: svdobj.cxx:978
bool isDiagram() const
Definition: svdobj.hxx:265
bool IsEdgeObj() const
Definition: svdobj.hxx:752
Point m_aAnchor
Definition: svdobj.hxx:902
virtual void Mirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1590
void NbcMirrorGluePoints(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:2351
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage)
Definition: svdobj.cxx:523
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1534
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1514
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:289
SdrObjUserCall * m_pUserCall
Definition: svdobj.hxx:903
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1527
void NbcShearGluePoints(const Point &rRef, double tn, bool bVShear)
Definition: svdobj.cxx:2361
virtual const OUString & GetName() const
Definition: svdobj.cxx:769
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:1503
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:1579
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
Definition: svdobj.cxx:2766
virtual void SetChanged()
Definition: svdobj.cxx:1002
tools::Rectangle m_aOutRect
Definition: svdobj.hxx:901
virtual const tools::Rectangle & GetLastBoundRect() const
Definition: svdobj.cxx:940
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:279
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:645
bool m_bClosedObj
Definition: svdobj.hxx:921
void NbcRotateGluePoints(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:2341
void GetGrabBagItem(css::uno::Any &rVal) const
Definition: svdobj.cxx:886
void setOutRectangle(tools::Rectangle const &rRectangle)
Definition: svdobj.cxx:3188
void SetGlueReallyAbsolute(bool bOn)
Definition: svdobj.cxx:2331
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdobj.cxx:1404
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:509
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
Definition: svdobj.cxx:631
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
Definition: svdobj.cxx:1551
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:377
constexpr tools::Long Height() const
constexpr tools::Long Width() const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
sal_uInt32 count() const
static void AddAdditionalVisualization(const SdrObjGroup &rTarget, SdrHdlList &rHdlList)
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr tools::Long Right() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr bool IsEmpty() const
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
struct _xmlTextWriter * xmlTextWriterPtr
OUString sName
OUString aName
uno_Any a
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
int i
long Long
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
SdrObjKind
Definition: svdobjkind.hxx:25
@ Group
abstract object (SdrObject)
static bool containsOOXData(const css::uno::Any &rVal)
Definition: svdogrp.cxx:213
void ResizeRect(tools::Rectangle &rRect, const Point &rRef, const Fraction &rxFact, const Fraction &ryFact)
Definition: svdtrans.cxx:38
void MirrorPoint(Point &rPnt, const Point &rRef1, const Point &rRef2)
Definition: svdtrans.cxx:105
void ShearPoint(Point &rPnt, const Point &rRef, double tn, bool bVShear=false)
Definition: svdtrans.hxx:109
void RotatePoint(Point &rPnt, const Point &rRef, double sn, double cs)
Definition: svdtrans.hxx:101
void ResizePoint(Point &rPnt, const Point &rRef, const Fraction &xFract, const Fraction &yFract)
Definition: svdtrans.hxx:93
o3tl::strong_int< sal_Int16, struct SdrLayerIDTag > SdrLayerID
Definition: svdtypes.hxx:56
Center