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  SfxViewShell* pViewShell = SfxViewShell::Current();
911  if (pViewShell && comphelper::LibreOfficeKit::isActive())
912  pViewShell->sendUnoStatus( &aSet );
913 
914  return aSet;
915 }
916 
917 void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) const
918 {
919  const size_t nMarkCount(GetMarkedObjectCount());
920 
921  for(size_t a = 0; a < nMarkCount; ++a)
922  {
923  // #80277# merging was done wrong in the prev version
925  SfxWhichIter aIter(rSet);
926  sal_uInt16 nWhich(aIter.FirstWhich());
927 
928  while(nWhich)
929  {
930  if(!bOnlyHardAttr)
931  {
932  if(SfxItemState::DONTCARE == rSet.GetItemState(nWhich, false))
933  rAttr.InvalidateItem(nWhich);
934  else
935  rAttr.MergeValue(rSet.Get(nWhich), true);
936  }
937  else if(SfxItemState::SET == rSet.GetItemState(nWhich, false))
938  {
939  const SfxPoolItem& rItem = rSet.Get(nWhich);
940  rAttr.MergeValue(rItem, true);
941  }
942 
944  {
945  OUString sPayload;
946  switch(nWhich)
947  {
948  case XATTR_LINECOLOR:
949  {
950  const SfxPoolItem* pItem = rSet.GetItem(XATTR_LINECOLOR);
951  if (pItem)
952  {
953  Color aColor = static_cast<const XLineColorItem*>(pItem)->GetColorValue();
954  sPayload = OUString::number(static_cast<sal_uInt32>(aColor));
955 
956  sPayload = ".uno:XLineColor=" + sPayload;
957  }
958  break;
959  }
960 
961  case XATTR_FILLCOLOR:
962  {
963  const SfxPoolItem* pItem = rSet.GetItem(XATTR_FILLCOLOR);
964  if (pItem)
965  {
966  Color aColor = static_cast<const XFillColorItem*>(pItem)->GetColorValue();
967  sPayload = OUString::number(static_cast<sal_uInt32>(aColor));
968 
969  sPayload = ".uno:FillColor=" + sPayload;
970  }
971  break;
972  }
973 
975  {
976  const SfxPoolItem* pItem = rSet.GetItem(XATTR_FILLTRANSPARENCE);
977  if (pItem)
978  {
979  sal_uInt16 nTransparency = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
980  sPayload = OUString::number(nTransparency);
981 
982  sPayload = ".uno:FillTransparence=" + sPayload;
983  }
984  break;
985  }
986 
988  {
989  const SfxPoolItem* pItem = rSet.GetItem(XATTR_LINETRANSPARENCE);
990  if (pItem)
991  {
992  sal_uInt16 nTransparency = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
993  sPayload = OUString::number(nTransparency);
994 
995  sPayload = ".uno:LineTransparence=" + sPayload;
996  }
997  break;
998  }
999 
1000  case XATTR_LINEWIDTH:
1001  {
1002  const SfxPoolItem* pItem = rSet.GetItem(XATTR_LINEWIDTH);
1003  if (pItem)
1004  {
1005  sal_uInt32 nWidth = static_cast<const XLineWidthItem*>(pItem)->GetValue();
1006  sPayload = OUString::number(nWidth);
1007 
1008  sPayload = ".uno:LineWidth=" + sPayload;
1009  }
1010  break;
1011  }
1012 
1014  {
1015  const SfxPoolItem* pItem = rSet.GetItem(SDRATTR_SHADOWTRANSPARENCE);
1016  if (pItem)
1017  {
1018  sal_uInt16 nWidth = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
1019  sPayload = OUString::number(nWidth);
1020 
1021  sPayload = ".uno:FillShadowTransparency=" + sPayload;
1022  }
1023  break;
1024  }
1025  }
1026 
1027  if (!sPayload.isEmpty())
1028  GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
1029  OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr());
1030  }
1031 
1032  nWhich = aIter.NextWhich();
1033  }
1034  }
1035 }
1036 
1037 std::vector<sal_uInt16> GetAllCharPropIds(const SfxItemSet& rSet)
1038 {
1039  std::vector<sal_uInt16> aCharWhichIds;
1040  {
1041  SfxItemIter aIter(rSet);
1042  for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
1043  {
1044  if (!IsInvalidItem(pItem))
1045  {
1046  sal_uInt16 nWhich = pItem->Which();
1047  if (nWhich>=EE_CHAR_START && nWhich<=EE_CHAR_END)
1048  aCharWhichIds.push_back( nWhich );
1049  }
1050  }
1051  }
1052  return aCharWhichIds;
1053 }
1054 
1055 void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll)
1056 {
1057  if (!AreObjectsMarked())
1058  return;
1059 
1060 #ifdef DBG_UTIL
1061  {
1062  bool bHasEEFeatureItems=false;
1063  SfxItemIter aIter(rAttr);
1064  for (const SfxPoolItem* pItem = aIter.GetCurItem(); !bHasEEFeatureItems && pItem;
1065  pItem = aIter.NextItem())
1066  {
1067  if (!IsInvalidItem(pItem)) {
1068  sal_uInt16 nW=pItem->Which();
1069  if (nW>=EE_FEATURE_START && nW<=EE_FEATURE_END) bHasEEFeatureItems=true;
1070  }
1071  }
1072  if(bHasEEFeatureItems)
1073  {
1074  const OUString aMessage("SdrEditView::SetAttrToMarked(): Setting EE_FEATURE items at the SdrView does not make sense! It only leads to overhead and unreadable documents.");
1075  std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr,
1076  VclMessageType::Info, VclButtonsType::Ok,
1077  aMessage));
1078  xInfoBox->run();
1079  }
1080  }
1081 #endif
1082 
1083  // #103836# if the user sets character attributes to the complete shape,
1084  // we want to remove all hard set character attributes with same
1085  // which ids from the text. We do that later but here we remember
1086  // all character attribute which id's that are set.
1087  std::vector<sal_uInt16> aCharWhichIds(GetAllCharPropIds(rAttr));
1088 
1089  // To make Undo reconstruct text attributes correctly after Format.Standard
1090  bool bHasEEItems=SearchOutlinerItems(rAttr,bReplaceAll);
1091 
1092  // save additional geometry information when paragraph or character attributes
1093  // are changed and the geometrical shape of the text object might be changed
1094  bool bPossibleGeomChange(false);
1095  SfxWhichIter aIter(rAttr);
1096  sal_uInt16 nWhich = aIter.FirstWhich();
1097  while(!bPossibleGeomChange && nWhich)
1098  {
1099  SfxItemState eState = rAttr.GetItemState(nWhich);
1100  if(eState == SfxItemState::SET)
1101  {
1102  if((nWhich >= SDRATTR_TEXT_MINFRAMEHEIGHT && nWhich <= SDRATTR_TEXT_CONTOURFRAME)
1103  || nWhich == SDRATTR_3DOBJ_PERCENT_DIAGONAL
1104  || nWhich == SDRATTR_3DOBJ_BACKSCALE
1105  || nWhich == SDRATTR_3DOBJ_DEPTH
1106  || nWhich == SDRATTR_3DOBJ_END_ANGLE
1107  || nWhich == SDRATTR_3DSCENE_DISTANCE)
1108  {
1109  bPossibleGeomChange = true;
1110  }
1111  }
1112  nWhich = aIter.NextWhich();
1113  }
1114 
1115  const bool bUndo = IsUndoEnabled();
1116  if( bUndo )
1117  {
1119  BegUndo(ImpGetDescriptionString(STR_EditSetAttributes));
1120  }
1121 
1122  const size_t nMarkCount(GetMarkedObjectCount());
1123  std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters;
1124 
1125  // create ItemSet without SfxItemState::DONTCARE. Put()
1126  // uses its second parameter (bInvalidAsDefault) to
1127  // remove all such items to set them to default.
1128  SfxItemSet aAttr(*rAttr.GetPool(), rAttr.GetRanges());
1129  aAttr.Put(rAttr);
1130 
1131  // #i38135#
1132  bool bResetAnimationTimer(false);
1133 
1134  const bool bLineStartWidthExplicitChange(SfxItemState::SET
1135  == aAttr.GetItemState(XATTR_LINESTARTWIDTH));
1136  const bool bLineEndWidthExplicitChange(SfxItemState::SET
1137  == aAttr.GetItemState(XATTR_LINEENDWIDTH));
1138  // check if LineWidth is part of the change
1139  const bool bAdaptStartEndWidths(!(bLineStartWidthExplicitChange && bLineEndWidthExplicitChange)
1140  && SfxItemState::SET == aAttr.GetItemState(XATTR_LINEWIDTH));
1141  sal_Int32 nNewLineWidth(0);
1142 
1143  if(bAdaptStartEndWidths)
1144  {
1145  nNewLineWidth = aAttr.Get(XATTR_LINEWIDTH).GetValue();
1146  }
1147 
1148  for (size_t nm=0; nm<nMarkCount; ++nm)
1149  {
1150  SdrMark* pM=GetSdrMarkByIndex(nm);
1151  SdrObject* pObj = pM->GetMarkedSdrObj();
1152 
1153  if( bUndo )
1154  {
1155  SdrEdgeObj* pEdgeObj = dynamic_cast< SdrEdgeObj* >( pObj );
1156  if ( pEdgeObj )
1157  bPossibleGeomChange = true;
1158  else
1159  AddUndoActions( CreateConnectorUndo( *pObj ) );
1160  }
1161 
1162  // new geometry undo
1163  if(bPossibleGeomChange && bUndo)
1164  {
1165  // save position and size of object, too
1166  AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
1167  }
1168 
1169  if( bUndo )
1170  {
1171  // #i8508#
1172  // If this is a text object also rescue the OutlinerParaObject since
1173  // applying attributes to the object may change text layout when
1174  // multiple portions exist with multiple formats. If an OutlinerParaObject
1175  // really exists and needs to be rescued is evaluated in the undo
1176  // implementation itself.
1177  const bool bRescueText = dynamic_cast< SdrTextObj* >(pObj) != nullptr;
1178 
1179  // add attribute undo
1180  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj,false,bHasEEItems || bPossibleGeomChange || bRescueText));
1181  }
1182 
1183  // set up a scene updater if object is a 3d object
1184  if(dynamic_cast< E3dObject* >(pObj))
1185  {
1186  aUpdaters.push_back(new E3DModifySceneSnapRectUpdater(pObj));
1187  }
1188 
1189  sal_Int32 nOldLineWidth(0);
1190  if (bAdaptStartEndWidths)
1191  {
1192  nOldLineWidth = pObj->GetMergedItem(XATTR_LINEWIDTH).GetValue();
1193  }
1194 
1195  // set attributes at object
1196  pObj->SetMergedItemSetAndBroadcast(aAttr, bReplaceAll);
1197 
1198  if(bAdaptStartEndWidths)
1199  {
1200  const SfxItemSet& rSet = pObj->GetMergedItemSet();
1201 
1202  if(nOldLineWidth != nNewLineWidth)
1203  {
1204  if(SfxItemState::DONTCARE != rSet.GetItemState(XATTR_LINESTARTWIDTH))
1205  {
1206  const sal_Int32 nValAct(rSet.Get(XATTR_LINESTARTWIDTH).GetValue());
1207  const sal_Int32 nValNewStart(std::max(sal_Int32(0), nValAct + (((nNewLineWidth - nOldLineWidth) * 15) / 10)));
1208 
1209  pObj->SetMergedItem(XLineStartWidthItem(nValNewStart));
1210  }
1211 
1212  if(SfxItemState::DONTCARE != rSet.GetItemState(XATTR_LINEENDWIDTH))
1213  {
1214  const sal_Int32 nValAct(rSet.Get(XATTR_LINEENDWIDTH).GetValue());
1215  const sal_Int32 nValNewEnd(std::max(sal_Int32(0), nValAct + (((nNewLineWidth - nOldLineWidth) * 15) / 10)));
1216 
1217  pObj->SetMergedItem(XLineEndWidthItem(nValNewEnd));
1218  }
1219  }
1220  }
1221 
1222  if(dynamic_cast<const SdrTextObj*>( pObj) != nullptr)
1223  {
1224  SdrTextObj* pTextObj = static_cast<SdrTextObj*>(pObj);
1225 
1226  if(!aCharWhichIds.empty())
1227  {
1228  tools::Rectangle aOldBoundRect = pTextObj->GetLastBoundRect();
1229 
1230  // #110094#-14 pTextObj->SendRepaintBroadcast(pTextObj->GetBoundRect());
1231  pTextObj->RemoveOutlinerCharacterAttribs( aCharWhichIds );
1232 
1233  // object has changed, should be called from
1234  // RemoveOutlinerCharacterAttribs. This will change when the text
1235  // object implementation changes.
1236  pTextObj->SetChanged();
1237 
1238  pTextObj->BroadcastObjectChange();
1239  pTextObj->SendUserCall(SdrUserCallType::ChangeAttr, aOldBoundRect);
1240  }
1241  }
1242 
1243  // #i38495#
1244  if(!bResetAnimationTimer)
1245  {
1247  {
1248  bResetAnimationTimer = true;
1249  }
1250  }
1251  }
1252 
1253  // fire scene updaters
1254  while(!aUpdaters.empty())
1255  {
1256  delete aUpdaters.back();
1257  aUpdaters.pop_back();
1258  }
1259 
1260  // #i38135#
1261  if(bResetAnimationTimer)
1262  {
1263  SetAnimationTimer(0);
1264  }
1265 
1266  // better check before what to do:
1267  // pObj->SetAttr() or SetNotPersistAttr()
1268  // TODO: missing implementation!
1270 
1271  if( bUndo )
1272  EndUndo();
1273 }
1274 
1276 {
1277  SfxStyleSheet* pRet=nullptr;
1278  bool b1st=true;
1279  const size_t nMarkCount=GetMarkedObjectCount();
1280  for (size_t nm=0; nm<nMarkCount; ++nm) {
1281  SdrMark* pM=GetSdrMarkByIndex(nm);
1283  if (b1st) pRet=pSS;
1284  else if (pRet!=pSS) return nullptr; // different stylesheets
1285  b1st=false;
1286  }
1287  return pRet;
1288 }
1289 
1290 void SdrEditView::SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
1291 {
1292  if (AreObjectsMarked())
1293  {
1294  const bool bUndo = IsUndoEnabled();
1295 
1296  if( bUndo )
1297  {
1299  OUString aStr;
1300  if (pStyleSheet!=nullptr)
1301  aStr = ImpGetDescriptionString(STR_EditSetStylesheet);
1302  else
1303  aStr = ImpGetDescriptionString(STR_EditDelStylesheet);
1304  BegUndo(aStr);
1305  }
1306 
1307  const size_t nMarkCount=GetMarkedObjectCount();
1308  for (size_t nm=0; nm<nMarkCount; ++nm)
1309  {
1310  SdrMark* pM=GetSdrMarkByIndex(nm);
1311  if( bUndo )
1312  {
1313  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pM->GetMarkedSdrObj()));
1314  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pM->GetMarkedSdrObj(),true,true));
1315  }
1316  pM->GetMarkedSdrObj()->SetStyleSheet(pStyleSheet,bDontRemoveHardAttr);
1317  }
1318 
1319  if( bUndo )
1320  EndUndo();
1321  }
1322 }
1323 
1324 
1325 void SdrEditView::GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const
1326 {
1327  if(GetMarkedObjectCount())
1328  {
1329  rTargetSet.Put(GetAttrFromMarked(bOnlyHardAttr), false);
1330  }
1331  else
1332  {
1333  SdrMarkView::GetAttributes(rTargetSet, bOnlyHardAttr);
1334  }
1335 }
1336 
1337 void SdrEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
1338 {
1339  if (GetMarkedObjectCount()!=0) {
1340  SetAttrToMarked(rSet,bReplaceAll);
1341  } else {
1342  SdrMarkView::SetAttributes(rSet,bReplaceAll);
1343  }
1344 }
1345 
1347 {
1348  if (GetMarkedObjectCount()!=0) {
1349  return GetStyleSheetFromMarked();
1350  } else {
1351  return SdrMarkView::GetStyleSheet();
1352  }
1353 }
1354 
1355 void SdrEditView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
1356 {
1357  if (GetMarkedObjectCount()!=0) {
1358  SetStyleSheetToMarked(pStyleSheet,bDontRemoveHardAttr);
1359  } else {
1360  SdrMarkView::SetStyleSheet(pStyleSheet,bDontRemoveHardAttr);
1361  }
1362 }
1363 
1364 
1366 {
1367  SfxItemSet aRetSet(
1368  mpModel->GetItemPool(),
1369  svl::Items< // SID_ATTR_TRANSFORM_... from s:svxids.hrc
1371  SID_ATTR_TRANSFORM_POS_X, SID_ATTR_TRANSFORM_ANGLE,
1372  SID_ATTR_TRANSFORM_PROTECT_POS, SID_ATTR_TRANSFORM_AUTOHEIGHT>{});
1373 
1374  if (AreObjectsMarked())
1375  {
1376  SfxItemSet aMarkAttr(GetAttrFromMarked(false)); // because of AutoGrowHeight and corner radius
1378 
1379  if(GetSdrPageView())
1380  {
1381  GetSdrPageView()->LogicToPagePos(aRect);
1382  }
1383 
1384  // position
1385  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_X,aRect.Left()));
1386  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_Y,aRect.Top()));
1387 
1388  // size
1389  long nResizeRefX=aRect.Left();
1390  long nResizeRefY=aRect.Top();
1391  if (meDragMode==SdrDragMode::Rotate) { // use rotation axis as a reference for resizing, too
1392  nResizeRefX=maRef1.X();
1393  nResizeRefY=maRef1.Y();
1394  }
1395  aRetSet.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_WIDTH,aRect.Right()-aRect.Left()));
1396  aRetSet.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_HEIGHT,aRect.Bottom()-aRect.Top()));
1397  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_RESIZE_REF_X,nResizeRefX));
1398  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_RESIZE_REF_Y,nResizeRefY));
1399 
1400  Point aRotateAxe(maRef1);
1401 
1402  if(GetSdrPageView())
1403  {
1404  GetSdrPageView()->LogicToPagePos(aRotateAxe);
1405  }
1406 
1407  // rotation
1408  long nRotateRefX=aRect.Center().X();
1409  long nRotateRefY=aRect.Center().Y();
1411  nRotateRefX=aRotateAxe.X();
1412  nRotateRefY=aRotateAxe.Y();
1413  }
1414  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ANGLE,GetMarkedObjRotate()));
1415  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_X,nRotateRefX));
1416  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_Y,nRotateRefY));
1417 
1418  // shearing
1419  long nShearRefX=aRect.Left();
1420  long nShearRefY=aRect.Bottom();
1421  if (meDragMode==SdrDragMode::Rotate) { // use rotation axis as a reference for shearing, too
1422  nShearRefX=aRotateAxe.X();
1423  nShearRefY=aRotateAxe.Y();
1424  }
1425  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR,GetMarkedObjShear()));
1426  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_X,nShearRefX));
1427  aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_Y,nShearRefY));
1428 
1429  // check every object whether it is protected
1430  const SdrMarkList& rMarkList=GetMarkedObjectList();
1431  const size_t nMarkCount=rMarkList.GetMarkCount();
1432  SdrObject* pObj=rMarkList.GetMark(0)->GetMarkedSdrObj();
1433  bool bPosProt=pObj->IsMoveProtect();
1434  bool bSizProt=pObj->IsResizeProtect();
1435  bool bPosProtDontCare=false;
1436  bool bSizProtDontCare=false;
1437  for (size_t i=1; i<nMarkCount && (!bPosProtDontCare || !bSizProtDontCare); ++i)
1438  {
1439  pObj=rMarkList.GetMark(i)->GetMarkedSdrObj();
1440  if (bPosProt!=pObj->IsMoveProtect()) bPosProtDontCare=true;
1441  if (bSizProt!=pObj->IsResizeProtect()) bSizProtDontCare=true;
1442  }
1443 
1444  // InvalidateItem sets item to DONT_CARE
1445  if (bPosProtDontCare) {
1446  aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_PROTECT_POS);
1447  } else {
1448  aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_PROTECT_POS,bPosProt));
1449  }
1450  if (bSizProtDontCare) {
1451  aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_PROTECT_SIZE);
1452  } else {
1453  aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_PROTECT_SIZE,bSizProt));
1454  }
1455 
1457  bool bAutoGrow=aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWWIDTH).GetValue();
1458  if (eState==SfxItemState::DONTCARE) {
1459  aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_AUTOWIDTH);
1460  } else if (eState==SfxItemState::SET) {
1461  aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_AUTOWIDTH,bAutoGrow));
1462  }
1463 
1464  eState=aMarkAttr.GetItemState(SDRATTR_TEXT_AUTOGROWHEIGHT);
1465  bAutoGrow=aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue();
1466  if (eState==SfxItemState::DONTCARE) {
1467  aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_AUTOHEIGHT);
1468  } else if (eState==SfxItemState::SET) {
1469  aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_AUTOHEIGHT,bAutoGrow));
1470  }
1471 
1472  eState=aMarkAttr.GetItemState(SDRATTR_ECKENRADIUS);
1473  long nRadius=aMarkAttr.Get(SDRATTR_ECKENRADIUS).GetValue();
1474  if (eState==SfxItemState::DONTCARE) {
1475  aRetSet.InvalidateItem(SDRATTR_ECKENRADIUS);
1476  } else if (eState==SfxItemState::SET) {
1477  aRetSet.Put(makeSdrEckenradiusItem(nRadius));
1478  }
1479 
1480  basegfx::B2DHomMatrix aTransformation;
1481 
1482  if(nMarkCount > 1)
1483  {
1484  // multiple objects, range is collected in aRect
1486  aRect.Left(), aRect.Top(),
1487  aRect.getWidth(), aRect.getHeight());
1488  }
1489  else
1490  {
1491  // single object, get homogen transformation
1492  basegfx::B2DPolyPolygon aPolyPolygon;
1493 
1494  pObj->TRGetBaseGeometry(aTransformation, aPolyPolygon);
1495  }
1496 
1497  if(aTransformation.isIdentity())
1498  {
1499  aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_MATRIX);
1500  }
1501  else
1502  {
1503  css::geometry::AffineMatrix2D aAffineMatrix2D;
1504  Point aPageOffset(0, 0);
1505 
1506  if(GetSdrPageView())
1507  {
1508  aPageOffset = GetSdrPageView()->GetPageOrigin();
1509  }
1510 
1511  aAffineMatrix2D.m00 = aTransformation.get(0, 0);
1512  aAffineMatrix2D.m01 = aTransformation.get(0, 1);
1513  aAffineMatrix2D.m02 = aTransformation.get(0, 2) - aPageOffset.X();
1514  aAffineMatrix2D.m10 = aTransformation.get(1, 0);
1515  aAffineMatrix2D.m11 = aTransformation.get(1, 1);
1516  aAffineMatrix2D.m12 = aTransformation.get(1, 2) - aPageOffset.Y();
1517 
1518  aRetSet.Put(AffineMatrixItem(&aAffineMatrix2D));
1519  }
1520  }
1521 
1522  return aRetSet;
1523 }
1524 
1525 static Point ImpGetPoint(const tools::Rectangle& rRect, RectPoint eRP)
1526 {
1527  switch(eRP) {
1528  case RectPoint::LT: return rRect.TopLeft();
1529  case RectPoint::MT: return rRect.TopCenter();
1530  case RectPoint::RT: return rRect.TopRight();
1531  case RectPoint::LM: return rRect.LeftCenter();
1532  case RectPoint::MM: return rRect.Center();
1533  case RectPoint::RM: return rRect.RightCenter();
1534  case RectPoint::LB: return rRect.BottomLeft();
1535  case RectPoint::MB: return rRect.BottomCenter();
1536  case RectPoint::RB: return rRect.BottomRight();
1537  }
1538  return Point(); // Should not happen!
1539 }
1540 
1542 {
1543  const bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
1544 
1546 
1547  if(GetSdrPageView())
1548  {
1549  GetSdrPageView()->LogicToPagePos(aRect);
1550  }
1551 
1552  long nOldRotateAngle=GetMarkedObjRotate();
1553  long nOldShearAngle=GetMarkedObjShear();
1554  const SdrMarkList& rMarkList=GetMarkedObjectList();
1555  const size_t nMarkCount=rMarkList.GetMarkCount();
1556  SdrObject* pObj=nullptr;
1557 
1558  RectPoint eSizePoint=RectPoint::MM;
1559  long nPosDX=0;
1560  long nPosDY=0;
1561  long nSizX=0;
1562  long nSizY=0;
1563  long nRotateAngle=0;
1564 
1565  bool bModeIsRotate(meDragMode == SdrDragMode::Rotate);
1566  long nRotateX(0);
1567  long nRotateY(0);
1568  long nOldRotateX(0);
1569  long nOldRotateY(0);
1570  if(bModeIsRotate)
1571  {
1572  Point aRotateAxe(maRef1);
1573 
1574  if(GetSdrPageView())
1575  {
1576  GetSdrPageView()->LogicToPagePos(aRotateAxe);
1577  }
1578 
1579  nRotateX = nOldRotateX = aRotateAxe.X();
1580  nRotateY = nOldRotateY = aRotateAxe.Y();
1581  }
1582 
1583  long nShearAngle=0;
1584  long nShearX=0;
1585  long nShearY=0;
1586  bool bShearVert=false;
1587 
1588  bool bChgPos=false;
1589  bool bChgSiz=false;
1590  bool bChgWdh=false;
1591  bool bChgHgt=false;
1592  bool bRotate=false;
1593  bool bShear =false;
1594 
1595  bool bSetAttr=false;
1596  SfxItemSet aSetAttr(mpModel->GetItemPool());
1597 
1598  const SfxPoolItem* pPoolItem=nullptr;
1599 
1600  // position
1601  if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_POS_X,true,&pPoolItem)) {
1602  nPosDX=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue() - aRect.Left();
1603  bChgPos=true;
1604  }
1605  if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_POS_Y,true,&pPoolItem)){
1606  nPosDY=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue() - aRect.Top();
1607  bChgPos=true;
1608  }
1609  // size
1610  if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_WIDTH,true,&pPoolItem)) {
1611  nSizX=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
1612  bChgSiz=true;
1613  bChgWdh=true;
1614  }
1615  if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,true,&pPoolItem)) {
1616  nSizY=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
1617  bChgSiz=true;
1618  bChgHgt=true;
1619  }
1620  if (bChgSiz) {
1621  if (bTiledRendering && SfxItemState::SET != rAttr.GetItemState(SID_ATTR_TRANSFORM_SIZE_POINT, true, &pPoolItem))
1622  eSizePoint = RectPoint::LT;
1623  else
1624  eSizePoint = static_cast<RectPoint>(rAttr.Get(SID_ATTR_TRANSFORM_SIZE_POINT).GetValue());
1625  }
1626 
1627  // rotation
1628  if (SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_DELTA_ANGLE, true, &pPoolItem)) {
1629  nRotateAngle = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
1630  bRotate = (nRotateAngle != 0);
1631  }
1632 
1633  // rotation
1634  if (SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_ANGLE, true, &pPoolItem)) {
1635  nRotateAngle = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue() - nOldRotateAngle;
1636  bRotate = (nRotateAngle != 0);
1637  }
1638 
1639  // position rotation point x
1640  if(bRotate || SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ROT_X, true ,&pPoolItem))
1641  nRotateX = rAttr.Get(SID_ATTR_TRANSFORM_ROT_X).GetValue();
1642 
1643  // position rotation point y
1644  if(bRotate || SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ROT_Y, true ,&pPoolItem))
1645  nRotateY = rAttr.Get(SID_ATTR_TRANSFORM_ROT_Y).GetValue();
1646 
1647  // shearing
1648  if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_SHEAR,true,&pPoolItem)) {
1649  long nNewShearAngle=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
1650  if (nNewShearAngle>SDRMAXSHEAR) nNewShearAngle=SDRMAXSHEAR;
1651  if (nNewShearAngle<-SDRMAXSHEAR) nNewShearAngle=-SDRMAXSHEAR;
1652  if (nNewShearAngle!=nOldShearAngle) {
1653  bShearVert=static_cast<const SfxBoolItem&>(rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_VERTICAL)).GetValue();
1654  if (bShearVert) {
1655  nShearAngle=nNewShearAngle;
1656  } else {
1657  if (nNewShearAngle!=0 && nOldShearAngle!=0) {
1658  // bug fix
1659  double nOld = tan(static_cast<double>(nOldShearAngle) * F_PI18000);
1660  double nNew = tan(static_cast<double>(nNewShearAngle) * F_PI18000);
1661  nNew-=nOld;
1662  nNew = atan(nNew) / F_PI18000;
1663  nShearAngle=FRound(nNew);
1664  } else {
1665  nShearAngle=nNewShearAngle-nOldShearAngle;
1666  }
1667  }
1668  bShear=nShearAngle!=0;
1669  if (bShear) {
1670  nShearX=static_cast<const SfxInt32Item&>(rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_X)).GetValue();
1671  nShearY=static_cast<const SfxInt32Item&>(rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_Y)).GetValue();
1672  }
1673  }
1674  }
1675 
1676  // AutoGrow
1677  if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_AUTOWIDTH,true,&pPoolItem)) {
1678  bool bAutoGrow=static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
1679  aSetAttr.Put(makeSdrTextAutoGrowWidthItem(bAutoGrow));
1680  bSetAttr=true;
1681  }
1682 
1683  if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_AUTOHEIGHT,true,&pPoolItem)) {
1684  bool bAutoGrow=static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
1685  aSetAttr.Put(makeSdrTextAutoGrowHeightItem(bAutoGrow));
1686  bSetAttr=true;
1687  }
1688 
1689  // corner radius
1690  if (m_bEdgeRadiusAllowed && SfxItemState::SET==rAttr.GetItemState(SDRATTR_ECKENRADIUS,true,&pPoolItem)) {
1691  long nRadius=static_cast<const SdrMetricItem*>(pPoolItem)->GetValue();
1692  aSetAttr.Put(makeSdrEckenradiusItem(nRadius));
1693  bSetAttr=true;
1694  }
1695 
1697 
1698  BegUndo(SvxResId(STR_EditTransform),GetDescriptionOfMarkedObjects());
1699 
1700  if (bSetAttr) {
1701  SetAttrToMarked(aSetAttr,false);
1702  }
1703 
1704  // change size and height
1705  if (bChgSiz && (m_bResizeFreeAllowed || m_bResizePropAllowed)) {
1706  Fraction aWdt(nSizX,aRect.Right()-aRect.Left());
1707  Fraction aHgt(nSizY,aRect.Bottom()-aRect.Top());
1708  Point aRef(ImpGetPoint(aRect,eSizePoint));
1709 
1710  if(GetSdrPageView())
1711  {
1712  GetSdrPageView()->PagePosToLogic(aRef);
1713  }
1714 
1715  ResizeMultMarkedObj(aRef, aWdt, aHgt, bChgWdh, bChgHgt);
1716  }
1717 
1718  // rotate
1719  if (bRotate && (m_bRotateFreeAllowed || m_bRotate90Allowed)) {
1720  Point aRef(nRotateX,nRotateY);
1721 
1722  if(GetSdrPageView())
1723  {
1724  GetSdrPageView()->PagePosToLogic(aRef);
1725  }
1726 
1727  RotateMarkedObj(aRef,nRotateAngle);
1728  }
1729 
1730  // set rotation point position
1731  if(bModeIsRotate && (nRotateX != nOldRotateX || nRotateY != nOldRotateY))
1732  {
1733  Point aNewRef1(nRotateX, nRotateY);
1734 
1735  if(GetSdrPageView())
1736  {
1737  GetSdrPageView()->PagePosToLogic(aNewRef1);
1738  }
1739 
1740  SetRef1(aNewRef1);
1741  }
1742 
1743  // shear
1744  if (bShear && m_bShearAllowed) {
1745  Point aRef(nShearX,nShearY);
1746 
1747  if(GetSdrPageView())
1748  {
1749  GetSdrPageView()->PagePosToLogic(aRef);
1750  }
1751 
1752  ShearMarkedObj(aRef,nShearAngle,bShearVert);
1753 
1754  // #i74358#
1755  // ShearMarkedObj creates a linear combination of the existing transformation and
1756  // the new shear to apply. If the object is already transformed (e.g. rotated) the
1757  // linear combination will not decompose to the same start values again, but to a
1758  // new combination. Thus it makes no sense to check if the wanted shear is reached
1759  // or not. Taking out.
1760  }
1761 
1762  // change position
1763  if (bChgPos && m_bMoveAllowed) {
1764  MoveMarkedObj(Size(nPosDX,nPosDY));
1765  }
1766 
1767  // protect position
1768  if(SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_POS, true, &pPoolItem))
1769  {
1770  const bool bProtPos(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
1771  bool bChanged(false);
1772 
1773  for(size_t i = 0; i < nMarkCount; ++i)
1774  {
1775  pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
1776 
1777  if(pObj->IsMoveProtect() != bProtPos)
1778  {
1779  bChanged = true;
1780  pObj->SetMoveProtect(bProtPos);
1781 
1782  if(bProtPos)
1783  {
1784  pObj->SetResizeProtect(true);
1785  }
1786  }
1787  }
1788 
1789  if(bChanged)
1790  {
1791  m_bMoveProtect = bProtPos;
1792 
1793  if(bProtPos)
1794  {
1795  m_bResizeProtect = true;
1796  }
1797 
1798  // #i77187# there is no simple method to get the toolbars updated
1799  // in the application. The App is listening to selection change and i
1800  // will use it here (even if not true). It's acceptable since changing
1801  // this model data is pretty rare and only possible using the F4 dialog
1803  }
1804  }
1805 
1806  if(!m_bMoveProtect)
1807  {
1808  // protect size
1809  if(SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_SIZE, true, &pPoolItem))
1810  {
1811  const bool bProtSize(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
1812  bool bChanged(false);
1813 
1814  for(size_t i = 0; i < nMarkCount; ++i)
1815  {
1816  pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
1817 
1818  if(pObj->IsResizeProtect() != bProtSize)
1819  {
1820  bChanged = true;
1821  pObj->SetResizeProtect(bProtSize);
1822  }
1823  }
1824 
1825  if(bChanged)
1826  {
1827  m_bResizeProtect = bProtSize;
1828 
1829  // #i77187# see above
1831  }
1832  }
1833  }
1834 
1835  EndUndo();
1836 }
1837 
1838 
1840 { // at least two selected objects, at least one of them movable
1842  const size_t nCount=GetMarkedObjectCount();
1843  if (nCount==0) return false; // nothing selected!
1844  if (nCount==1) return m_bMoveAllowed; // align single object to page
1845  return m_bOneOrMoreMovable; // otherwise: MarkCount>=2
1846 }
1847 
1849 {
1850  if (eHor==SdrHorAlign::NONE && eVert==SdrVertAlign::NONE)
1851  return;
1852 
1854  if (!GetMarkedObjectCount())
1855  return;
1856 
1857  const bool bUndo = IsUndoEnabled();
1858  if( bUndo )
1859  {
1861  OUString aStr(GetDescriptionOfMarkedObjects());
1862  if (eHor==SdrHorAlign::NONE)
1863  {
1864  switch (eVert)
1865  {
1866  case SdrVertAlign::Top:
1867  aStr = ImpGetDescriptionString(STR_EditAlignVTop);
1868  break;
1869  case SdrVertAlign::Bottom:
1870  aStr = ImpGetDescriptionString(STR_EditAlignVBottom);
1871  break;
1872  case SdrVertAlign::Center:
1873  aStr = ImpGetDescriptionString(STR_EditAlignVCenter);
1874  break;
1875  default: break;
1876  }
1877  }
1878  else if (eVert==SdrVertAlign::NONE)
1879  {
1880  switch (eHor)
1881  {
1882  case SdrHorAlign::Left:
1883  aStr = ImpGetDescriptionString(STR_EditAlignHLeft);
1884  break;
1885  case SdrHorAlign::Right:
1886  aStr = ImpGetDescriptionString(STR_EditAlignHRight);
1887  break;
1888  case SdrHorAlign::Center:
1889  aStr = ImpGetDescriptionString(STR_EditAlignHCenter);
1890  break;
1891  default: break;
1892  }
1893  }
1894  else if (eHor==SdrHorAlign::Center && eVert==SdrVertAlign::Center)
1895  {
1896  aStr = ImpGetDescriptionString(STR_EditAlignCenter);
1897  }
1898  else
1899  {
1900  aStr = ImpGetDescriptionString(STR_EditAlign);
1901  }
1902  BegUndo(aStr);
1903  }
1904 
1905  tools::Rectangle aBound;
1906  const size_t nMarkCount=GetMarkedObjectCount();
1907  bool bHasFixed=false;
1908  for (size_t nm=0; nm<nMarkCount; ++nm)
1909  {
1910  SdrMark* pM=GetSdrMarkByIndex(nm);
1911  SdrObject* pObj=pM->GetMarkedSdrObj();
1912  SdrObjTransformInfoRec aInfo;
1913  pObj->TakeObjInfo(aInfo);
1914  if (!aInfo.bMoveAllowed || pObj->IsMoveProtect())
1915  {
1916  tools::Rectangle aObjRect(pObj->GetSnapRect());
1917  aBound.Union(aObjRect);
1918  bHasFixed=true;
1919  }
1920  }
1921  if (!bHasFixed)
1922  {
1923  if (nMarkCount==1)
1924  { // align single object to page
1925  const SdrObject* pObj=GetMarkedObjectByIndex(0);
1926  const SdrPage* pPage=pObj->getSdrPageFromSdrObject();
1928  const SdrPageGridFrame* pFrame=nullptr;
1929  if (pGFL!=nullptr && pGFL->GetCount()!=0)
1930  { // Writer
1931  pFrame=&((*pGFL)[0]);
1932  }
1933 
1934  if (pFrame!=nullptr)
1935  { // Writer
1936  aBound=pFrame->GetUserArea();
1937  }
1938  else
1939  {
1940  aBound=tools::Rectangle(pPage->GetLeftBorder(),pPage->GetUpperBorder(),
1941  pPage->GetWidth()-pPage->GetRightBorder(),
1942  pPage->GetHeight()-pPage->GetLowerBorder());
1943  }
1944  }
1945  else
1946  {
1947  aBound=GetMarkedObjRect();
1948  }
1949  }
1950  Point aCenter(aBound.Center());
1951  for (size_t nm=0; nm<nMarkCount; ++nm)
1952  {
1953  SdrMark* pM=GetSdrMarkByIndex(nm);
1954  SdrObject* pObj=pM->GetMarkedSdrObj();
1955  SdrObjTransformInfoRec aInfo;
1956  pObj->TakeObjInfo(aInfo);
1957  if (aInfo.bMoveAllowed && !pObj->IsMoveProtect())
1958  {
1959  long nXMov=0;
1960  long nYMov=0;
1961  tools::Rectangle aObjRect(pObj->GetSnapRect());
1962  switch (eVert)
1963  {
1964  case SdrVertAlign::Top : nYMov=aBound.Top() -aObjRect.Top() ; break;
1965  case SdrVertAlign::Bottom: nYMov=aBound.Bottom()-aObjRect.Bottom() ; break;
1966  case SdrVertAlign::Center: nYMov=aCenter.Y() -aObjRect.Center().Y(); break;
1967  default: break;
1968  }
1969  switch (eHor)
1970  {
1971  case SdrHorAlign::Left : nXMov=aBound.Left() -aObjRect.Left() ; break;
1972  case SdrHorAlign::Right : nXMov=aBound.Right() -aObjRect.Right() ; break;
1973  case SdrHorAlign::Center: nXMov=aCenter.X() -aObjRect.Center().X(); break;
1974  default: break;
1975  }
1976  if (nXMov!=0 || nYMov!=0)
1977  {
1978  // SdrEdgeObj needs an extra SdrUndoGeoObj since the
1979  // connections may need to be saved
1980  if( bUndo )
1981  {
1982  if( dynamic_cast<SdrEdgeObj*>(pObj) )
1983  {
1984  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
1985  }
1986 
1987  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*pObj,Size(nXMov,nYMov)));
1988  }
1989 
1990  pObj->Move(Size(nXMov,nYMov));
1991  }
1992  }
1993  }
1994 
1995  if( bUndo )
1996  EndUndo();
1997 }
1998 
1999 /* 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:1848
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr) const
Definition: svdedtv1.cxx:1325
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:1541
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:917
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:214
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 sendUnoStatus(const SfxItemSet *pSet) const override
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:1525
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:1365
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:1055
const SfxPoolItem * NextItem()
SdrCrookMode
Definition: svdsnpv.hxx:83
long Right() const
void LogicToPagePos(Point &rPnt) const
Definition: svdpagv.hxx:212
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
static SfxViewShell * Current()
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:209
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:1346
#define SDRATTR_3DOBJ_END_ANGLE
Definition: svddef.hxx:328
void SetAttributes(const SfxItemSet &rSet, bool bReplaceAll)
Definition: svdedtv1.cxx:1337
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:1037
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:1290
#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:1839
bool m_bMoveAllowed
Definition: svdedtv.hxx:97
void SetStyleSheet(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr)
Definition: svdedtv1.cxx:1355
#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:1275
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