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