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