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