LibreOffice Module svx (master) 1
svdedtv1.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
22#include <editeng/eeitem.hxx>
23#include <math.h>
24#include <svl/itemiter.hxx>
25#include <svl/whiter.hxx>
26#include <tools/bigint.hxx>
27#include <vcl/svapp.hxx>
28#include <vcl/weld.hxx>
29
30#include <getallcharpropids.hxx>
31#include <svx/dialmgr.hxx>
32#include <svx/svditer.hxx>
33#include <svx/strings.hrc>
34
35#include <AffineMatrixItem.hxx>
37#include <svx/obj3d.hxx>
38#include <svx/rectenum.hxx>
40#include <svx/sdooitm.hxx>
41#include <svx/sderitm.hxx>
42#include <svx/sdtagitm.hxx>
43#include <svx/svdedtv.hxx>
44#include <svx/svdetc.hxx>
45#include <svx/svdopath.hxx>
46#include <svx/svdpage.hxx>
47#include <svx/svdpagv.hxx>
48#include <svx/svdtrans.hxx>
49#include <svx/svdundo.hxx>
50#include <svx/svxids.hrc>
51#include <sxallitm.hxx>
52#include <sxmovitm.hxx>
53#include <sxreaitm.hxx>
54#include <sxreoitm.hxx>
55#include <sxroaitm.hxx>
56#include <sxrooitm.hxx>
57#include <sxsalitm.hxx>
58#include <sxsoitm.hxx>
59#include <sxtraitm.hxx>
60#include <svx/xlnedwit.hxx>
61#include <svx/xlnstwit.hxx>
62#include <svx/xlnwtit.hxx>
63#include <svx/xlnclit.hxx>
64#include <svx/xflclit.hxx>
65#include <svx/xlntrit.hxx>
66#include <svx/xfltrit.hxx>
67#include <svx/sdprcitm.hxx>
68#include <LibreOfficeKit/LibreOfficeKitEnums.h>
69#include <rtl/ustring.hxx>
70#include <sfx2/viewsh.hxx>
71#include <comphelper/lok.hxx>
72#include <osl/diagnose.h>
73
74// EditView
75
76
78{
79 DBG_ASSERT(!rRect.IsEmpty(),"SetMarkedObjRect() with an empty Rect does not make sense.");
80 if (rRect.IsEmpty()) return;
81 const size_t nCount=GetMarkedObjectCount();
82 if (nCount==0) return;
84 DBG_ASSERT(!aR0.IsEmpty(),"SetMarkedObjRect(): GetMarkedObjRect() is empty.");
85 if (aR0.IsEmpty()) return;
86 tools::Long x0=aR0.Left();
87 tools::Long y0=aR0.Top();
88 tools::Long w0=aR0.Right()-x0;
89 tools::Long h0=aR0.Bottom()-y0;
90 tools::Long x1=rRect.Left();
91 tools::Long y1=rRect.Top();
92 tools::Long w1=rRect.Right()-x1;
93 tools::Long h1=rRect.Bottom()-y1;
94
95 const bool bUndo = IsUndoEnabled();
96 if( bUndo )
97 {
99 BegUndo(ImpGetDescriptionString(STR_EditPosSize));
100 }
101
102 for (size_t nm=0; nm<nCount; ++nm)
103 {
105 SdrObject* pO=pM->GetMarkedSdrObj();
106 if (bUndo)
107 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
108
109 tools::Rectangle aR1(pO->GetSnapRect());
110 if (!aR1.IsEmpty())
111 {
112 if (aR1==aR0)
113 {
114 aR1=rRect;
115 }
116 else
117 { // transform aR1 to aR0 after rRect
118 aR1.Move(-x0,-y0);
119 BigInt l(aR1.Left());
120 BigInt r(aR1.Right());
121 BigInt t(aR1.Top());
122 BigInt b(aR1.Bottom());
123 if (w0!=0) {
124 l*=w1; l/=w0;
125 r*=w1; r/=w0;
126 } else {
127 l=0; r=w1;
128 }
129 if (h0!=0) {
130 t*=h1; t/=h0;
131 b*=h1; b/=h0;
132 } else {
133 t=0; b=h1;
134 }
135 aR1.SetLeft(tools::Long(l) );
136 aR1.SetRight(tools::Long(r) );
137 aR1.SetTop(tools::Long(t) );
138 aR1.SetBottom(tools::Long(b) );
139 aR1.Move(x1,y1);
140 }
141 pO->SetSnapRect(aR1);
142 } else {
143 OSL_FAIL("SetMarkedObjRect(): pObj->GetSnapRect() returns empty Rect");
144 }
145 }
146 if( bUndo )
147 EndUndo();
148}
149
150std::vector< std::unique_ptr<SdrUndoAction> > SdrEditView::CreateConnectorUndo( const SdrObject& rO )
151{
152 std::vector< std::unique_ptr<SdrUndoAction> > vUndoActions;
153
154 if ( rO.GetBroadcaster() )
155 {
156 const SdrPage* pPage = rO.getSdrPageFromSdrObject();
157 if ( pPage )
158 {
160 while( aIter.IsMore() )
161 {
162 SdrObject* pPartObj = aIter.Next();
163 if ( dynamic_cast<const SdrEdgeObj*>( pPartObj) != nullptr )
164 {
165 if ( ( pPartObj->GetConnectedNode( false ) == &rO ) ||
166 ( pPartObj->GetConnectedNode( true ) == &rO ) )
167 {
168 vUndoActions.push_back(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pPartObj));
169 }
170 }
171 }
172 }
173 }
174 return vUndoActions;
175}
176
177void SdrEditView::AddUndoActions( std::vector< std::unique_ptr<SdrUndoAction> > aUndoActions )
178{
179 for (auto & rAction : aUndoActions)
180 AddUndo( std::move(rAction) );
181}
182
183void SdrEditView::MoveMarkedObj(const Size& rSiz, bool bCopy)
184{
185 const bool bUndo = IsUndoEnabled();
186
187 if( bUndo )
188 {
190 OUString aStr(SvxResId(STR_EditMove));
191 if (bCopy)
192 aStr += SvxResId(STR_EditWithCopy);
193 // needs its own UndoGroup because of its parameters
195 }
196
197 if (bCopy)
199
200 const size_t nMarkCount=GetMarkedObjectCount();
201 for (size_t nm=0; nm<nMarkCount; ++nm)
202 {
204 SdrObject* pO=pM->GetMarkedSdrObj();
205 if( bUndo )
206 {
208 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoMoveObject(*pO,rSiz));
209 }
210 pO->Move(rSiz);
211 }
212
213 if( bUndo )
214 EndUndo();
215}
216
217void SdrEditView::ResizeMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy)
218{
219 const bool bUndo = IsUndoEnabled();
220 if( bUndo )
221 {
223 OUString aStr {ImpGetDescriptionString(STR_EditResize)};
224 if (bCopy)
225 aStr+=SvxResId(STR_EditWithCopy);
226 BegUndo(aStr);
227 }
228
229 if (bCopy)
231
232 const size_t nMarkCount=GetMarkedObjectCount();
233 for (size_t nm=0; nm<nMarkCount; ++nm)
234 {
236 SdrObject* pO=pM->GetMarkedSdrObj();
237 if( bUndo )
238 {
240 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
241 }
242 pO->Resize(rRef,xFact,yFact);
243 }
244
245 if( bUndo )
246 EndUndo();
247}
249 const Fraction& xFact,
250 const Fraction& yFact,
251 const bool bWdh,
252 const bool bHgt)
253{
254 const bool bUndo = IsUndoEnabled();
255 if( bUndo )
256 {
258 BegUndo(ImpGetDescriptionString(STR_EditResize));
259 }
260
261 const size_t nMarkCount=GetMarkedObjectCount();
262 for (size_t nm=0; nm<nMarkCount; ++nm)
263 {
265 SdrObject* pO=pM->GetMarkedSdrObj();
266 if( bUndo )
267 {
269 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
270 }
271
272 Fraction aFrac(1,1);
273 if (bWdh && xFact.IsValid() && bHgt && yFact.IsValid())
274 pO->Resize(rRef, xFact, yFact);
275 else if (bWdh && xFact.IsValid())
276 pO->Resize(rRef, xFact, aFrac);
277 else if (bHgt && yFact.IsValid())
278 pO->Resize(rRef, aFrac, yFact);
279 }
280 if( bUndo )
281 EndUndo();
282}
283
285{
286 Degree100 nRetval(0);
287
289 {
290 SdrMark* pM = GetSdrMarkByIndex(0);
291 SdrObject* pO = pM->GetMarkedSdrObj();
292
293 nRetval = pO->GetRotateAngle();
294 }
295
296 return nRetval;
297}
298
299void SdrEditView::RotateMarkedObj(const Point& rRef, Degree100 nAngle, bool bCopy)
300{
301 const bool bUndo = IsUndoEnabled();
302 if( bUndo )
303 {
305 OUString aStr {ImpGetDescriptionString(STR_EditRotate)};
306 if (bCopy) aStr+=SvxResId(STR_EditWithCopy);
307 BegUndo(aStr);
308 }
309
310 if (bCopy)
312
313 double nSin = sin(toRadians(nAngle));
314 double nCos = cos(toRadians(nAngle));
315 const size_t nMarkCount(GetMarkedObjectCount());
316
317 if(nMarkCount)
318 {
319 std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters;
320
321 for(size_t nm = 0; nm < nMarkCount; ++nm)
322 {
323 SdrMark* pM = GetSdrMarkByIndex(nm);
324 SdrObject* pO = pM->GetMarkedSdrObj();
325
326 if( bUndo )
327 {
328 // extra undo actions for changed connector which now may hold its laid out path (SJ)
330
331 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
332 }
333
334 // set up a scene updater if object is a 3d object
335 if(DynCastE3dObject(pO))
336 {
337 aUpdaters.push_back(new E3DModifySceneSnapRectUpdater(pO));
338 }
339
340 pO->Rotate(rRef,nAngle,nSin,nCos);
341 }
342
343 // fire scene updaters
344 while(!aUpdaters.empty())
345 {
346 delete aUpdaters.back();
347 aUpdaters.pop_back();
348 }
349 }
350
351 if( bUndo )
352 EndUndo();
353}
354
355void SdrEditView::MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool bCopy)
356{
357 const bool bUndo = IsUndoEnabled();
358
359 if( bUndo )
360 {
362 OUString aStr;
363 Point aDif(rRef2-rRef1);
364 if (aDif.X()==0)
365 aStr = ImpGetDescriptionString(STR_EditMirrorHori);
366 else if (aDif.Y()==0)
367 aStr = ImpGetDescriptionString(STR_EditMirrorVert);
368 else if (std::abs(aDif.X()) == std::abs(aDif.Y()))
369 aStr = ImpGetDescriptionString(STR_EditMirrorDiag);
370 else
371 aStr = ImpGetDescriptionString(STR_EditMirrorFree);
372 if (bCopy) aStr+=SvxResId(STR_EditWithCopy);
373 BegUndo(aStr);
374 }
375
376 if (bCopy)
378
379 const size_t nMarkCount(GetMarkedObjectCount());
380
381 if(nMarkCount)
382 {
383 std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters;
384
385 for(size_t nm = 0; nm < nMarkCount; ++nm)
386 {
387 SdrMark* pM = GetSdrMarkByIndex(nm);
388 SdrObject* pO = pM->GetMarkedSdrObj();
389
390 if( bUndo )
391 {
392 // extra undo actions for changed connector which now may hold its laid out path (SJ)
394
395 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
396 }
397
398 // set up a scene updater if object is a 3d object
399 if(DynCastE3dObject(pO))
400 {
401 aUpdaters.push_back(new E3DModifySceneSnapRectUpdater(pO));
402 }
403
404 pO->Mirror(rRef1,rRef2);
405 }
406
407 // fire scene updaters
408 while(!aUpdaters.empty())
409 {
410 delete aUpdaters.back();
411 aUpdaters.pop_back();
412 }
413 }
414
415 if( bUndo )
416 EndUndo();
417}
418
420{
421 Point aCenter(GetMarkedObjRect().Center());
422 Point aPt2(aCenter);
423 aPt2.AdjustY( 1 );
424 MirrorMarkedObj(aCenter,aPt2);
425}
426
428{
429 Point aCenter(GetMarkedObjRect().Center());
430 Point aPt2(aCenter);
431 aPt2.AdjustX( 1 );
432 MirrorMarkedObj(aCenter,aPt2);
433}
434
436{
437 bool b1st=true;
438 bool bOk=true;
439 Degree100 nAngle(0);
440 const size_t nMarkCount=GetMarkedObjectCount();
441 for (size_t nm=0; nm<nMarkCount && bOk; ++nm) {
443 SdrObject* pO=pM->GetMarkedSdrObj();
444 Degree100 nAngle2=pO->GetShearAngle();
445 if (b1st) nAngle=nAngle2;
446 else if (nAngle2!=nAngle) bOk=false;
447 b1st=false;
448 }
449 if (nAngle>SDRMAXSHEAR) nAngle=SDRMAXSHEAR;
450 if (nAngle<-SDRMAXSHEAR) nAngle=-SDRMAXSHEAR;
451 if (!bOk) nAngle=0_deg100;
452 return nAngle;
453}
454
455void SdrEditView::ShearMarkedObj(const Point& rRef, Degree100 nAngle, bool bVShear, bool bCopy)
456{
457 const bool bUndo = IsUndoEnabled();
458
459 if( bUndo )
460 {
462 OUString aStr {ImpGetDescriptionString(STR_EditShear)};
463 if (bCopy)
464 aStr+=SvxResId(STR_EditWithCopy);
465 BegUndo(aStr);
466 }
467
468 if (bCopy)
470
471 double nTan = tan(toRadians(nAngle));
472 const size_t nMarkCount=GetMarkedObjectCount();
473 for (size_t nm=0; nm<nMarkCount; ++nm)
474 {
476 SdrObject* pO=pM->GetMarkedSdrObj();
477 if( bUndo )
478 {
480 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
481 }
482 pO->Shear(rRef,nAngle,nTan,bVShear);
483 }
484
485 if( bUndo )
486 EndUndo();
487}
488
489void SdrEditView::ImpCrookObj(SdrObject* pO, const Point& rRef, const Point& rRad,
490 SdrCrookMode eMode, bool bVertical, bool bNoContortion, bool bRotate, const tools::Rectangle& rMarkRect)
491{
492 SdrPathObj* pPath=dynamic_cast<SdrPathObj*>( pO );
493 bool bDone = false;
494
495 if(pPath!=nullptr && !bNoContortion)
496 {
497 XPolyPolygon aXPP(pPath->GetPathPoly());
498 switch (eMode) {
499 case SdrCrookMode::Rotate : CrookRotatePoly (aXPP,rRef,rRad,bVertical); break;
500 case SdrCrookMode::Slant : CrookSlantPoly (aXPP,rRef,rRad,bVertical); break;
501 case SdrCrookMode::Stretch: CrookStretchPoly(aXPP,rRef,rRad,bVertical,rMarkRect); break;
502 } // switch
503 pPath->SetPathPoly(aXPP.getB2DPolyPolygon());
504 bDone = true;
505 }
506
507 if(!bDone && !pPath && pO->IsPolyObj() && 0 != pO->GetPointCount())
508 {
509 // for PolyObj's, but NOT for SdrPathObj's, e.g. the measurement object
510 sal_uInt32 nPointCount(pO->GetPointCount());
511 XPolygon aXP(static_cast<sal_uInt16>(nPointCount));
512 sal_uInt32 nPtNum;
513
514 for(nPtNum = 0; nPtNum < nPointCount; nPtNum++)
515 {
516 Point aPt(pO->GetPoint(nPtNum));
517 aXP[static_cast<sal_uInt16>(nPtNum)]=aPt;
518 }
519
520 switch (eMode)
521 {
522 case SdrCrookMode::Rotate : CrookRotatePoly (aXP,rRef,rRad,bVertical); break;
523 case SdrCrookMode::Slant : CrookSlantPoly (aXP,rRef,rRad,bVertical); break;
524 case SdrCrookMode::Stretch: CrookStretchPoly(aXP,rRef,rRad,bVertical,rMarkRect); break;
525 }
526
527 for(nPtNum = 0; nPtNum < nPointCount; nPtNum++)
528 {
529 // broadcasting could be optimized here, but for the
530 // current two points of the measurement object, it's fine
531 pO->SetPoint(aXP[static_cast<sal_uInt16>(nPtNum)],nPtNum);
532 }
533
534 bDone = true;
535 }
536
537 if(bDone)
538 return;
539
540 // for all others or if bNoContortion
541 Point aCtr0(pO->GetSnapRect().Center());
542 Point aCtr1(aCtr0);
543 bool bRotOk(false);
544 double nSin(0.0), nCos(1.0);
545 double nAngle(0.0);
546
547 if(0 != rRad.X() && 0 != rRad.Y())
548 {
549 bRotOk = bRotate;
550
551 switch (eMode)
552 {
553 case SdrCrookMode::Rotate : nAngle=CrookRotateXPoint (aCtr1,nullptr,nullptr,rRef,rRad,nSin,nCos,bVertical); bRotOk=bRotate; break;
554 case SdrCrookMode::Slant : nAngle=CrookSlantXPoint (aCtr1,nullptr,nullptr,rRef,rRad,nSin,nCos,bVertical); break;
555 case SdrCrookMode::Stretch: nAngle=CrookStretchXPoint(aCtr1,nullptr,nullptr,rRef,rRad,nSin,nCos,bVertical,rMarkRect); break;
556 }
557 }
558
559 aCtr1 -= aCtr0;
560
561 if(bRotOk)
562 pO->Rotate(aCtr0, Degree100(FRound(basegfx::rad2deg<100>(nAngle))), nSin, nCos);
563
564 pO->Move(Size(aCtr1.X(),aCtr1.Y()));
565}
566
567void SdrEditView::CrookMarkedObj(const Point& rRef, const Point& rRad, SdrCrookMode eMode,
568 bool bVertical, bool bNoContortion, bool bCopy)
569{
571 const bool bUndo = IsUndoEnabled();
572
573 bool bRotate=bNoContortion && eMode==SdrCrookMode::Rotate && IsRotateAllowed();
574
575 if( bUndo )
576 {
578 OUString aStr {ImpGetDescriptionString(bNoContortion ? STR_EditCrook : STR_EditCrookContortion)};
579 if (bCopy)
580 aStr+=SvxResId(STR_EditWithCopy);
581 BegUndo(aStr);
582 }
583
584 if (bCopy)
586
587 const size_t nMarkCount=GetMarkedObjectCount();
588 for (size_t nm=0; nm<nMarkCount; ++nm)
589 {
591 SdrObject* pO=pM->GetMarkedSdrObj();
592 if (bUndo)
593 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
594
595 const SdrObjList* pOL=pO->GetSubList();
596 if (bNoContortion || pOL==nullptr) {
597 ImpCrookObj(pO,rRef,rRad,eMode,bVertical,bNoContortion,bRotate,aMarkRect);
598 } else {
600 while (aIter.IsMore()) {
601 SdrObject* pO1=aIter.Next();
602 ImpCrookObj(pO1,rRef,rRad,eMode,bVertical,bNoContortion,bRotate,aMarkRect);
603 }
604 }
605 }
606
607 if( bUndo )
608 EndUndo();
609}
610
611void SdrEditView::ImpDistortObj(SdrObject* pO, const tools::Rectangle& rRef, const XPolygon& rDistortedRect, bool bNoContortion)
612{
613 SdrPathObj* pPath = dynamic_cast<SdrPathObj*>( pO );
614
615 if(!bNoContortion && pPath)
616 {
617 XPolyPolygon aXPP(pPath->GetPathPoly());
618 aXPP.Distort(rRef, rDistortedRect);
619 pPath->SetPathPoly(aXPP.getB2DPolyPolygon());
620 }
621 else if(pO->IsPolyObj())
622 {
623 // e. g. for the measurement object
624 sal_uInt32 nPointCount(pO->GetPointCount());
625 XPolygon aXP(static_cast<sal_uInt16>(nPointCount));
626 sal_uInt32 nPtNum;
627
628 for(nPtNum = 0; nPtNum < nPointCount; nPtNum++)
629 {
630 Point aPt(pO->GetPoint(nPtNum));
631 aXP[static_cast<sal_uInt16>(nPtNum)]=aPt;
632 }
633
634 aXP.Distort(rRef, rDistortedRect);
635
636 for(nPtNum = 0; nPtNum < nPointCount; nPtNum++)
637 {
638 // broadcasting could be optimized here, but for the
639 // current two points of the measurement object it's fine
640 pO->SetPoint(aXP[static_cast<sal_uInt16>(nPtNum)],nPtNum);
641 }
642 }
643}
644
645void SdrEditView::DistortMarkedObj(const tools::Rectangle& rRef, const XPolygon& rDistortedRect, bool bNoContortion, bool bCopy)
646{
647 const bool bUndo = IsUndoEnabled();
648
649 if( bUndo )
650 {
652 OUString aStr {ImpGetDescriptionString(STR_EditDistort)};
653 if (bCopy)
654 aStr+=SvxResId(STR_EditWithCopy);
655 BegUndo(aStr);
656 }
657
658 if (bCopy)
660
661 const size_t nMarkCount=GetMarkedObjectCount();
662 for (size_t nm=0; nm<nMarkCount; ++nm)
663 {
665 SdrObject* pO=pM->GetMarkedSdrObj();
666 if (bUndo)
667 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
668
669 tools::Rectangle aRefRect(rRef);
670 const SdrObjList* pOL=pO->GetSubList();
671 if (bNoContortion || pOL==nullptr) {
672 ImpDistortObj(pO,aRefRect,rDistortedRect,bNoContortion);
673 } else {
675 while (aIter.IsMore()) {
676 SdrObject* pO1=aIter.Next();
677 ImpDistortObj(pO1,aRefRect,rDistortedRect,bNoContortion);
678 }
679 }
680 }
681 if( bUndo )
682 EndUndo();
683}
684
685
687{
688 // bReplaceAll has no effect here
689 tools::Rectangle aAllSnapRect(GetMarkedObjRect());
690 if (const SdrTransformRef1XItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_TRANSFORMREF1X))
691 {
692 tools::Long n = pPoolItem->GetValue();
693 SetRef1(Point(n,GetRef1().Y()));
694 }
695 if (const SdrTransformRef1YItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_TRANSFORMREF1Y))
696 {
697 tools::Long n = pPoolItem->GetValue();
698 SetRef1(Point(GetRef1().X(),n));
699 }
700 if (const SdrTransformRef2XItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_TRANSFORMREF2X))
701 {
702 tools::Long n = pPoolItem->GetValue();
703 SetRef2(Point(n,GetRef2().Y()));
704 }
705 if (const SdrTransformRef2YItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_TRANSFORMREF2Y))
706 {
707 tools::Long n = pPoolItem->GetValue();
708 SetRef2(Point(GetRef2().X(),n));
709 }
710 tools::Long nAllPosX=0; bool bAllPosX=false;
711 tools::Long nAllPosY=0; bool bAllPosY=false;
712 tools::Long nAllWdt=0; bool bAllWdt=false;
713 tools::Long nAllHgt=0; bool bAllHgt=false;
714 bool bDoIt=false;
715 if (const SdrAllPositionXItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_ALLPOSITIONX))
716 {
717 nAllPosX = pPoolItem->GetValue();
718 bAllPosX=true; bDoIt=true;
719 }
720 if (const SdrAllPositionYItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_ALLPOSITIONY))
721 {
722 nAllPosY = pPoolItem->GetValue();
723 bAllPosY=true; bDoIt=true;
724 }
725 if (const SdrAllSizeWidthItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_ALLSIZEWIDTH))
726 {
727 nAllWdt = pPoolItem->GetValue();
728 bAllWdt=true; bDoIt=true;
729 }
730 if (const SdrAllSizeHeightItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_ALLSIZEHEIGHT))
731 {
732 nAllHgt = pPoolItem->GetValue();
733 bAllHgt=true; bDoIt=true;
734 }
735 if (bDoIt) {
736 tools::Rectangle aRect(aAllSnapRect); // TODO: change this for PolyPt's and GluePt's!!!
737 if (bAllPosX) aRect.Move(nAllPosX-aRect.Left(),0);
738 if (bAllPosY) aRect.Move(0,nAllPosY-aRect.Top());
739 if (bAllWdt) aRect.SetRight(aAllSnapRect.Left()+nAllWdt );
740 if (bAllHgt) aRect.SetBottom(aAllSnapRect.Top()+nAllHgt );
741 SetMarkedObjRect(aRect);
742 }
743 if (const SdrResizeXAllItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_RESIZEXALL))
744 {
745 Fraction aXFact = pPoolItem->GetValue();
746 ResizeMarkedObj(aAllSnapRect.TopLeft(),aXFact,Fraction(1,1));
747 }
748 if (const SdrResizeYAllItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_RESIZEYALL))
749 {
750 Fraction aYFact = pPoolItem->GetValue();
751 ResizeMarkedObj(aAllSnapRect.TopLeft(),Fraction(1,1),aYFact);
752 }
753 if (const SdrRotateAllItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_ROTATEALL))
754 {
755 Degree100 nAngle = pPoolItem->GetValue();
756 RotateMarkedObj(aAllSnapRect.Center(),nAngle);
757 }
758 if (const SdrHorzShearAllItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_HORZSHEARALL))
759 {
760 Degree100 nAngle = pPoolItem->GetValue();
761 ShearMarkedObj(aAllSnapRect.Center(),nAngle);
762 }
763 if (const SdrVertShearAllItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_VERTSHEARALL))
764 {
765 Degree100 nAngle = pPoolItem->GetValue();
766 ShearMarkedObj(aAllSnapRect.Center(),nAngle,true);
767 }
768
769 const bool bUndo = IsUndoEnabled();
770
771 // TODO: check if WhichRange is necessary.
772 const size_t nMarkCount=GetMarkedObjectCount();
773 for (size_t nm=0; nm<nMarkCount; ++nm)
774 {
775 const SdrMark* pM=GetSdrMarkByIndex(nm);
776 SdrObject* pObj=pM->GetMarkedSdrObj();
777 if (bUndo)
778 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
779
780 pObj->ApplyNotPersistAttr(rAttr);
781 }
782}
783
785{
786 // TODO: Take into account the origin and PvPos.
787 tools::Rectangle aAllSnapRect(GetMarkedObjRect()); // TODO: change this for PolyPt's and GluePt's!!!
788 tools::Long nAllSnapPosX=aAllSnapRect.Left();
789 tools::Long nAllSnapPosY=aAllSnapRect.Top();
790 tools::Long nAllSnapWdt=aAllSnapRect.GetWidth()-1;
791 tools::Long nAllSnapHgt=aAllSnapRect.GetHeight()-1;
792 // TODO: could go into CheckPossibilities
793 bool bMovProtect = false, bMovProtectDC = false;
794 bool bSizProtect = false, bSizProtectDC = false;
795 bool bPrintable = true, bPrintableDC = false;
796 bool bVisible = true, bVisibleDC = false;
797 SdrLayerID nLayerId(0);
798 bool bLayerDC=false;
799 tools::Long nSnapPosX=0; bool bSnapPosXDC=false;
800 tools::Long nSnapPosY=0; bool bSnapPosYDC=false;
801 tools::Long nSnapWdt=0; bool bSnapWdtDC=false;
802 tools::Long nSnapHgt=0; bool bSnapHgtDC=false;
803 tools::Long nLogicWdt=0; bool bLogicWdtDC=false,bLogicWdtDiff=false;
804 tools::Long nLogicHgt=0; bool bLogicHgtDC=false,bLogicHgtDiff=false;
805 Degree100 nRotAngle(0); bool bRotAngleDC=false;
806 Degree100 nShrAngle(0); bool bShrAngleDC=false;
807 tools::Rectangle aSnapRect;
808 tools::Rectangle aLogicRect;
809 const size_t nMarkCount=GetMarkedObjectCount();
810 for (size_t nm=0; nm<nMarkCount; ++nm) {
811 const SdrMark* pM=GetSdrMarkByIndex(nm);
812 const SdrObject* pObj=pM->GetMarkedSdrObj();
813 if (nm==0) {
814 nLayerId=pObj->GetLayer();
815 bMovProtect=pObj->IsMoveProtect();
816 bSizProtect=pObj->IsResizeProtect();
817 bPrintable =pObj->IsPrintable();
818 bVisible = pObj->IsVisible();
819 tools::Rectangle aSnapRect2(pObj->GetSnapRect());
820 tools::Rectangle aLogicRect2(pObj->GetLogicRect());
821 nSnapPosX=aSnapRect2.Left();
822 nSnapPosY=aSnapRect2.Top();
823 nSnapWdt=aSnapRect2.GetWidth()-1;
824 nSnapHgt=aSnapRect2.GetHeight()-1;
825 nLogicWdt=aLogicRect2.GetWidth()-1;
826 nLogicHgt=aLogicRect2.GetHeight()-1;
827 bLogicWdtDiff=nLogicWdt!=nSnapWdt;
828 bLogicHgtDiff=nLogicHgt!=nSnapHgt;
829 nRotAngle=pObj->GetRotateAngle();
830 nShrAngle=pObj->GetShearAngle();
831 } else {
832 if (!bLayerDC && nLayerId !=pObj->GetLayer()) bLayerDC = true;
833 if (!bMovProtectDC && bMovProtect!=pObj->IsMoveProtect()) bMovProtectDC = true;
834 if (!bSizProtectDC && bSizProtect!=pObj->IsResizeProtect()) bSizProtectDC = true;
835 if (!bPrintableDC && bPrintable !=pObj->IsPrintable()) bPrintableDC = true;
836 if (!bVisibleDC && bVisible !=pObj->IsVisible()) bVisibleDC=true;
837 if (!bRotAngleDC && nRotAngle !=pObj->GetRotateAngle()) bRotAngleDC=true;
838 if (!bShrAngleDC && nShrAngle !=pObj->GetShearAngle()) bShrAngleDC=true;
839 if (!bSnapWdtDC || !bSnapHgtDC || !bSnapPosXDC || !bSnapPosYDC || !bLogicWdtDiff || !bLogicHgtDiff) {
840 aSnapRect=pObj->GetSnapRect();
841 if (nSnapPosX!=aSnapRect.Left()) bSnapPosXDC=true;
842 if (nSnapPosY!=aSnapRect.Top()) bSnapPosYDC=true;
843 if (nSnapWdt!=aSnapRect.GetWidth()-1) bSnapWdtDC=true;
844 if (nSnapHgt!=aSnapRect.GetHeight()-1) bSnapHgtDC=true;
845 }
846 if (!bLogicWdtDC || !bLogicHgtDC || !bLogicWdtDiff || !bLogicHgtDiff) {
847 aLogicRect=pObj->GetLogicRect();
848 if (nLogicWdt!=aLogicRect.GetWidth()-1) bLogicWdtDC=true;
849 if (nLogicHgt!=aLogicRect.GetHeight()-1) bLogicHgtDC=true;
850 if (!bLogicWdtDiff && aSnapRect.GetWidth()!=aLogicRect.GetWidth()) bLogicWdtDiff=true;
851 if (!bLogicHgtDiff && aSnapRect.GetHeight()!=aLogicRect.GetHeight()) bLogicHgtDiff=true;
852 }
853 }
854 }
855
856 if (bSnapPosXDC || nAllSnapPosX!=nSnapPosX) rAttr.Put(SdrAllPositionXItem(nAllSnapPosX));
857 if (bSnapPosYDC || nAllSnapPosY!=nSnapPosY) rAttr.Put(SdrAllPositionYItem(nAllSnapPosY));
858 if (bSnapWdtDC || nAllSnapWdt !=nSnapWdt ) rAttr.Put(SdrAllSizeWidthItem(nAllSnapWdt));
859 if (bSnapHgtDC || nAllSnapHgt !=nSnapHgt ) rAttr.Put(SdrAllSizeHeightItem(nAllSnapHgt));
860
861 // items for pure transformations
862 rAttr.Put(SdrMoveXItem());
863 rAttr.Put(SdrMoveYItem());
864 rAttr.Put(SdrResizeXOneItem());
865 rAttr.Put(SdrResizeYOneItem());
866 rAttr.Put(SdrRotateOneItem());
867 rAttr.Put(SdrHorzShearOneItem());
868 rAttr.Put(SdrVertShearOneItem());
869
870 if (nMarkCount>1) {
871 rAttr.Put(SdrResizeXAllItem());
872 rAttr.Put(SdrResizeYAllItem());
873 rAttr.Put(SdrRotateAllItem());
874 rAttr.Put(SdrHorzShearAllItem());
875 rAttr.Put(SdrVertShearAllItem());
876 }
877
879 {
882 }
883
885 {
888 }
889}
890
892{
893 SfxItemSet aSet(GetModel().GetItemPool());
894 MergeAttrFromMarked(aSet,bOnlyHardAttr);
895 //the EE_FEATURE items should not be set with SetAttrToMarked (see error message there)
896 //so we do not set them here
897 // #i32448#
898 // Do not disable, but clear the items.
903
904 return aSet;
905}
906
907void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) const
908{
909 const size_t nMarkCount(GetMarkedObjectCount());
910
911 for(size_t a = 0; a < nMarkCount; ++a)
912 {
913 // #80277# merging was done wrong in the prev version
915 if (!pObj)
916 {
917 continue;
918 }
919
920 const SfxItemSet& rSet = pObj->GetMergedItemSet();
921 SfxWhichIter aIter(rSet);
922 sal_uInt16 nWhich(aIter.FirstWhich());
923
924 while(nWhich)
925 {
926 if(!bOnlyHardAttr)
927 {
928 if(SfxItemState::DONTCARE == aIter.GetItemState(false))
929 rAttr.InvalidateItem(nWhich);
930 else
931 rAttr.MergeValue(rSet.Get(nWhich), true);
932 }
933 else if(SfxItemState::SET == aIter.GetItemState(false))
934 {
935 const SfxPoolItem& rItem = rSet.Get(nWhich);
936 rAttr.MergeValue(rItem, true);
937 }
938
940 {
941 OUString sPayload;
942 switch(nWhich)
943 {
944 case XATTR_LINECOLOR:
945 {
946 const SfxPoolItem* pItem = rSet.GetItem(XATTR_LINECOLOR);
947 if (pItem)
948 {
949 Color aColor = static_cast<const XLineColorItem*>(pItem)->GetColorValue();
950 sPayload = OUString::number(static_cast<sal_uInt32>(aColor));
951
952 sPayload = ".uno:XLineColor=" + sPayload;
953 }
954 break;
955 }
956
957 case XATTR_FILLCOLOR:
958 {
959 const SfxPoolItem* pItem = rSet.GetItem(XATTR_FILLCOLOR);
960 if (pItem)
961 {
962 Color aColor = static_cast<const XFillColorItem*>(pItem)->GetColorValue();
963 sPayload = OUString::number(static_cast<sal_uInt32>(aColor));
964
965 sPayload = ".uno:FillColor=" + sPayload;
966 }
967 break;
968 }
969
971 {
973 if (pItem)
974 {
975 sal_uInt16 nTransparency = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
976 sPayload = OUString::number(nTransparency);
977
978 sPayload = ".uno:FillTransparence=" + sPayload;
979 }
980 break;
981 }
982
984 {
986 if (pItem)
987 {
988 sal_uInt16 nTransparency = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
989 sPayload = OUString::number(nTransparency);
990
991 sPayload = ".uno:LineTransparence=" + sPayload;
992 }
993 break;
994 }
995
996 case XATTR_LINEWIDTH:
997 {
998 const SfxPoolItem* pItem = rSet.GetItem(XATTR_LINEWIDTH);
999 if (pItem)
1000 {
1001 sal_uInt32 nWidth = static_cast<const XLineWidthItem*>(pItem)->GetValue();
1002 sPayload = OUString::number(nWidth);
1003
1004 sPayload = ".uno:LineWidth=" + sPayload;
1005 }
1006 break;
1007 }
1008
1010 {
1012 if (pItem)
1013 {
1014 sal_uInt16 nWidth = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
1015 sPayload = OUString::number(nWidth);
1016
1017 sPayload = ".uno:FillShadowTransparency=" + sPayload;
1018 }
1019 break;
1020 }
1021 }
1022
1023 if (!sPayload.isEmpty())
1024 GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
1025 OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US));
1026 }
1027
1028 nWhich = aIter.NextWhich();
1029 }
1030 }
1031}
1032
1033std::vector<sal_uInt16> GetAllCharPropIds(const SfxItemSet& rSet)
1034{
1035 std::vector<sal_uInt16> aCharWhichIds;
1036 {
1037 SfxItemIter aIter(rSet);
1038 for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
1039 {
1040 if (!IsInvalidItem(pItem))
1041 {
1042 sal_uInt16 nWhich = pItem->Which();
1043 if (nWhich>=EE_CHAR_START && nWhich<=EE_CHAR_END)
1044 aCharWhichIds.push_back( nWhich );
1045 }
1046 }
1047 }
1048 return aCharWhichIds;
1049}
1050
1051std::vector<sal_uInt16> GetAllCharPropIds(o3tl::span< const SfxPoolItem* const > aChangedItems)
1052{
1053 std::vector<sal_uInt16> aCharWhichIds;
1054 for (const SfxPoolItem* pItem : aChangedItems)
1055 {
1056 sal_uInt16 nWhich = pItem->Which();
1057 if (nWhich>=EE_CHAR_START && nWhich<=EE_CHAR_END)
1058 aCharWhichIds.push_back( nWhich );
1059 }
1060 return aCharWhichIds;
1061}
1062
1063void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll)
1064{
1065 if (!AreObjectsMarked())
1066 return;
1067
1068#ifdef DBG_UTIL
1069 {
1070 bool bHasEEFeatureItems=false;
1071 SfxItemIter aIter(rAttr);
1072 for (const SfxPoolItem* pItem = aIter.GetCurItem(); !bHasEEFeatureItems && pItem;
1073 pItem = aIter.NextItem())
1074 {
1075 if (!IsInvalidItem(pItem)) {
1076 sal_uInt16 nW=pItem->Which();
1077 if (nW>=EE_FEATURE_START && nW<=EE_FEATURE_END) bHasEEFeatureItems=true;
1078 }
1079 }
1080 if(bHasEEFeatureItems)
1081 {
1082 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr,
1083 VclMessageType::Info, VclButtonsType::Ok,
1084 "SdrEditView::SetAttrToMarked(): Setting EE_FEATURE items at the SdrView does not make sense! It only leads to overhead and unreadable documents."));
1085 xInfoBox->run();
1086 }
1087 }
1088#endif
1089
1090 // #103836# if the user sets character attributes to the complete shape,
1091 // we want to remove all hard set character attributes with same
1092 // which ids from the text. We do that later but here we remember
1093 // all character attribute which id's that are set.
1094 std::vector<sal_uInt16> aCharWhichIds(GetAllCharPropIds(rAttr));
1095
1096 // To make Undo reconstruct text attributes correctly after Format.Standard
1097 bool bHasEEItems=SearchOutlinerItems(rAttr,bReplaceAll);
1098
1099 // save additional geometry information when paragraph or character attributes
1100 // are changed and the geometrical shape of the text object might be changed
1101 bool bPossibleGeomChange(false);
1102 SfxWhichIter aIter(rAttr);
1103 sal_uInt16 nWhich = aIter.FirstWhich();
1104 while(!bPossibleGeomChange && nWhich)
1105 {
1106 SfxItemState eState = aIter.GetItemState();
1107 if(eState == SfxItemState::SET)
1108 {
1109 if((nWhich >= SDRATTR_TEXT_MINFRAMEHEIGHT && nWhich <= SDRATTR_TEXT_CONTOURFRAME)
1111 || nWhich == SDRATTR_3DOBJ_BACKSCALE
1112 || nWhich == SDRATTR_3DOBJ_DEPTH
1113 || nWhich == SDRATTR_3DOBJ_END_ANGLE
1114 || nWhich == SDRATTR_3DSCENE_DISTANCE)
1115 {
1116 bPossibleGeomChange = true;
1117 }
1118 }
1119 nWhich = aIter.NextWhich();
1120 }
1121
1122 const bool bUndo = IsUndoEnabled();
1123 if( bUndo )
1124 {
1126 BegUndo(ImpGetDescriptionString(STR_EditSetAttributes));
1127 }
1128
1129 const size_t nMarkCount(GetMarkedObjectCount());
1130 std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters;
1131
1132 // create ItemSet without SfxItemState::DONTCARE. Put()
1133 // uses its second parameter (bInvalidAsDefault) to
1134 // remove all such items to set them to default.
1135 SfxItemSet aAttr(*rAttr.GetPool(), rAttr.GetRanges());
1136 aAttr.Put(rAttr);
1137
1138 // #i38135#
1139 bool bResetAnimationTimer(false);
1140
1141 const bool bLineStartWidthExplicitChange(SfxItemState::SET
1143 const bool bLineEndWidthExplicitChange(SfxItemState::SET
1145 // check if LineWidth is part of the change
1146 const bool bAdaptStartEndWidths(!(bLineStartWidthExplicitChange && bLineEndWidthExplicitChange)
1147 && SfxItemState::SET == aAttr.GetItemState(XATTR_LINEWIDTH));
1148 sal_Int32 nNewLineWidth(0);
1149
1150 if(bAdaptStartEndWidths)
1151 {
1152 nNewLineWidth = aAttr.Get(XATTR_LINEWIDTH).GetValue();
1153 }
1154
1155 for (size_t nm=0; nm<nMarkCount; ++nm)
1156 {
1157 SdrMark* pM=GetSdrMarkByIndex(nm);
1158 SdrObject* pObj = pM->GetMarkedSdrObj();
1159
1160 if( bUndo )
1161 {
1162 SdrEdgeObj* pEdgeObj = dynamic_cast< SdrEdgeObj* >( pObj );
1163 if ( pEdgeObj )
1164 bPossibleGeomChange = true;
1165 else
1167 }
1168
1169 // new geometry undo
1170 if(bPossibleGeomChange && bUndo)
1171 {
1172 // save position and size of object, too
1173 AddUndo( GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
1174 }
1175
1176 if( bUndo )
1177 {
1178 // #i8508#
1179 // If this is a text object also rescue the OutlinerParaObject since
1180 // applying attributes to the object may change text layout when
1181 // multiple portions exist with multiple formats. If an OutlinerParaObject
1182 // really exists and needs to be rescued is evaluated in the undo
1183 // implementation itself.
1184 const bool bRescueText = DynCastSdrTextObj(pObj) != nullptr;
1185
1186 // add attribute undo
1187 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoAttrObject(*pObj,false,bHasEEItems || bPossibleGeomChange || bRescueText));
1188 }
1189
1190 // set up a scene updater if object is a 3d object
1191 if(DynCastE3dObject(pObj))
1192 {
1193 aUpdaters.push_back(new E3DModifySceneSnapRectUpdater(pObj));
1194 }
1195
1196 sal_Int32 nOldLineWidth(0);
1197 if (bAdaptStartEndWidths)
1198 {
1199 nOldLineWidth = pObj->GetMergedItem(XATTR_LINEWIDTH).GetValue();
1200 }
1201
1202 // set attributes at object
1203 pObj->SetMergedItemSetAndBroadcast(aAttr, bReplaceAll);
1204
1205 if(bAdaptStartEndWidths)
1206 {
1207 const SfxItemSet& rSet = pObj->GetMergedItemSet();
1208
1209 if(nOldLineWidth != nNewLineWidth)
1210 {
1211 if(SfxItemState::DONTCARE != rSet.GetItemState(XATTR_LINESTARTWIDTH))
1212 {
1213 const sal_Int32 nValAct(rSet.Get(XATTR_LINESTARTWIDTH).GetValue());
1214 const sal_Int32 nValNewStart(std::max(sal_Int32(0), nValAct + (((nNewLineWidth - nOldLineWidth) * 15) / 10)));
1215
1216 pObj->SetMergedItem(XLineStartWidthItem(nValNewStart));
1217 }
1218
1219 if(SfxItemState::DONTCARE != rSet.GetItemState(XATTR_LINEENDWIDTH))
1220 {
1221 const sal_Int32 nValAct(rSet.Get(XATTR_LINEENDWIDTH).GetValue());
1222 const sal_Int32 nValNewEnd(std::max(sal_Int32(0), nValAct + (((nNewLineWidth - nOldLineWidth) * 15) / 10)));
1223
1224 pObj->SetMergedItem(XLineEndWidthItem(nValNewEnd));
1225 }
1226 }
1227 }
1228
1229 if(auto pTextObj = DynCastSdrTextObj( pObj))
1230 {
1231 if(!aCharWhichIds.empty())
1232 {
1233 tools::Rectangle aOldBoundRect = pTextObj->GetLastBoundRect();
1234
1235 // #110094#-14 pTextObj->SendRepaintBroadcast(pTextObj->GetBoundRect());
1236 pTextObj->RemoveOutlinerCharacterAttribs( aCharWhichIds );
1237
1238 // object has changed, should be called from
1239 // RemoveOutlinerCharacterAttribs. This will change when the text
1240 // object implementation changes.
1241 pTextObj->SetChanged();
1242
1243 pTextObj->BroadcastObjectChange();
1244 pTextObj->SendUserCall(SdrUserCallType::ChangeAttr, aOldBoundRect);
1245 }
1246 }
1247
1248 // #i38495#
1249 if(!bResetAnimationTimer)
1250 {
1252 {
1253 bResetAnimationTimer = true;
1254 }
1255 }
1256 }
1257
1258 // fire scene updaters
1259 while(!aUpdaters.empty())
1260 {
1261 delete aUpdaters.back();
1262 aUpdaters.pop_back();
1263 }
1264
1265 // #i38135#
1266 if(bResetAnimationTimer)
1267 {
1269 }
1270
1271 // better check before what to do:
1272 // pObj->SetAttr() or SetNotPersistAttr()
1273 // TODO: missing implementation!
1275
1276 if( bUndo )
1277 EndUndo();
1278}
1279
1281{
1282 SfxStyleSheet* pRet=nullptr;
1283 bool b1st=true;
1284 const size_t nMarkCount=GetMarkedObjectCount();
1285 for (size_t nm=0; nm<nMarkCount; ++nm) {
1286 SdrMark* pM=GetSdrMarkByIndex(nm);
1288 if (b1st) pRet=pSS;
1289 else if (pRet!=pSS) return nullptr; // different stylesheets
1290 b1st=false;
1291 }
1292 return pRet;
1293}
1294
1295void SdrEditView::SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
1296{
1297 if (!AreObjectsMarked())
1298 return;
1299
1300 const bool bUndo = IsUndoEnabled();
1301
1302 if( bUndo )
1303 {
1305 OUString aStr;
1306 if (pStyleSheet!=nullptr)
1307 aStr = ImpGetDescriptionString(STR_EditSetStylesheet);
1308 else
1309 aStr = ImpGetDescriptionString(STR_EditDelStylesheet);
1310 BegUndo(aStr);
1311 }
1312
1313 const size_t nMarkCount=GetMarkedObjectCount();
1314 for (size_t nm=0; nm<nMarkCount; ++nm)
1315 {
1316 SdrMark* pM=GetSdrMarkByIndex(nm);
1317 if( bUndo )
1318 {
1319 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pM->GetMarkedSdrObj()));
1320 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoAttrObject(*pM->GetMarkedSdrObj(),true,true));
1321 }
1322 pM->GetMarkedSdrObj()->SetStyleSheet(pStyleSheet,bDontRemoveHardAttr);
1323 }
1324
1325 if( bUndo )
1326 EndUndo();
1327}
1328
1329
1330void SdrEditView::GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const
1331{
1333 {
1334 rTargetSet.Put(GetAttrFromMarked(bOnlyHardAttr), false);
1335 }
1336 else
1337 {
1338 SdrMarkView::GetAttributes(rTargetSet, bOnlyHardAttr);
1339 }
1340}
1341
1342void SdrEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
1343{
1344 if (GetMarkedObjectCount()!=0) {
1345 SetAttrToMarked(rSet,bReplaceAll);
1346 } else {
1347 SdrMarkView::SetAttributes(rSet,bReplaceAll);
1348 }
1349}
1350
1352{
1353 if (GetMarkedObjectCount()!=0) {
1354 return GetStyleSheetFromMarked();
1355 } else {
1357 }
1358}
1359
1360void SdrEditView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
1361{
1362 if (GetMarkedObjectCount()!=0) {
1363 SetStyleSheetToMarked(pStyleSheet,bDontRemoveHardAttr);
1364 } else {
1365 SdrMarkView::SetStyleSheet(pStyleSheet,bDontRemoveHardAttr);
1366 }
1367}
1368
1369
1371{
1372 SfxItemSet aRetSet(
1373 GetModel().GetItemPool(),
1374 svl::Items< // SID_ATTR_TRANSFORM_... from s:svxids.hrc
1376 SID_ATTR_TRANSFORM_POS_X, SID_ATTR_TRANSFORM_ANGLE,
1377 SID_ATTR_TRANSFORM_PROTECT_POS, SID_ATTR_TRANSFORM_AUTOHEIGHT>);
1378
1379 if (AreObjectsMarked())
1380 {
1381 SfxItemSet aMarkAttr(GetAttrFromMarked(false)); // because of AutoGrowHeight and corner radius
1383
1384 if(GetSdrPageView())
1385 {
1387 }
1388
1389 // position
1390 aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_X,aRect.Left()));
1391 aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_Y,aRect.Top()));
1392
1393 // size
1394 tools::Long nResizeRefX=aRect.Left();
1395 tools::Long nResizeRefY=aRect.Top();
1396 if (meDragMode==SdrDragMode::Rotate) { // use rotation axis as a reference for resizing, too
1397 nResizeRefX=maRef1.X();
1398 nResizeRefY=maRef1.Y();
1399 }
1400 aRetSet.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_WIDTH,aRect.Right()-aRect.Left()));
1401 aRetSet.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_HEIGHT,aRect.Bottom()-aRect.Top()));
1402 aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_RESIZE_REF_X,nResizeRefX));
1403 aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_RESIZE_REF_Y,nResizeRefY));
1404
1405 Point aRotateAxe(maRef1);
1406
1407 if(GetSdrPageView())
1408 {
1409 GetSdrPageView()->LogicToPagePos(aRotateAxe);
1410 }
1411
1412 // rotation
1413 tools::Long nRotateRefX=aRect.Center().X();
1414 tools::Long nRotateRefY=aRect.Center().Y();
1416 nRotateRefX=aRotateAxe.X();
1417 nRotateRefY=aRotateAxe.Y();
1418 }
1419 aRetSet.Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE,GetMarkedObjRotate()));
1420 aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_X,nRotateRefX));
1421 aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_Y,nRotateRefY));
1422
1423 // shearing
1424 tools::Long nShearRefX=aRect.Left();
1425 tools::Long nShearRefY=aRect.Bottom();
1426 if (meDragMode==SdrDragMode::Rotate) { // use rotation axis as a reference for shearing, too
1427 nShearRefX=aRotateAxe.X();
1428 nShearRefY=aRotateAxe.Y();
1429 }
1430 aRetSet.Put(SdrAngleItem(SID_ATTR_TRANSFORM_SHEAR,GetMarkedObjShear()));
1431 aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_X,nShearRefX));
1432 aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_Y,nShearRefY));
1433
1434 // check every object whether it is protected
1435 const SdrMarkList& rMarkList=GetMarkedObjectList();
1436 const size_t nMarkCount=rMarkList.GetMarkCount();
1437 SdrObject* pObj=rMarkList.GetMark(0)->GetMarkedSdrObj();
1438 bool bPosProt=pObj->IsMoveProtect();
1439 bool bSizProt=pObj->IsResizeProtect();
1440 bool bPosProtDontCare=false;
1441 bool bSizProtDontCare=false;
1442 for (size_t i=1; i<nMarkCount && (!bPosProtDontCare || !bSizProtDontCare); ++i)
1443 {
1444 pObj=rMarkList.GetMark(i)->GetMarkedSdrObj();
1445 if (bPosProt!=pObj->IsMoveProtect()) bPosProtDontCare=true;
1446 if (bSizProt!=pObj->IsResizeProtect()) bSizProtDontCare=true;
1447 }
1448
1449 // InvalidateItem sets item to DONT_CARE
1450 if (bPosProtDontCare) {
1451 aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_PROTECT_POS);
1452 } else {
1453 aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_PROTECT_POS,bPosProt));
1454 }
1455 if (bSizProtDontCare) {
1456 aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_PROTECT_SIZE);
1457 } else {
1458 aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_PROTECT_SIZE,bSizProt));
1459 }
1460
1462 bool bAutoGrow=aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWWIDTH).GetValue();
1463 if (eState==SfxItemState::DONTCARE) {
1464 aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_AUTOWIDTH);
1465 } else if (eState==SfxItemState::SET) {
1466 aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_AUTOWIDTH,bAutoGrow));
1467 }
1468
1469 eState=aMarkAttr.GetItemState(SDRATTR_TEXT_AUTOGROWHEIGHT);
1470 bAutoGrow=aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue();
1471 if (eState==SfxItemState::DONTCARE) {
1472 aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_AUTOHEIGHT);
1473 } else if (eState==SfxItemState::SET) {
1474 aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_AUTOHEIGHT,bAutoGrow));
1475 }
1476
1477 eState=aMarkAttr.GetItemState(SDRATTR_CORNER_RADIUS);
1478 tools::Long nRadius=aMarkAttr.Get(SDRATTR_CORNER_RADIUS).GetValue();
1479 if (eState==SfxItemState::DONTCARE) {
1481 } else if (eState==SfxItemState::SET) {
1482 aRetSet.Put(makeSdrEckenradiusItem(nRadius));
1483 }
1484
1485 basegfx::B2DHomMatrix aTransformation;
1486
1487 if(nMarkCount > 1)
1488 {
1489 // multiple objects, range is collected in aRect
1491 aRect.Left(), aRect.Top(),
1492 aRect.getOpenWidth(), aRect.getOpenHeight());
1493 }
1494 else
1495 {
1496 // single object, get homogen transformation
1497 basegfx::B2DPolyPolygon aPolyPolygon;
1498
1499 pObj->TRGetBaseGeometry(aTransformation, aPolyPolygon);
1500 }
1501
1502 if(aTransformation.isIdentity())
1503 {
1504 aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_MATRIX);
1505 }
1506 else
1507 {
1508 css::geometry::AffineMatrix2D aAffineMatrix2D;
1509 Point aPageOffset(0, 0);
1510
1511 if(GetSdrPageView())
1512 {
1513 aPageOffset = GetSdrPageView()->GetPageOrigin();
1514 }
1515
1516 aAffineMatrix2D.m00 = aTransformation.get(0, 0);
1517 aAffineMatrix2D.m01 = aTransformation.get(0, 1);
1518 aAffineMatrix2D.m02 = aTransformation.get(0, 2) - aPageOffset.X();
1519 aAffineMatrix2D.m10 = aTransformation.get(1, 0);
1520 aAffineMatrix2D.m11 = aTransformation.get(1, 1);
1521 aAffineMatrix2D.m12 = aTransformation.get(1, 2) - aPageOffset.Y();
1522
1523 aRetSet.Put(AffineMatrixItem(&aAffineMatrix2D));
1524 }
1525 }
1526
1527 return aRetSet;
1528}
1529
1531{
1532 switch(eRP) {
1533 case RectPoint::LT: return rRect.TopLeft();
1534 case RectPoint::MT: return rRect.TopCenter();
1535 case RectPoint::RT: return rRect.TopRight();
1536 case RectPoint::LM: return rRect.LeftCenter();
1537 case RectPoint::MM: return rRect.Center();
1538 case RectPoint::RM: return rRect.RightCenter();
1539 case RectPoint::LB: return rRect.BottomLeft();
1540 case RectPoint::MB: return rRect.BottomCenter();
1541 case RectPoint::RB: return rRect.BottomRight();
1542 }
1543 return Point(); // Should not happen!
1544}
1545
1546void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr, bool addPageMargin)
1547{
1548 const bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
1549
1551
1552 if(GetSdrPageView())
1553 {
1554 if (addPageMargin)
1555 {
1556 SdrPage * pPage = GetSdrPageView()->GetPage();
1557 Point upperLeft(pPage->GetLeftBorder(), pPage->GetUpperBorder());
1558 aRect.Move(upperLeft.getX(), upperLeft.getY());
1559 }
1561 }
1562
1563 Degree100 nOldRotateAngle=GetMarkedObjRotate();
1564 Degree100 nOldShearAngle=GetMarkedObjShear();
1565 const SdrMarkList& rMarkList=GetMarkedObjectList();
1566 SdrObject* pObj=nullptr;
1567
1568 RectPoint eSizePoint=RectPoint::MM;
1569 tools::Long nPosDX=0;
1570 tools::Long nPosDY=0;
1571 tools::Long nSizX=0;
1572 tools::Long nSizY=0;
1573 Degree100 nRotateAngle(0);
1574
1575 bool bModeIsRotate(meDragMode == SdrDragMode::Rotate);
1576 tools::Long nRotateX(0);
1577 tools::Long nRotateY(0);
1578 tools::Long nOldRotateX(0);
1579 tools::Long nOldRotateY(0);
1580 if(bModeIsRotate)
1581 {
1582 Point aRotateAxe(maRef1);
1583
1584 if(GetSdrPageView())
1585 {
1586 GetSdrPageView()->LogicToPagePos(aRotateAxe);
1587 }
1588
1589 nRotateX = nOldRotateX = aRotateAxe.X();
1590 nRotateY = nOldRotateY = aRotateAxe.Y();
1591 }
1592
1593 Degree100 nShearAngle(0);
1594 tools::Long nShearX=0;
1595 tools::Long nShearY=0;
1596 bool bShearVert=false;
1597
1598 bool bChgPos=false;
1599 bool bChgSiz=false;
1600 bool bChgWdh=false;
1601 bool bChgHgt=false;
1602 bool bRotate=false;
1603 bool bShear =false;
1604
1605 bool bSetAttr=false;
1606 SfxItemSet aSetAttr(GetModel().GetItemPool());
1607
1608 // position
1609 if (const SfxInt32Item *pPoolItem = rAttr.GetItemIfSet(SID_ATTR_TRANSFORM_POS_X))
1610 {
1611 nPosDX = pPoolItem->GetValue() - aRect.Left();
1612 bChgPos=true;
1613 }
1614 if (const SfxInt32Item *pPoolItem = rAttr.GetItemIfSet(SID_ATTR_TRANSFORM_POS_Y))
1615 {
1616 nPosDY = pPoolItem->GetValue() - aRect.Top();
1617 bChgPos=true;
1618 }
1619 // size
1620 if (const SfxUInt32Item *pPoolItem = rAttr.GetItemIfSet(SID_ATTR_TRANSFORM_WIDTH))
1621 {
1622 nSizX = pPoolItem->GetValue();
1623 bChgSiz=true;
1624 bChgWdh=true;
1625 }
1626 if (const SfxUInt32Item *pPoolItem = rAttr.GetItemIfSet(SID_ATTR_TRANSFORM_HEIGHT))
1627 {
1628 nSizY = pPoolItem->GetValue();
1629 bChgSiz=true;
1630 bChgHgt=true;
1631 }
1632 if (bChgSiz) {
1633 if (bTiledRendering && SfxItemState::SET != rAttr.GetItemState(SID_ATTR_TRANSFORM_SIZE_POINT))
1634 eSizePoint = RectPoint::LT;
1635 else
1636 eSizePoint = static_cast<RectPoint>(rAttr.Get(SID_ATTR_TRANSFORM_SIZE_POINT).GetValue());
1637 }
1638
1639 // rotation
1640 if (const SdrAngleItem *pPoolItem = rAttr.GetItemIfSet(SID_ATTR_TRANSFORM_DELTA_ANGLE))
1641 {
1642 nRotateAngle = pPoolItem->GetValue();
1643 bRotate = (nRotateAngle != 0_deg100);
1644 }
1645
1646 // rotation
1647 if (const SdrAngleItem *pPoolItem = rAttr.GetItemIfSet(SID_ATTR_TRANSFORM_ANGLE))
1648 {
1649 nRotateAngle = pPoolItem->GetValue() - nOldRotateAngle;
1650 bRotate = (nRotateAngle != 0_deg100);
1651 }
1652
1653 // position rotation point x
1654 if(bRotate || rAttr.GetItemIfSet(SID_ATTR_TRANSFORM_ROT_X))
1655 nRotateX = rAttr.Get(SID_ATTR_TRANSFORM_ROT_X).GetValue();
1656
1657 // position rotation point y
1658 if(bRotate || rAttr.GetItemIfSet(SID_ATTR_TRANSFORM_ROT_Y))
1659 nRotateY = rAttr.Get(SID_ATTR_TRANSFORM_ROT_Y).GetValue();
1660
1661 // shearing
1662 if (const SdrAngleItem *pPoolItem = rAttr.GetItemIfSet(SID_ATTR_TRANSFORM_SHEAR))
1663 {
1664 Degree100 nNewShearAngle=pPoolItem->GetValue();
1665 if (nNewShearAngle>SDRMAXSHEAR) nNewShearAngle=SDRMAXSHEAR;
1666 if (nNewShearAngle<-SDRMAXSHEAR) nNewShearAngle=-SDRMAXSHEAR;
1667 if (nNewShearAngle!=nOldShearAngle) {
1668 bShearVert = rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_VERTICAL).GetValue();
1669 if (bShearVert) {
1670 nShearAngle=nNewShearAngle;
1671 } else {
1672 if (nNewShearAngle!=0_deg100 && nOldShearAngle!=0_deg100) {
1673 // bug fix
1674 double nOld = tan(toRadians(nOldShearAngle));
1675 double nNew = tan(toRadians(nNewShearAngle));
1676 nNew-=nOld;
1677 nNew = basegfx::rad2deg<100>(atan(nNew));
1678 nShearAngle=Degree100(FRound(nNew));
1679 } else {
1680 nShearAngle=nNewShearAngle-nOldShearAngle;
1681 }
1682 }
1683 bShear=nShearAngle!=0_deg100;
1684 if (bShear) {
1685 nShearX = rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_X).GetValue();
1686 nShearY = rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_Y).GetValue();
1687 }
1688 }
1689 }
1690
1691 // AutoGrow
1692 if (const SfxBoolItem *pPoolItem = rAttr.GetItemIfSet(SID_ATTR_TRANSFORM_AUTOWIDTH))
1693 {
1694 bool bAutoGrow = pPoolItem->GetValue();
1695 aSetAttr.Put(makeSdrTextAutoGrowWidthItem(bAutoGrow));
1696 bSetAttr=true;
1697 }
1698
1699 if (const SfxBoolItem *pPoolItem = rAttr.GetItemIfSet(SID_ATTR_TRANSFORM_AUTOHEIGHT))
1700 {
1701 bool bAutoGrow = pPoolItem->GetValue();
1702 aSetAttr.Put(makeSdrTextAutoGrowHeightItem(bAutoGrow));
1703 bSetAttr=true;
1704 }
1705
1706 // corner radius
1708 if (const SdrMetricItem *pPoolItem = rAttr.GetItemIfSet(SDRATTR_CORNER_RADIUS))
1709 {
1710 tools::Long nRadius = pPoolItem->GetValue();
1711 aSetAttr.Put(makeSdrEckenradiusItem(nRadius));
1712 bSetAttr=true;
1713 }
1714
1716
1717 BegUndo(SvxResId(STR_EditTransform),GetDescriptionOfMarkedObjects());
1718
1719 if (bSetAttr) {
1720 SetAttrToMarked(aSetAttr,false);
1721 }
1722
1723 // change size and height
1724 if (bChgSiz && (m_bResizeFreeAllowed || m_bResizePropAllowed)) {
1725 Fraction aWdt(nSizX,aRect.Right()-aRect.Left());
1726 Fraction aHgt(nSizY,aRect.Bottom()-aRect.Top());
1727 Point aRef(ImpGetPoint(aRect,eSizePoint));
1728
1729 if(GetSdrPageView())
1730 {
1732 }
1733
1734 ResizeMultMarkedObj(aRef, aWdt, aHgt, bChgWdh, bChgHgt);
1735 }
1736
1737 // rotate
1738 if (bRotate && (m_bRotateFreeAllowed || m_bRotate90Allowed)) {
1739 Point aRef(nRotateX,nRotateY);
1740
1741 if(GetSdrPageView())
1742 {
1744 }
1745
1746 RotateMarkedObj(aRef,nRotateAngle);
1747 }
1748
1749 // set rotation point position
1750 if(bModeIsRotate && (nRotateX != nOldRotateX || nRotateY != nOldRotateY))
1751 {
1752 Point aNewRef1(nRotateX, nRotateY);
1753
1754 if(GetSdrPageView())
1755 {
1756 GetSdrPageView()->PagePosToLogic(aNewRef1);
1757 }
1758
1759 SetRef1(aNewRef1);
1760 }
1761
1762 // shear
1763 if (bShear && m_bShearAllowed) {
1764 Point aRef(nShearX,nShearY);
1765
1766 if(GetSdrPageView())
1767 {
1769 }
1770
1771 ShearMarkedObj(aRef,nShearAngle,bShearVert);
1772
1773 // #i74358#
1774 // ShearMarkedObj creates a linear combination of the existing transformation and
1775 // the new shear to apply. If the object is already transformed (e.g. rotated) the
1776 // linear combination will not decompose to the same start values again, but to a
1777 // new combination. Thus it makes no sense to check if the wanted shear is reached
1778 // or not. Taking out.
1779 }
1780
1781 // change position
1782 if (bChgPos && m_bMoveAllowed) {
1783 MoveMarkedObj(Size(nPosDX,nPosDY));
1784 }
1785
1786 const size_t nMarkCount=rMarkList.GetMarkCount();
1787 // protect position
1788 if(const SfxBoolItem *pPoolItem = rAttr.GetItemIfSet(SID_ATTR_TRANSFORM_PROTECT_POS))
1789 {
1790 const bool bProtPos(pPoolItem->GetValue());
1791 bool bChanged(false);
1792
1793 for(size_t i = 0; i < nMarkCount; ++i)
1794 {
1795 pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
1796
1797 if(pObj->IsMoveProtect() != bProtPos)
1798 {
1799 bChanged = true;
1800 pObj->SetMoveProtect(bProtPos);
1801
1802 if(bProtPos)
1803 {
1804 pObj->SetResizeProtect(true);
1805 }
1806 }
1807 }
1808
1809 if(bChanged)
1810 {
1811 m_bMoveProtect = bProtPos;
1812
1813 if(bProtPos)
1814 {
1815 m_bResizeProtect = true;
1816 }
1817
1818 // #i77187# there is no simple method to get the toolbars updated
1819 // in the application. The App is listening to selection change and i
1820 // will use it here (even if not true). It's acceptable since changing
1821 // this model data is pretty rare and only possible using the F4 dialog
1823 }
1824 }
1825
1826 if(!m_bMoveProtect)
1827 {
1828 // protect size
1829 if(const SfxBoolItem *pPoolItem = rAttr.GetItemIfSet(SID_ATTR_TRANSFORM_PROTECT_SIZE))
1830 {
1831 const bool bProtSize(pPoolItem->GetValue());
1832 bool bChanged(false);
1833
1834 for(size_t i = 0; i < nMarkCount; ++i)
1835 {
1836 pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
1837
1838 if(pObj->IsResizeProtect() != bProtSize)
1839 {
1840 bChanged = true;
1841 pObj->SetResizeProtect(bProtSize);
1842 }
1843 }
1844
1845 if(bChanged)
1846 {
1847 m_bResizeProtect = bProtSize;
1848
1849 // #i77187# see above
1851 }
1852 }
1853 }
1854
1855 EndUndo();
1856}
1857
1858
1860{ // at least two selected objects, at least one of them movable
1862 const size_t nCount=GetMarkedObjectCount();
1863 if (nCount==0) return false; // nothing selected!
1864 if (nCount==1) return m_bMoveAllowed; // align single object to page
1865 return m_bOneOrMoreMovable; // otherwise: MarkCount>=2
1866}
1867
1869{
1870 if (eHor==SdrHorAlign::NONE && eVert==SdrVertAlign::NONE)
1871 return;
1872
1874 if (!GetMarkedObjectCount())
1875 return;
1876
1877 const bool bUndo = IsUndoEnabled();
1878 if( bUndo )
1879 {
1882 if (eHor==SdrHorAlign::NONE)
1883 {
1884 switch (eVert)
1885 {
1886 case SdrVertAlign::Top:
1887 aStr = ImpGetDescriptionString(STR_EditAlignVTop);
1888 break;
1890 aStr = ImpGetDescriptionString(STR_EditAlignVBottom);
1891 break;
1893 aStr = ImpGetDescriptionString(STR_EditAlignVCenter);
1894 break;
1895 default: break;
1896 }
1897 }
1898 else if (eVert==SdrVertAlign::NONE)
1899 {
1900 switch (eHor)
1901 {
1902 case SdrHorAlign::Left:
1903 aStr = ImpGetDescriptionString(STR_EditAlignHLeft);
1904 break;
1905 case SdrHorAlign::Right:
1906 aStr = ImpGetDescriptionString(STR_EditAlignHRight);
1907 break;
1909 aStr = ImpGetDescriptionString(STR_EditAlignHCenter);
1910 break;
1911 default: break;
1912 }
1913 }
1914 else if (eHor==SdrHorAlign::Center && eVert==SdrVertAlign::Center)
1915 {
1916 aStr = ImpGetDescriptionString(STR_EditAlignCenter);
1917 }
1918 else
1919 {
1920 aStr = ImpGetDescriptionString(STR_EditAlign);
1921 }
1922 BegUndo(aStr);
1923 }
1924
1925 tools::Rectangle aBound;
1926 const size_t nMarkCount=GetMarkedObjectCount();
1927 bool bHasFixed=false;
1928 for (size_t nm=0; nm<nMarkCount; ++nm)
1929 {
1930 SdrMark* pM=GetSdrMarkByIndex(nm);
1931 SdrObject* pObj=pM->GetMarkedSdrObj();
1933 pObj->TakeObjInfo(aInfo);
1934 if (!aInfo.bMoveAllowed || pObj->IsMoveProtect())
1935 {
1936 tools::Rectangle aObjRect(pObj->GetSnapRect());
1937 aBound.Union(aObjRect);
1938 bHasFixed=true;
1939 }
1940 }
1941 if (!bHasFixed)
1942 {
1943 if (nMarkCount==1)
1944 { // align single object to page
1945 const SdrObject* pObj=GetMarkedObjectByIndex(0);
1946 const SdrPage* pPage=pObj->getSdrPageFromSdrObject();
1948 const SdrPageGridFrame* pFrame=nullptr;
1949 if (pGFL!=nullptr && pGFL->GetCount()!=0)
1950 { // Writer
1951 pFrame=&((*pGFL)[0]);
1952 }
1953
1954 if (pFrame!=nullptr)
1955 { // Writer
1956 aBound=pFrame->GetUserArea();
1957 }
1958 else
1959 {
1960 aBound=tools::Rectangle(pPage->GetLeftBorder(),pPage->GetUpperBorder(),
1961 pPage->GetWidth()-pPage->GetRightBorder(),
1962 pPage->GetHeight()-pPage->GetLowerBorder());
1963 }
1964 }
1965 else
1966 {
1967 aBound=GetMarkedObjRect();
1968 }
1969 }
1970 Point aCenter(aBound.Center());
1971 for (size_t nm=0; nm<nMarkCount; ++nm)
1972 {
1973 SdrMark* pM=GetSdrMarkByIndex(nm);
1974 SdrObject* pObj=pM->GetMarkedSdrObj();
1976 pObj->TakeObjInfo(aInfo);
1977 if (aInfo.bMoveAllowed && !pObj->IsMoveProtect())
1978 {
1979 tools::Long nXMov=0;
1980 tools::Long nYMov=0;
1981 tools::Rectangle aObjRect(pObj->GetSnapRect());
1982 switch (eVert)
1983 {
1984 case SdrVertAlign::Top : nYMov=aBound.Top() -aObjRect.Top() ; break;
1985 case SdrVertAlign::Bottom: nYMov=aBound.Bottom()-aObjRect.Bottom() ; break;
1986 case SdrVertAlign::Center: nYMov=aCenter.Y() -aObjRect.Center().Y(); break;
1987 default: break;
1988 }
1989 switch (eHor)
1990 {
1991 case SdrHorAlign::Left : nXMov=aBound.Left() -aObjRect.Left() ; break;
1992 case SdrHorAlign::Right : nXMov=aBound.Right() -aObjRect.Right() ; break;
1993 case SdrHorAlign::Center: nXMov=aCenter.X() -aObjRect.Center().X(); break;
1994 default: break;
1995 }
1996 if (nXMov!=0 || nYMov!=0)
1997 {
1998 // SdrEdgeObj needs an extra SdrUndoGeoObj since the
1999 // connections may need to be saved
2000 if( bUndo )
2001 {
2002 if( dynamic_cast<SdrEdgeObj*>(pObj) )
2003 {
2004 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
2005 }
2006
2007 AddUndo(GetModel().GetSdrUndoFactory().CreateUndoMoveObject(*pObj,Size(nXMov,nYMov)));
2008 }
2009
2010 pObj->Move(Size(nXMov,nYMov));
2011 }
2012 }
2013 }
2014
2015 if( bUndo )
2016 EndUndo();
2017}
2018
2019/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
Helper for 3d object changes affecting 2d geometry.
bool IsValid() const
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long getX() const
constexpr tools::Long getY() const
Utility class SdrEdgeObj.
Definition: svdoedge.hxx:130
SfxItemSet GetAttrFromMarked(bool bOnlyHardAttr) const
Definition: svdedtv1.cxx:891
bool IsUndoEnabled() const
Definition: svdedtv.cxx:1056
bool m_bResizeProtect
Definition: svdedtv.hxx:114
virtual void MarkListHasChanged() override
Definition: svdedtv.cxx:371
void MirrorMarkedObj(const Point &rRef1, const Point &rRef2, bool bCopy=false)
Definition: svdedtv1.cxx:355
void SetAttrToMarked(const SfxItemSet &rAttr, bool bReplaceAll)
Definition: svdedtv1.cxx:1063
bool m_bShearAllowed
Definition: svdedtv.hxx:105
void SetStyleSheetToMarked(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr)
Definition: svdedtv1.cxx:1295
bool m_bMoveAllowed
Definition: svdedtv.hxx:97
void SetNotPersistAttrToMarked(const SfxItemSet &rAttr)
Definition: svdedtv1.cxx:686
SfxStyleSheet * GetStyleSheet() const
Definition: svdedtv1.cxx:1351
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdedtv.hxx:196
void BegUndo()
Definition: svdedtv.hxx:178
void SetStyleSheet(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr)
Definition: svdedtv1.cxx:1360
void EndTextEditCurrentView(bool bDontDeleteReally=false)
Definition: svdedtv.cxx:1073
SfxStyleSheet * GetStyleSheetFromMarked() const
Definition: svdedtv1.cxx:1280
void SetGeoAttrToMarked(const SfxItemSet &rAttr, bool addPageMargin=false)
Definition: svdedtv1.cxx:1546
void MirrorMarkedObjVertical()
Definition: svdedtv1.cxx:427
std::vector< std::unique_ptr< SdrUndoAction > > CreateConnectorUndo(const SdrObject &rO)
Definition: svdedtv1.cxx:150
static void ImpDistortObj(SdrObject *pO, const tools::Rectangle &rRef, const XPolygon &rDistortedRect, bool bNoContortion)
Definition: svdedtv1.cxx:611
void SetMarkedObjRect(const tools::Rectangle &rRect)
Definition: svdedtv1.cxx:77
void MergeAttrFromMarked(SfxItemSet &rAttr, bool bOnlyHardAttr) const
Definition: svdedtv1.cxx:907
void ForcePossibilities() const
Definition: svdedtv.hxx:161
void CopyMarkedObj()
Definition: svdedtv.cxx:902
void SetAttributes(const SfxItemSet &rSet, bool bReplaceAll)
Definition: svdedtv1.cxx:1342
Degree100 GetMarkedObjShear() const
Definition: svdedtv1.cxx:435
void AddUndoActions(std::vector< std::unique_ptr< SdrUndoAction > >)
Definition: svdedtv1.cxx:177
void AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert)
Definition: svdedtv1.cxx:1868
bool IsAlignPossible() const
Definition: svdedtv1.cxx:1859
Degree100 GetMarkedObjRotate() const
Definition: svdedtv1.cxx:284
bool IsRotateAllowed(bool b90Deg=false) const
Definition: svdedtv.cxx:391
bool m_bRotate90Allowed
Definition: svdedtv.hxx:101
void MergeNotPersistAttrFromMarked(SfxItemSet &rAttr) const
Definition: svdedtv1.cxx:784
bool m_bResizeFreeAllowed
Definition: svdedtv.hxx:98
bool m_bRotateFreeAllowed
Definition: svdedtv.hxx:100
bool m_bResizePropAllowed
Definition: svdedtv.hxx:99
void ShearMarkedObj(const Point &rRef, Degree100 nAngle, bool bVShear=false, bool bCopy=false)
Definition: svdedtv1.cxx:455
void CrookMarkedObj(const Point &rRef, const Point &rRad, SdrCrookMode eMode, bool bVertical, bool bNoContortion, bool bCopy=false)
Definition: svdedtv1.cxx:567
bool m_bEdgeRadiusAllowed
Definition: svdedtv.hxx:106
SfxItemSet GetGeoAttrFromMarked() const
Definition: svdedtv1.cxx:1370
void RotateMarkedObj(const Point &rRef, Degree100 nAngle, bool bCopy=false)
Definition: svdedtv1.cxx:299
void MirrorMarkedObjHorizontal()
Definition: svdedtv1.cxx:419
void ResizeMarkedObj(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bCopy=false)
Definition: svdedtv1.cxx:217
void DistortMarkedObj(const tools::Rectangle &rRef, const XPolygon &rDistortedRect, bool bNoContortion, bool bCopy=false)
Definition: svdedtv1.cxx:645
static void ImpCrookObj(SdrObject *pO, const Point &rRef, const Point &rRad, SdrCrookMode eMode, bool bVertical, bool bNoContortion, bool bRotate, const tools::Rectangle &rMarkRect)
Definition: svdedtv1.cxx:489
void MoveMarkedObj(const Size &rSiz, bool bCopy=false)
Definition: svdedtv1.cxx:183
bool m_bOneOrMoreMovable
Definition: svdedtv.hxx:94
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr) const
Definition: svdedtv1.cxx:1330
bool m_bMoveProtect
Definition: svdedtv.hxx:113
void EndUndo()
Definition: svdedtv.cxx:295
void ResizeMultMarkedObj(const Point &rRef, const Fraction &xFact, const Fraction &yFact, const bool bWdh, const bool bHgt)
Definition: svdedtv1.cxx:248
size_t GetMarkCount() const
Definition: svdmark.hxx:178
SdrMark * GetMark(size_t nNum) const
Definition: svdmark.cxx:230
const Point & GetRef2() const
Definition: svdmrkv.hxx:447
virtual SfxViewShell * GetSfxViewShell() const
Get access to the view shell owning this draw view, if any.
Definition: svdmrkv.cxx:1834
OUString ImpGetDescriptionString(TranslateId pStrCacheID, ImpGetDescriptionOptions nOpt=ImpGetDescriptionOptions::NONE) const
Definition: svdmrkv.cxx:2656
const Point & GetRef1() const
Definition: svdmrkv.hxx:443
const SdrMarkList & GetMarkedObjectList() const
Definition: svdmrkv.hxx:258
bool AreObjectsMarked() const
Definition: svdmrkv.hxx:266
void SortMarkedObjects() const
Definition: svdmrkv.hxx:265
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
Definition: svdmrkv.hxx:263
void SetRef1(const Point &rPt)
Definition: svdmrkv.cxx:1812
size_t GetMarkedObjectCount() const
Definition: svdmrkv.hxx:264
Point maRef1
Definition: svdmrkv.hxx:105
SdrDragMode meDragMode
Definition: svdmrkv.hxx:118
SdrMark * GetSdrMarkByIndex(size_t nNum) const
Definition: svdmrkv.hxx:262
OUString const & GetDescriptionOfMarkedObjects() const
Definition: svdmrkv.hxx:267
SdrPageView * GetSdrPageViewOfMarkedByIndex(size_t nNum) const
Definition: svdmrkv.hxx:261
const tools::Rectangle & GetMarkedObjRect() const
Definition: svdmrkv.cxx:2636
void SetRef2(const Point &rPt)
Definition: svdmrkv.cxx:1823
Everything a View needs to know about a selected object.
Definition: svdmark.hxx:45
SdrObject * GetMarkedSdrObj() const
Definition: svdmark.hxx:68
SdrObject * Next()
Definition: svditer.hxx:63
bool IsMore() const
Definition: svditer.hxx:62
Provides information about various ZObject properties.
Definition: svdobj.hxx:196
Abstract DrawObject.
Definition: svdobj.hxx:260
bool IsResizeProtect() const
Definition: svdobj.hxx:758
virtual Degree100 GetShearAngle(bool bVertical=false) const
Definition: svdobj.cxx:1710
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:2009
virtual Degree100 GetRotateAngle() const
Definition: svdobj.cxx:1705
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1596
const SfxBroadcaster * GetBroadcaster() const
Definition: svdobj.cxx:697
virtual Point GetPoint(sal_uInt32 i) const
Definition: svdobj.cxx:1735
bool IsMoveProtect() const
Definition: svdobj.hxx:756
void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
Definition: svdobj.cxx:2249
virtual void Mirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1587
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:717
virtual bool IsPolyObj() const
Definition: svdobj.cxx:1725
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1531
void SetResizeProtect(bool bProt)
Definition: svdobj.cxx:2677
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1662
SfxStyleSheet * GetStyleSheet() const
Definition: svdobj.cxx:2244
void SetMoveProtect(bool bProt)
Definition: svdobj.cxx:2666
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:261
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:1576
void SetPoint(const Point &rPnt, sal_uInt32 i)
Definition: svdobj.cxx:1740
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:2014
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:279
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1687
bool IsVisible() const
Definition: svdobj.hxx:762
const SfxItemSet & GetMergedItemSet() const
Definition: svdobj.cxx:1974
bool IsPrintable() const
Definition: svdobj.hxx:760
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:645
void SetMergedItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1984
virtual SdrObject * GetConnectedNode(bool bTail1) const
Definition: svdobj.cxx:2376
void ApplyNotPersistAttr(const SfxItemSet &rAttr)
Definition: svdobj.cxx:2019
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const
Definition: svdobj.cxx:2981
virtual sal_uInt32 GetPointCount() const
Definition: svdobj.cxx:1730
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
Definition: svdobj.cxx:631
virtual const tools::Rectangle & GetLogicRect() const
Definition: svdobj.cxx:1672
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
Definition: svdobj.cxx:1548
sal_uInt16 GetCount() const
Definition: svdpage.hxx:308
for the snap-to-grid in Writer
Definition: svdpage.hxx:287
const tools::Rectangle & GetUserArea() const
Definition: svdpage.hxx:293
void LogicToPagePos(Point &rPnt) const
Definition: svdpagv.hxx:205
void PagePosToLogic(Point &rPnt) const
Definition: svdpagv.hxx:207
SdrPage * GetPage() const
Definition: svdpagv.hxx:166
const Point & GetPageOrigin() const
The Origin always refers to the upper left corner of the Page.
Definition: svdpagv.hxx:202
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:379
virtual const SdrPageGridFrameList * GetGridFrameList(const SdrPageView *pPV, const tools::Rectangle *pRect) const
for snap-to-grid in Writer, also for AlignObjects if 1 object is marked if pRect !...
Definition: svdpage.cxx:1721
sal_Int32 GetUpperBorder() const
Definition: svdpage.cxx:1561
sal_Int32 GetRightBorder() const
Definition: svdpage.cxx:1566
sal_Int32 GetLeftBorder() const
Definition: svdpage.cxx:1556
sal_Int32 GetLowerBorder() const
Definition: svdpage.cxx:1571
tools::Long GetHeight() const
Definition: svdpage.cxx:1481
tools::Long GetWidth() const
Definition: svdpage.cxx:1455
void SetAttributes(const SfxItemSet &rSet, bool bReplaceAll)
Definition: svdpntv.cxx:1000
SfxStyleSheet * GetStyleSheet() const
Definition: svdpntv.cxx:1005
void SetAnimationTimer(sal_uInt32 nTime)
Definition: svdpntv.cxx:1203
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr) const
Definition: svdpntv.cxx:985
SdrPageView * GetSdrPageView() const
Definition: svdpntv.hxx:323
SdrModel & GetModel() const
Definition: svdpntv.hxx:282
void SetStyleSheet(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr)
Definition: svdpntv.cxx:1010
void SetPathPoly(const basegfx::B2DPolyPolygon &rPathPoly)
Definition: svdopath.cxx:2737
const basegfx::B2DPolyPolygon & GetPathPoly() const
Definition: svdopath.hxx:141
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
const WhichRangesContainer & GetRanges() const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
void MergeValue(const SfxPoolItem &rItem, bool bOverwriteDefaults=false)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void InvalidateItem(sal_uInt16 nWhich)
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
sal_uInt16 FirstWhich()
SfxItemState GetItemState(bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
sal_uInt16 NextWhich()
basegfx::B2DPolyPolygon getB2DPolyPolygon() const
Definition: _xpoly.cxx:930
void Distort(const tools::Rectangle &rRefRect, const XPolygon &rDistortedRect)
Distort a polygon by scaling its coordinates relative to a reference rectangle into an arbitrary rect...
Definition: _xpoly.cxx:923
void Distort(const tools::Rectangle &rRefRect, const XPolygon &rDistortedRect)
Distort a polygon by scaling its coordinates relative to a reference rectangle into an arbitrary rect...
Definition: _xpoly.cxx:762
double get(sal_uInt16 nRow, sal_uInt16 nColumn) const
bool isIdentity() const
bool isAnimatedInAnyViewObjectContact() const
constexpr Point Center() const
constexpr tools::Long GetWidth() const
constexpr void SetLeft(tools::Long v)
constexpr void SetTop(tools::Long v)
constexpr tools::Long Top() const
constexpr Point TopLeft() const
tools::Long getOpenHeight() const
constexpr void SetRight(tools::Long v)
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
constexpr tools::Long Right() const
constexpr Point RightCenter() const
constexpr Point BottomCenter() const
constexpr void SetBottom(tools::Long v)
constexpr Point BottomRight() const
constexpr Point TopRight() const
constexpr tools::Long GetHeight() const
tools::Rectangle & Union(const tools::Rectangle &rRect)
constexpr Point LeftCenter() const
constexpr Point TopCenter() const
tools::Long getOpenWidth() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr bool IsEmpty() const
constexpr Point BottomLeft() const
int nCount
#define DBG_ASSERT(sCon, aError)
double toRadians(D x)
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
constexpr sal_uInt16 EE_FEATURE_END(EE_FEATURE_FIELD+0)
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
constexpr sal_uInt16 EE_FEATURE_LINEBR(EE_FEATURE_TAB+1)
constexpr sal_uInt16 EE_CHAR_START(EE_PARA_END+1)
constexpr sal_uInt16 EE_FEATURE_NOTCONV(EE_FEATURE_LINEBR+1)
constexpr sal_uInt16 EE_FEATURE_START(EE_CHAR_END+1)
constexpr sal_uInt16 EE_CHAR_END(EE_CHAR_START+32)
constexpr sal_uInt16 EE_FEATURE_TAB(EE_FEATURE_START+0)
tools::Long FRound(double fVal)
Mode eMode
sal_Int64 n
uno_Any a
aStr
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
int i
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
static constexpr auto Items
long Long
const char GetValue[]
#define Y
SfxItemState
bool IsInvalidItem(const SfxPoolItem *pItem)
RectPoint
Definition: rectenum.hxx:23
SdrMetricItem makeSdrEckenradiusItem(tools::Long nRadius)
Definition: sderitm.hxx:25
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
Definition: sdtagitm.hxx:25
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
Definition: sdtagitm.hxx:30
static SfxItemSet & rSet
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWWIDTH(SDRATTR_MISC_FIRST+12)
constexpr TypedWhichId< SdrTransformRef2XItem > SDRATTR_TRANSFORMREF2X(SDRATTR_NOTPERSIST_FIRST+32)
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DOBJ_DEPTH(SDRATTR_3DOBJ_FIRST+2)
constexpr TypedWhichId< SdrResizeXAllItem > SDRATTR_RESIZEXALL(SDRATTR_NOTPERSIST_FIRST+25)
constexpr TypedWhichId< SdrHorzShearAllItem > SDRATTR_HORZSHEARALL(SDRATTR_NOTPERSIST_FIRST+28)
constexpr TypedWhichId< SdrPercentItem > SDRATTR_SHADOWTRANSPARENCE(SDRATTR_SHADOW_FIRST+4)
constexpr TypedWhichId< SdrAllSizeWidthItem > SDRATTR_ALLSIZEWIDTH(SDRATTR_NOTPERSIST_FIRST+8)
constexpr TypedWhichId< SdrAllPositionYItem > SDRATTR_ALLPOSITIONY(SDRATTR_NOTPERSIST_FIRST+7)
constexpr TypedWhichId< SdrResizeYAllItem > SDRATTR_RESIZEYALL(SDRATTR_NOTPERSIST_FIRST+26)
constexpr TypedWhichId< SdrAllSizeHeightItem > SDRATTR_ALLSIZEHEIGHT(SDRATTR_NOTPERSIST_FIRST+9)
constexpr TypedWhichId< SdrTransformRef2YItem > SDRATTR_TRANSFORMREF2Y(SDRATTR_NOTPERSIST_FIRST+33)
constexpr TypedWhichId< SdrRotateAllItem > SDRATTR_ROTATEALL(SDRATTR_NOTPERSIST_FIRST+27)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWHEIGHT(SDRATTR_MISC_FIRST+2)
constexpr TypedWhichId< SfxUInt16Item > SDRATTR_3DOBJ_BACKSCALE(SDRATTR_3DOBJ_FIRST+1)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_MINFRAMEHEIGHT(SDRATTR_MISC_FIRST+1)
constexpr TypedWhichId< SdrAllPositionXItem > SDRATTR_ALLPOSITIONX(SDRATTR_NOTPERSIST_FIRST+6)
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DSCENE_DISTANCE(SDRATTR_3DSCENE_FIRST+1)
constexpr TypedWhichId< SdrTransformRef1YItem > SDRATTR_TRANSFORMREF1Y(SDRATTR_NOTPERSIST_FIRST+31)
constexpr TypedWhichId< SfxUInt16Item > SDRATTR_3DOBJ_PERCENT_DIAGONAL(SDRATTR_3DOBJ_FIRST+0)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_CORNER_RADIUS(SDRATTR_MISC_FIRST+0)
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DOBJ_END_ANGLE(SDRATTR_3DOBJ_FIRST+5)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_CONTOURFRAME(SDRATTR_MISC_FIRST+21)
constexpr TypedWhichId< SdrVertShearAllItem > SDRATTR_VERTSHEARALL(SDRATTR_NOTPERSIST_FIRST+29)
constexpr TypedWhichId< SdrTransformRef1XItem > SDRATTR_TRANSFORMREF1X(SDRATTR_NOTPERSIST_FIRST+30)
static Point ImpGetPoint(const tools::Rectangle &rRect, RectPoint eRP)
Definition: svdedtv1.cxx:1530
std::vector< sal_uInt16 > GetAllCharPropIds(const SfxItemSet &rSet)
Definition: svdedtv1.cxx:1033
SdrVertAlign
Definition: svdedtv.hxx:44
SdrHorAlign
Definition: svdedtv.hxx:37
bool SearchOutlinerItems(const SfxItemSet &rSet, bool bInklDefaults, bool *pbOnlyEE)
Search an ItemSet for Outliner/EditEngine Items.
Definition: svdetc.cxx:352
E3dObject * DynCastE3dObject(SdrObject *pObj)
Definition: svdobj.cxx:3205
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
Definition: svdobj.cxx:3212
SdrCrookMode
Definition: svdsnpv.hxx:83
void CrookStretchPoly(XPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert, const tools::Rectangle &rRefRect)
Definition: svdtrans.cxx:338
void CrookRotatePoly(XPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert)
Definition: svdtrans.cxx:292
double CrookRotateXPoint(Point &rPnt, Point *pC1, Point *pC2, const Point &rCenter, const Point &rRad, double &rSin, double &rCos, bool bVert)
The following methods accept a point of an XPolygon, whereas the neighbouring control points of the a...
Definition: svdtrans.cxx:163
double CrookSlantXPoint(Point &rPnt, Point *pC1, Point *pC2, const Point &rCenter, const Point &rRad, double &rSin, double &rCos, bool bVert)
Definition: svdtrans.cxx:217
double CrookStretchXPoint(Point &rPnt, Point *pC1, Point *pC2, const Point &rCenter, const Point &rRad, double &rSin, double &rCos, bool bVert, const tools::Rectangle &rRefRect)
Definition: svdtrans.cxx:272
void CrookSlantPoly(XPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert)
Definition: svdtrans.cxx:315
constexpr Degree100 SDRMAXSHEAR(8900)
bool bVisible
Center
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr TypedWhichId< XFillTransparenceItem > XATTR_FILLTRANSPARENCE(XATTR_FILL_FIRST+5)
constexpr TypedWhichId< XLineColorItem > XATTR_LINECOLOR(XATTR_LINE_FIRST+3)
constexpr TypedWhichId< XLineStartWidthItem > XATTR_LINESTARTWIDTH(XATTR_LINE_FIRST+6)
constexpr TypedWhichId< XLineWidthItem > XATTR_LINEWIDTH(XATTR_LINE_FIRST+2)
constexpr TypedWhichId< XLineEndWidthItem > XATTR_LINEENDWIDTH(XATTR_LINE_FIRST+7)
constexpr TypedWhichId< XLineTransparenceItem > XATTR_LINETRANSPARENCE(XATTR_LINE_FIRST+10)
XPropertyListType t
Definition: xtable.cxx:371