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