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>
36 #include <svx/e3dsceneupdater.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  {
104  SdrMark* pM=GetSdrMarkByIndex(nm);
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 
150 std::vector< std::unique_ptr<SdrUndoAction> > SdrEditView::CreateConnectorUndo( 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 
177 void SdrEditView::AddUndoActions( std::vector< std::unique_ptr<SdrUndoAction> > aUndoActions )
178 {
179  for (auto & rAction : aUndoActions)
180  AddUndo( std::move(rAction) );
181 }
182 
183 void 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)
198  CopyMarkedObj();
199 
200  const size_t nMarkCount=GetMarkedObjectCount();
201  for (size_t nm=0; nm<nMarkCount; ++nm)
202  {
203  SdrMark* pM=GetSdrMarkByIndex(nm);
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 
217 void 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)
230  CopyMarkedObj();
231 
232  const size_t nMarkCount=GetMarkedObjectCount();
233  for (size_t nm=0; nm<nMarkCount; ++nm)
234  {
235  SdrMark* pM=GetSdrMarkByIndex(nm);
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 }
248 void SdrEditView::ResizeMultMarkedObj(const Point& rRef,
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  {
264  SdrMark* pM=GetSdrMarkByIndex(nm);
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 
299 void 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)
311  CopyMarkedObj();
312 
313  double nSin = sin(nAngle.get() * F_PI18000);
314  double nCos = cos(nAngle.get() * F_PI18000);
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(dynamic_cast< E3dObject* >(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 
355 void 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)
377  CopyMarkedObj();
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(dynamic_cast< E3dObject* >(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 {
422  Point aPt2(aCenter);
423  aPt2.AdjustY( 1 );
424  MirrorMarkedObj(aCenter,aPt2);
425 }
426 
428 {
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) {
442  SdrMark* pM=GetSdrMarkByIndex(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 
455 void 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)
469  CopyMarkedObj();
470 
471  double nTan = tan(nAngle.get() * F_PI18000);
472  const size_t nMarkCount=GetMarkedObjectCount();
473  for (size_t nm=0; nm<nMarkCount; ++nm)
474  {
475  SdrMark* pM=GetSdrMarkByIndex(nm);
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 
489 void 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(nAngle / F_PI18000)), nSin, nCos);
563 
564  pO->Move(Size(aCtr1.X(),aCtr1.Y()));
565 }
566 
567 void 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)
585  CopyMarkedObj();
586 
587  const size_t nMarkCount=GetMarkedObjectCount();
588  for (size_t nm=0; nm<nMarkCount; ++nm)
589  {
590  SdrMark* pM=GetSdrMarkByIndex(nm);
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 
611 void 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 
645 void 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)
659  CopyMarkedObj();
660 
661  const size_t nMarkCount=GetMarkedObjectCount();
662  for (size_t nm=0; nm<nMarkCount; ++nm)
663  {
664  SdrMark* pM=GetSdrMarkByIndex(nm);
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  const SfxPoolItem *pPoolItem=nullptr;
691  if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1X,true,&pPoolItem)==SfxItemState::SET) {
692  tools::Long n=static_cast<const SdrTransformRef1XItem*>(pPoolItem)->GetValue();
693  SetRef1(Point(n,GetRef1().Y()));
694  }
695  if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1Y,true,&pPoolItem)==SfxItemState::SET) {
696  tools::Long n=static_cast<const SdrTransformRef1YItem*>(pPoolItem)->GetValue();
697  SetRef1(Point(GetRef1().X(),n));
698  }
699  if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2X,true,&pPoolItem)==SfxItemState::SET) {
700  tools::Long n=static_cast<const SdrTransformRef2XItem*>(pPoolItem)->GetValue();
701  SetRef2(Point(n,GetRef2().Y()));
702  }
703  if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2Y,true,&pPoolItem)==SfxItemState::SET) {
704  tools::Long n=static_cast<const SdrTransformRef2YItem*>(pPoolItem)->GetValue();
705  SetRef2(Point(GetRef2().X(),n));
706  }
707  tools::Long nAllPosX=0; bool bAllPosX=false;
708  tools::Long nAllPosY=0; bool bAllPosY=false;
709  tools::Long nAllWdt=0; bool bAllWdt=false;
710  tools::Long nAllHgt=0; bool bAllHgt=false;
711  bool bDoIt=false;
712  if (rAttr.GetItemState(SDRATTR_ALLPOSITIONX,true,&pPoolItem)==SfxItemState::SET) {
713  nAllPosX=static_cast<const SdrAllPositionXItem*>(pPoolItem)->GetValue();
714  bAllPosX=true; bDoIt=true;
715  }
716  if (rAttr.GetItemState(SDRATTR_ALLPOSITIONY,true,&pPoolItem)==SfxItemState::SET) {
717  nAllPosY=static_cast<const SdrAllPositionYItem*>(pPoolItem)->GetValue();
718  bAllPosY=true; bDoIt=true;
719  }
720  if (rAttr.GetItemState(SDRATTR_ALLSIZEWIDTH,true,&pPoolItem)==SfxItemState::SET) {
721  nAllWdt=static_cast<const SdrAllSizeWidthItem*>(pPoolItem)->GetValue();
722  bAllWdt=true; bDoIt=true;
723  }
724  if (rAttr.GetItemState(SDRATTR_ALLSIZEHEIGHT,true,&pPoolItem)==SfxItemState::SET) {
725  nAllHgt=static_cast<const SdrAllSizeHeightItem*>(pPoolItem)->GetValue();
726  bAllHgt=true; bDoIt=true;
727  }
728  if (bDoIt) {
729  tools::Rectangle aRect(aAllSnapRect); // TODO: change this for PolyPt's and GluePt's!!!
730  if (bAllPosX) aRect.Move(nAllPosX-aRect.Left(),0);
731  if (bAllPosY) aRect.Move(0,nAllPosY-aRect.Top());
732  if (bAllWdt) aRect.SetRight(aAllSnapRect.Left()+nAllWdt );
733  if (bAllHgt) aRect.SetBottom(aAllSnapRect.Top()+nAllHgt );
734  SetMarkedObjRect(aRect);
735  }
736  if (rAttr.GetItemState(SDRATTR_RESIZEXALL,true,&pPoolItem)==SfxItemState::SET) {
737  Fraction aXFact=static_cast<const SdrResizeXAllItem*>(pPoolItem)->GetValue();
738  ResizeMarkedObj(aAllSnapRect.TopLeft(),aXFact,Fraction(1,1));
739  }
740  if (rAttr.GetItemState(SDRATTR_RESIZEYALL,true,&pPoolItem)==SfxItemState::SET) {
741  Fraction aYFact=static_cast<const SdrResizeYAllItem*>(pPoolItem)->GetValue();
742  ResizeMarkedObj(aAllSnapRect.TopLeft(),Fraction(1,1),aYFact);
743  }
744  if (rAttr.GetItemState(SDRATTR_ROTATEALL,true,&pPoolItem)==SfxItemState::SET) {
745  Degree100 nAngle=static_cast<const SdrRotateAllItem*>(pPoolItem)->GetValue();
746  RotateMarkedObj(aAllSnapRect.Center(),nAngle);
747  }
748  if (rAttr.GetItemState(SDRATTR_HORZSHEARALL,true,&pPoolItem)==SfxItemState::SET) {
749  Degree100 nAngle=static_cast<const SdrHorzShearAllItem*>(pPoolItem)->GetValue();
750  ShearMarkedObj(aAllSnapRect.Center(),nAngle);
751  }
752  if (rAttr.GetItemState(SDRATTR_VERTSHEARALL,true,&pPoolItem)==SfxItemState::SET) {
753  Degree100 nAngle=static_cast<const SdrVertShearAllItem*>(pPoolItem)->GetValue();
754  ShearMarkedObj(aAllSnapRect.Center(),nAngle,true);
755  }
756 
757  const bool bUndo = IsUndoEnabled();
758 
759  // TODO: check if WhichRange is necessary.
760  const size_t nMarkCount=GetMarkedObjectCount();
761  for (size_t nm=0; nm<nMarkCount; ++nm)
762  {
763  const SdrMark* pM=GetSdrMarkByIndex(nm);
764  SdrObject* pObj=pM->GetMarkedSdrObj();
765  if( bUndo )
766  AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
767 
768  pObj->ApplyNotPersistAttr(rAttr);
769  }
770 }
771 
773 {
774  // TODO: Take into account the origin and PvPos.
775  tools::Rectangle aAllSnapRect(GetMarkedObjRect()); // TODO: change this for PolyPt's and GluePt's!!!
776  tools::Long nAllSnapPosX=aAllSnapRect.Left();
777  tools::Long nAllSnapPosY=aAllSnapRect.Top();
778  tools::Long nAllSnapWdt=aAllSnapRect.GetWidth()-1;
779  tools::Long nAllSnapHgt=aAllSnapRect.GetHeight()-1;
780  // TODO: could go into CheckPossibilities
781  bool bMovProtect = false, bMovProtectDC = false;
782  bool bSizProtect = false, bSizProtectDC = false;
783  bool bPrintable = true, bPrintableDC = false;
784  bool bVisible = true, bVisibleDC = false;
785  SdrLayerID nLayerId(0);
786  bool bLayerDC=false;
787  tools::Long nSnapPosX=0; bool bSnapPosXDC=false;
788  tools::Long nSnapPosY=0; bool bSnapPosYDC=false;
789  tools::Long nSnapWdt=0; bool bSnapWdtDC=false;
790  tools::Long nSnapHgt=0; bool bSnapHgtDC=false;
791  tools::Long nLogicWdt=0; bool bLogicWdtDC=false,bLogicWdtDiff=false;
792  tools::Long nLogicHgt=0; bool bLogicHgtDC=false,bLogicHgtDiff=false;
793  Degree100 nRotAngle(0); bool bRotAngleDC=false;
794  Degree100 nShrAngle(0); bool bShrAngleDC=false;
795  tools::Rectangle aSnapRect;
796  tools::Rectangle aLogicRect;
797  const size_t nMarkCount=GetMarkedObjectCount();
798  for (size_t nm=0; nm<nMarkCount; ++nm) {
799  const SdrMark* pM=GetSdrMarkByIndex(nm);
800  const SdrObject* pObj=pM->GetMarkedSdrObj();
801  if (nm==0) {
802  nLayerId=pObj->GetLayer();
803  bMovProtect=pObj->IsMoveProtect();
804  bSizProtect=pObj->IsResizeProtect();
805  bPrintable =pObj->IsPrintable();
806  bVisible = pObj->IsVisible();
807  tools::Rectangle aSnapRect2(pObj->GetSnapRect());
808  tools::Rectangle aLogicRect2(pObj->GetLogicRect());
809  nSnapPosX=aSnapRect2.Left();
810  nSnapPosY=aSnapRect2.Top();
811  nSnapWdt=aSnapRect2.GetWidth()-1;
812  nSnapHgt=aSnapRect2.GetHeight()-1;
813  nLogicWdt=aLogicRect2.GetWidth()-1;
814  nLogicHgt=aLogicRect2.GetHeight()-1;
815  bLogicWdtDiff=nLogicWdt!=nSnapWdt;
816  bLogicHgtDiff=nLogicHgt!=nSnapHgt;
817  nRotAngle=pObj->GetRotateAngle();
818  nShrAngle=pObj->GetShearAngle();
819  } else {
820  if (!bLayerDC && nLayerId !=pObj->GetLayer()) bLayerDC = true;
821  if (!bMovProtectDC && bMovProtect!=pObj->IsMoveProtect()) bMovProtectDC = true;
822  if (!bSizProtectDC && bSizProtect!=pObj->IsResizeProtect()) bSizProtectDC = true;
823  if (!bPrintableDC && bPrintable !=pObj->IsPrintable()) bPrintableDC = true;
824  if (!bVisibleDC && bVisible !=pObj->IsVisible()) bVisibleDC=true;
825  if (!bRotAngleDC && nRotAngle !=pObj->GetRotateAngle()) bRotAngleDC=true;
826  if (!bShrAngleDC && nShrAngle !=pObj->GetShearAngle()) bShrAngleDC=true;
827  if (!bSnapWdtDC || !bSnapHgtDC || !bSnapPosXDC || !bSnapPosYDC || !bLogicWdtDiff || !bLogicHgtDiff) {
828  aSnapRect=pObj->GetSnapRect();
829  if (nSnapPosX!=aSnapRect.Left()) bSnapPosXDC=true;
830  if (nSnapPosY!=aSnapRect.Top()) bSnapPosYDC=true;
831  if (nSnapWdt!=aSnapRect.GetWidth()-1) bSnapWdtDC=true;
832  if (nSnapHgt!=aSnapRect.GetHeight()-1) bSnapHgtDC=true;
833  }
834  if (!bLogicWdtDC || !bLogicHgtDC || !bLogicWdtDiff || !bLogicHgtDiff) {
835  aLogicRect=pObj->GetLogicRect();
836  if (nLogicWdt!=aLogicRect.GetWidth()-1) bLogicWdtDC=true;
837  if (nLogicHgt!=aLogicRect.GetHeight()-1) bLogicHgtDC=true;
838  if (!bLogicWdtDiff && aSnapRect.GetWidth()!=aLogicRect.GetWidth()) bLogicWdtDiff=true;
839  if (!bLogicHgtDiff && aSnapRect.GetHeight()!=aLogicRect.GetHeight()) bLogicHgtDiff=true;
840  }
841  }
842  }
843 
844  if (bSnapPosXDC || nAllSnapPosX!=nSnapPosX) rAttr.Put(SdrAllPositionXItem(nAllSnapPosX));
845  if (bSnapPosYDC || nAllSnapPosY!=nSnapPosY) rAttr.Put(SdrAllPositionYItem(nAllSnapPosY));
846  if (bSnapWdtDC || nAllSnapWdt !=nSnapWdt ) rAttr.Put(SdrAllSizeWidthItem(nAllSnapWdt));
847  if (bSnapHgtDC || nAllSnapHgt !=nSnapHgt ) rAttr.Put(SdrAllSizeHeightItem(nAllSnapHgt));
848 
849  // items for pure transformations
850  rAttr.Put(SdrMoveXItem());
851  rAttr.Put(SdrMoveYItem());
852  rAttr.Put(SdrResizeXOneItem());
853  rAttr.Put(SdrResizeYOneItem());
854  rAttr.Put(SdrRotateOneItem());
855  rAttr.Put(SdrHorzShearOneItem());
856  rAttr.Put(SdrVertShearOneItem());
857 
858  if (nMarkCount>1) {
859  rAttr.Put(SdrResizeXAllItem());
860  rAttr.Put(SdrResizeYAllItem());
861  rAttr.Put(SdrRotateAllItem());
862  rAttr.Put(SdrHorzShearAllItem());
863  rAttr.Put(SdrVertShearAllItem());
864  }
865 
867  {
868  rAttr.Put(SdrTransformRef1XItem(GetRef1().X()));
869  rAttr.Put(SdrTransformRef1YItem(GetRef1().Y()));
870  }
871 
873  {
874  rAttr.Put(SdrTransformRef2XItem(GetRef2().X()));
875  rAttr.Put(SdrTransformRef2YItem(GetRef2().Y()));
876  }
877 }
878 
880 {
881  SfxItemSet aSet(mpModel->GetItemPool());
882  MergeAttrFromMarked(aSet,bOnlyHardAttr);
883  //the EE_FEATURE items should not be set with SetAttrToMarked (see error message there)
884  //so we do not set them here
885  // #i32448#
886  // Do not disable, but clear the items.
887  aSet.ClearItem(EE_FEATURE_TAB);
888  aSet.ClearItem(EE_FEATURE_LINEBR);
889  aSet.ClearItem(EE_FEATURE_NOTCONV);
890  aSet.ClearItem(EE_FEATURE_FIELD);
891 
892  return aSet;
893 }
894 
895 void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) const
896 {
897  const size_t nMarkCount(GetMarkedObjectCount());
898 
899  for(size_t a = 0; a < nMarkCount; ++a)
900  {
901  // #80277# merging was done wrong in the prev version
903  SfxWhichIter aIter(rSet);
904  sal_uInt16 nWhich(aIter.FirstWhich());
905 
906  while(nWhich)
907  {
908  if(!bOnlyHardAttr)
909  {
910  if(SfxItemState::DONTCARE == rSet.GetItemState(nWhich, false))
911  rAttr.InvalidateItem(nWhich);
912  else
913  rAttr.MergeValue(rSet.Get(nWhich), true);
914  }
915  else if(SfxItemState::SET == rSet.GetItemState(nWhich, false))
916  {
917  const SfxPoolItem& rItem = rSet.Get(nWhich);
918  rAttr.MergeValue(rItem, true);
919  }
920 
922  {
923  OUString sPayload;
924  switch(nWhich)
925  {
926  case XATTR_LINECOLOR:
927  {
928  const SfxPoolItem* pItem = rSet.GetItem(XATTR_LINECOLOR);
929  if (pItem)
930  {
931  Color aColor = static_cast<const XLineColorItem*>(pItem)->GetColorValue();
932  sPayload = OUString::number(static_cast<sal_uInt32>(aColor));
933 
934  sPayload = ".uno:XLineColor=" + sPayload;
935  }
936  break;
937  }
938 
939  case XATTR_FILLCOLOR:
940  {
941  const SfxPoolItem* pItem = rSet.GetItem(XATTR_FILLCOLOR);
942  if (pItem)
943  {
944  Color aColor = static_cast<const XFillColorItem*>(pItem)->GetColorValue();
945  sPayload = OUString::number(static_cast<sal_uInt32>(aColor));
946 
947  sPayload = ".uno:FillColor=" + sPayload;
948  }
949  break;
950  }
951 
953  {
954  const SfxPoolItem* pItem = rSet.GetItem(XATTR_FILLTRANSPARENCE);
955  if (pItem)
956  {
957  sal_uInt16 nTransparency = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
958  sPayload = OUString::number(nTransparency);
959 
960  sPayload = ".uno:FillTransparence=" + sPayload;
961  }
962  break;
963  }
964 
966  {
967  const SfxPoolItem* pItem = rSet.GetItem(XATTR_LINETRANSPARENCE);
968  if (pItem)
969  {
970  sal_uInt16 nTransparency = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
971  sPayload = OUString::number(nTransparency);
972 
973  sPayload = ".uno:LineTransparence=" + sPayload;
974  }
975  break;
976  }
977 
978  case XATTR_LINEWIDTH:
979  {
980  const SfxPoolItem* pItem = rSet.GetItem(XATTR_LINEWIDTH);
981  if (pItem)
982  {
983  sal_uInt32 nWidth = static_cast<const XLineWidthItem*>(pItem)->GetValue();
984  sPayload = OUString::number(nWidth);
985 
986  sPayload = ".uno:LineWidth=" + sPayload;
987  }
988  break;
989  }
990 
992  {
993  const SfxPoolItem* pItem = rSet.GetItem(SDRATTR_SHADOWTRANSPARENCE);
994  if (pItem)
995  {
996  sal_uInt16 nWidth = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
997  sPayload = OUString::number(nWidth);
998 
999  sPayload = ".uno:FillShadowTransparency=" + sPayload;
1000  }
1001  break;
1002  }
1003  }
1004 
1005  if (!sPayload.isEmpty())
1006  GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
1007  OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr());
1008  }
1009 
1010  nWhich = aIter.NextWhich();
1011  }
1012  }
1013 }
1014 
1015 std::vector<sal_uInt16> GetAllCharPropIds(const SfxItemSet& rSet)
1016 {
1017  std::vector<sal_uInt16> aCharWhichIds;
1018  {
1019  SfxItemIter aIter(rSet);
1020  for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
1021  {
1022  if (!IsInvalidItem(pItem))
1023  {
1024  sal_uInt16 nWhich = pItem->Which();
1025  if (nWhich>=EE_CHAR_START && nWhich<=EE_CHAR_END)
1026  aCharWhichIds.push_back( nWhich );
1027  }
1028  }
1029  }
1030  return aCharWhichIds;
1031 }
1032 
1033 void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll)
1034 {
1035  if (!AreObjectsMarked())
1036  return;
1037 
1038 #ifdef DBG_UTIL
1039  {
1040  bool bHasEEFeatureItems=false;
1041  SfxItemIter aIter(rAttr);
1042  for (const SfxPoolItem* pItem = aIter.GetCurItem(); !bHasEEFeatureItems && pItem;
1043  pItem = aIter.NextItem())
1044  {
1045  if (!IsInvalidItem(pItem)) {
1046  sal_uInt16 nW=pItem->Which();
1047  if (nW>=EE_FEATURE_START && nW<=EE_FEATURE_END) bHasEEFeatureItems=true;
1048  }
1049  }
1050  if(bHasEEFeatureItems)
1051  {
1052  std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr,
1053  VclMessageType::Info, VclButtonsType::Ok,
1054  "SdrEditView::SetAttrToMarked(): Setting EE_FEATURE items at the SdrView does not make sense! It only leads to overhead and unreadable documents."));
1055  xInfoBox->run();
1056  }
1057  }
1058 #endif
1059 
1060  // #103836# if the user sets character attributes to the complete shape,
1061  // we want to remove all hard set character attributes with same
1062  // which ids from the text. We do that later but here we remember
1063  // all character attribute which id's that are set.
1064  std::vector<sal_uInt16> aCharWhichIds(GetAllCharPropIds(rAttr));
1065 
1066  // To make Undo reconstruct text attributes correctly after Format.Standard
1067  bool bHasEEItems=SearchOutlinerItems(rAttr,bReplaceAll);
1068 
1069  // save additional geometry information when paragraph or character attributes
1070  // are changed and the geometrical shape of the text object might be changed
1071  bool bPossibleGeomChange(false);
1072  SfxWhichIter aIter(rAttr);
1073  sal_uInt16 nWhich = aIter.FirstWhich();
1074  while(!bPossibleGeomChange && nWhich)
1075  {
1076  SfxItemState eState = rAttr.GetItemState(nWhich);
1077  if(eState == SfxItemState::SET)
1078  {
1079  if((nWhich >= SDRATTR_TEXT_MINFRAMEHEIGHT && nWhich <= SDRATTR_TEXT_CONTOURFRAME)
1080  || nWhich == SDRATTR_3DOBJ_PERCENT_DIAGONAL
1081  || nWhich == SDRATTR_3DOBJ_BACKSCALE
1082  || nWhich == SDRATTR_3DOBJ_DEPTH
1083  || nWhich == SDRATTR_3DOBJ_END_ANGLE
1084  || nWhich == SDRATTR_3DSCENE_DISTANCE)
1085  {
1086  bPossibleGeomChange = true;
1087  }
1088  }
1089  nWhich = aIter.NextWhich();
1090  }
1091 
1092  const bool bUndo = IsUndoEnabled();
1093  if( bUndo )
1094  {
1096  BegUndo(ImpGetDescriptionString(STR_EditSetAttributes));
1097  }
1098 
1099  const size_t nMarkCount(GetMarkedObjectCount());
1100  std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters;
1101 
1102  // create ItemSet without SfxItemState::DONTCARE. Put()
1103  // uses its second parameter (bInvalidAsDefault) to
1104  // remove all such items to set them to default.
1105  SfxItemSet aAttr(*rAttr.GetPool(), rAttr.GetRanges());
1106  aAttr.Put(rAttr);
1107 
1108  // #i38135#
1109  bool bResetAnimationTimer(false);
1110 
1111  const bool bLineStartWidthExplicitChange(SfxItemState::SET
1112  == aAttr.GetItemState(XATTR_LINESTARTWIDTH));
1113  const bool bLineEndWidthExplicitChange(SfxItemState::SET
1114  == aAttr.GetItemState(XATTR_LINEENDWIDTH));
1115  // check if LineWidth is part of the change
1116  const bool bAdaptStartEndWidths(!(bLineStartWidthExplicitChange && bLineEndWidthExplicitChange)
1117  && SfxItemState::SET == aAttr.GetItemState(XATTR_LINEWIDTH));
1118  sal_Int32 nNewLineWidth(0);
1119 
1120  if(bAdaptStartEndWidths)
1121  {
1122  nNewLineWidth = aAttr.Get(XATTR_LINEWIDTH).GetValue();
1123  }
1124 
1125  for (size_t nm=0; nm<nMarkCount; ++nm)
1126  {
1127  SdrMark* pM=GetSdrMarkByIndex(nm);
1128  SdrObject* pObj = pM->GetMarkedSdrObj();
1129 
1130  if( bUndo )
1131  {
1132  SdrEdgeObj* pEdgeObj = dynamic_cast< SdrEdgeObj* >( pObj );
1133  if ( pEdgeObj )
1134  bPossibleGeomChange = true;
1135  else
1136  AddUndoActions( CreateConnectorUndo( *pObj ) );
1137  }
1138 
1139  // new geometry undo
1140  if(bPossibleGeomChange && bUndo)
1141  {
1142  // save position and size of object, too
1143  AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
1144  }
1145 
1146  if( bUndo )
1147  {
1148  // #i8508#
1149  // If this is a text object also rescue the OutlinerParaObject since
1150  // applying attributes to the object may change text layout when
1151  // multiple portions exist with multiple formats. If an OutlinerParaObject
1152  // really exists and needs to be rescued is evaluated in the undo
1153  // implementation itself.
1154  const bool bRescueText = dynamic_cast< SdrTextObj* >(pObj) != nullptr;
1155 
1156  // add attribute undo
1157  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj,false,bHasEEItems || bPossibleGeomChange || bRescueText));
1158  }
1159 
1160  // set up a scene updater if object is a 3d object
1161  if(dynamic_cast< E3dObject* >(pObj))
1162  {
1163  aUpdaters.push_back(new E3DModifySceneSnapRectUpdater(pObj));
1164  }
1165 
1166  sal_Int32 nOldLineWidth(0);
1167  if (bAdaptStartEndWidths)
1168  {
1169  nOldLineWidth = pObj->GetMergedItem(XATTR_LINEWIDTH).GetValue();
1170  }
1171 
1172  // set attributes at object
1173  pObj->SetMergedItemSetAndBroadcast(aAttr, bReplaceAll);
1174 
1175  if(bAdaptStartEndWidths)
1176  {
1177  const SfxItemSet& rSet = pObj->GetMergedItemSet();
1178 
1179  if(nOldLineWidth != nNewLineWidth)
1180  {
1181  if(SfxItemState::DONTCARE != rSet.GetItemState(XATTR_LINESTARTWIDTH))
1182  {
1183  const sal_Int32 nValAct(rSet.Get(XATTR_LINESTARTWIDTH).GetValue());
1184  const sal_Int32 nValNewStart(std::max(sal_Int32(0), nValAct + (((nNewLineWidth - nOldLineWidth) * 15) / 10)));
1185 
1186  pObj->SetMergedItem(XLineStartWidthItem(nValNewStart));
1187  }
1188 
1189  if(SfxItemState::DONTCARE != rSet.GetItemState(XATTR_LINEENDWIDTH))
1190  {
1191  const sal_Int32 nValAct(rSet.Get(XATTR_LINEENDWIDTH).GetValue());
1192  const sal_Int32 nValNewEnd(std::max(sal_Int32(0), nValAct + (((nNewLineWidth - nOldLineWidth) * 15) / 10)));
1193 
1194  pObj->SetMergedItem(XLineEndWidthItem(nValNewEnd));
1195  }
1196  }
1197  }
1198 
1199  if(auto pTextObj = dynamic_cast<SdrTextObj*>( pObj))
1200  {
1201  if(!aCharWhichIds.empty())
1202  {
1203  tools::Rectangle aOldBoundRect = pTextObj->GetLastBoundRect();
1204 
1205  // #110094#-14 pTextObj->SendRepaintBroadcast(pTextObj->GetBoundRect());
1206  pTextObj->RemoveOutlinerCharacterAttribs( aCharWhichIds );
1207 
1208  // object has changed, should be called from
1209  // RemoveOutlinerCharacterAttribs. This will change when the text
1210  // object implementation changes.
1211  pTextObj->SetChanged();
1212 
1213  pTextObj->BroadcastObjectChange();
1214  pTextObj->SendUserCall(SdrUserCallType::ChangeAttr, aOldBoundRect);
1215  }
1216  }
1217 
1218  // #i38495#
1219  if(!bResetAnimationTimer)
1220  {
1222  {
1223  bResetAnimationTimer = true;
1224  }
1225  }
1226  }
1227 
1228  // fire scene updaters
1229  while(!aUpdaters.empty())
1230  {
1231  delete aUpdaters.back();
1232  aUpdaters.pop_back();
1233  }
1234 
1235  // #i38135#
1236  if(bResetAnimationTimer)
1237  {
1238  SetAnimationTimer(0);
1239  }
1240 
1241  // better check before what to do:
1242  // pObj->SetAttr() or SetNotPersistAttr()
1243  // TODO: missing implementation!
1245 
1246  if( bUndo )
1247  EndUndo();
1248 }
1249 
1251 {
1252  SfxStyleSheet* pRet=nullptr;
1253  bool b1st=true;
1254  const size_t nMarkCount=GetMarkedObjectCount();
1255  for (size_t nm=0; nm<nMarkCount; ++nm) {
1256  SdrMark* pM=GetSdrMarkByIndex(nm);
1258  if (b1st) pRet=pSS;
1259  else if (pRet!=pSS) return nullptr; // different stylesheets
1260  b1st=false;
1261  }
1262  return pRet;
1263 }
1264 
1265 void SdrEditView::SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
1266 {
1267  if (!AreObjectsMarked())
1268  return;
1269 
1270  const bool bUndo = IsUndoEnabled();
1271 
1272  if( bUndo )
1273  {
1275  OUString aStr;
1276  if (pStyleSheet!=nullptr)
1277  aStr = ImpGetDescriptionString(STR_EditSetStylesheet);
1278  else
1279  aStr = ImpGetDescriptionString(STR_EditDelStylesheet);
1280  BegUndo(aStr);
1281  }
1282 
1283  const size_t nMarkCount=GetMarkedObjectCount();
1284  for (size_t nm=0; nm<nMarkCount; ++nm)
1285  {
1286  SdrMark* pM=GetSdrMarkByIndex(nm);
1287  if( bUndo )
1288  {
1289  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pM->GetMarkedSdrObj()));
1290  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pM->GetMarkedSdrObj(),true,true));
1291  }
1292  pM->GetMarkedSdrObj()->SetStyleSheet(pStyleSheet,bDontRemoveHardAttr);
1293  }
1294 
1295  if( bUndo )
1296  EndUndo();
1297 }
1298 
1299 
1300 void SdrEditView::GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const
1301 {
1302  if(GetMarkedObjectCount())
1303  {
1304  rTargetSet.Put(GetAttrFromMarked(bOnlyHardAttr), false);
1305  }
1306  else
1307  {
1308  SdrMarkView::GetAttributes(rTargetSet, bOnlyHardAttr);
1309  }
1310 }
1311 
1312 void SdrEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
1313 {
1314  if (GetMarkedObjectCount()!=0) {
1315  SetAttrToMarked(rSet,bReplaceAll);
1316  } else {
1317  SdrMarkView::SetAttributes(rSet,bReplaceAll);
1318  }
1319 }
1320 
1322 {
1323  if (GetMarkedObjectCount()!=0) {
1324  return GetStyleSheetFromMarked();
1325  } else {
1326  return SdrMarkView::GetStyleSheet();
1327  }
1328 }
1329 
1330 void SdrEditView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
1331 {
1332  if (GetMarkedObjectCount()!=0) {
1333  SetStyleSheetToMarked(pStyleSheet,bDontRemoveHardAttr);
1334  } else {
1335  SdrMarkView::SetStyleSheet(pStyleSheet,bDontRemoveHardAttr);
1336  }
1337 }
1338 
1339 
1341 {
1342  SfxItemSet aRetSet(
1343  mpModel->GetItemPool(),
1344  svl::Items< // SID_ATTR_TRANSFORM_... from s:svxids.hrc
1346  SID_ATTR_TRANSFORM_POS_X, SID_ATTR_TRANSFORM_ANGLE,
1347  SID_ATTR_TRANSFORM_PROTECT_POS, SID_ATTR_TRANSFORM_AUTOHEIGHT>{});
1348 
1349  if (AreObjectsMarked())
1350  {
1351  SfxItemSet aMarkAttr(GetAttrFromMarked(false)); // because of AutoGrowHeight and corner radius
1353 
1354  if(GetSdrPageView())
1355  {
1356  GetSdrPageView()->LogicToPagePos(aRect);
1357  }
1358 
1359  // position
1360  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_X,aRect.Left()));
1361  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_Y,aRect.Top()));
1362 
1363  // size
1364  tools::Long nResizeRefX=aRect.Left();
1365  tools::Long nResizeRefY=aRect.Top();
1366  if (meDragMode==SdrDragMode::Rotate) { // use rotation axis as a reference for resizing, too
1367  nResizeRefX=maRef1.X();
1368  nResizeRefY=maRef1.Y();
1369  }
1370  aRetSet.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_WIDTH,aRect.Right()-aRect.Left()));
1371  aRetSet.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_HEIGHT,aRect.Bottom()-aRect.Top()));
1372  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_RESIZE_REF_X,nResizeRefX));
1373  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_RESIZE_REF_Y,nResizeRefY));
1374 
1375  Point aRotateAxe(maRef1);
1376 
1377  if(GetSdrPageView())
1378  {
1379  GetSdrPageView()->LogicToPagePos(aRotateAxe);
1380  }
1381 
1382  // rotation
1383  tools::Long nRotateRefX=aRect.Center().X();
1384  tools::Long nRotateRefY=aRect.Center().Y();
1386  nRotateRefX=aRotateAxe.X();
1387  nRotateRefY=aRotateAxe.Y();
1388  }
1389  aRetSet.Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE,GetMarkedObjRotate()));
1390  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_X,nRotateRefX));
1391  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_Y,nRotateRefY));
1392 
1393  // shearing
1394  tools::Long nShearRefX=aRect.Left();
1395  tools::Long nShearRefY=aRect.Bottom();
1396  if (meDragMode==SdrDragMode::Rotate) { // use rotation axis as a reference for shearing, too
1397  nShearRefX=aRotateAxe.X();
1398  nShearRefY=aRotateAxe.Y();
1399  }
1400  aRetSet.Put(SdrAngleItem(SID_ATTR_TRANSFORM_SHEAR,GetMarkedObjShear()));
1401  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_X,nShearRefX));
1402  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_Y,nShearRefY));
1403 
1404  // check every object whether it is protected
1405  const SdrMarkList& rMarkList=GetMarkedObjectList();
1406  const size_t nMarkCount=rMarkList.GetMarkCount();
1407  SdrObject* pObj=rMarkList.GetMark(0)->GetMarkedSdrObj();
1408  bool bPosProt=pObj->IsMoveProtect();
1409  bool bSizProt=pObj->IsResizeProtect();
1410  bool bPosProtDontCare=false;
1411  bool bSizProtDontCare=false;
1412  for (size_t i=1; i<nMarkCount && (!bPosProtDontCare || !bSizProtDontCare); ++i)
1413  {
1414  pObj=rMarkList.GetMark(i)->GetMarkedSdrObj();
1415  if (bPosProt!=pObj->IsMoveProtect()) bPosProtDontCare=true;
1416  if (bSizProt!=pObj->IsResizeProtect()) bSizProtDontCare=true;
1417  }
1418 
1419  // InvalidateItem sets item to DONT_CARE
1420  if (bPosProtDontCare) {
1421  aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_PROTECT_POS);
1422  } else {
1423  aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_PROTECT_POS,bPosProt));
1424  }
1425  if (bSizProtDontCare) {
1426  aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_PROTECT_SIZE);
1427  } else {
1428  aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_PROTECT_SIZE,bSizProt));
1429  }
1430 
1432  bool bAutoGrow=aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWWIDTH).GetValue();
1433  if (eState==SfxItemState::DONTCARE) {
1434  aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_AUTOWIDTH);
1435  } else if (eState==SfxItemState::SET) {
1436  aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_AUTOWIDTH,bAutoGrow));
1437  }
1438 
1439  eState=aMarkAttr.GetItemState(SDRATTR_TEXT_AUTOGROWHEIGHT);
1440  bAutoGrow=aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue();
1441  if (eState==SfxItemState::DONTCARE) {
1442  aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_AUTOHEIGHT);
1443  } else if (eState==SfxItemState::SET) {
1444  aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_AUTOHEIGHT,bAutoGrow));
1445  }
1446 
1447  eState=aMarkAttr.GetItemState(SDRATTR_CORNER_RADIUS);
1448  tools::Long nRadius=aMarkAttr.Get(SDRATTR_CORNER_RADIUS).GetValue();
1449  if (eState==SfxItemState::DONTCARE) {
1450  aRetSet.InvalidateItem(SDRATTR_CORNER_RADIUS);
1451  } else if (eState==SfxItemState::SET) {
1452  aRetSet.Put(makeSdrEckenradiusItem(nRadius));
1453  }
1454 
1455  basegfx::B2DHomMatrix aTransformation;
1456 
1457  if(nMarkCount > 1)
1458  {
1459  // multiple objects, range is collected in aRect
1461  aRect.Left(), aRect.Top(),
1462  aRect.getWidth(), aRect.getHeight());
1463  }
1464  else
1465  {
1466  // single object, get homogen transformation
1467  basegfx::B2DPolyPolygon aPolyPolygon;
1468 
1469  pObj->TRGetBaseGeometry(aTransformation, aPolyPolygon);
1470  }
1471 
1472  if(aTransformation.isIdentity())
1473  {
1474  aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_MATRIX);
1475  }
1476  else
1477  {
1478  css::geometry::AffineMatrix2D aAffineMatrix2D;
1479  Point aPageOffset(0, 0);
1480 
1481  if(GetSdrPageView())
1482  {
1483  aPageOffset = GetSdrPageView()->GetPageOrigin();
1484  }
1485 
1486  aAffineMatrix2D.m00 = aTransformation.get(0, 0);
1487  aAffineMatrix2D.m01 = aTransformation.get(0, 1);
1488  aAffineMatrix2D.m02 = aTransformation.get(0, 2) - aPageOffset.X();
1489  aAffineMatrix2D.m10 = aTransformation.get(1, 0);
1490  aAffineMatrix2D.m11 = aTransformation.get(1, 1);
1491  aAffineMatrix2D.m12 = aTransformation.get(1, 2) - aPageOffset.Y();
1492 
1493  aRetSet.Put(AffineMatrixItem(&aAffineMatrix2D));
1494  }
1495  }
1496 
1497  return aRetSet;
1498 }
1499 
1500 static Point ImpGetPoint(const tools::Rectangle& rRect, RectPoint eRP)
1501 {
1502  switch(eRP) {
1503  case RectPoint::LT: return rRect.TopLeft();
1504  case RectPoint::MT: return rRect.TopCenter();
1505  case RectPoint::RT: return rRect.TopRight();
1506  case RectPoint::LM: return rRect.LeftCenter();
1507  case RectPoint::MM: return rRect.Center();
1508  case RectPoint::RM: return rRect.RightCenter();
1509  case RectPoint::LB: return rRect.BottomLeft();
1510  case RectPoint::MB: return rRect.BottomCenter();
1511  case RectPoint::RB: return rRect.BottomRight();
1512  }
1513  return Point(); // Should not happen!
1514 }
1515 
1516 void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr, bool addPageMargin)
1517 {
1518  const bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
1519 
1521 
1522  if(GetSdrPageView())
1523  {
1524  if (addPageMargin)
1525  {
1526  SdrPage * pPage = GetSdrPageView()->GetPage();
1527  Point upperLeft(pPage->GetLeftBorder(), pPage->GetUpperBorder());
1528  aRect.Move(upperLeft.getX(), upperLeft.getY());
1529  }
1530  GetSdrPageView()->LogicToPagePos(aRect);
1531  }
1532 
1533  Degree100 nOldRotateAngle=GetMarkedObjRotate();
1534  Degree100 nOldShearAngle=GetMarkedObjShear();
1535  const SdrMarkList& rMarkList=GetMarkedObjectList();
1536  const size_t nMarkCount=rMarkList.GetMarkCount();
1537  SdrObject* pObj=nullptr;
1538 
1539  RectPoint eSizePoint=RectPoint::MM;
1540  tools::Long nPosDX=0;
1541  tools::Long nPosDY=0;
1542  tools::Long nSizX=0;
1543  tools::Long nSizY=0;
1544  Degree100 nRotateAngle(0);
1545 
1546  bool bModeIsRotate(meDragMode == SdrDragMode::Rotate);
1547  tools::Long nRotateX(0);
1548  tools::Long nRotateY(0);
1549  tools::Long nOldRotateX(0);
1550  tools::Long nOldRotateY(0);
1551  if(bModeIsRotate)
1552  {
1553  Point aRotateAxe(maRef1);
1554 
1555  if(GetSdrPageView())
1556  {
1557  GetSdrPageView()->LogicToPagePos(aRotateAxe);
1558  }
1559 
1560  nRotateX = nOldRotateX = aRotateAxe.X();
1561  nRotateY = nOldRotateY = aRotateAxe.Y();
1562  }
1563 
1564  Degree100 nShearAngle(0);
1565  tools::Long nShearX=0;
1566  tools::Long nShearY=0;
1567  bool bShearVert=false;
1568 
1569  bool bChgPos=false;
1570  bool bChgSiz=false;
1571  bool bChgWdh=false;
1572  bool bChgHgt=false;
1573  bool bRotate=false;
1574  bool bShear =false;
1575 
1576  bool bSetAttr=false;
1577  SfxItemSet aSetAttr(mpModel->GetItemPool());
1578 
1579  const SfxPoolItem* pPoolItem=nullptr;
1580 
1581  // position
1582  if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_POS_X,true,&pPoolItem)) {
1583  nPosDX=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue() - aRect.Left();
1584  bChgPos=true;
1585  }
1586  if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_POS_Y,true,&pPoolItem)){
1587  nPosDY=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue() - aRect.Top();
1588  bChgPos=true;
1589  }
1590  // size
1591  if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_WIDTH,true,&pPoolItem)) {
1592  nSizX=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue();
1593  bChgSiz=true;
1594  bChgWdh=true;
1595  }
1596  if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,true,&pPoolItem)) {
1597  nSizY=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue();
1598  bChgSiz=true;
1599  bChgHgt=true;
1600  }
1601  if (bChgSiz) {
1602  if (bTiledRendering && SfxItemState::SET != rAttr.GetItemState(SID_ATTR_TRANSFORM_SIZE_POINT, true, &pPoolItem))
1603  eSizePoint = RectPoint::LT;
1604  else
1605  eSizePoint = static_cast<RectPoint>(rAttr.Get(SID_ATTR_TRANSFORM_SIZE_POINT).GetValue());
1606  }
1607 
1608  // rotation
1609  if (SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_DELTA_ANGLE, true, &pPoolItem)) {
1610  nRotateAngle = static_cast<const SdrAngleItem*>(pPoolItem)->GetValue();
1611  bRotate = (nRotateAngle != 0_deg100);
1612  }
1613 
1614  // rotation
1615  if (SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_ANGLE, true, &pPoolItem)) {
1616  nRotateAngle = static_cast<const SdrAngleItem*>(pPoolItem)->GetValue() - nOldRotateAngle;
1617  bRotate = (nRotateAngle != 0_deg100);
1618  }
1619 
1620  // position rotation point x
1621  if(bRotate || SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ROT_X, true ,&pPoolItem))
1622  nRotateX = rAttr.Get(SID_ATTR_TRANSFORM_ROT_X).GetValue();
1623 
1624  // position rotation point y
1625  if(bRotate || SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ROT_Y, true ,&pPoolItem))
1626  nRotateY = rAttr.Get(SID_ATTR_TRANSFORM_ROT_Y).GetValue();
1627 
1628  // shearing
1629  if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_SHEAR,true,&pPoolItem)) {
1630  Degree100 nNewShearAngle=static_cast<const SdrAngleItem*>(pPoolItem)->GetValue();
1631  if (nNewShearAngle>SDRMAXSHEAR) nNewShearAngle=SDRMAXSHEAR;
1632  if (nNewShearAngle<-SDRMAXSHEAR) nNewShearAngle=-SDRMAXSHEAR;
1633  if (nNewShearAngle!=nOldShearAngle) {
1634  bShearVert=static_cast<const SfxBoolItem&>(rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_VERTICAL)).GetValue();
1635  if (bShearVert) {
1636  nShearAngle=nNewShearAngle;
1637  } else {
1638  if (nNewShearAngle!=0_deg100 && nOldShearAngle!=0_deg100) {
1639  // bug fix
1640  double nOld = tan(static_cast<double>(nOldShearAngle.get()) * F_PI18000);
1641  double nNew = tan(static_cast<double>(nNewShearAngle.get()) * F_PI18000);
1642  nNew-=nOld;
1643  nNew = atan(nNew) / F_PI18000;
1644  nShearAngle=Degree100(FRound(nNew));
1645  } else {
1646  nShearAngle=nNewShearAngle-nOldShearAngle;
1647  }
1648  }
1649  bShear=nShearAngle!=0_deg100;
1650  if (bShear) {
1651  nShearX=static_cast<const SfxInt32Item&>(rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_X)).GetValue();
1652  nShearY=static_cast<const SfxInt32Item&>(rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_Y)).GetValue();
1653  }
1654  }
1655  }
1656 
1657  // AutoGrow
1658  if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_AUTOWIDTH,true,&pPoolItem)) {
1659  bool bAutoGrow=static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
1660  aSetAttr.Put(makeSdrTextAutoGrowWidthItem(bAutoGrow));
1661  bSetAttr=true;
1662  }
1663 
1664  if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_AUTOHEIGHT,true,&pPoolItem)) {
1665  bool bAutoGrow=static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
1666  aSetAttr.Put(makeSdrTextAutoGrowHeightItem(bAutoGrow));
1667  bSetAttr=true;
1668  }
1669 
1670  // corner radius
1671  if (m_bEdgeRadiusAllowed && SfxItemState::SET==rAttr.GetItemState(SDRATTR_CORNER_RADIUS,true,&pPoolItem)) {
1672  tools::Long nRadius=static_cast<const SdrMetricItem*>(pPoolItem)->GetValue();
1673  aSetAttr.Put(makeSdrEckenradiusItem(nRadius));
1674  bSetAttr=true;
1675  }
1676 
1678 
1679  BegUndo(SvxResId(STR_EditTransform),GetDescriptionOfMarkedObjects());
1680 
1681  if (bSetAttr) {
1682  SetAttrToMarked(aSetAttr,false);
1683  }
1684 
1685  // change size and height
1686  if (bChgSiz && (m_bResizeFreeAllowed || m_bResizePropAllowed)) {
1687  Fraction aWdt(nSizX,aRect.Right()-aRect.Left());
1688  Fraction aHgt(nSizY,aRect.Bottom()-aRect.Top());
1689  Point aRef(ImpGetPoint(aRect,eSizePoint));
1690 
1691  if(GetSdrPageView())
1692  {
1693  GetSdrPageView()->PagePosToLogic(aRef);
1694  }
1695 
1696  ResizeMultMarkedObj(aRef, aWdt, aHgt, bChgWdh, bChgHgt);
1697  }
1698 
1699  // rotate
1700  if (bRotate && (m_bRotateFreeAllowed || m_bRotate90Allowed)) {
1701  Point aRef(nRotateX,nRotateY);
1702 
1703  if(GetSdrPageView())
1704  {
1705  GetSdrPageView()->PagePosToLogic(aRef);
1706  }
1707 
1708  RotateMarkedObj(aRef,nRotateAngle);
1709  }
1710 
1711  // set rotation point position
1712  if(bModeIsRotate && (nRotateX != nOldRotateX || nRotateY != nOldRotateY))
1713  {
1714  Point aNewRef1(nRotateX, nRotateY);
1715 
1716  if(GetSdrPageView())
1717  {
1718  GetSdrPageView()->PagePosToLogic(aNewRef1);
1719  }
1720 
1721  SetRef1(aNewRef1);
1722  }
1723 
1724  // shear
1725  if (bShear && m_bShearAllowed) {
1726  Point aRef(nShearX,nShearY);
1727 
1728  if(GetSdrPageView())
1729  {
1730  GetSdrPageView()->PagePosToLogic(aRef);
1731  }
1732 
1733  ShearMarkedObj(aRef,nShearAngle,bShearVert);
1734 
1735  // #i74358#
1736  // ShearMarkedObj creates a linear combination of the existing transformation and
1737  // the new shear to apply. If the object is already transformed (e.g. rotated) the
1738  // linear combination will not decompose to the same start values again, but to a
1739  // new combination. Thus it makes no sense to check if the wanted shear is reached
1740  // or not. Taking out.
1741  }
1742 
1743  // change position
1744  if (bChgPos && m_bMoveAllowed) {
1745  MoveMarkedObj(Size(nPosDX,nPosDY));
1746  }
1747 
1748  // protect position
1749  if(SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_POS, true, &pPoolItem))
1750  {
1751  const bool bProtPos(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
1752  bool bChanged(false);
1753 
1754  for(size_t i = 0; i < nMarkCount; ++i)
1755  {
1756  pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
1757 
1758  if(pObj->IsMoveProtect() != bProtPos)
1759  {
1760  bChanged = true;
1761  pObj->SetMoveProtect(bProtPos);
1762 
1763  if(bProtPos)
1764  {
1765  pObj->SetResizeProtect(true);
1766  }
1767  }
1768  }
1769 
1770  if(bChanged)
1771  {
1772  m_bMoveProtect = bProtPos;
1773 
1774  if(bProtPos)
1775  {
1776  m_bResizeProtect = true;
1777  }
1778 
1779  // #i77187# there is no simple method to get the toolbars updated
1780  // in the application. The App is listening to selection change and i
1781  // will use it here (even if not true). It's acceptable since changing
1782  // this model data is pretty rare and only possible using the F4 dialog
1784  }
1785  }
1786 
1787  if(!m_bMoveProtect)
1788  {
1789  // protect size
1790  if(SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_SIZE, true, &pPoolItem))
1791  {
1792  const bool bProtSize(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
1793  bool bChanged(false);
1794 
1795  for(size_t i = 0; i < nMarkCount; ++i)
1796  {
1797  pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
1798 
1799  if(pObj->IsResizeProtect() != bProtSize)
1800  {
1801  bChanged = true;
1802  pObj->SetResizeProtect(bProtSize);
1803  }
1804  }
1805 
1806  if(bChanged)
1807  {
1808  m_bResizeProtect = bProtSize;
1809 
1810  // #i77187# see above
1812  }
1813  }
1814  }
1815 
1816  EndUndo();
1817 }
1818 
1819 
1821 { // at least two selected objects, at least one of them movable
1823  const size_t nCount=GetMarkedObjectCount();
1824  if (nCount==0) return false; // nothing selected!
1825  if (nCount==1) return m_bMoveAllowed; // align single object to page
1826  return m_bOneOrMoreMovable; // otherwise: MarkCount>=2
1827 }
1828 
1830 {
1831  if (eHor==SdrHorAlign::NONE && eVert==SdrVertAlign::NONE)
1832  return;
1833 
1835  if (!GetMarkedObjectCount())
1836  return;
1837 
1838  const bool bUndo = IsUndoEnabled();
1839  if( bUndo )
1840  {
1842  OUString aStr(GetDescriptionOfMarkedObjects());
1843  if (eHor==SdrHorAlign::NONE)
1844  {
1845  switch (eVert)
1846  {
1847  case SdrVertAlign::Top:
1848  aStr = ImpGetDescriptionString(STR_EditAlignVTop);
1849  break;
1850  case SdrVertAlign::Bottom:
1851  aStr = ImpGetDescriptionString(STR_EditAlignVBottom);
1852  break;
1853  case SdrVertAlign::Center:
1854  aStr = ImpGetDescriptionString(STR_EditAlignVCenter);
1855  break;
1856  default: break;
1857  }
1858  }
1859  else if (eVert==SdrVertAlign::NONE)
1860  {
1861  switch (eHor)
1862  {
1863  case SdrHorAlign::Left:
1864  aStr = ImpGetDescriptionString(STR_EditAlignHLeft);
1865  break;
1866  case SdrHorAlign::Right:
1867  aStr = ImpGetDescriptionString(STR_EditAlignHRight);
1868  break;
1869  case SdrHorAlign::Center:
1870  aStr = ImpGetDescriptionString(STR_EditAlignHCenter);
1871  break;
1872  default: break;
1873  }
1874  }
1875  else if (eHor==SdrHorAlign::Center && eVert==SdrVertAlign::Center)
1876  {
1877  aStr = ImpGetDescriptionString(STR_EditAlignCenter);
1878  }
1879  else
1880  {
1881  aStr = ImpGetDescriptionString(STR_EditAlign);
1882  }
1883  BegUndo(aStr);
1884  }
1885 
1886  tools::Rectangle aBound;
1887  const size_t nMarkCount=GetMarkedObjectCount();
1888  bool bHasFixed=false;
1889  for (size_t nm=0; nm<nMarkCount; ++nm)
1890  {
1891  SdrMark* pM=GetSdrMarkByIndex(nm);
1892  SdrObject* pObj=pM->GetMarkedSdrObj();
1893  SdrObjTransformInfoRec aInfo;
1894  pObj->TakeObjInfo(aInfo);
1895  if (!aInfo.bMoveAllowed || pObj->IsMoveProtect())
1896  {
1897  tools::Rectangle aObjRect(pObj->GetSnapRect());
1898  aBound.Union(aObjRect);
1899  bHasFixed=true;
1900  }
1901  }
1902  if (!bHasFixed)
1903  {
1904  if (nMarkCount==1)
1905  { // align single object to page
1906  const SdrObject* pObj=GetMarkedObjectByIndex(0);
1907  const SdrPage* pPage=pObj->getSdrPageFromSdrObject();
1909  const SdrPageGridFrame* pFrame=nullptr;
1910  if (pGFL!=nullptr && pGFL->GetCount()!=0)
1911  { // Writer
1912  pFrame=&((*pGFL)[0]);
1913  }
1914 
1915  if (pFrame!=nullptr)
1916  { // Writer
1917  aBound=pFrame->GetUserArea();
1918  }
1919  else
1920  {
1921  aBound=tools::Rectangle(pPage->GetLeftBorder(),pPage->GetUpperBorder(),
1922  pPage->GetWidth()-pPage->GetRightBorder(),
1923  pPage->GetHeight()-pPage->GetLowerBorder());
1924  }
1925  }
1926  else
1927  {
1928  aBound=GetMarkedObjRect();
1929  }
1930  }
1931  Point aCenter(aBound.Center());
1932  for (size_t nm=0; nm<nMarkCount; ++nm)
1933  {
1934  SdrMark* pM=GetSdrMarkByIndex(nm);
1935  SdrObject* pObj=pM->GetMarkedSdrObj();
1936  SdrObjTransformInfoRec aInfo;
1937  pObj->TakeObjInfo(aInfo);
1938  if (aInfo.bMoveAllowed && !pObj->IsMoveProtect())
1939  {
1940  tools::Long nXMov=0;
1941  tools::Long nYMov=0;
1942  tools::Rectangle aObjRect(pObj->GetSnapRect());
1943  switch (eVert)
1944  {
1945  case SdrVertAlign::Top : nYMov=aBound.Top() -aObjRect.Top() ; break;
1946  case SdrVertAlign::Bottom: nYMov=aBound.Bottom()-aObjRect.Bottom() ; break;
1947  case SdrVertAlign::Center: nYMov=aCenter.Y() -aObjRect.Center().Y(); break;
1948  default: break;
1949  }
1950  switch (eHor)
1951  {
1952  case SdrHorAlign::Left : nXMov=aBound.Left() -aObjRect.Left() ; break;
1953  case SdrHorAlign::Right : nXMov=aBound.Right() -aObjRect.Right() ; break;
1954  case SdrHorAlign::Center: nXMov=aCenter.X() -aObjRect.Center().X(); break;
1955  default: break;
1956  }
1957  if (nXMov!=0 || nYMov!=0)
1958  {
1959  // SdrEdgeObj needs an extra SdrUndoGeoObj since the
1960  // connections may need to be saved
1961  if( bUndo )
1962  {
1963  if( dynamic_cast<SdrEdgeObj*>(pObj) )
1964  {
1965  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
1966  }
1967 
1968  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*pObj,Size(nXMov,nYMov)));
1969  }
1970 
1971  pObj->Move(Size(nXMov,nYMov));
1972  }
1973  }
1974  }
1975 
1976  if( bUndo )
1977  EndUndo();
1978 }
1979 
1980 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1574
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWHEIGHT(SDRATTR_MISC_FIRST+2)
XPropertyListType t
Definition: xtable.cxx:370
Degree100 nAngle
Definition: svddrgm1.hxx:162
constexpr TypedWhichId< SdrHorzShearAllItem > SDRATTR_HORZSHEARALL(SDRATTR_NOTPERSIST_FIRST+28)
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
Definition: svdobj.cxx:637
bool SearchOutlinerItems(const SfxItemSet &rSet, bool bInklDefaults, bool *pbOnlyEE)
Search an ItemSet for Outliner/EditEngine Items.
Definition: svdetc.cxx:345
constexpr TypedWhichId< SdrPercentItem > SDRATTR_SHADOWTRANSPARENCE(SDRATTR_SHADOW_FIRST+4)
void MirrorMarkedObj(const Point &rRef1, const Point &rRef2, bool bCopy=false)
Definition: svdedtv1.cxx:355
bool bVisible
size_t GetMarkCount() const
Definition: svdmark.hxx:180
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
Definition: svdobj.cxx:1526
constexpr TypedWhichId< SdrResizeXAllItem > SDRATTR_RESIZEXALL(SDRATTR_NOTPERSIST_FIRST+25)
void SetStyleSheet(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr)
Definition: svdpntv.cxx:1000
void SortMarkedObjects() const
Definition: svdmrkv.hxx:259
constexpr sal_uInt16 EE_FEATURE_TAB(EE_FEATURE_START+0)
void AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert)
Definition: svdedtv1.cxx:1829
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr) const
Definition: svdedtv1.cxx:1300
void SetResizeProtect(bool bProt)
Definition: svdobj.cxx:2627
void SetPoint(const Point &rPnt, sal_uInt32 i)
Definition: svdobj.cxx:1718
sal_Int32 GetHeight() const
Definition: svdpage.cxx:1404
constexpr TypedWhichId< SdrTransformRef1XItem > SDRATTR_TRANSFORMREF1X(SDRATTR_NOTPERSIST_FIRST+30)
for the snap-to-grid in Writer
Definition: svdpage.hxx:280
std::string GetValue
tools::Long getWidth() const
void SetNotPersistAttrToMarked(const SfxItemSet &rAttr)
Definition: svdedtv1.cxx:686
virtual bool IsPolyObj() const
Definition: svdobj.cxx:1703
constexpr TypedWhichId< SdrAllSizeWidthItem > SDRATTR_ALLSIZEWIDTH(SDRATTR_NOTPERSIST_FIRST+8)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWWIDTH(SDRATTR_MISC_FIRST+12)
Point BottomLeft() const
bool m_bShearAllowed
Definition: svdedtv.hxx:105
constexpr Degree100 SDRMAXSHEAR(8900)
bool isAnimatedInAnyViewObjectContact() const
bool AreObjectsMarked() const
Definition: svdmrkv.hxx:260
bool IsUndoEnabled() const
Definition: svdedtv.cxx:1064
void MirrorMarkedObjHorizontal()
Definition: svdedtv1.cxx:419
long Long
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_CONTOURFRAME(SDRATTR_MISC_FIRST+21)
void MergeValue(const SfxPoolItem &rItem, bool bOverwriteDefaults=false)
void ForcePossibilities() const
Definition: svdedtv.hxx:161
void ResizeMultMarkedObj(const Point &rRef, const Fraction &xFact, const Fraction &yFact, const bool bWdh, const bool bHgt)
Definition: svdedtv1.cxx:248
void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
Definition: svdobj.cxx:2204
constexpr TypedWhichId< XLineWidthItem > XATTR_LINEWIDTH(XATTR_LINE_FIRST+2)
bool m_bResizeProtect
Definition: svdedtv.hxx:114
static void ImpDistortObj(SdrObject *pO, const tools::Rectangle &rRef, const XPolygon &rDistortedRect, bool bNoContortion)
Definition: svdedtv1.cxx:611
sal_Int64 n
sal_Int32 GetRightBorder() const
Definition: svdpage.cxx:1489
void MirrorMarkedObjVertical()
Definition: svdedtv1.cxx:427
void RotateMarkedObj(const Point &rRef, Degree100 nAngle, bool bCopy=false)
Definition: svdedtv1.cxx:299
void InvalidateItem(sal_uInt16 nWhich)
void BegUndo()
Definition: svdedtv.hxx:178
sal_uInt16 FirstWhich()
const tools::Rectangle & GetUserArea() const
Definition: svdpage.hxx:287
SdrPageView * GetSdrPageViewOfMarkedByIndex(size_t nNum) const
Definition: svdmrkv.hxx:255
const SfxBroadcaster * GetBroadcaster() const
Definition: svdobj.cxx:701
SdrMark * GetMark(size_t nNum) const
Definition: svdmark.cxx:230
std::vector< std::unique_ptr< SdrUndoAction > > CreateConnectorUndo(SdrObject &rO)
Definition: svdedtv1.cxx:150
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DOBJ_DEPTH(SDRATTR_3DOBJ_FIRST+2)
void MergeAttrFromMarked(SfxItemSet &rAttr, bool bOnlyHardAttr) const
Definition: svdedtv1.cxx:895
void EndTextEditAllViews() const
Checks if this or other views have an active text edit, if true, end them.
Definition: svdedtv.cxx:1069
virtual sal_uInt32 GetPointCount() const
Definition: svdobj.cxx:1708
sal_Int32 GetLowerBorder() const
Definition: svdpage.cxx:1494
constexpr TypedWhichId< SdrMetricItem > SDRATTR_CORNER_RADIUS(SDRATTR_MISC_FIRST+0)
void PagePosToLogic(Point &rPnt) const
Definition: svdpagv.hxx:212
Center
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:721
sal_Int32 GetLeftBorder() const
Definition: svdpage.cxx:1479
void SetRight(tools::Long v)
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
static Point ImpGetPoint(const tools::Rectangle &rRect, RectPoint eRP)
Definition: svdedtv1.cxx:1500
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:248
sal_uInt16 NextWhich()
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
Definition: sdtagitm.hxx:25
double get(sal_uInt16 nRow, sal_uInt16 nColumn) const
const tools::Rectangle & GetMarkedObjRect() const
Definition: svdmrkv.cxx:2562
Point RightCenter() const
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1640
SfxItemSet GetGeoAttrFromMarked() const
Definition: svdedtv1.cxx:1340
bool IsVisible() const
Definition: svdobj.hxx:753
tools::Long getHeight() const
SdrModel * mpModel
Definition: svdpntv.hxx:127
constexpr TypedWhichId< XLineTransparenceItem > XATTR_LINETRANSPARENCE(XATTR_LINE_FIRST+10)
bool m_bMoveProtect
Definition: svdedtv.hxx:113
Provides information about various ZObject properties.
Definition: svdobj.hxx:194
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DSCENE_DISTANCE(SDRATTR_3DSCENE_FIRST+1)
void SetAttrToMarked(const SfxItemSet &rAttr, bool bReplaceAll)
Definition: svdedtv1.cxx:1033
const SfxPoolItem * NextItem()
SdrCrookMode
Definition: svdsnpv.hxx:84
void LogicToPagePos(Point &rPnt) const
Definition: svdpagv.hxx:210
void CrookRotatePoly(XPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert)
Definition: svdtrans.cxx:292
void SetGeoAttrToMarked(const SfxItemSet &rAttr, bool addPageMargin=false)
Definition: svdedtv1.cxx:1516
tools::Long Left() const
bool IsMore() const
Definition: svditer.hxx:62
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:266
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:25
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
constexpr TypedWhichId< SdrAllPositionYItem > SDRATTR_ALLPOSITIONY(SDRATTR_NOTPERSIST_FIRST+7)
Point BottomCenter() const
int nCount
constexpr Point TopCenter() const
tools::Rectangle aMarkRect
Definition: svddrgm1.hxx:142
tools::Long Bottom() const
void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
SfxStyleSheet * GetStyleSheet() const
Definition: svdobj.cxx:2199
constexpr tools::Long GetWidth() const
void DistortMarkedObj(const tools::Rectangle &rRef, const XPolygon &rDistortedRect, bool bNoContortion, bool bCopy=false)
Definition: svdedtv1.cxx:645
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
bool IsRotateAllowed(bool b90Deg=false) const
Definition: svdedtv.cxx:399
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
Definition: sdtagitm.hxx:30
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
const Point & GetPageOrigin() const
The Origin always refers to the upper left corner of the Page.
Definition: svdpagv.hxx:207
Point LeftCenter() const
void SetMoveProtect(bool bProt)
Definition: svdobj.cxx:2616
Point maRef1
Definition: svdmrkv.hxx:106
SfxStyleSheet * GetStyleSheet() const
Definition: svdedtv1.cxx:1321
void SetAttributes(const SfxItemSet &rSet, bool bReplaceAll)
Definition: svdedtv1.cxx:1312
virtual SdrObject * GetConnectedNode(bool bTail1) const
Definition: svdobj.cxx:2326
void EndUndo()
Definition: svdedtv.cxx:303
constexpr bool IsEmpty() const
SdrVertAlign
Definition: svdedtv.hxx:44
SdrObject * GetMarkedSdrObj() const
Definition: svdmark.hxx:68
Point BottomRight() const
Everything a View needs to know about a selected object.
Definition: svdmark.hxx:44
SfxStyleSheet * GetStyleSheet() const
Definition: svdpntv.cxx:995
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr) const
Definition: svdpntv.cxx:975
SdrDragMode meDragMode
Definition: svdmrkv.hxx:119
RectPoint
Definition: rectenum.hxx:22
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdedtv.hxx:182
std::vector< sal_uInt16 > GetAllCharPropIds(const SfxItemSet &rSet)
Definition: svdedtv1.cxx:1015
void CopyMarkedObj()
Definition: svdedtv.cxx:907
void CrookStretchPoly(XPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert, const tools::Rectangle &rRefRect)
Definition: svdtrans.cxx:338
UNDERLYING_TYPE get() const
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 != null...
Definition: svdpage.cxx:1644
virtual void MarkListHasChanged() override
Definition: svdedtv.cxx:379
constexpr TypedWhichId< SdrResizeYAllItem > SDRATTR_RESIZEYALL(SDRATTR_NOTPERSIST_FIRST+26)
constexpr TypedWhichId< XLineStartWidthItem > XATTR_LINESTARTWIDTH(XATTR_LINE_FIRST+6)
constexpr TypedWhichId< XFillTransparenceItem > XATTR_FILLTRANSPARENCE(XATTR_FILL_FIRST+5)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define DBG_ASSERT(sCon, aError)
int i
void ResizeMarkedObj(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bCopy=false)
Definition: svdedtv1.cxx:217
void SetPathPoly(const basegfx::B2DPolyPolygon &rPathPoly)
Definition: svdopath.cxx:2733
uno_Any a
constexpr TypedWhichId< SdrTransformRef2YItem > SDRATTR_TRANSFORMREF2Y(SDRATTR_NOTPERSIST_FIRST+33)
tools::Long FRound(double fVal)
size_t GetMarkedObjectCount() const
Definition: svdmrkv.hxx:258
void MergeNotPersistAttrFromMarked(SfxItemSet &rAttr) const
Definition: svdedtv1.cxx:772
SdrMetricItem makeSdrEckenradiusItem(tools::Long nRadius)
Definition: sderitm.hxx:25
OUString const & GetDescriptionOfMarkedObjects() const
Definition: svdmrkv.hxx:261
constexpr TypedWhichId< XLineEndWidthItem > XATTR_LINEENDWIDTH(XATTR_LINE_FIRST+7)
bool m_bRotate90Allowed
Definition: svdedtv.hxx:101
sal_Int32 GetUpperBorder() const
Definition: svdpage.cxx:1484
bool m_bRotateFreeAllowed
Definition: svdedtv.hxx:100
const SdrMarkList & GetMarkedObjectList() const
Definition: svdmrkv.hxx:252
virtual Degree100 GetShearAngle(bool bVertical=false) const
Definition: svdobj.cxx:1688
bool IsPrintable() const
Definition: svdobj.hxx:751
void SetAttributes(const SfxItemSet &rSet, bool bReplaceAll)
Definition: svdpntv.cxx:990
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:1992
bool bVertical
Definition: svddrgm1.hxx:155
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
constexpr sal_uInt16 EE_CHAR_START(EE_PARA_END+1)
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1509
void SetMergedItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1962
void SetBottom(tools::Long v)
bool isIdentity() const
bool IsResizeProtect() const
Definition: svdobj.hxx:749
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_MINFRAMEHEIGHT(SDRATTR_MISC_FIRST+1)
constexpr TypedWhichId< SdrTransformRef2XItem > SDRATTR_TRANSFORMREF2X(SDRATTR_NOTPERSIST_FIRST+32)
constexpr sal_uInt16 EE_CHAR_END(EE_CHAR_START+32)
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:1987
constexpr sal_uInt16 EE_FEATURE_START(EE_CHAR_END+1)
tools::Long Top() const
Abstract DrawObject.
Definition: svdobj.hxx:258
virtual SfxViewShell * GetSfxViewShell() const
Get access to the view shell owning this draw view, if any.
Definition: svdmrkv.cxx:1756
constexpr sal_uInt16 EE_FEATURE_LINEBR(EE_FEATURE_TAB+1)
SfxItemPool * GetPool() const
constexpr TypedWhichId< SdrAllSizeHeightItem > SDRATTR_ALLSIZEHEIGHT(SDRATTR_NOTPERSIST_FIRST+9)
virtual void Mirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1565
#define Y
void CrookMarkedObj(const Point &rRef, const Point &rRad, SdrCrookMode eMode, bool bVertical, bool bNoContortion, bool bCopy=false)
Definition: svdedtv1.cxx:567
void SetAnimationTimer(sal_uInt32 nTime)
Definition: svdpntv.cxx:1185
Degree100 GetMarkedObjShear() const
Definition: svdedtv1.cxx:435
constexpr Point TopLeft() const
bool m_bResizeFreeAllowed
Definition: svdedtv.hxx:98
sal_uInt16 GetCount() const
Definition: svdpage.hxx:302
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:651
constexpr TypedWhichId< SdrRotateAllItem > SDRATTR_ROTATEALL(SDRATTR_NOTPERSIST_FIRST+27)
void ShearMarkedObj(const Point &rRef, Degree100 nAngle, bool bVShear=false, bool bCopy=false)
Definition: svdedtv1.cxx:455
void SetRef1(const Point &rPt)
Definition: svdmrkv.cxx:1734
Point aCenter
Definition: svddrgm1.hxx:144
constexpr sal_uInt16 EE_FEATURE_NOTCONV(EE_FEATURE_LINEBR+1)
void SetStyleSheetToMarked(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr)
Definition: svdedtv1.cxx:1265
SdrObject * Next()
Definition: svditer.hxx:63
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
bool IsAlignPossible() const
Definition: svdedtv1.cxx:1820
bool m_bMoveAllowed
Definition: svdedtv.hxx:97
void SetStyleSheet(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr)
Definition: svdedtv1.cxx:1330
SfxItemState
const Point & GetRef2() const
Definition: svdmrkv.hxx:441
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
tools::Rectangle & Union(const tools::Rectangle &rRect)
constexpr TypedWhichId< SfxUInt16Item > SDRATTR_3DOBJ_BACKSCALE(SDRATTR_3DOBJ_FIRST+1)
constexpr TypedWhichId< SdrVertShearAllItem > SDRATTR_VERTSHEARALL(SDRATTR_NOTPERSIST_FIRST+29)
SdrPage * GetPage() const
Definition: svdpagv.hxx:171
OUString ImpGetDescriptionString(const char *pStrCacheID, ImpGetDescriptionOptions nOpt=ImpGetDescriptionOptions::NONE) const
Definition: svdmrkv.cxx:2582
bool m_bEdgeRadiusAllowed
Definition: svdedtv.hxx:106
double CrookSlantXPoint(Point &rPnt, Point *pC1, Point *pC2, const Point &rCenter, const Point &rRad, double &rSin, double &rCos, bool bVert)
Definition: svdtrans.cxx:217
const SfxItemSet & GetMergedItemSet() const
Definition: svdobj.cxx:1952
constexpr Point TopRight() const
bool m_bResizePropAllowed
Definition: svdedtv.hxx:99
SfxStyleSheet * GetStyleSheetFromMarked() const
Definition: svdedtv1.cxx:1250
#define F_PI18000
SfxItemSet GetAttrFromMarked(bool bOnlyHardAttr) const
Definition: svdedtv1.cxx:879
constexpr TypedWhichId< SfxUInt16Item > SDRATTR_3DOBJ_PERCENT_DIAGONAL(SDRATTR_3DOBJ_FIRST+0)
void AddUndoActions(std::vector< std::unique_ptr< SdrUndoAction > >)
Definition: svdedtv1.cxx:177
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
Definition: svdmrkv.hxx:257
const basegfx::B2DPolyPolygon & GetPathPoly() const
Definition: svdopath.hxx:141
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:1554
SdrPageView * GetSdrPageView() const
Definition: svdpntv.hxx:304
Helper for 3d object changes affecting 2d geometry.
constexpr sal_uInt16 EE_FEATURE_END(EE_FEATURE_FIELD+0)
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1665
const sal_uInt16 * GetRanges() const
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
Degree100 GetMarkedObjRotate() const
Definition: svdedtv1.cxx:284
constexpr TypedWhichId< SdrTransformRef1YItem > SDRATTR_TRANSFORMREF1Y(SDRATTR_NOTPERSIST_FIRST+31)
SdrHorAlign
Definition: svdedtv.hxx:37
const SfxItemPool & GetItemPool() const
Definition: svdmodel.hxx:309
virtual Degree100 GetRotateAngle() const
Definition: svdobj.cxx:1683
constexpr sal_uInt16 EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DOBJ_END_ANGLE(SDRATTR_3DOBJ_FIRST+5)
virtual const tools::Rectangle & GetLogicRect() const
Definition: svdobj.cxx:1650
SdrMark * GetSdrMarkByIndex(size_t nNum) const
Definition: svdmrkv.hxx:256
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:365
bool IsValid() const
sal_Int32 GetWidth() const
Definition: svdpage.cxx:1378
void CrookSlantPoly(XPolygon &rPoly, const Point &rCenter, const Point &rRad, bool bVert)
Definition: svdtrans.cxx:315
SdrCrookMode eMode
Definition: svddrgm1.hxx:164
void SetMarkedObjRect(const tools::Rectangle &rRect)
Definition: svdedtv1.cxx:77
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const
Definition: svdobj.cxx:2947
bool IsInvalidItem(const SfxPoolItem *pItem)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
constexpr TypedWhichId< XLineColorItem > XATTR_LINECOLOR(XATTR_LINE_FIRST+3)
virtual Point GetPoint(sal_uInt32 i) const
Definition: svdobj.cxx:1713
SdrModel * GetModel() const
Definition: svdpntv.hxx:265
void SetRef2(const Point &rPt)
Definition: svdmrkv.cxx:1745
aStr
tools::Long Right() const
void ApplyNotPersistAttr(const SfxItemSet &rAttr)
Definition: svdobj.cxx:1997
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
constexpr TypedWhichId< SdrAllPositionXItem > SDRATTR_ALLPOSITIONX(SDRATTR_NOTPERSIST_FIRST+6)
Point Center() const
bool IsMoveProtect() const
Definition: svdobj.hxx:747
const SfxPoolItem * GetCurItem() const
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:928
Utility class SdrEdgeObj.
Definition: svdoedge.hxx:128
const Point & GetRef1() const
Definition: svdmrkv.hxx:437
constexpr tools::Long GetHeight() const
bool m_bOneOrMoreMovable
Definition: svdedtv.hxx:94
void MoveMarkedObj(const Size &rSiz, bool bCopy=false)
Definition: svdedtv1.cxx:183