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 <svl/aeitem.hxx>
40 #include <swpossizetabpage.hxx>
41 #include <vcl/canvastools.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  , rOutAttrs(rInAttrs)
172  , pView(nullptr)
173  , eDlgUnit(FieldUnit::NONE)
174  , m_aCtlRect(this)
175  , m_xFlPosition(m_xBuilder->weld_widget("FL_POSITION"))
176  , m_xMtrPosX(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_X", FieldUnit::CM))
177  , m_xMtrPosY(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_Y", FieldUnit::CM))
178  , m_xCtlRect(new weld::CustomWeld(*m_xBuilder, "CTL_RECT", m_aCtlRect))
179  , m_xFlAngle(m_xBuilder->weld_widget("FL_ANGLE"))
180  , m_xNfAngle(m_xBuilder->weld_spin_button("NF_ANGLE"))
181  , m_xCtlAngle(new weld::CustomWeld(*m_xBuilder, "CTL_ANGLE", m_aCtlAngle))
182 {
183  // calculate PoolUnit
184  SfxItemPool* pPool = rOutAttrs.GetPool();
185  DBG_ASSERT( pPool, "no pool (!)" );
186  ePoolUnit = pPool->GetMetric(SID_ATTR_TRANSFORM_POS_X);
187 
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_aCtlAngle.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_aCtlAngle.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_aCtlAngle.SetRotation(static_cast<const SfxInt32Item*>(pItem)->GetValue());
294  }
295  else
296  {
298  }
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  {
333  switch(eRP)
334  {
335  case RectPoint::LT:
336  {
337  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE );
338  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE );
339  break;
340  }
341  case RectPoint::MT:
342  {
343  m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE );
344  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE );
345  break;
346  }
347  case RectPoint::RT:
348  {
349  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE );
350  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE );
351  break;
352  }
353  case RectPoint::LM:
354  {
355  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE );
356  m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE );
357  break;
358  }
359  case RectPoint::MM:
360  {
361  m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE );
362  m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE );
363  break;
364  }
365  case RectPoint::RM:
366  {
367  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE );
368  m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE );
369  break;
370  }
371  case RectPoint::LB:
372  {
373  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE );
374  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
375  break;
376  }
377  case RectPoint::MB:
378  {
379  m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE );
380  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
381  break;
382  }
383  case RectPoint::RB:
384  {
385  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE );
386  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
387  break;
388  }
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  , rOutAttrs(rInAttrs)
401  , pView(nullptr)
402  , eDlgUnit(FieldUnit::NONE)
403  , m_xFlRadius(m_xBuilder->weld_widget("FL_RADIUS"))
404  , m_xMtrRadius(m_xBuilder->weld_metric_spin_button("MTR_FLD_RADIUS", FieldUnit::CM))
405  , m_xFlAngle(m_xBuilder->weld_widget("FL_SLANT"))
406  , m_xMtrAngle(m_xBuilder->weld_metric_spin_button("MTR_FLD_ANGLE", FieldUnit::DEGREE))
407 {
408  for (int i = 0; i < 2; ++i)
409  {
410  m_aControlGroups[i] = m_xBuilder->weld_widget("controlgroups" + OString::number(i+1));
411  m_aControlGroupX[i] = m_xBuilder->weld_widget("controlgroupx" + OString::number(i+1));
412  m_aControlX[i] = m_xBuilder->weld_metric_spin_button("controlx" + OString::number(i+1), FieldUnit::CM);
413  m_aControlGroupY[i] = m_xBuilder->weld_widget("controlgroupy" + OString::number(i+1));
414  m_aControlY[i] = m_xBuilder->weld_metric_spin_button("controly" + OString::number(i+1), FieldUnit::CM);
415  }
416 
417  // this page needs ExchangeSupport
419 
420  // evaluate PoolUnit
421  SfxItemPool* pPool = rOutAttrs.GetPool();
422  assert(pPool && "no pool (!)");
423  ePoolUnit = pPool->GetMetric( SID_ATTR_TRANSFORM_POS_X );
424 }
425 
427 {
428 }
429 
431 {
432  // get the range
433  DBG_ASSERT(pView, "no valid view (!)");
436  for (int i = 0; i < 2; ++i)
437  {
439  SetFieldUnit(*m_aControlY[i], eDlgUnit, true);
440  }
441 
442  { // #i75273#
444  pView->GetSdrPageView()->LogicToPagePos(aTempRect);
445  }
446 }
447 
449 {
450  bool bModified = false;
451 
452  if (m_xMtrRadius->get_value_changed_from_saved())
453  {
454  Fraction aUIScale = pView->GetModel()->GetUIScale();
455  long nTmp = long(GetCoreValue(*m_xMtrRadius, ePoolUnit) * aUIScale);
456 
457  rAttrs->Put( makeSdrEckenradiusItem( nTmp ) );
458  bModified = true;
459  }
460 
461  if (m_xMtrAngle->get_value_changed_from_saved())
462  {
463  sal_Int32 nValue = static_cast<sal_Int32>(m_xMtrAngle->get_value(FieldUnit::NONE));
464  rAttrs->Put( SfxInt32Item( SID_ATTR_TRANSFORM_SHEAR, nValue ) );
465  bModified = true;
466  }
467 
468  if( bModified )
469  {
470  // set reference points
471  ::tools::Rectangle aObjectRect(pView->GetAllMarkedRect());
472  pView->GetSdrPageView()->LogicToPagePos(aObjectRect);
473  Point aPt = aObjectRect.Center();
474 
475  rAttrs->Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_X, aPt.X()));
476  rAttrs->Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_Y, aPt.Y()));
477  rAttrs->Put( SfxBoolItem( SID_ATTR_TRANSFORM_SHEAR_VERTICAL, false ) );
478  }
479 
480  bool bControlPointsChanged = false;
481  for (int i = 0; i < 2; ++i)
482  {
483  bControlPointsChanged |= (m_aControlX[i]->get_value_changed_from_saved() ||
484  m_aControlY[i]->get_value_changed_from_saved());
485  }
486 
487  if (!bControlPointsChanged)
488  return bModified;
489 
490  bool bSelectionIsSdrObjCustomShape(false);
491 
492  while(true)
493  {
494  if(nullptr == pView)
495  {
496  break;
497  }
498 
500  {
501  break;
502  }
503 
505 
506  if(nullptr == pCandidate)
507  {
508  break;
509  }
510 
511  if(nullptr == dynamic_cast< SdrObjCustomShape* >(pCandidate))
512  {
513  break;
514  }
515 
516  bSelectionIsSdrObjCustomShape = true;
517  break;
518  }
519 
520  if(bSelectionIsSdrObjCustomShape)
521  {
522  SdrObjCustomShape& rSdrObjCustomShape(
523  static_cast< SdrObjCustomShape& >(
525  SdrModel& rModel(rSdrObjCustomShape.getSdrModelFromSdrObject());
526  std::unique_ptr<SdrUndoAction> pUndo;
527  if (rModel.IsUndoEnabled())
528  pUndo = rModel.GetSdrUndoFactory().CreateUndoAttrObject(rSdrObjCustomShape);
529 
530  if(pUndo)
531  {
532  rModel.BegUndo(pUndo->GetComment());
533  }
534 
535  EnhancedCustomShape2d aShape(rSdrObjCustomShape);
536  ::tools::Rectangle aLogicRect = aShape.GetLogicRect();
537 
538  for (int i = 0; i < 2; ++i)
539  {
540  if (m_aControlX[i]->get_value_changed_from_saved() || m_aControlY[i]->get_value_changed_from_saved())
541  {
542  Point aNewPosition(GetCoreValue(*m_aControlX[i], ePoolUnit),
544  aNewPosition.Move(aLogicRect.Left(), aLogicRect.Top());
545 
546  css::awt::Point aPosition;
547  aPosition.X = aNewPosition.X();
548  aPosition.Y = aNewPosition.Y();
549 
550  aShape.SetHandleControllerPosition(i, aPosition);
551  }
552  }
553 
554  rSdrObjCustomShape.SetChanged();
555  rSdrObjCustomShape.BroadcastObjectChange();
556  bModified = true;
557 
558  if (pUndo)
559  {
560  rModel.AddUndo(std::move(pUndo));
561  rModel.EndUndo();
562  }
563  }
564 
565  return bModified;
566 }
567 
569 {
570  // if the view has selected objects, items with SfxItemState::DEFAULT need to be disabled
571  const SfxPoolItem* pItem;
572 
573  // corner radius
574  if(!pView->IsEdgeRadiusAllowed())
575  {
576  m_xMtrRadius->set_text("");
577  m_xFlRadius->set_sensitive(false);
578  }
579  else
580  {
581  pItem = GetItem( *rAttrs, SDRATTR_ECKENRADIUS );
582 
583  if( pItem )
584  {
585  const double fUIScale(double(pView->GetModel()->GetUIScale()));
586  const double fTmp(static_cast<double>(static_cast<const SdrMetricItem*>(pItem)->GetValue()) / fUIScale);
588  }
589  else
590  {
591  m_xMtrRadius->set_text("");
592  }
593  }
594 
595  m_xMtrRadius->save_value();
596 
597  // slant: angle
598  if( !pView->IsShearAllowed() )
599  {
600  m_xMtrAngle->set_text( "" );
601  m_xFlAngle->set_sensitive(false);
602  }
603  else
604  {
605  pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_SHEAR );
606 
607  if( pItem )
608  {
609  m_xMtrAngle->set_value(static_cast<const SfxInt32Item*>(pItem)->GetValue(), FieldUnit::NONE);
610  }
611  else
612  {
613  m_xMtrAngle->set_text("");
614  }
615  }
616 
617  m_xMtrAngle->save_value();
618 
619  bool bSelectionIsSdrObjCustomShape(false);
620 
621  while(true)
622  {
624  {
625  break;
626  }
627 
629 
630  if(nullptr == pCandidate)
631  {
632  break;
633  }
634 
635  if(nullptr == dynamic_cast< SdrObjCustomShape* >(pCandidate))
636  {
637  break;
638  }
639 
640  bSelectionIsSdrObjCustomShape = true;
641  break;
642  }
643 
644  if(bSelectionIsSdrObjCustomShape)
645  {
646  SdrObjCustomShape& rSdrObjCustomShape(
647  static_cast< SdrObjCustomShape& >(
649 
650  //save geometry
651  SdrCustomShapeGeometryItem aInitialGeometry(rSdrObjCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY));
652  EnhancedCustomShape2d aShape(rSdrObjCustomShape);
653 
654  for (int i = 0; i < 2; ++i)
655  {
656  Point aInitialPosition;
657  if (!aShape.GetHandlePosition(i, aInitialPosition))
658  break;
659  m_aControlGroups[i]->set_sensitive(true);
660  css::awt::Point aPosition;
661 
662  aPosition.X = SAL_MAX_INT32/2;
663  aPosition.Y = SAL_MAX_INT32/2;
664  aShape.SetHandleControllerPosition(i, aPosition);
665  Point aMaxPosition;
666  aShape.GetHandlePosition(i, aMaxPosition);
667 
668  aPosition.X = SAL_MIN_INT32/2;
669  aPosition.Y = SAL_MIN_INT32/2;
670  aShape.SetHandleControllerPosition(i, aPosition);
671  Point aMinPosition;
672  aShape.GetHandlePosition(i, aMinPosition);
673 
674  ::tools::Rectangle aLogicRect = aShape.GetLogicRect();
675  aInitialPosition.Move(-aLogicRect.Left(), -aLogicRect.Top());
676  aMaxPosition.Move(-aLogicRect.Left(), -aLogicRect.Top());
677  aMinPosition.Move(-aLogicRect.Left(), -aLogicRect.Top());
678 
679  SetMetricValue(*m_aControlX[i], aInitialPosition.X(), ePoolUnit);
680  SetMetricValue(*m_aControlY[i], aInitialPosition.Y(), ePoolUnit);
681 
682  if (aMaxPosition.X() == aMinPosition.X())
683  m_aControlGroupX[i]->set_sensitive(false);
684  else
685  m_aControlX[i]->set_range(aMinPosition.X(), aMaxPosition.X(), FieldUnit::MM);
686  if (aMaxPosition.Y() == aMinPosition.Y())
687  m_aControlGroupY[i]->set_sensitive(false);
688  else
689  m_aControlY[i]->set_range(aMinPosition.Y(), aMaxPosition.Y(), FieldUnit::MM);
690  }
691 
692  //restore geometry
693  rSdrObjCustomShape.SetMergedItem(aInitialGeometry);
694  }
695 
696  for (int i = 0; i < 2; ++i)
697  {
698  m_aControlX[i]->save_value();
699  m_aControlY[i]->save_value();
700  }
701 }
702 
703 std::unique_ptr<SfxTabPage> SvxSlantTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rOutAttrs)
704 {
705  return std::make_unique<SvxSlantTabPage>(pPage, pController, *rOutAttrs);
706 }
707 
709 {
710  SfxBoolItem const * bPosProtect = nullptr;
711  if(SfxItemState::SET == rSet.GetItemState( GetWhich(SID_ATTR_TRANSFORM_PROTECT_POS ) , false, reinterpret_cast<SfxPoolItem const **>(&bPosProtect) ))
712  {
713  m_xFlAngle->set_sensitive(!bPosProtect->GetValue());
714  }
715  SfxBoolItem const * bSizeProtect = nullptr;
716  if(SfxItemState::SET == rSet.GetItemState( GetWhich(SID_ATTR_TRANSFORM_PROTECT_SIZE ) , false, reinterpret_cast<SfxPoolItem const **>(&bSizeProtect) ))
717  {
718  m_xFlAngle->set_sensitive(!bSizeProtect->GetValue());
719  }
720 
721 }
722 
724 {
725  if(_pSet)
726  {
727  FillItemSet(_pSet);
728  }
729 
730  return DeactivateRC::LeavePage;
731 }
732 
733 
734 /*************************************************************************
735 |*
736 |* Dialog for changing position and size of graphic objects
737 |*
738 \************************************************************************/
740  : SvxTabPage(pPage, pController, "cui/ui/possizetabpage.ui", "PositionAndSize", rInAttrs)
741  , mrOutAttrs(rInAttrs)
742  , mpView(nullptr)
743  , meDlgUnit(FieldUnit::NONE)
744  , mnProtectSizeState(TRISTATE_FALSE)
745  , mbPageDisabled(false)
746  , mbProtectDisabled(false)
747  , mbSizeDisabled(false)
748  , mbAdjustDisabled(true)
749  , mbIgnoreAutoGrowWidth(true)
750  , mbIgnoreAutoGrowHeight(true)
751  , mfOldWidth(0.0)
752  , mfOldHeight(0.0)
753  , m_aCtlPos(this)
754  , m_aCtlSize(this)
755  , m_xFlPosition(m_xBuilder->weld_widget("FL_POSITION"))
756  , m_xMtrPosX(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_X", FieldUnit::CM))
757  , m_xMtrPosY(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_Y", FieldUnit::CM))
758  , m_xCtlPos(new weld::CustomWeld(*m_xBuilder, "CTL_POSRECT", m_aCtlPos))
759  , m_xFlSize(m_xBuilder->weld_widget("FL_SIZE"))
760  , m_xFtWidth(m_xBuilder->weld_label("FT_WIDTH"))
761  , m_xMtrWidth(m_xBuilder->weld_metric_spin_button("MTR_FLD_WIDTH", FieldUnit::CM))
762  , m_xFtHeight(m_xBuilder->weld_label("FT_HEIGHT"))
763  , m_xMtrHeight(m_xBuilder->weld_metric_spin_button("MTR_FLD_HEIGHT", FieldUnit::CM))
764  , m_xCbxScale(m_xBuilder->weld_check_button("CBX_SCALE"))
765  , m_xCtlSize(new weld::CustomWeld(*m_xBuilder, "CTL_SIZERECT", m_aCtlSize))
766  , m_xFlProtect(m_xBuilder->weld_widget("FL_PROTECT"))
767  , m_xTsbPosProtect(m_xBuilder->weld_check_button("TSB_POSPROTECT"))
768  , m_xTsbSizeProtect(m_xBuilder->weld_check_button("TSB_SIZEPROTECT"))
769  , m_xFlAdjust(m_xBuilder->weld_widget("FL_ADJUST"))
770  , m_xTsbAutoGrowWidth(m_xBuilder->weld_check_button("TSB_AUTOGROW_WIDTH"))
771  , m_xTsbAutoGrowHeight(m_xBuilder->weld_check_button("TSB_AUTOGROW_HEIGHT"))
772 {
773  // this page needs ExchangeSupport
774  SetExchangeSupport();
775 
776  // evaluate PoolUnit
777  SfxItemPool* pPool = mrOutAttrs.GetPool();
778  DBG_ASSERT( pPool, "no pool (!)" );
779  mePoolUnit = pPool->GetMetric( SID_ATTR_TRANSFORM_POS_X );
780 
781  m_aCtlPos.SetActualRP(RectPoint::LT);
782  m_aCtlSize.SetActualRP(RectPoint::LT);
783  meRP = RectPoint::LT; // see above
784 
785  m_xMtrWidth->connect_value_changed( LINK( this, SvxPositionSizeTabPage, ChangeWidthHdl ) );
786  m_xMtrHeight->connect_value_changed( LINK( this, SvxPositionSizeTabPage, ChangeHeightHdl ) );
787  m_xCbxScale->connect_toggled( LINK( this, SvxPositionSizeTabPage, ClickAutoHdl ) );
788 
789  m_xFlAdjust->set_sensitive(false);
790 
791  // #i2379# disable controls when protected
792  m_xTsbPosProtect->connect_toggled( LINK( this, SvxPositionSizeTabPage, ChangePosProtectHdl ) );
793  m_xTsbSizeProtect->connect_toggled( LINK( this, SvxPositionSizeTabPage, ChangeSizeProtectHdl ) );
794 }
795 
797 {
798 }
799 
801 {
802  // get range and work area
803  DBG_ASSERT( mpView, "no valid view (!)" );
805  SetFieldUnit( *m_xMtrPosX, meDlgUnit, true );
806  SetFieldUnit( *m_xMtrPosY, meDlgUnit, true );
809 
810  if(FieldUnit::MILE == meDlgUnit || FieldUnit::KM == meDlgUnit)
811  {
812  m_xMtrPosX->set_digits( 3 );
813  m_xMtrPosY->set_digits( 3 );
814  m_xMtrWidth->set_digits( 3 );
815  m_xMtrHeight->set_digits( 3 );
816  }
817 
818  { // #i75273#
820  mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
822  }
823 
824  { // #i75273#
825  ::tools::Rectangle aTempRect(mpView->GetWorkArea());
826  mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
828  }
829 
830  // take anchor into account (Writer)
831  const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
832 
833  if(rMarkList.GetMarkCount())
834  {
835  const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
836  maAnchor = basegfx::B2DPoint(pObj->GetAnchorPos().X(), pObj->GetAnchorPos().Y());
837 
838  if(!maAnchor.equalZero()) // -> Writer
839  {
840  for(size_t i = 1; i < rMarkList.GetMarkCount(); ++i)
841  {
842  pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
843 
844  if(maAnchor != basegfx::B2DPoint(pObj->GetAnchorPos().X(), pObj->GetAnchorPos().Y()))
845  {
846  // different anchor positions
847  m_xMtrPosX->set_text("");
848  m_xMtrPosY->set_text("");
849  mbPageDisabled = true;
850  return;
851  }
852  }
853 
854  // translate ranges about anchor
856  maWorkRange = basegfx::B2DRange(maWorkRange.getMinimum() - maAnchor, maWorkRange.getMaximum() - maAnchor);
857  }
858  }
859 
860  // this should happen via SID_ATTR_TRANSFORM_AUTOSIZE
861  if(1 == rMarkList.GetMarkCount())
862  {
863  const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
864  const SdrObjKind eKind(static_cast<SdrObjKind>(pObj->GetObjIdentifier()));
865 
866  if((pObj->GetObjInventor() == SdrInventor::Default) &&
867  (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind) &&
868  pObj->HasText())
869  {
870  mbAdjustDisabled = false;
871 
872  m_xFlAdjust->set_sensitive(true);
873 
874  m_xTsbAutoGrowWidth->connect_toggled( LINK( this, SvxPositionSizeTabPage, ClickSizeProtectHdl ) );
875  m_xTsbAutoGrowHeight->connect_toggled( LINK( this, SvxPositionSizeTabPage, ClickSizeProtectHdl ) );
876 
877  // is used as flag to evaluate if its selectable
878  mbIgnoreAutoGrowWidth = false;
879  mbIgnoreAutoGrowHeight = false;
880  }
881  }
882 
883  // take scale into account
884  const Fraction aUIScale(mpView->GetModel()->GetUIScale());
886  TransfrmHelper::ScaleRect( maRange, aUIScale );
887 
888  // take UI units into account
889  const sal_uInt16 nDigits(m_xMtrPosX->get_digits());
892 
894 }
895 
896 
898 {
899  bool bModified(false);
900 
901  if ( m_xMtrWidth->has_focus() )
902  {
903  ChangeWidthHdl( *m_xMtrWidth );
904  }
905 
906  if ( m_xMtrHeight->has_focus() )
907  {
908  ChangeHeightHdl( *m_xMtrHeight );
909  }
910 
911  if( !mbPageDisabled )
912  {
913  if (m_xMtrPosX->get_value_changed_from_saved() || m_xMtrPosY->get_value_changed_from_saved())
914  {
915  const double fUIScale(double(mpView->GetModel()->GetUIScale()));
916  double fX((GetCoreValue( *m_xMtrPosX, mePoolUnit ) + maAnchor.getX()) * fUIScale);
917  double fY((GetCoreValue( *m_xMtrPosY, mePoolUnit ) + maAnchor.getY()) * fUIScale);
918 
919  { // #i75273#
921  mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
923  }
924 
925  // #101581# GetTopLeftPosition(...) needs coordinates after UI scaling, in real PagePositions
926  GetTopLeftPosition(fX, fY, maRange);
927 
928  rOutAttrs->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_POS_X), basegfx::fround(fX)));
929  rOutAttrs->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_POS_Y), basegfx::fround(fY)));
930 
931  bModified = true;
932  }
933 
934  if (m_xTsbPosProtect->get_state_changed_from_saved())
935  {
936  if( m_xTsbPosProtect->get_inconsistent() )
937  {
938  rOutAttrs->InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_POS );
939  }
940  else
941  {
942  rOutAttrs->Put(
943  SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ),
944  m_xTsbPosProtect->get_active() ) );
945  }
946 
947  bModified = true;
948  }
949  }
950 
951  if (m_xMtrWidth->get_value_changed_from_saved() || m_xMtrHeight->get_value_changed_from_saved())
952  {
953  Fraction aUIScale = mpView->GetModel()->GetUIScale();
954 
955  // get Width
956  double nWidth = static_cast<double>(m_xMtrWidth->get_value(FieldUnit::MM_100TH));
957  long lWidth = long(nWidth * static_cast<double>(aUIScale));
958  lWidth = OutputDevice::LogicToLogic( lWidth, MapUnit::Map100thMM, mePoolUnit );
959  lWidth = static_cast<long>(m_xMtrWidth->denormalize( lWidth ));
960 
961  // get Height
962  double nHeight = static_cast<double>(m_xMtrHeight->get_value(FieldUnit::MM_100TH));
963  long lHeight = long(nHeight * static_cast<double>(aUIScale));
964  lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit );
965  lHeight = static_cast<long>(m_xMtrHeight->denormalize( lHeight ));
966 
967  // put Width & Height to itemset
968  rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ), static_cast<sal_uInt32>(lWidth) ) );
969  rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), static_cast<sal_uInt32>(lHeight) ) );
970  rOutAttrs->Put( SfxUInt16Item( GetWhich( SID_ATTR_TRANSFORM_SIZE_POINT ), sal::static_int_cast< sal_uInt16 >( meRP ) ) );
971  bModified = true;
972  }
973 
974  if (m_xTsbSizeProtect->get_state_changed_from_saved())
975  {
976  if ( m_xTsbSizeProtect->get_inconsistent() )
977  rOutAttrs->InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_SIZE );
978  else
979  rOutAttrs->Put(
980  SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ),
981  m_xTsbSizeProtect->get_active() ) );
982  bModified = true;
983  }
984 
985  if (m_xTsbAutoGrowWidth->get_state_changed_from_saved())
986  {
988  {
989  if( m_xTsbAutoGrowWidth->get_inconsistent() )
990  rOutAttrs->InvalidateItem( SID_ATTR_TRANSFORM_AUTOWIDTH );
991  else
992  rOutAttrs->Put(
993  SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOWIDTH ),
994  m_xTsbAutoGrowWidth->get_active() ) );
995  }
996  bModified = true;
997  }
998 
999  if (m_xTsbAutoGrowHeight->get_state_changed_from_saved())
1000  {
1002  {
1003  if (m_xTsbAutoGrowHeight->get_inconsistent())
1004  {
1005  rOutAttrs->InvalidateItem( SID_ATTR_TRANSFORM_AUTOHEIGHT );
1006  }
1007  else
1008  {
1009  rOutAttrs->Put(
1010  SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOHEIGHT ),
1011  m_xTsbAutoGrowHeight->get_active() ) );
1012  }
1013  }
1014  bModified = true;
1015  }
1016 
1017  return bModified;
1018 }
1019 
1021 {
1022  const SfxPoolItem* pItem;
1023  const double fUIScale(double(mpView->GetModel()->GetUIScale()));
1024 
1025  if ( !mbPageDisabled )
1026  {
1027  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_POS_X );
1028  if ( pItem )
1029  {
1030  const double fTmp((static_cast<const SfxInt32Item*>(pItem)->GetValue() - maAnchor.getX()) / fUIScale);
1032  }
1033 
1034  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_POS_Y );
1035  if ( pItem )
1036  {
1037  const double fTmp((static_cast<const SfxInt32Item*>(pItem)->GetValue() - maAnchor.getY()) / fUIScale);
1039  }
1040 
1041  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_PROTECT_POS );
1042  if ( pItem )
1043  {
1044  bool bProtected = static_cast<const SfxBoolItem*>( pItem )->GetValue();
1045  m_xTsbPosProtect->set_active(bProtected);
1046  }
1047  else
1048  {
1049  m_xTsbPosProtect->set_inconsistent(true);
1050  }
1051 
1052  m_xTsbPosProtect->save_state();
1053  m_aCtlPos.Reset();
1054 
1055  // #i2379# Disable controls for protected objects
1056  ChangePosProtectHdl(*m_xTsbPosProtect);
1057  }
1058 
1059  { // #i75273# set width
1060  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_WIDTH );
1061  mfOldWidth = std::max( pItem ? static_cast<double>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0.0, 1.0 );
1062  double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), mePoolUnit, MapUnit::Map100thMM)) / fUIScale);
1063  if (m_xMtrWidth->get_digits())
1064  fTmpWidth *= pow(10.0, m_xMtrWidth->get_digits());
1065  m_xMtrWidth->set_value(static_cast<int>(fTmpWidth), FieldUnit::MM_100TH);
1066  }
1067 
1068  { // #i75273# set height
1069  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_HEIGHT );
1070  mfOldHeight = std::max( pItem ? static_cast<double>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0.0, 1.0 );
1071  double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), mePoolUnit, MapUnit::Map100thMM)) / fUIScale);
1072  if (m_xMtrHeight->get_digits())
1073  fTmpHeight *= pow(10.0, m_xMtrHeight->get_digits());
1074  m_xMtrHeight->set_value(static_cast<int>(fTmpHeight), FieldUnit::MM_100TH);
1075  }
1076 
1077  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_PROTECT_SIZE );
1078  if ( pItem )
1079  {
1080  m_xTsbSizeProtect->set_active(static_cast<const SfxBoolItem*>(pItem)->GetValue());
1081  }
1082  else
1083  m_xTsbSizeProtect->set_inconsistent(true);
1084 
1085  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_AUTOWIDTH );
1086  if ( pItem )
1087  {
1088  m_xTsbAutoGrowWidth->set_active(static_cast<const SfxBoolItem*>( pItem )->GetValue());
1089  }
1090  else
1091  m_xTsbAutoGrowWidth->set_inconsistent(true);
1092 
1093  pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_AUTOHEIGHT );
1094  if ( pItem )
1095  {
1096  m_xTsbAutoGrowHeight->set_active(static_cast<const SfxBoolItem*>( pItem )->GetValue());
1097  }
1098  else
1099  m_xTsbAutoGrowHeight->set_inconsistent(true);
1100 
1101  // Is matching set?
1102  OUString aStr = GetUserData();
1103  m_xCbxScale->set_active(aStr.toInt32() != 0);
1104 
1105  m_xMtrPosX->save_value();
1106  m_xMtrPosY->save_value();
1107  m_xMtrWidth->save_value();
1108  m_xMtrHeight->save_value();
1109 
1110  m_xTsbSizeProtect->save_state();
1111  m_xTsbAutoGrowWidth->save_state();
1112  m_xTsbAutoGrowHeight->save_state();
1113  ClickSizeProtectHdl(*m_xTsbAutoGrowHeight);
1114 
1115  // #i2379# Disable controls for protected objects
1116  ChangeSizeProtectHdl(*m_xTsbSizeProtect);
1117 }
1118 
1119 std::unique_ptr<SfxTabPage> SvxPositionSizeTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rOutAttrs)
1120 {
1121  return std::make_unique<SvxPositionSizeTabPage>(pPage, pController, *rOutAttrs);
1122 }
1123 
1125 {
1126  SfxRectangleItem const * pRectItem = nullptr;
1127 
1128  if( SfxItemState::SET == rSet.GetItemState( GetWhich( SID_ATTR_TRANSFORM_INTERN ) , false, reinterpret_cast<SfxPoolItem const **>(&pRectItem) ) )
1129  {
1130  { // #i75273#
1131  const ::tools::Rectangle aTempRect(pRectItem->GetValue());
1133  }
1134 
1136  }
1137 }
1138 
1139 
1141 {
1142  if( _pSet )
1143  {
1144  double fX(static_cast<double>(m_xMtrPosX->get_value(FieldUnit::NONE)));
1145  double fY(static_cast<double>(m_xMtrPosY->get_value(FieldUnit::NONE)));
1146 
1147  GetTopLeftPosition(fX, fY, maRange);
1148  const ::tools::Rectangle aOutRectangle(
1151  _pSet->Put(SfxRectangleItem(SID_ATTR_TRANSFORM_INTERN, aOutRectangle));
1152  _pSet->Put(SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ),
1153  m_xTsbPosProtect->get_state() == TRISTATE_TRUE ));
1154  _pSet->Put(SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ),
1155  m_xTsbSizeProtect->get_state() == TRISTATE_TRUE ));
1156  FillItemSet(_pSet);
1157  }
1158 
1159  return DeactivateRC::LeavePage;
1160 }
1161 
1162 
1164 {
1165  // #106572# Remember user's last choice
1166  m_xTsbSizeProtect->set_state(m_xTsbPosProtect->get_state() == TRISTATE_TRUE ? TRISTATE_TRUE : mnProtectSizeState);
1167  UpdateControlStates();
1168 }
1169 
1170 
1172 {
1173  const bool bPosProtect = m_xTsbPosProtect->get_state() == TRISTATE_TRUE;
1174  const bool bSizeProtect = m_xTsbSizeProtect->get_state() == TRISTATE_TRUE;
1175  const bool bHeightChecked = !mbIgnoreAutoGrowHeight && (m_xTsbAutoGrowHeight->get_active());
1176  const bool bWidthChecked = !mbIgnoreAutoGrowWidth && (m_xTsbAutoGrowWidth->get_active());
1177 
1178  m_xFlPosition->set_sensitive(!bPosProtect && !mbPageDisabled);
1179 
1180  m_xTsbPosProtect->set_sensitive( !mbProtectDisabled && !mbPageDisabled );
1181 
1182  m_xFlSize->set_sensitive( !mbSizeDisabled && !bSizeProtect );
1183 
1184  m_xFtWidth->set_sensitive( !mbSizeDisabled && !bSizeProtect && !bWidthChecked );
1185  m_xMtrWidth->set_sensitive( !mbSizeDisabled && !bSizeProtect && !bWidthChecked );
1186 
1187  m_xFtHeight->set_sensitive( !mbSizeDisabled && !bSizeProtect && !bHeightChecked );
1188  m_xMtrHeight->set_sensitive( !mbSizeDisabled && !bSizeProtect && !bHeightChecked );
1189 
1190  m_xCbxScale->set_sensitive( !mbSizeDisabled && !bSizeProtect && !bHeightChecked && !bWidthChecked );
1191  m_xCtlSize->set_sensitive( !mbSizeDisabled && !bSizeProtect && (!bHeightChecked || !bWidthChecked) );
1192 
1193  m_xFlProtect->set_sensitive( !mbProtectDisabled );
1194  m_xTsbSizeProtect->set_sensitive( !mbProtectDisabled && !bPosProtect );
1195 
1196  m_xFlAdjust->set_sensitive( !mbSizeDisabled && !bSizeProtect && !mbAdjustDisabled );
1197 
1198  m_aCtlSize.Invalidate();
1199  m_aCtlPos.Invalidate();
1200 }
1201 
1203 {
1204  if (m_xTsbSizeProtect->get_sensitive())
1205  {
1206  // #106572# Remember user's last choice
1207 
1208  // Note: this works only as long as the dialog is open. When
1209  // the user closes the dialog, there is no way to remember
1210  // whether size was enabled or disabled before pos protect was
1211  // clicked. Thus, if pos protect is selected, the dialog is
1212  // closed and reopened again, unchecking pos protect will
1213  // always uncheck size protect, too. That's life.
1214  mnProtectSizeState = m_xTsbSizeProtect->get_state();
1215  }
1216 
1217  UpdateControlStates();
1218 }
1219 
1221 {
1222  // position
1223  double fLeft(maWorkRange.getMinX());
1224  double fTop(maWorkRange.getMinY());
1225  double fRight(maWorkRange.getMaxX());
1226  double fBottom(maWorkRange.getMaxY());
1227 
1228  switch (m_aCtlPos.GetActualRP())
1229  {
1230  case RectPoint::LT:
1231  {
1232  fRight -= maRange.getWidth();
1233  fBottom -= maRange.getHeight();
1234  break;
1235  }
1236  case RectPoint::MT:
1237  {
1238  fLeft += maRange.getWidth() / 2.0;
1239  fRight -= maRange.getWidth() / 2.0;
1240  fBottom -= maRange.getHeight();
1241  break;
1242  }
1243  case RectPoint::RT:
1244  {
1245  fLeft += maRange.getWidth();
1246  fBottom -= maRange.getHeight();
1247  break;
1248  }
1249  case RectPoint::LM:
1250  {
1251  fRight -= maRange.getWidth();
1252  fTop += maRange.getHeight() / 2.0;
1253  fBottom -= maRange.getHeight() / 2.0;
1254  break;
1255  }
1256  case RectPoint::MM:
1257  {
1258  fLeft += maRange.getWidth() / 2.0;
1259  fRight -= maRange.getWidth() / 2.0;
1260  fTop += maRange.getHeight() / 2.0;
1261  fBottom -= maRange.getHeight() / 2.0;
1262  break;
1263  }
1264  case RectPoint::RM:
1265  {
1266  fLeft += maRange.getWidth();
1267  fTop += maRange.getHeight() / 2.0;
1268  fBottom -= maRange.getHeight() / 2.0;
1269  break;
1270  }
1271  case RectPoint::LB:
1272  {
1273  fRight -= maRange.getWidth();
1274  fTop += maRange.getHeight();
1275  break;
1276  }
1277  case RectPoint::MB:
1278  {
1279  fLeft += maRange.getWidth() / 2.0;
1280  fRight -= maRange.getWidth() / 2.0;
1281  fTop += maRange.getHeight();
1282  break;
1283  }
1284  case RectPoint::RB:
1285  {
1286  fLeft += maRange.getWidth();
1287  fTop += maRange.getHeight();
1288  break;
1289  }
1290  }
1291 
1292  const double fMaxLong(static_cast<double>(MetricField::ConvertValue( LONG_MAX, 0, MapUnit::Map100thMM, meDlgUnit ) - 1));
1293  fLeft = std::clamp(fLeft, -fMaxLong, fMaxLong);
1294  fRight = std::clamp(fRight, -fMaxLong, fMaxLong);
1295  fTop = std::clamp(fTop, - fMaxLong, fMaxLong);
1296  fBottom = std::clamp(fBottom, -fMaxLong, fMaxLong);
1297 
1298  // #i75273# normalizing when setting the min/max values was wrong, removed
1299  m_xMtrPosX->set_range(basegfx::fround64(fLeft), basegfx::fround64(fRight), FieldUnit::NONE);
1300  m_xMtrPosY->set_range(basegfx::fround64(fTop), basegfx::fround64(fBottom), FieldUnit::NONE);
1301 
1302  // size
1303  fLeft = maWorkRange.getMinX();
1304  fTop = maWorkRange.getMinY();
1305  fRight = maWorkRange.getMaxX();
1306  fBottom = maWorkRange.getMaxY();
1307  double fNewX(0);
1308  double fNewY(0);
1309 
1310  switch (m_aCtlSize.GetActualRP())
1311  {
1312  case RectPoint::LT:
1313  {
1314  fNewX = maWorkRange.getWidth() - ( maRange.getMinX() - fLeft );
1315  fNewY = maWorkRange.getHeight() - ( maRange.getMinY() - fTop );
1316  break;
1317  }
1318  case RectPoint::MT:
1319  {
1320  fNewX = std::min( maRange.getCenter().getX() - fLeft, fRight - maRange.getCenter().getX() ) * 2.0;
1321  fNewY = maWorkRange.getHeight() - ( maRange.getMinY() - fTop );
1322  break;
1323  }
1324  case RectPoint::RT:
1325  {
1326  fNewX = maWorkRange.getWidth() - ( fRight - maRange.getMaxX() );
1327  fNewY = maWorkRange.getHeight() - ( maRange.getMinY() - fTop );
1328  break;
1329  }
1330  case RectPoint::LM:
1331  {
1332  fNewX = maWorkRange.getWidth() - ( maRange.getMinX() - fLeft );
1333  fNewY = std::min( maRange.getCenter().getY() - fTop, fBottom - maRange.getCenter().getY() ) * 2.0;
1334  break;
1335  }
1336  case RectPoint::MM:
1337  {
1338  const double f1(maRange.getCenter().getX() - fLeft);
1339  const double f2(fRight - maRange.getCenter().getX());
1340  const double f3(std::min(f1, f2));
1341  const double f4(maRange.getCenter().getY() - fTop);
1342  const double f5(fBottom - maRange.getCenter().getY());
1343  const double f6(std::min(f4, f5));
1344 
1345  fNewX = f3 * 2.0;
1346  fNewY = f6 * 3.0;
1347 
1348  break;
1349  }
1350  case RectPoint::RM:
1351  {
1352  fNewX = maWorkRange.getWidth() - ( fRight - maRange.getMaxX() );
1353  fNewY = std::min( maRange.getCenter().getY() - fTop, fBottom - maRange.getCenter().getY() ) * 2.0;
1354  break;
1355  }
1356  case RectPoint::LB:
1357  {
1358  fNewX = maWorkRange.getWidth() - ( maRange.getMinX() - fLeft );
1359  fNewY = maWorkRange.getHeight() - ( fBottom - maRange.getMaxY() );
1360  break;
1361  }
1362  case RectPoint::MB:
1363  {
1364  fNewX = std::min( maRange.getCenter().getX() - fLeft, fRight - maRange.getCenter().getX() ) * 2.0;
1365  fNewY = maWorkRange.getHeight() - ( maRange.getMaxY() - fBottom );
1366  break;
1367  }
1368  case RectPoint::RB:
1369  {
1370  fNewX = maWorkRange.getWidth() - ( fRight - maRange.getMaxX() );
1371  fNewY = maWorkRange.getHeight() - ( fBottom - maRange.getMaxY() );
1372  break;
1373  }
1374  }
1375 
1376  // #i75273# normalizing when setting the min/max values was wrong, removed
1377  m_xMtrWidth->set_max(basegfx::fround64(fNewX), FieldUnit::NONE);
1378  m_xMtrHeight->set_max(basegfx::fround64(fNewY), FieldUnit::NONE);
1379 }
1380 
1381 void SvxPositionSizeTabPage::GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange)
1382 {
1383  switch (m_aCtlPos.GetActualRP())
1384  {
1385  case RectPoint::LT:
1386  {
1387  break;
1388  }
1389  case RectPoint::MT:
1390  {
1391  rfX -= rRange.getCenter().getX() - rRange.getMinX();
1392  break;
1393  }
1394  case RectPoint::RT:
1395  {
1396  rfX -= rRange.getWidth();
1397  break;
1398  }
1399  case RectPoint::LM:
1400  {
1401  rfY -= rRange.getCenter().getY() - rRange.getMinY();
1402  break;
1403  }
1404  case RectPoint::MM:
1405  {
1406  rfX -= rRange.getCenter().getX() - rRange.getMinX();
1407  rfY -= rRange.getCenter().getY() - rRange.getMinY();
1408  break;
1409  }
1410  case RectPoint::RM:
1411  {
1412  rfX -= rRange.getWidth();
1413  rfY -= rRange.getCenter().getY() - rRange.getMinY();
1414  break;
1415  }
1416  case RectPoint::LB:
1417  {
1418  rfY -= rRange.getHeight();
1419  break;
1420  }
1421  case RectPoint::MB:
1422  {
1423  rfX -= rRange.getCenter().getX() - rRange.getMinX();
1424  rfY -= rRange.getHeight();
1425  break;
1426  }
1427  case RectPoint::RB:
1428  {
1429  rfX -= rRange.getWidth();
1430  rfY -= rRange.getHeight();
1431  break;
1432  }
1433  }
1434 }
1435 
1437 {
1438  if (pDrawingArea == m_aCtlPos.GetDrawingArea())
1439  {
1441  switch( eRP )
1442  {
1443  case RectPoint::LT:
1444  {
1445  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE );
1446  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE );
1447  break;
1448  }
1449  case RectPoint::MT:
1450  {
1451  m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE );
1452  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE );
1453  break;
1454  }
1455  case RectPoint::RT:
1456  {
1457  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE );
1458  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE );
1459  break;
1460  }
1461  case RectPoint::LM:
1462  {
1463  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE );
1464  m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE );
1465  break;
1466  }
1467  case RectPoint::MM:
1468  {
1469  m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE );
1470  m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE );
1471  break;
1472  }
1473  case RectPoint::RM:
1474  {
1475  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE );
1476  m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE );
1477  break;
1478  }
1479  case RectPoint::LB:
1480  {
1481  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE );
1482  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
1483  break;
1484  }
1485  case RectPoint::MB:
1486  {
1487  m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE );
1488  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
1489  break;
1490  }
1491  case RectPoint::RB:
1492  {
1493  m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE );
1494  m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
1495  break;
1496  }
1497  }
1498  }
1499  else
1500  {
1501  meRP = eRP;
1503  }
1504 }
1505 
1507 {
1508  mbSizeDisabled = true;
1509 }
1510 
1511 
1513 {
1514  mbProtectDisabled = true;
1515 }
1516 
1517 
1519 {
1520  if( m_xCbxScale->get_active() && m_xCbxScale->get_sensitive() )
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 }
1540 
1542 {
1543  if( m_xCbxScale->get_active() && m_xCbxScale->get_sensitive() )
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 }
1563 
1565 {
1566  UpdateControlStates();
1567 }
1568 
1570 {
1571  if (m_xCbxScale->get_active())
1572  {
1573  mfOldWidth = std::max( static_cast<double>(GetCoreValue( *m_xMtrWidth, mePoolUnit )), 1.0 );
1574  mfOldHeight = std::max( static_cast<double>(GetCoreValue( *m_xMtrHeight, mePoolUnit )), 1.0 );
1575  }
1576 }
1577 
1579 {
1580  // matching is saved in the Ini-file
1581  OUString aStr = m_xCbxScale->get_active() ? OUString("1") : OUString("0");
1582  SetUserData( aStr );
1583 }
1584 
1585 /* 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:164
std::unique_ptr< weld::Widget > m_aControlGroups[2]
Definition: transfrm.hxx:228
std::unique_ptr< weld::CheckButton > m_xTsbSizeProtect
Definition: transfrm.hxx:113
bool IsEdgeRadiusAllowed() const
double getHeight() const
basegfx::B2DRange maRange
Definition: transfrm.hxx:72
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:231
void Reset()
OBJ_TEXT
const SfxPoolItem * GetItem(const SwTextAttr &rAttr, sal_uInt16 nWhich)
virtual ~SvxSlantTabPage() override
Definition: transfrm.cxx:426
void SetLinkedField(weld::SpinButton *pField, sal_Int32 nDecimalPlaces=0)
Link< SvxSwFrameValidation &, void > aValidateLink
Definition: transfrm.hxx:43
double getX() const
void SetValidateFramePosLink(const Link< SvxSwFrameValidation &, void > &rLink)
virtual bool HasText() const
void RemoveTabPage(const OString &rName)
void InvalidateItem(sal_uInt16 nWhich)
double getY() const
RectPoint GetActualRP() const
SdrMark * GetMark(size_t nNum) const
void Construct()
Definition: transfrm.cxx:195
basegfx::B2DPoint maAnchor
Definition: transfrm.hxx:74
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:739
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosY
Definition: transfrm.hxx:98
std::unique_ptr< weld::CheckButton > m_xTsbAutoGrowWidth
Definition: transfrm.hxx:117
TRISTATE_TRUE
std::unique_ptr< weld::Widget > m_aControlGroupX[2]
Definition: transfrm.hxx:229
double getMaxX() const
static const SfxPoolItem * GetItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
std::unique_ptr< weld::SpinButton > m_xNfAngle
Definition: transfrm.hxx:185
std::unique_ptr< weld::Widget > m_xFlSize
Definition: transfrm.hxx:102
FieldUnit GetModuleFieldUnit(const SfxItemSet &rSet)
static const sal_uInt16 * GetRanges()
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:147
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: transfrm.cxx:703
void LogicToPagePos(Point &rPnt) const
double getWidth() const
#define SDRATTR_CUSTOMSHAPE_GEOMETRY
std::unique_ptr< weld::Widget > m_xFlAngle
Definition: transfrm.hxx:184
std::unique_ptr< weld::MetricSpinButton > m_xMtrRadius
Definition: transfrm.hxx:225
std::unique_ptr< weld::Widget > m_xFlPosition
Definition: transfrm.hxx:96
void SetExchangeSupport()
bool IsValueModified() const
SvxRectCtl m_aCtlSize
Definition: transfrm.hxx:93
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:708
std::unique_ptr< weld::Label > m_xFtHeight
Definition: transfrm.hxx:105
long Top() const
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosY
Definition: transfrm.hxx:182
bool IsRotateAllowed(bool b90Deg=false) const
basegfx::B2DRange maRange
Definition: transfrm.hxx:171
SvxRectCtl m_aCtlPos
Definition: transfrm.hxx:92
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:221
void Construct()
Definition: transfrm.cxx:430
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:103
SdrObject * GetMarkedSdrObj() const
std::unique_ptr< weld::MetricSpinButton > m_xMtrAngle
Definition: transfrm.hxx:227
const SdrView * pView
Definition: transfrm.hxx:219
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:136
RectPoint
NONE
std::unique_ptr< weld::Widget > m_xFlRadius
Definition: transfrm.hxx:224
bool IsShearAllowed() const
void SetRotation(sal_Int32 nAngle)
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
Definition: transfrm.cxx:1436
#define SAL_MAX_INT32
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:897
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define DBG_ASSERT(sCon, aError)
const SfxItemSet & rOutAttrs
Definition: transfrm.hxx:167
SdrMetricItem makeSdrEckenradiusItem(long nRadius)
virtual void FillUserData() override
Definition: transfrm.cxx:1578
virtual sal_uInt16 GetObjIdentifier() const
static void ScaleRect(basegfx::B2DRange &rRange, const Fraction &rUIScale)
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:239
SvxRectCtl m_aCtlRect
Definition: transfrm.hxx:178
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:204
IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangePosProtectHdl, weld::ToggleButton &, void)
Definition: transfrm.cxx:1163
int i
void BroadcastObjectChange() const
TRISTATE_FALSE
const SdrMarkList & GetMarkedObjectList() const
std::unique_ptr< weld::Widget > m_xFlProtect
Definition: transfrm.hxx:111
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:1020
SdrModel & getSdrModelFromSdrObject() const
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosX
Definition: transfrm.hxx:97
const SdrView * pView
Definition: transfrm.hxx:40
void GetTopLeftPosition(double &rfX, double &rfY, const basegfx::B2DRange &rRange)
Definition: transfrm.cxx:1381
void SetMergedItem(const SfxPoolItem &rItem)
virtual void Reset(const SfxItemSet *) override
Definition: transfrm.cxx:568
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:723
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:448
std::unique_ptr< weld::MetricSpinButton > m_aControlY[2]
Definition: transfrm.hxx:232
static const sal_uInt16 pPosSizeRanges[]
Definition: transfrm.hxx:64
void SetMetricValue(weld::MetricSpinButton &rField, int nCoreValue, MapUnit eUnit)
std::unique_ptr< weld::Widget > m_xFlPosition
Definition: transfrm.hxx:180
SfxItemPool * GetPool() const
std::unique_ptr< weld::Widget > m_xFlAngle
Definition: transfrm.hxx:226
long X() const
const tools::Rectangle & GetAllMarkedRect() const
SdrUndoFactory & GetSdrUndoFactory() const
const long LONG_MAX
std::unique_ptr< weld::Widget > m_xFlAdjust
Definition: transfrm.hxx:116
const SdrView * mpView
Definition: transfrm.hxx:69
virtual SdrInventor GetObjInventor() const
std::unique_ptr< weld::MetricSpinButton > m_xMtrWidth
Definition: transfrm.hxx:104
basegfx::B2DRange maWorkRange
Definition: transfrm.hxx:73
FieldUnit eDlgUnit
Definition: transfrm.hxx:175
virtual ~SvxPositionSizeTabPage() override
Definition: transfrm.cxx:796
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
std::unique_ptr< weld::CheckButton > m_xTsbPosProtect
Definition: transfrm.hxx:112
void SetView(const SdrView *pSdrView)
Definition: transfrm.hxx:248
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:230
const SfxItemSet & rOutAttrs
Definition: transfrm.hxx:217
double getMinY() const
std::unique_ptr< weld::MetricSpinButton > m_xMtrPosX
Definition: transfrm.hxx:181
SdrObjKind
std::unique_ptr< weld::MetricSpinButton > m_xMtrHeight
Definition: transfrm.hxx:106
static void ConvertRect(basegfx::B2DRange &rRange, const sal_uInt16 nDigits, const MapUnit ePoolUnit, const FieldUnit eDlgUnit)
bool equalZero() const
const SdrView * pView
Definition: transfrm.hxx:168
#define GetWhich(nSlot)
static sal_Int64 ConvertValue(sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits, FieldUnit eInUnit, FieldUnit eOutUnit)
SvxAnchorIds
std::unique_ptr< weld::CustomWeld > m_xCtlSize
Definition: transfrm.hxx:108
void AddTabPage(const OString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
const tools::Rectangle & GetValue() const
B2DPoint getMinimum() const
FieldUnit eDlgUnit
Definition: transfrm.hxx:222
basegfx::B2DPoint maAnchor
Definition: transfrm.hxx:172
UnoViewSharedPtr mpView
SvxSlantTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
Definition: transfrm.cxx:398
long Left() const
sal_Int32 GetRotation() const
const Point & GetAnchorPos() const
SvxAnchorIds nAnchorCtrls
Definition: transfrm.hxx:42
SdrPageView * GetSdrPageView() const
DeactivateRC
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
void Move(long nHorzMove, long nVertMove)
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:118
std::unique_ptr< weld::CheckButton > m_xCbxScale
Definition: transfrm.hxx:107
const SfxItemSet & mrOutAttrs
Definition: transfrm.hxx:67
virtual std::unique_ptr< SdrUndoAction > CreateUndoAttrObject(SdrObject &rObject, bool bStyleSheet1=false, bool bSaveText=false)
virtual void SetChanged()
sal_Int64 fround64(double fVal)
virtual bool FillItemSet(SfxItemSet *) override
Definition: transfrm.cxx:243
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: transfrm.cxx:1119
SdrModel * GetModel() const
aStr
const tools::Rectangle & GetWorkArea() const
OBJ_TITLETEXT
MapUnit ePoolUnit
Definition: transfrm.hxx:174
svx::SvxDialControl m_aCtlAngle
Definition: transfrm.hxx:177
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: transfrm.cxx:1124
virtual void PageCreated(const OString &rId, SfxTabPage &rPage) override
Definition: transfrm.cxx:115
long Y() const
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:1140
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
const tools::Rectangle & GetLogicRect() const
static const sal_uInt16 pSlantRanges[]
Definition: transfrm.hxx:214
void SetView(const SdrView *pSdrView)
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: transfrm.cxx:319
#define SDRATTR_ECKENRADIUS
static const sal_uInt16 * GetRanges()
Definition: transfrm.hxx:193