LibreOffice Module cui (master)  1
transfrm.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 
20 #include <sal/config.h>
21 
22 #include <algorithm>
23 
24 #include <sfx2/app.hxx>
26 #include <svx/svdundo.hxx>
27 #include <svx/svdview.hxx>
28 #include <svx/svdobj.hxx>
29 #include <svx/svdpagv.hxx>
30 #include <svx/svdotext.hxx>
31 #include <svx/svdoashp.hxx>
32 #include <svx/sderitm.hxx>
33 #include <svx/dialogs.hrc>
34 #include <svx/svxids.hrc>
35 #include <svx/transfrmhelper.hxx>
36 #include <editeng/sizeitem.hxx>
37 #include <svtools/unitconv.hxx>
38 
39 #include <transfrm.hxx>
40 #include <svx/dlgutil.hxx>
41 #include <editeng/svxenum.hxx>
42 #include <svx/anchorid.hxx>
43 #include <sfx2/module.hxx>
44 #include <svl/rectitem.hxx>
45 #include <svl/aeitem.hxx>
46 #include <swpossizetabpage.hxx>
47 #include <comphelper/lok.hxx>
48 #include <vcl/canvastools.hxx>
49 
50 // static ----------------------------------------------------------------
51 
52 const sal_uInt16 SvxPositionSizeTabPage::pPosSizeRanges[] =
53 {
54  SID_ATTR_TRANSFORM_POS_X,
55  SID_ATTR_TRANSFORM_POS_Y,
56  SID_ATTR_TRANSFORM_PROTECT_POS,
57  SID_ATTR_TRANSFORM_PROTECT_POS,
58  SID_ATTR_TRANSFORM_INTERN,
59  SID_ATTR_TRANSFORM_INTERN,
60  SID_ATTR_TRANSFORM_ANCHOR,
61  SID_ATTR_TRANSFORM_VERT_ORIENT,
62  SID_ATTR_TRANSFORM_WIDTH,
63  SID_ATTR_TRANSFORM_SIZE_POINT,
64  SID_ATTR_TRANSFORM_PROTECT_POS,
65  SID_ATTR_TRANSFORM_INTERN,
66  SID_ATTR_TRANSFORM_AUTOWIDTH,
67  SID_ATTR_TRANSFORM_AUTOHEIGHT,
68  0
69 };
70 
71 const sal_uInt16 SvxAngleTabPage::pAngleRanges[] =
72 {
73  SID_ATTR_TRANSFORM_ROT_X,
74  SID_ATTR_TRANSFORM_ANGLE,
75  SID_ATTR_TRANSFORM_INTERN,
76  SID_ATTR_TRANSFORM_INTERN,
77  0
78 };
79 
80 const sal_uInt16 SvxSlantTabPage::pSlantRanges[] =
81 {
84  SID_ATTR_TRANSFORM_SHEAR,
85  SID_ATTR_TRANSFORM_SHEAR_VERTICAL,
86  SID_ATTR_TRANSFORM_INTERN,
87  SID_ATTR_TRANSFORM_INTERN,
88  0
89 };
90 
91 /*************************************************************************
92 |*
93 |* constructor of the tab dialog: adds the pages to the dialog
94 |*
95 \************************************************************************/
96 
98  const SdrView* pSdrView, SvxAnchorIds nAnchorTypes)
99  : SfxTabDialogController(pParent, "cui/ui/positionsizedialog.ui", "PositionAndSizeDialog", pAttr)
100  , pView(pSdrView)
101  , nAnchorCtrls(nAnchorTypes)
102 {
103  DBG_ASSERT(pView, "no valid view (!)");
104 
105  //different positioning page in Writer
106  if(nAnchorCtrls & (SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page | SvxAnchorIds::Fly))
107  {
109  RemoveTabPage("RID_SVXPAGE_POSITION_SIZE");
110  }
111  else
112  {
114  RemoveTabPage("RID_SVXPAGE_SWPOSSIZE");
115  }
116 
119 }
120 
121 
122 void SvxTransformTabDialog::PageCreated(const OString& rId, SfxTabPage &rPage)
123 {
124  if (rId == "RID_SVXPAGE_POSITION_SIZE")
125  {
126  SvxPositionSizeTabPage& rSvxPos = static_cast<SvxPositionSizeTabPage&>(rPage);
127  rSvxPos.SetView(pView);
128  rSvxPos.Construct();
129 
130  if(nAnchorCtrls & SvxAnchorIds::NoResize)
131  {
132  rSvxPos.DisableResize();
133  }
134 
135  if(nAnchorCtrls & SvxAnchorIds::NoProtect)
136  {
137  rSvxPos.DisableProtect();
138  rSvxPos.UpdateControlStates();
139  }
140  }
141  else if (rId == "RID_SVXPAGE_SWPOSSIZE")
142  {
143  SvxSwPosSizeTabPage& rSwPos = static_cast<SvxSwPosSizeTabPage&>(rPage);
144 
147  rSwPos.SetView(pView);
148  }
149  else if (rId == "RID_SVXPAGE_ANGLE")
150  {
151  SvxAngleTabPage& rSvxAng = static_cast<SvxAngleTabPage&>(rPage);
152 
153  rSvxAng.SetView( pView );
154  rSvxAng.Construct();
155  }
156  else if (rId == "RID_SVXPAGE_SLANT")
157  {
158  SvxSlantTabPage& rSvxSlnt = static_cast<SvxSlantTabPage&>(rPage);
159 
160  rSvxSlnt.SetView( pView );
161  rSvxSlnt.Construct();
162  }
163 }
164 
166 {
167  aValidateLink = rLink;
168 }
169 
170 /*************************************************************************
171 |*
172 |* dialog for changing the positions of the rotation
173 |* angle and the rotation angle of the graphic objects
174 |*
175 \************************************************************************/
177  : SvxTabPage(pParent, "cui/ui/rotationtabpage.ui", "Rotation", rInAttrs)
178  , rOutAttrs(rInAttrs)
179  , pView(nullptr)
180  , eDlgUnit(FieldUnit::NONE)
181  , m_aCtlRect(this)
182  , m_xFlPosition(m_xBuilder->weld_widget("FL_POSITION"))
183  , m_xMtrPosX(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_X", FieldUnit::CM))
184  , m_xMtrPosY(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_Y", FieldUnit::CM))
185  , m_xCtlRect(new weld::CustomWeld(*m_xBuilder, "CTL_RECT", m_aCtlRect))
186  , m_xFlAngle(m_xBuilder->weld_widget("FL_ANGLE"))
187  , m_xNfAngle(m_xBuilder->weld_spin_button("NF_ANGLE"))
188  , m_xCtlAngle(new weld::CustomWeld(*m_xBuilder, "CTL_ANGLE", m_aCtlAngle))
189 {
190  // calculate PoolUnit
191  SfxItemPool* pPool = rOutAttrs.GetPool();
192  DBG_ASSERT( pPool, "no pool (!)" );
193  ePoolUnit = pPool->GetMetric(SID_ATTR_TRANSFORM_POS_X);
194 
196 }
197 
199 {
200 }
201 
203 {
204  DBG_ASSERT(pView, "No valid view (!)");
208 
209  if (FieldUnit::MILE == eDlgUnit || FieldUnit::KM == eDlgUnit)
210  {
211  m_xMtrPosX->set_digits(3);
212  m_xMtrPosY->set_digits(3);
213  }
214 
215  { // #i75273#
217  pView->GetSdrPageView()->LogicToPagePos(aTempRect);
219  }
220 
221  // Take anchor into account (Writer)
222  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
223 
224  if(rMarkList.GetMarkCount())
225  {
226  const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
227  maAnchor = basegfx::B2DPoint(pObj->GetAnchorPos().X(), pObj->GetAnchorPos().Y());
228 
229  if(!maAnchor.equalZero()) // -> Writer
230  {
232  }
233  }
234 
235  // take scale into account
236  const Fraction aUIScale(pView->GetModel()->GetUIScale());
238 
239  // take UI units into account
240  sal_uInt16 nDigits(m_xMtrPosX->get_digits());
242 
243  if(!pView->IsRotateAllowed())
244  {
245  m_xFlPosition->set_sensitive(false);
246  m_xFlAngle->set_sensitive(false);
247  }
248 }
249 
251 {
252  bool bModified = false;
253 
254  if (m_aCtlAngle.IsValueModified() || m_xMtrPosX->get_value_changed_from_saved() || m_xMtrPosY->get_value_changed_from_saved())
255  {
256  const double fUIScale(double(pView->GetModel()->GetUIScale()));
257  const double fTmpX((GetCoreValue(*m_xMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale);
258  const double fTmpY((GetCoreValue(*m_xMtrPosY, ePoolUnit) + maAnchor.getY()) * fUIScale);
259 
260  rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_aCtlAngle.GetRotation()));
261  rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_X), basegfx::fround(fTmpX)));
262  rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_Y), basegfx::fround(fTmpY)));
263 
264  bModified = true;
265  }
266 
267  return bModified;
268 }
269 
270 
272 {
273  const double fUIScale(double(pView->GetModel()->GetUIScale()));
274 
275  const SfxPoolItem* pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_ROT_X );
276  if(pItem)
277  {
278  const double fTmp((static_cast<double>(static_cast<const SfxInt32Item*>(pItem)->GetValue()) - maAnchor.getX()) / fUIScale);
280  }
281  else
282  {
283  m_xMtrPosX->set_text(OUString());
284  }
285 
286  pItem = GetItem(*rAttrs, SID_ATTR_TRANSFORM_ROT_Y);
287  if(pItem)
288  {
289  const double fTmp((static_cast<double>(static_cast<const SfxInt32Item*>(pItem)->GetValue()) - maAnchor.getY()) / fUIScale);
291  }
292  else
293  {
294  m_xMtrPosY->set_text(OUString());
295  }
296 
297  pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_ANGLE );
298  if(pItem)
299  {
300  m_aCtlAngle.SetRotation(static_cast<const SfxInt32Item*>(pItem)->GetValue());
301  }
302  else
303  {
305  }
307  m_xMtrPosX->save_value();
308  m_xMtrPosY->save_value();
309 }
310 
312 {
313  return VclPtr<SvxAngleTabPage>::Create(pParent, *rSet);
314 }
315 
317 {
318  SfxBoolItem const * bPosProtect = nullptr;
319  if(SfxItemState::SET == rSet.GetItemState( GetWhich(SID_ATTR_TRANSFORM_PROTECT_POS ) , false, reinterpret_cast<SfxPoolItem const **>(&bPosProtect) ))
320  {
321  m_xFlPosition->set_sensitive(!bPosProtect->GetValue());
322  m_xFlAngle->set_sensitive(!bPosProtect->GetValue());
323  }
324 }
325 
327 {
328  if(_pSet)
329  {
330  FillItemSet(_pSet);
331  }
332 
333  return DeactivateRC::LeavePage;
334 }
335 
337 {
338  if (pDrawingArea == m_aCtlRect.GetDrawingArea())
339  {
340  switch(eRP)
341  {
342  case RectPoint::LT:
343  {
344  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE );
345  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE );
346  break;
347  }
348  case RectPoint::MT:
349  {
350  m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE );
351  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE );
352  break;
353  }
354  case RectPoint::RT:
355  {
356  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE );
357  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE );
358  break;
359  }
360  case RectPoint::LM:
361  {
362  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE );
363  m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE );
364  break;
365  }
366  case RectPoint::MM:
367  {
368  m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE );
369  m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE );
370  break;
371  }
372  case RectPoint::RM:
373  {
374  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE );
375  m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE );
376  break;
377  }
378  case RectPoint::LB:
379  {
380  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE );
381  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
382  break;
383  }
384  case RectPoint::MB:
385  {
386  m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE );
387  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
388  break;
389  }
390  case RectPoint::RB:
391  {
392  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE );
393  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
394  break;
395  }
396  }
397  }
398 }
399 
400 /*************************************************************************
401 |*
402 |* dialog for changing slant and corner radius
403 |*
404 \************************************************************************/
406  : SfxTabPage(pParent, "cui/ui/slantcornertabpage.ui", "SlantAndCornerRadius", &rInAttrs)
407  , rOutAttrs(rInAttrs)
408  , pView(nullptr)
409  , eDlgUnit(FieldUnit::NONE)
410  , m_xFlRadius(m_xBuilder->weld_widget("FL_RADIUS"))
411  , m_xMtrRadius(m_xBuilder->weld_metric_spin_button("MTR_FLD_RADIUS", FieldUnit::CM))
412  , m_xFlAngle(m_xBuilder->weld_widget("FL_SLANT"))
413  , m_xMtrAngle(m_xBuilder->weld_metric_spin_button("MTR_FLD_ANGLE", FieldUnit::DEGREE))
414 {
415  for (int i = 0; i < 2; ++i)
416  {
417  m_aControlGroups[i] = m_xBuilder->weld_widget("controlgroups" + OString::number(i+1));
418  m_aControlGroupX[i] = m_xBuilder->weld_widget("controlgroupx" + OString::number(i+1));
419  m_aControlX[i] = m_xBuilder->weld_metric_spin_button("controlx" + OString::number(i+1), FieldUnit::CM);
420  m_aControlGroupY[i] = m_xBuilder->weld_widget("controlgroupy" + OString::number(i+1));
421  m_aControlY[i] = m_xBuilder->weld_metric_spin_button("controly" + OString::number(i+1), FieldUnit::CM);
422  }
423 
424  // this page needs ExchangeSupport
426 
427  // evaluate PoolUnit
428  SfxItemPool* pPool = rOutAttrs.GetPool();
429  assert(pPool && "no pool (!)");
430  ePoolUnit = pPool->GetMetric( SID_ATTR_TRANSFORM_POS_X );
431 }
432 
434 {
435 }
436 
438 {
439  // get the range
440  DBG_ASSERT(pView, "no valid view (!)");
443  for (int i = 0; i < 2; ++i)
444  {
446  SetFieldUnit(*m_aControlY[i], eDlgUnit, true);
447  }
448 
449  { // #i75273#
451  pView->GetSdrPageView()->LogicToPagePos(aTempRect);
452  }
453 }
454 
456 {
457  bool bModified = false;
458 
459  if (m_xMtrRadius->get_value_changed_from_saved())
460  {
461  Fraction aUIScale = pView->GetModel()->GetUIScale();
462  long nTmp = long(GetCoreValue(*m_xMtrRadius, ePoolUnit) * aUIScale);
463 
464  rAttrs->Put( makeSdrEckenradiusItem( nTmp ) );
465  bModified = true;
466  }
467 
468  if (m_xMtrAngle->get_value_changed_from_saved())
469  {
470  sal_Int32 nValue = static_cast<sal_Int32>(m_xMtrAngle->get_value(FieldUnit::NONE));
471  rAttrs->Put( SfxInt32Item( SID_ATTR_TRANSFORM_SHEAR, nValue ) );
472  bModified = true;
473  }
474 
475  if( bModified )
476  {
477  // set reference points
478  ::tools::Rectangle aObjectRect(pView->GetAllMarkedRect());
479  pView->GetSdrPageView()->LogicToPagePos(aObjectRect);
480  Point aPt = aObjectRect.Center();
481 
482  rAttrs->Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_X, aPt.X()));
483  rAttrs->Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_Y, aPt.Y()));
484  rAttrs->Put( SfxBoolItem( SID_ATTR_TRANSFORM_SHEAR_VERTICAL, false ) );
485  }
486 
487  bool bControlPointsChanged = false;
488  for (int i = 0; i < 2; ++i)
489  {
490  bControlPointsChanged |= (m_aControlX[i]->get_value_changed_from_saved() ||
491  m_aControlY[i]->get_value_changed_from_saved());
492  }
493 
494  if (!bControlPointsChanged)
495  return bModified;
496 
497  bool bSelectionIsSdrObjCustomShape(false);
498 
499  while(true)
500  {
501  if(nullptr == pView)
502  {
503  break;
504  }
505 
507  {
508  break;
509  }
510 
512 
513  if(nullptr == pCandidate)
514  {
515  break;
516  }
517 
518  if(nullptr == dynamic_cast< SdrObjCustomShape* >(pCandidate))
519  {
520  break;
521  }
522 
523  bSelectionIsSdrObjCustomShape = true;
524  break;
525  }
526 
527  if(bSelectionIsSdrObjCustomShape)
528  {
529  SdrObjCustomShape& rSdrObjCustomShape(
530  static_cast< SdrObjCustomShape& >(
532  SdrModel& rModel(rSdrObjCustomShape.getSdrModelFromSdrObject());
533  std::unique_ptr<SdrUndoAction> pUndo;
534  if (rModel.IsUndoEnabled())
535  pUndo = rModel.GetSdrUndoFactory().CreateUndoAttrObject(rSdrObjCustomShape);
536 
537  if(pUndo)
538  {
539  rModel.BegUndo(pUndo->GetComment());
540  }
541 
542  EnhancedCustomShape2d aShape(rSdrObjCustomShape);
543  ::tools::Rectangle aLogicRect = aShape.GetLogicRect();
544 
545  for (int i = 0; i < 2; ++i)
546  {
547  if (m_aControlX[i]->get_value_changed_from_saved() || m_aControlY[i]->get_value_changed_from_saved())
548  {
549  Point aNewPosition(GetCoreValue(*m_aControlX[i], ePoolUnit),
551  aNewPosition.Move(aLogicRect.Left(), aLogicRect.Top());
552 
553  css::awt::Point aPosition;
554  aPosition.X = aNewPosition.X();
555  aPosition.Y = aNewPosition.Y();
556 
557  aShape.SetHandleControllerPosition(i, aPosition);
558  }
559  }
560 
561  rSdrObjCustomShape.SetChanged();
562  rSdrObjCustomShape.BroadcastObjectChange();
563  bModified = true;
564 
565  if (pUndo)
566  {
567  rModel.AddUndo(std::move(pUndo));
568  rModel.EndUndo();
569  }
570  }
571 
572  return bModified;
573 }
574 
576 {
577  // if the view has selected objects, items with SfxItemState::DEFAULT need to be disabled
578  const SfxPoolItem* pItem;
579 
580  // corner radius
581  if(!pView->IsEdgeRadiusAllowed())
582  {
583  m_xMtrRadius->set_text("");
584  m_xFlRadius->set_sensitive(false);
585  }
586  else
587  {
588  pItem = GetItem( *rAttrs, SDRATTR_ECKENRADIUS );
589 
590  if( pItem )
591  {
592  const double fUIScale(double(pView->GetModel()->GetUIScale()));
593  const double fTmp(static_cast<double>(static_cast<const SdrMetricItem*>(pItem)->GetValue()) / fUIScale);
595  }
596  else
597  {
598  m_xMtrRadius->set_text("");
599  }
600  }
601 
602  m_xMtrRadius->save_value();
603 
604  // slant: angle
605  if( !pView->IsShearAllowed() )
606  {
607  m_xMtrAngle->set_text( "" );
608  m_xFlAngle->set_sensitive(false);
609  }
610  else
611  {
612  pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_SHEAR );
613 
614  if( pItem )
615  {
616  m_xMtrAngle->set_value(static_cast<const SfxInt32Item*>(pItem)->GetValue(), FieldUnit::NONE);
617  }
618  else
619  {
620  m_xMtrAngle->set_text("");
621  }
622  }
623 
624  m_xMtrAngle->save_value();
625 
626  bool bSelectionIsSdrObjCustomShape(false);
627 
628  while(true)
629  {
631  {
632  break;
633  }
634 
636 
637  if(nullptr == pCandidate)
638  {
639  break;
640  }
641 
642  if(nullptr == dynamic_cast< SdrObjCustomShape* >(pCandidate))
643  {
644  break;
645  }
646 
647  bSelectionIsSdrObjCustomShape = true;
648  break;
649  }
650 
651  if(bSelectionIsSdrObjCustomShape)
652  {
653  SdrObjCustomShape& rSdrObjCustomShape(
654  static_cast< SdrObjCustomShape& >(
656 
657  //save geometry
658  SdrCustomShapeGeometryItem aInitialGeometry(rSdrObjCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY));
659  EnhancedCustomShape2d aShape(rSdrObjCustomShape);
660 
661  for (int i = 0; i < 2; ++i)
662  {
663  Point aInitialPosition;
664  if (!aShape.GetHandlePosition(i, aInitialPosition))
665  break;
666  m_aControlGroups[i]->set_sensitive(true);
667  css::awt::Point aPosition;
668 
669  aPosition.X = SAL_MAX_INT32/2;
670  aPosition.Y = SAL_MAX_INT32/2;
671  aShape.SetHandleControllerPosition(i, aPosition);
672  Point aMaxPosition;
673  aShape.GetHandlePosition(i, aMaxPosition);
674 
675  aPosition.X = SAL_MIN_INT32/2;
676  aPosition.Y = SAL_MIN_INT32/2;
677  aShape.SetHandleControllerPosition(i, aPosition);
678  Point aMinPosition;
679  aShape.GetHandlePosition(i, aMinPosition);
680 
681  ::tools::Rectangle aLogicRect = aShape.GetLogicRect();
682  aInitialPosition.Move(-aLogicRect.Left(), -aLogicRect.Top());
683  aMaxPosition.Move(-aLogicRect.Left(), -aLogicRect.Top());
684  aMinPosition.Move(-aLogicRect.Left(), -aLogicRect.Top());
685 
686  SetMetricValue(*m_aControlX[i], aInitialPosition.X(), ePoolUnit);
687  SetMetricValue(*m_aControlY[i], aInitialPosition.Y(), ePoolUnit);
688 
689  if (aMaxPosition.X() == aMinPosition.X())
690  m_aControlGroupX[i]->set_sensitive(false);
691  else
692  m_aControlX[i]->set_range(aMinPosition.X(), aMaxPosition.X(), FieldUnit::MM);
693  if (aMaxPosition.Y() == aMinPosition.Y())
694  m_aControlGroupY[i]->set_sensitive(false);
695  else
696  m_aControlY[i]->set_range(aMinPosition.Y(), aMaxPosition.Y(), FieldUnit::MM);
697  }
698 
699  //restore geometry
700  rSdrObjCustomShape.SetMergedItem(aInitialGeometry);
701  }
702 
703  for (int i = 0; i < 2; ++i)
704  {
705  m_aControlX[i]->save_value();
706  m_aControlY[i]->save_value();
707  }
708 }
709 
711 {
712  return VclPtr<SvxSlantTabPage>::Create(pParent, *rOutAttrs);
713 }
714 
716 {
717  SfxBoolItem const * bPosProtect = nullptr;
718  if(SfxItemState::SET == rSet.GetItemState( GetWhich(SID_ATTR_TRANSFORM_PROTECT_POS ) , false, reinterpret_cast<SfxPoolItem const **>(&bPosProtect) ))
719  {
720  m_xFlAngle->set_sensitive(!bPosProtect->GetValue());
721  }
722  SfxBoolItem const * bSizeProtect = nullptr;
723  if(SfxItemState::SET == rSet.GetItemState( GetWhich(SID_ATTR_TRANSFORM_PROTECT_SIZE ) , false, reinterpret_cast<SfxPoolItem const **>(&bSizeProtect) ))
724  {
725  m_xFlAngle->set_sensitive(!bSizeProtect->GetValue());
726  }
727 
728 }
729 
731 {
732  if(_pSet)
733  {
734  FillItemSet(_pSet);
735  }
736 
737  return DeactivateRC::LeavePage;
738 }
739 
740 
741 /*************************************************************************
742 |*
743 |* Dialog for changing position and size of graphic objects
744 |*
745 \************************************************************************/
747  : SvxTabPage(pParent, "cui/ui/possizetabpage.ui", "PositionAndSize", rInAttrs)
748  , mrOutAttrs(rInAttrs)
749  , mpView(nullptr)
750  , meDlgUnit(FieldUnit::NONE)
751  , mnProtectSizeState(TRISTATE_FALSE)
752  , mbPageDisabled(false)
753  , mbProtectDisabled(false)
754  , mbSizeDisabled(false)
755  , mbAdjustDisabled(true)
756  , mbIgnoreAutoGrowWidth(true)
757  , mbIgnoreAutoGrowHeight(true)
758  , mfOldWidth(0.0)
759  , mfOldHeight(0.0)
760  , m_aCtlPos(this)
761  , m_aCtlSize(this)
762  , m_xFlPosition(m_xBuilder->weld_widget("FL_POSITION"))
763  , m_xMtrPosX(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_X", FieldUnit::CM))
764  , m_xMtrPosY(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_Y", FieldUnit::CM))
765  , m_xCtlPos(new weld::CustomWeld(*m_xBuilder, "CTL_POSRECT", m_aCtlPos))
766  , m_xFlSize(m_xBuilder->weld_widget("FL_SIZE"))
767  , m_xFtWidth(m_xBuilder->weld_label("FT_WIDTH"))
768  , m_xMtrWidth(m_xBuilder->weld_metric_spin_button("MTR_FLD_WIDTH", FieldUnit::CM))
769  , m_xFtHeight(m_xBuilder->weld_label("FT_HEIGHT"))
770  , m_xMtrHeight(m_xBuilder->weld_metric_spin_button("MTR_FLD_HEIGHT", FieldUnit::CM))
771  , m_xCbxScale(m_xBuilder->weld_check_button("CBX_SCALE"))
772  , m_xCtlSize(new weld::CustomWeld(*m_xBuilder, "CTL_SIZERECT", m_aCtlSize))
773  , m_xFlProtect(m_xBuilder->weld_widget("FL_PROTECT"))
774  , m_xTsbPosProtect(m_xBuilder->weld_check_button("TSB_POSPROTECT"))
775  , m_xTsbSizeProtect(m_xBuilder->weld_check_button("TSB_SIZEPROTECT"))
776  , m_xFlAdjust(m_xBuilder->weld_widget("FL_ADJUST"))
777  , m_xTsbAutoGrowWidth(m_xBuilder->weld_check_button("TSB_AUTOGROW_WIDTH"))
778  , m_xTsbAutoGrowHeight(m_xBuilder->weld_check_button("TSB_AUTOGROW_HEIGHT"))
779 {
780  // this page needs ExchangeSupport
781  SetExchangeSupport();
782 
783  // evaluate PoolUnit
784  SfxItemPool* pPool = mrOutAttrs.GetPool();
785  DBG_ASSERT( pPool, "no pool (!)" );
786  mePoolUnit = pPool->GetMetric( SID_ATTR_TRANSFORM_POS_X );
787 
788  m_aCtlPos.SetActualRP(RectPoint::LT);
789  m_aCtlSize.SetActualRP(RectPoint::LT);
790  meRP = RectPoint::LT; // see above
791 
792  m_xMtrWidth->connect_value_changed( LINK( this, SvxPositionSizeTabPage, ChangeWidthHdl ) );
793  m_xMtrHeight->connect_value_changed( LINK( this, SvxPositionSizeTabPage, ChangeHeightHdl ) );
794  m_xCbxScale->connect_toggled( LINK( this, SvxPositionSizeTabPage, ClickAutoHdl ) );
795 
796  m_xFlAdjust->set_sensitive(false);
797 
798  // #i2379# disable controls when protected
799  m_xTsbPosProtect->connect_toggled( LINK( this, SvxPositionSizeTabPage, ChangePosProtectHdl ) );
800  m_xTsbSizeProtect->connect_toggled( LINK( this, SvxPositionSizeTabPage, ChangeSizeProtectHdl ) );
801 }
802 
804 {
805 }
806 
808 {
809  // get range and work area
810  DBG_ASSERT( mpView, "no valid view (!)" );
812  SetFieldUnit( *m_xMtrPosX, meDlgUnit, true );
813  SetFieldUnit( *m_xMtrPosY, meDlgUnit, true );
816 
817  if(FieldUnit::MILE == meDlgUnit || FieldUnit::KM == meDlgUnit)
818  {
819  m_xMtrPosX->set_digits( 3 );
820  m_xMtrPosY->set_digits( 3 );
821  m_xMtrWidth->set_digits( 3 );
822  m_xMtrHeight->set_digits( 3 );
823  }
824 
825  { // #i75273#
827  mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
829  }
830 
831  { // #i75273#
832  ::tools::Rectangle aTempRect(mpView->GetWorkArea());
833  mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
835  }
836 
837  // take anchor into account (Writer)
838  const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
839 
840  if(rMarkList.GetMarkCount())
841  {
842  const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
843  maAnchor = basegfx::B2DPoint(pObj->GetAnchorPos().X(), pObj->GetAnchorPos().Y());
844 
845  if(!maAnchor.equalZero()) // -> Writer
846  {
847  for(size_t i = 1; i < rMarkList.GetMarkCount(); ++i)
848  {
849  pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
850 
851  if(maAnchor != basegfx::B2DPoint(pObj->GetAnchorPos().X(), pObj->GetAnchorPos().Y()))
852  {
853  // different anchor positions
854  m_xMtrPosX->set_text("");
855  m_xMtrPosY->set_text("");
856  mbPageDisabled = true;
857  return;
858  }
859  }
860 
861  // translate ranges about anchor
863  maWorkRange = basegfx::B2DRange(maWorkRange.getMinimum() - maAnchor, maWorkRange.getMaximum() - maAnchor);
864  }
865  }
866 
867  // this should happen via SID_ATTR_TRANSFORM_AUTOSIZE
868  if(1 == rMarkList.GetMarkCount())
869  {
870  const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
871  const SdrObjKind eKind(static_cast<SdrObjKind>(pObj->GetObjIdentifier()));
872 
873  if((pObj->GetObjInventor() == SdrInventor::Default) &&
874  (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind) &&
875  pObj->HasText())
876  {
877  mbAdjustDisabled = false;
878 
879  m_xFlAdjust->set_sensitive(true);
880 
881  m_xTsbAutoGrowWidth->connect_toggled( LINK( this, SvxPositionSizeTabPage, ClickSizeProtectHdl ) );
882  m_xTsbAutoGrowHeight->connect_toggled( LINK( this, SvxPositionSizeTabPage, ClickSizeProtectHdl ) );
883 
884  // is used as flag to evaluate if its selectable
885  mbIgnoreAutoGrowWidth = false;
886  mbIgnoreAutoGrowHeight = false;
887  }
888  }
889 
890  // take scale into account
891  const Fraction aUIScale(mpView->GetModel()->GetUIScale());
893  TransfrmHelper::ScaleRect( maRange, aUIScale );
894 
895  // take UI units into account
896  const sal_uInt16 nDigits(m_xMtrPosX->get_digits());
899 
901 }
902 
903 
905 {
906  bool bModified(false);
907 
908  if ( m_xMtrWidth->has_focus() )
909  {
910  ChangeWidthHdl( *m_xMtrWidth );
911  }
912 
913  if ( m_xMtrHeight->has_focus() )
914  {
915  ChangeHeightHdl( *m_xMtrHeight );
916  }
917 
918  if( !mbPageDisabled )
919  {
920  if (m_xMtrPosX->get_value_changed_from_saved() || m_xMtrPosY->get_value_changed_from_saved())
921  {
922  const double fUIScale(double(mpView->GetModel()->GetUIScale()));
923  double fX((GetCoreValue( *m_xMtrPosX, mePoolUnit ) + maAnchor.getX()) * fUIScale);
924  double fY((GetCoreValue( *m_xMtrPosY, mePoolUnit ) + maAnchor.getY()) * fUIScale);
925 
926  { // #i75273#
928  mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
930  }
931 
932  // #101581# GetTopLeftPosition(...) needs coordinates after UI scaling, in real PagePositions
933  GetTopLeftPosition(fX, fY, maRange);
934 
935  rOutAttrs->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_POS_X), basegfx::fround(fX)));
936  rOutAttrs->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_POS_Y), basegfx::fround(fY)));
937 
938  bModified = true;
939  }
940 
941  if (m_xTsbPosProtect->get_state_changed_from_saved())
942  {
943  if( m_xTsbPosProtect->get_inconsistent() )
944  {
945  rOutAttrs->InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_POS );
946  }
947  else
948  {
949  rOutAttrs->Put(
950  SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ),
951  m_xTsbPosProtect->get_active() ) );
952  }
953 
954  bModified = true;
955  }
956  }
957 
958  if (m_xMtrWidth->get_value_changed_from_saved() || m_xMtrHeight->get_value_changed_from_saved())
959  {
960  Fraction aUIScale = mpView->GetModel()->GetUIScale();
961 
962  // get Width
963  double nWidth = static_cast<double>(m_xMtrWidth->get_value(FieldUnit::MM_100TH));
964  long lWidth = long(nWidth * static_cast<double>(aUIScale));
965  lWidth = OutputDevice::LogicToLogic( lWidth, MapUnit::Map100thMM, mePoolUnit );
966  lWidth = static_cast<long>(m_xMtrWidth->denormalize( lWidth ));
967 
968  // get Height
969  double nHeight = static_cast<double>(m_xMtrHeight->get_value(FieldUnit::MM_100TH));
970  long lHeight = long(nHeight * static_cast<double>(aUIScale));
971  lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit );
972  lHeight = static_cast<long>(m_xMtrHeight->denormalize( lHeight ));
973 
974  // put Width & Height to itemset
975  rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ), static_cast<sal_uInt32>(lWidth) ) );
976  rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), static_cast<sal_uInt32>(lHeight) ) );
977  rOutAttrs->Put( SfxAllEnumItem( GetWhich( SID_ATTR_TRANSFORM_SIZE_POINT ), sal::static_int_cast< sal_uInt16 >( meRP ) ) );
978  bModified = true;
979  }
980 
981  if (m_xTsbSizeProtect->get_state_changed_from_saved())
982  {
983  if ( m_xTsbSizeProtect->get_inconsistent() )
984  rOutAttrs->InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_SIZE );
985  else
986  rOutAttrs->Put(
987  SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ),
988  m_xTsbSizeProtect->get_active() ) );
989  bModified = true;
990  }
991 
992  if (m_xTsbAutoGrowWidth->get_state_changed_from_saved())
993  {
995  {
996  if( m_xTsbAutoGrowWidth->get_inconsistent() )
997  rOutAttrs->InvalidateItem( SID_ATTR_TRANSFORM_AUTOWIDTH );
998  else
999  rOutAttrs->Put(
1000  SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOWIDTH ),
1001  m_xTsbAutoGrowWidth->get_active() ) );
1002  }
1003  bModified = true;
1004  }
1005 
1006  if (m_xTsbAutoGrowHeight->get_state_changed_from_saved())
1007  {
1009  {
1010  if (m_xTsbAutoGrowHeight->get_inconsistent())
1011  {
1012  rOutAttrs->InvalidateItem( SID_ATTR_TRANSFORM_AUTOHEIGHT );
1013  }
1014  else
1015  {
1016  rOutAttrs->Put(
1017  SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOHEIGHT ),
1018  m_xTsbAutoGrowHeight->get_active() ) );
1019  }
1020  }
1021  bModified = true;
1022  }
1023 
1024  return bModified;
1025 }
1026 
1028 {
1029  const SfxPoolItem* pItem;
1030  const double fUIScale(double(mpView->GetModel()->GetUIScale()));
1031 
1032  if ( !mbPageDisabled )
1033  {
1034  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_POS_X );
1035  if ( pItem )
1036  {
1037  const double fTmp((static_cast<const SfxInt32Item*>(pItem)->GetValue() - maAnchor.getX()) / fUIScale);
1039  }
1040 
1041  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_POS_Y );
1042  if ( pItem )
1043  {
1044  const double fTmp((static_cast<const SfxInt32Item*>(pItem)->GetValue() - maAnchor.getY()) / fUIScale);
1046  }
1047 
1048  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_PROTECT_POS );
1049  if ( pItem )
1050  {
1051  bool bProtected = static_cast<const SfxBoolItem*>( pItem )->GetValue();
1052  m_xTsbPosProtect->set_active(bProtected);
1053  }
1054  else
1055  {
1056  m_xTsbPosProtect->set_inconsistent(true);
1057  }
1058 
1059  m_xTsbPosProtect->save_state();
1060  m_aCtlPos.Reset();
1061 
1062  // #i2379# Disable controls for protected objects
1063  ChangePosProtectHdl(*m_xTsbPosProtect);
1064  }
1065 
1066  { // #i75273# set width
1067  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_WIDTH );
1068  mfOldWidth = std::max( pItem ? static_cast<double>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0.0, 1.0 );
1069  double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), mePoolUnit, MapUnit::Map100thMM)) / fUIScale);
1070  if (m_xMtrWidth->get_digits())
1071  fTmpWidth *= pow(10.0, m_xMtrWidth->get_digits());
1072  m_xMtrWidth->set_value(static_cast<int>(fTmpWidth), FieldUnit::MM_100TH);
1073  }
1074 
1075  { // #i75273# set height
1076  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_HEIGHT );
1077  mfOldHeight = std::max( pItem ? static_cast<double>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0.0, 1.0 );
1078  double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), mePoolUnit, MapUnit::Map100thMM)) / fUIScale);
1079  if (m_xMtrHeight->get_digits())
1080  fTmpHeight *= pow(10.0, m_xMtrHeight->get_digits());
1081  m_xMtrHeight->set_value(static_cast<int>(fTmpHeight), FieldUnit::MM_100TH);
1082  }
1083 
1084  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_PROTECT_SIZE );
1085  if ( pItem )
1086  {
1087  m_xTsbSizeProtect->set_active(static_cast<const SfxBoolItem*>(pItem)->GetValue());
1088  }
1089  else
1090  m_xTsbSizeProtect->set_inconsistent(true);
1091 
1092  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_AUTOWIDTH );
1093  if ( pItem )
1094  {
1095  m_xTsbAutoGrowWidth->set_active(static_cast<const SfxBoolItem*>( pItem )->GetValue());
1096  }
1097  else
1098  m_xTsbAutoGrowWidth->set_inconsistent(true);
1099 
1100  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_AUTOHEIGHT );
1101  if ( pItem )
1102  {
1103  m_xTsbAutoGrowHeight->set_active(static_cast<const SfxBoolItem*>( pItem )->GetValue());
1104  }
1105  else
1106  m_xTsbAutoGrowHeight->set_inconsistent(true);
1107 
1108  // Is matching set?
1109  OUString aStr = GetUserData();
1110  m_xCbxScale->set_active(aStr.toInt32() != 0);
1111 
1112  m_xMtrPosX->save_value();
1113  m_xMtrPosY->save_value();
1114  m_xMtrWidth->save_value();
1115  m_xMtrHeight->save_value();
1116 
1117  m_xTsbSizeProtect->save_state();
1118  m_xTsbAutoGrowWidth->save_state();
1119  m_xTsbAutoGrowHeight->save_state();
1120  ClickSizeProtectHdl(*m_xTsbAutoGrowHeight);
1121 
1122  // #i2379# Disable controls for protected objects
1123  ChangeSizeProtectHdl(*m_xTsbSizeProtect);
1124 }
1125 
1127 {
1128  return VclPtr<SvxPositionSizeTabPage>::Create(pParent, *rOutAttrs);
1129 }
1130 
1132 {
1133  SfxRectangleItem const * pRectItem = nullptr;
1134 
1135  if( SfxItemState::SET == rSet.GetItemState( GetWhich( SID_ATTR_TRANSFORM_INTERN ) , false, reinterpret_cast<SfxPoolItem const **>(&pRectItem) ) )
1136  {
1137  { // #i75273#
1138  const ::tools::Rectangle aTempRect(pRectItem->GetValue());
1140  }
1141 
1143  }
1144 }
1145 
1146 
1148 {
1149  if( _pSet )
1150  {
1151  double fX(static_cast<double>(m_xMtrPosX->get_value(FieldUnit::NONE)));
1152  double fY(static_cast<double>(m_xMtrPosY->get_value(FieldUnit::NONE)));
1153 
1154  GetTopLeftPosition(fX, fY, maRange);
1155  const ::tools::Rectangle aOutRectangle(
1158  _pSet->Put(SfxRectangleItem(SID_ATTR_TRANSFORM_INTERN, aOutRectangle));
1159  _pSet->Put(SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ),
1160  m_xTsbPosProtect->get_state() == TRISTATE_TRUE ));
1161  _pSet->Put(SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ),
1162  m_xTsbSizeProtect->get_state() == TRISTATE_TRUE ));
1163  FillItemSet(_pSet);
1164  }
1165 
1166  return DeactivateRC::LeavePage;
1167 }
1168 
1169 
1171 {
1172  // #106572# Remember user's last choice
1173  m_xTsbSizeProtect->set_state(m_xTsbPosProtect->get_state() == TRISTATE_TRUE ? TRISTATE_TRUE : mnProtectSizeState);
1174  UpdateControlStates();
1175 }
1176 
1177 
1179 {
1180  const bool bPosProtect = m_xTsbPosProtect->get_state() == TRISTATE_TRUE;
1181  const bool bSizeProtect = m_xTsbSizeProtect->get_state() == TRISTATE_TRUE;
1182  const bool bHeightChecked = !mbIgnoreAutoGrowHeight && (m_xTsbAutoGrowHeight->get_active());
1183  const bool bWidthChecked = !mbIgnoreAutoGrowWidth && (m_xTsbAutoGrowWidth->get_active());
1184 
1185  m_xFlPosition->set_sensitive(!bPosProtect && !mbPageDisabled);
1186 
1187  m_xTsbPosProtect->set_sensitive( !mbProtectDisabled && !mbPageDisabled );
1188 
1189  m_xFlSize->set_sensitive( !mbSizeDisabled && !bSizeProtect );
1190 
1191  m_xFtWidth->set_sensitive( !mbSizeDisabled && !bSizeProtect && !bWidthChecked );
1192  m_xMtrWidth->set_sensitive( !mbSizeDisabled && !bSizeProtect && !bWidthChecked );
1193 
1194  m_xFtHeight->set_sensitive( !mbSizeDisabled && !bSizeProtect && !bHeightChecked );
1195  m_xMtrHeight->set_sensitive( !mbSizeDisabled && !bSizeProtect && !bHeightChecked );
1196 
1197  m_xCbxScale->set_sensitive( !mbSizeDisabled && !bSizeProtect && !bHeightChecked && !bWidthChecked );
1198  m_xCtlSize->set_sensitive( !mbSizeDisabled && !bSizeProtect && (!bHeightChecked || !bWidthChecked) );
1199 
1200  m_xFlProtect->set_sensitive( !mbProtectDisabled );
1201  m_xTsbSizeProtect->set_sensitive( !mbProtectDisabled && !bPosProtect );
1202 
1203  m_xFlAdjust->set_sensitive( !mbSizeDisabled && !bSizeProtect && !mbAdjustDisabled );
1204 
1205  m_aCtlSize.Invalidate();
1206  m_aCtlPos.Invalidate();
1207 }
1208 
1210 {
1211  if (m_xTsbSizeProtect->get_sensitive())
1212  {
1213  // #106572# Remember user's last choice
1214 
1215  // Note: this works only as long as the dialog is open. When
1216  // the user closes the dialog, there is no way to remember
1217  // whether size was enabled or disabled before pos protect was
1218  // clicked. Thus, if pos protect is selected, the dialog is
1219  // closed and reopened again, unchecking pos protect will
1220  // always uncheck size protect, too. That's life.
1221  mnProtectSizeState = m_xTsbSizeProtect->get_state();
1222  }
1223 
1224  UpdateControlStates();
1225 }
1226 
1228 {
1229  // position
1230  double fLeft(maWorkRange.getMinX());
1231  double fTop(maWorkRange.getMinY());
1232  double fRight(maWorkRange.getMaxX());
1233  double fBottom(maWorkRange.getMaxY());
1234 
1235  switch (m_aCtlPos.GetActualRP())
1236  {
1237  case RectPoint::LT:
1238  {
1239  fRight -= maRange.getWidth();
1240  fBottom -= maRange.getHeight();
1241  break;
1242  }
1243  case RectPoint::MT:
1244  {
1245  fLeft += maRange.getWidth() / 2.0;
1246  fRight -= maRange.getWidth() / 2.0;
1247  fBottom -= maRange.getHeight();
1248  break;
1249  }
1250  case RectPoint::RT:
1251  {
1252  fLeft += maRange.getWidth();
1253  fBottom -= maRange.getHeight();
1254  break;
1255  }
1256  case RectPoint::LM:
1257  {
1258  fRight -= maRange.getWidth();
1259  fTop += maRange.getHeight() / 2.0;
1260  fBottom -= maRange.getHeight() / 2.0;
1261  break;
1262  }
1263  case RectPoint::MM:
1264  {
1265  fLeft += maRange.getWidth() / 2.0;
1266  fRight -= maRange.getWidth() / 2.0;
1267  fTop += maRange.getHeight() / 2.0;
1268  fBottom -= maRange.getHeight() / 2.0;
1269  break;
1270  }
1271  case RectPoint::RM:
1272  {
1273  fLeft += maRange.getWidth();
1274  fTop += maRange.getHeight() / 2.0;
1275  fBottom -= maRange.getHeight() / 2.0;
1276  break;
1277  }
1278  case RectPoint::LB:
1279  {
1280  fRight -= maRange.getWidth();
1281  fTop += maRange.getHeight();
1282  break;
1283  }
1284  case RectPoint::MB:
1285  {
1286  fLeft += maRange.getWidth() / 2.0;
1287  fRight -= maRange.getWidth() / 2.0;
1288  fTop += maRange.getHeight();
1289  break;
1290  }
1291  case RectPoint::RB:
1292  {
1293  fLeft += maRange.getWidth();
1294  fTop += maRange.getHeight();
1295  break;
1296  }
1297  }
1298 
1299  const double fMaxLong(static_cast<double>(MetricField::ConvertValue( LONG_MAX, 0, MapUnit::Map100thMM, meDlgUnit ) - 1));
1300  fLeft = std::clamp(fLeft, -fMaxLong, fMaxLong);
1301  fRight = std::clamp(fRight, -fMaxLong, fMaxLong);
1302  fTop = std::clamp(fTop, - fMaxLong, fMaxLong);
1303  fBottom = std::clamp(fBottom, -fMaxLong, fMaxLong);
1304 
1305  // #i75273# normalizing when setting the min/max values was wrong, removed
1306  m_xMtrPosX->set_range(basegfx::fround64(fLeft), basegfx::fround64(fRight), FieldUnit::NONE);
1307  m_xMtrPosY->set_range(basegfx::fround64(fTop), basegfx::fround64(fBottom), FieldUnit::NONE);
1308 
1309  // size
1310  fLeft = maWorkRange.getMinX();
1311  fTop = maWorkRange.getMinY();
1312  fRight = maWorkRange.getMaxX();
1313  fBottom = maWorkRange.getMaxY();
1314  double fNewX(0);
1315  double fNewY(0);
1316 
1317  switch (m_aCtlSize.GetActualRP())
1318  {
1319  case RectPoint::LT:
1320  {
1321  fNewX = maWorkRange.getWidth() - ( maRange.getMinX() - fLeft );
1322  fNewY = maWorkRange.getHeight() - ( maRange.getMinY() - fTop );
1323  break;
1324  }
1325  case RectPoint::MT:
1326  {
1327  fNewX = std::min( maRange.getCenter().getX() - fLeft, fRight - maRange.getCenter().getX() ) * 2.0;
1328  fNewY = maWorkRange.getHeight() - ( maRange.getMinY() - fTop );
1329  break;
1330  }
1331  case RectPoint::RT:
1332  {
1333  fNewX = maWorkRange.getWidth() - ( fRight - maRange.getMaxX() );
1334  fNewY = maWorkRange.getHeight() - ( maRange.getMinY() - fTop );
1335  break;
1336  }
1337  case RectPoint::LM:
1338  {
1339  fNewX = maWorkRange.getWidth() - ( maRange.getMinX() - fLeft );
1340  fNewY = std::min( maRange.getCenter().getY() - fTop, fBottom - maRange.getCenter().getY() ) * 2.0;
1341  break;
1342  }
1343  case RectPoint::MM:
1344  {
1345  const double f1(maRange.getCenter().getX() - fLeft);
1346  const double f2(fRight - maRange.getCenter().getX());
1347  const double f3(std::min(f1, f2));
1348  const double f4(maRange.getCenter().getY() - fTop);
1349  const double f5(fBottom - maRange.getCenter().getY());
1350  const double f6(std::min(f4, f5));
1351 
1352  fNewX = f3 * 2.0;
1353  fNewY = f6 * 3.0;
1354 
1355  break;
1356  }
1357  case RectPoint::RM:
1358  {
1359  fNewX = maWorkRange.getWidth() - ( fRight - maRange.getMaxX() );
1360  fNewY = std::min( maRange.getCenter().getY() - fTop, fBottom - maRange.getCenter().getY() ) * 2.0;
1361  break;
1362  }
1363  case RectPoint::LB:
1364  {
1365  fNewX = maWorkRange.getWidth() - ( maRange.getMinX() - fLeft );
1366  fNewY = maWorkRange.getHeight() - ( fBottom - maRange.getMaxY() );
1367  break;
1368  }
1369  case RectPoint::MB:
1370  {
1371  fNewX = std::min( maRange.getCenter().getX() - fLeft, fRight - maRange.getCenter().getX() ) * 2.0;
1372  fNewY = maWorkRange.getHeight() - ( maRange.getMaxY() - fBottom );
1373  break;
1374  }
1375  case RectPoint::RB:
1376  {
1377  fNewX = maWorkRange.getWidth() - ( fRight - maRange.getMaxX() );
1378  fNewY = maWorkRange.getHeight() - ( fBottom - maRange.getMaxY() );
1379  break;
1380  }
1381  }
1382 
1383  // #i75273# normalizing when setting the min/max values was wrong, removed
1384  m_xMtrWidth->set_max(basegfx::fround64(fNewX), FieldUnit::NONE);
1385  m_xMtrHeight->set_max(basegfx::fround64(fNewY), FieldUnit::NONE);
1386 }
1387 
1388 void SvxPositionSizeTabPage::GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange)
1389 {
1390  switch (m_aCtlPos.GetActualRP())
1391  {
1392  case RectPoint::LT:
1393  {
1394  break;
1395  }
1396  case RectPoint::MT:
1397  {
1398  rfX -= rRange.getCenter().getX() - rRange.getMinX();
1399  break;
1400  }
1401  case RectPoint::RT:
1402  {
1403  rfX -= rRange.getWidth();
1404  break;
1405  }
1406  case RectPoint::LM:
1407  {
1408  rfY -= rRange.getCenter().getY() - rRange.getMinY();
1409  break;
1410  }
1411  case RectPoint::MM:
1412  {
1413  rfX -= rRange.getCenter().getX() - rRange.getMinX();
1414  rfY -= rRange.getCenter().getY() - rRange.getMinY();
1415  break;
1416  }
1417  case RectPoint::RM:
1418  {
1419  rfX -= rRange.getWidth();
1420  rfY -= rRange.getCenter().getY() - rRange.getMinY();
1421  break;
1422  }
1423  case RectPoint::LB:
1424  {
1425  rfY -= rRange.getHeight();
1426  break;
1427  }
1428  case RectPoint::MB:
1429  {
1430  rfX -= rRange.getCenter().getX() - rRange.getMinX();
1431  rfY -= rRange.getHeight();
1432  break;
1433  }
1434  case RectPoint::RB:
1435  {
1436  rfX -= rRange.getWidth();
1437  rfY -= rRange.getHeight();
1438  break;
1439  }
1440  }
1441 }
1442 
1444 {
1445  if (pDrawingArea == m_aCtlPos.GetDrawingArea())
1446  {
1448  switch( eRP )
1449  {
1450  case RectPoint::LT:
1451  {
1452  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE );
1453  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE );
1454  break;
1455  }
1456  case RectPoint::MT:
1457  {
1458  m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE );
1459  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE );
1460  break;
1461  }
1462  case RectPoint::RT:
1463  {
1464  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE );
1465  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE );
1466  break;
1467  }
1468  case RectPoint::LM:
1469  {
1470  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE );
1471  m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE );
1472  break;
1473  }
1474  case RectPoint::MM:
1475  {
1476  m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE );
1477  m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE );
1478  break;
1479  }
1480  case RectPoint::RM:
1481  {
1482  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE );
1483  m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE );
1484  break;
1485  }
1486  case RectPoint::LB:
1487  {
1488  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE );
1489  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
1490  break;
1491  }
1492  case RectPoint::MB:
1493  {
1494  m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE );
1495  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
1496  break;
1497  }
1498  case RectPoint::RB:
1499  {
1500  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE );
1501  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
1502  break;
1503  }
1504  }
1505  }
1506  else
1507  {
1508  meRP = eRP;
1510  }
1511 }
1512 
1514 {
1515  mbSizeDisabled = true;
1516 }
1517 
1518 
1520 {
1521  mbProtectDisabled = true;
1522 }
1523 
1524 
1526 {
1527  if( m_xCbxScale->get_active() && m_xCbxScale->get_sensitive() )
1528  {
1529  sal_Int64 nHeight(basegfx::fround64((mfOldHeight * static_cast<double>(m_xMtrWidth->get_value(FieldUnit::NONE))) / mfOldWidth));
1530  int nMin, nMax;
1531  m_xMtrHeight->get_range(nMin, nMax, FieldUnit::NONE);
1532 
1533  if (nHeight <= nMax)
1534  {
1535  m_xMtrHeight->set_value(nHeight, FieldUnit::NONE);
1536  }
1537  else
1538  {
1539  nHeight = nMax;
1540  m_xMtrHeight->set_value(nHeight, FieldUnit::NONE);
1541 
1542  const sal_Int64 nWidth(basegfx::fround64((mfOldWidth * static_cast<double>(nHeight)) / mfOldHeight));
1543  m_xMtrWidth->set_value(nWidth, FieldUnit::NONE);
1544  }
1545  }
1546 }
1547 
1549 {
1550  if( m_xCbxScale->get_active() && m_xCbxScale->get_sensitive() )
1551  {
1552  sal_Int64 nWidth(basegfx::fround64((mfOldWidth * static_cast<double>(m_xMtrHeight->get_value(FieldUnit::NONE))) / mfOldHeight));
1553  int nMin, nMax;
1554  m_xMtrWidth->get_range(nMin, nMax, FieldUnit::NONE);
1555 
1556  if (nWidth <= nMax)
1557  {
1558  m_xMtrWidth->set_value(nWidth, FieldUnit::NONE);
1559  }
1560  else
1561  {
1562  nWidth = nMax;
1563  m_xMtrWidth->set_value(nWidth, FieldUnit::NONE);
1564 
1565  const sal_Int64 nHeight(basegfx::fround64((mfOldHeight * static_cast<double>(nWidth)) / mfOldWidth));
1566  m_xMtrHeight->set_value(nHeight, FieldUnit::NONE);
1567  }
1568  }
1569 }
1570 
1572 {
1573  UpdateControlStates();
1574 }
1575 
1577 {
1578  if (m_xCbxScale->get_active())
1579  {
1580  mfOldWidth = std::max( static_cast<double>(GetCoreValue( *m_xMtrWidth, mePoolUnit )), 1.0 );
1581  mfOldHeight = std::max( static_cast<double>(GetCoreValue( *m_xMtrHeight, mePoolUnit )), 1.0 );
1582  }
1583 }
1584 
1586 {
1587  // matching is saved in the Ini-file
1588  OUString aStr = m_xCbxScale->get_active() ? OUString("1") : OUString("0");
1589  SetUserData( aStr );
1590 }
1591 
1592 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GetValue() const
void SetFieldUnit(weld::MetricSpinButton &rField, FieldUnit eUnit, bool bAll)
FieldUnit
B2DPoint getCenter() const
void SetActualRP(RectPoint eNewRP)
size_t GetMarkCount() const
static const sal_uInt16 pAngleRanges[]
Definition: transfrm.hxx:168
std::unique_ptr< weld::Widget > m_aControlGroups[2]
Definition: transfrm.hxx:234
std::unique_ptr< weld::CheckButton > m_xTsbSizeProtect
Definition: transfrm.hxx:115
bool IsEdgeRadiusAllowed() const
double getHeight() const
basegfx::B2DRange maRange
Definition: transfrm.hxx:74
std::string GetValue
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
std::unique_ptr< weld::Widget > m_aControlGroupY[2]
Definition: transfrm.hxx:237
void Reset()
OBJ_TEXT
const SfxPoolItem * GetItem(const SwTextAttr &rAttr, sal_uInt16 nWhich)
virtual ~SvxSlantTabPage() override
Definition: transfrm.cxx:433
void SetLinkedField(weld::SpinButton *pField, sal_Int32 nDecimalPlaces=0)
Link< SvxSwFrameValidation &, void > aValidateLink
Definition: transfrm.hxx:43
double getX() const
void SetValidateFramePosLink(const Link< SvxSwFrameValidation &, void > &rLink)
virtual bool HasText() const
void RemoveTabPage(const OString &rName)
void InvalidateItem(sal_uInt16 nWhich)
static VclPtr< SfxTabPage > Create(TabPageParent, const SfxItemSet *)
Definition: transfrm.cxx:710
double getY() const
RectPoint GetActualRP() const
SdrMark * GetMark(size_t nNum) const
void Construct()
Definition: transfrm.cxx:202
static VclPtr< SfxTabPage > Create(TabPageParent, const SfxItemSet *)
static VclPtr< SfxTabPage > Create(TabPageParent, const SfxItemSet *)
Definition: transfrm.cxx:1126
basegfx::B2DPoint maAnchor
Definition: transfrm.hxx:76
B2DPoint getMaximum() const
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:271
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosY
Definition: transfrm.hxx:100
std::unique_ptr< weld::CheckButton > m_xTsbAutoGrowWidth
Definition: transfrm.hxx:119
TRISTATE_TRUE
std::unique_ptr< weld::Widget > m_aControlGroupX[2]
Definition: transfrm.hxx:235
double getMaxX() const
static const SfxPoolItem * GetItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
std::unique_ptr< weld::SpinButton > m_xNfAngle
Definition: transfrm.hxx:189
std::unique_ptr< weld::Widget > m_xFlSize
Definition: transfrm.hxx:104
FieldUnit GetModuleFieldUnit(const SfxItemSet &rSet)
static const sal_uInt16 * GetRanges()
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:149
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
void LogicToPagePos(Point &rPnt) const
double getWidth() const
#define SDRATTR_CUSTOMSHAPE_GEOMETRY
std::unique_ptr< weld::Widget > m_xFlAngle
Definition: transfrm.hxx:188
std::unique_ptr< weld::MetricSpinButton > m_xMtrRadius
Definition: transfrm.hxx:231
std::unique_ptr< weld::Widget > m_xFlPosition
Definition: transfrm.hxx:98
void SetExchangeSupport()
SvxRectCtl m_aCtlSize
Definition: transfrm.hxx:95
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:715
std::unique_ptr< weld::Label > m_xFtHeight
Definition: transfrm.hxx:107
long Top() const
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosY
Definition: transfrm.hxx:186
bool IsRotateAllowed(bool b90Deg=false) const
basegfx::B2DRange maRange
Definition: transfrm.hxx:175
SvxRectCtl m_aCtlPos
Definition: transfrm.hxx:94
double getMaxY() const
B2IRange fround(const B2DRange &rRange)
bool SetHandleControllerPosition(const sal_uInt32 nIndex, const css::awt::Point &rPosition)
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
Definition: transfrm.cxx:336
const SfxItemSet & GetItemSet() const
MapUnit ePoolUnit
Definition: transfrm.hxx:227
void Construct()
Definition: transfrm.cxx:437
std::unique_ptr< weld::Label > m_xFtWidth
Definition: transfrm.hxx:105
SdrObject * GetMarkedSdrObj() const
std::unique_ptr< weld::MetricSpinButton > m_xMtrAngle
Definition: transfrm.hxx:233
const SdrView * pView
Definition: transfrm.hxx:225
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:138
RectPoint
NONE
std::unique_ptr< weld::Widget > m_xFlRadius
Definition: transfrm.hxx:230
bool IsShearAllowed() const
void SetRotation(sal_Int32 nAngle)
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
Definition: transfrm.cxx:1443
#define SAL_MAX_INT32
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:904
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define DBG_ASSERT(sCon, aError)
const SfxItemSet & rOutAttrs
Definition: transfrm.hxx:171
std::unique_ptr< weld::Builder > m_xBuilder
SdrMetricItem makeSdrEckenradiusItem(long nRadius)
virtual void FillUserData() override
Definition: transfrm.cxx:1585
virtual sal_uInt16 GetObjIdentifier() const
static void ScaleRect(basegfx::B2DRange &rRange, const Fraction &rUIScale)
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:245
SvxRectCtl m_aCtlRect
Definition: transfrm.hxx:182
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:208
IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangePosProtectHdl, weld::ToggleButton &, void)
Definition: transfrm.cxx:1170
int i
void BroadcastObjectChange() const
TRISTATE_FALSE
const SdrMarkList & GetMarkedObjectList() const
std::unique_ptr< weld::Widget > m_xFlProtect
Definition: transfrm.hxx:113
int GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
virtual ~SvxAngleTabPage() override
Definition: transfrm.cxx:198
#define SAL_MIN_INT32
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
SvxAngleTabPage(TabPageParent pParent, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:176
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:1027
SdrModel & getSdrModelFromSdrObject() const
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosX
Definition: transfrm.hxx:99
const SdrView * pView
Definition: transfrm.hxx:40
void GetTopLeftPosition(double &rfX, double &rfY, const basegfx::B2DRange &rRange)
Definition: transfrm.cxx:1388
void SetMergedItem(const SfxPoolItem &rItem)
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:575
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:730
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:455
std::unique_ptr< weld::MetricSpinButton > m_aControlY[2]
Definition: transfrm.hxx:238
static const sal_uInt16 pPosSizeRanges[]
Definition: transfrm.hxx:66
void SetMetricValue(weld::MetricSpinButton &rField, int nCoreValue, MapUnit eUnit)
std::unique_ptr< weld::Widget > m_xFlPosition
Definition: transfrm.hxx:184
SfxItemPool * GetPool() const
std::unique_ptr< weld::Widget > m_xFlAngle
Definition: transfrm.hxx:232
long X() const
const tools::Rectangle & GetAllMarkedRect() const
SdrUndoFactory & GetSdrUndoFactory() const
const long LONG_MAX
std::unique_ptr< weld::Widget > m_xFlAdjust
Definition: transfrm.hxx:118
const SdrView * mpView
Definition: transfrm.hxx:71
virtual SdrInventor GetObjInventor() const
std::unique_ptr< weld::MetricSpinButton > m_xMtrWidth
Definition: transfrm.hxx:106
basegfx::B2DRange maWorkRange
Definition: transfrm.hxx:75
FieldUnit eDlgUnit
Definition: transfrm.hxx:179
virtual ~SvxPositionSizeTabPage() override
Definition: transfrm.cxx:803
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
std::unique_ptr< weld::CheckButton > m_xTsbPosProtect
Definition: transfrm.hxx:114
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:254
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const Fraction & GetUIScale() const
OBJ_OUTLINETEXT
std::unique_ptr< weld::MetricSpinButton > m_aControlX[2]
Definition: transfrm.hxx:236
const SfxItemSet & rOutAttrs
Definition: transfrm.hxx:223
SvxSlantTabPage(TabPageParent pParent, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:405
double getMinY() const
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosX
Definition: transfrm.hxx:185
SdrObjKind
std::unique_ptr< weld::MetricSpinButton > m_xMtrHeight
Definition: transfrm.hxx:108
static void ConvertRect(basegfx::B2DRange &rRange, const sal_uInt16 nDigits, const MapUnit ePoolUnit, const FieldUnit eDlgUnit)
bool equalZero() const
const SdrView * pView
Definition: transfrm.hxx:172
#define GetWhich(nSlot)
static sal_Int64 ConvertValue(sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits, FieldUnit eInUnit, FieldUnit eOutUnit)
SvxAnchorIds
static VclPtr< reference_type > Create(Arg &&...arg)
std::unique_ptr< weld::CustomWeld > m_xCtlSize
Definition: transfrm.hxx:110
void AddTabPage(const OString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
const tools::Rectangle & GetValue() const
B2DPoint getMinimum() const
FieldUnit eDlgUnit
Definition: transfrm.hxx:228
basegfx::B2DPoint maAnchor
Definition: transfrm.hxx:176
UnoViewSharedPtr mpView
long Left() const
sal_Int32 GetRotation() const
const Point & GetAnchorPos() const
SvxAnchorIds nAnchorCtrls
Definition: transfrm.hxx:42
SdrPageView * GetSdrPageView() const
SvxPositionSizeTabPage(TabPageParent pParent, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:746
DeactivateRC
void SetValidateFramePosLink(const Link< SvxSwFrameValidation &, void > &rLink)
Definition: transfrm.cxx:165
void Move(long nHorzMove, long nVertMove)
double getMinX() const
SvxTransformTabDialog(weld::Window *pParent, const SfxItemSet *pAttr, const SdrView *pView, SvxAnchorIds nAnchorTypes)
Definition: transfrm.cxx:97
static VclPtr< SfxTabPage > Create(TabPageParent, const SfxItemSet *)
Definition: transfrm.cxx:311
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:316
void EnableAnchorTypes(SvxAnchorIds nAnchorEnable)
std::unique_ptr< weld::CheckButton > m_xTsbAutoGrowHeight
Definition: transfrm.hxx:120
std::unique_ptr< weld::CheckButton > m_xCbxScale
Definition: transfrm.hxx:109
const SfxItemSet & mrOutAttrs
Definition: transfrm.hxx:69
virtual std::unique_ptr< SdrUndoAction > CreateUndoAttrObject(SdrObject &rObject, bool bStyleSheet1=false, bool bSaveText=false)
virtual void SetChanged()
sal_Int64 fround64(double fVal)
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:250
SdrModel * GetModel() const
aStr
const tools::Rectangle & GetWorkArea() const
OBJ_TITLETEXT
MapUnit ePoolUnit
Definition: transfrm.hxx:178
svx::SvxDialControl m_aCtlAngle
Definition: transfrm.hxx:181
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:1131
virtual void PageCreated(const OString &rId, SfxTabPage &rPage) override
Definition: transfrm.cxx:122
long Y() const
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:1147
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
const tools::Rectangle & GetLogicRect() const
static const sal_uInt16 pSlantRanges[]
Definition: transfrm.hxx:220
void SetView(const SdrView *pSdrView)
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:326
#define SDRATTR_ECKENRADIUS
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:197