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