LibreOffice Module svx (master)  1
PosSizePropertyPanel.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <sal/config.h>
21 
22 #include <algorithm>
23 
24 #include "PosSizePropertyPanel.hxx"
25 #include <sal/log.hxx>
26 #include <svx/svxids.hrc>
27 #include <sfx2/dispatch.hxx>
28 #include <sfx2/bindings.hxx>
29 #include <sfx2/module.hxx>
30 #include <sfx2/viewsh.hxx>
31 #include <sfx2/objsh.hxx>
32 #include <sfx2/viewfrm.hxx>
33 #include <sfx2/weldutils.hxx>
34 #include <svx/dialcontrol.hxx>
35 #include <svx/rectenum.hxx>
36 #include <unotools/viewoptions.hxx>
38 #include <vcl/canvastools.hxx>
39 #include <vcl/fieldvalues.hxx>
40 #include <svl/intitem.hxx>
41 #include <svx/svdpagv.hxx>
42 #include <svx/svdview.hxx>
43 #include <svx/transfrmhelper.hxx>
44 #include <boost/property_tree/json_parser.hpp>
45 
46 #include <svtools/unitconv.hxx>
47 
48 using namespace css;
49 using namespace css::uno;
50 
51 const char USERITEM_NAME[] = "FitItem";
52 
53 namespace svx::sidebar {
54 
55 PosSizePropertyPanel::PosSizePropertyPanel(
56  vcl::Window* pParent,
57  const css::uno::Reference<css::frame::XFrame>& rxFrame,
58  SfxBindings* pBindings,
59  const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
60 : PanelLayout(pParent, "PosSizePropertyPanel", "svx/ui/sidebarpossize.ui", rxFrame),
61  mxFtPosX(m_xBuilder->weld_label("horizontallabel")),
62  mxMtrPosX(m_xBuilder->weld_metric_spin_button("horizontalpos", FieldUnit::CM)),
63  mxFtPosY(m_xBuilder->weld_label("verticallabel")),
64  mxMtrPosY(m_xBuilder->weld_metric_spin_button("verticalpos", FieldUnit::CM)),
65  mxFtWidth(m_xBuilder->weld_label("widthlabel")),
66  mxMtrWidth(m_xBuilder->weld_metric_spin_button("selectwidth", FieldUnit::CM)),
67  mxFtHeight(m_xBuilder->weld_label("heightlabel")),
68  mxMtrHeight(m_xBuilder->weld_metric_spin_button("selectheight", FieldUnit::CM)),
69  mxCbxScale(m_xBuilder->weld_check_button("ratio")),
70  mxFtAngle(m_xBuilder->weld_label("rotationlabel")),
71  mxMtrAngle(m_xBuilder->weld_metric_spin_button("rotation", FieldUnit::DEGREE)),
72  mxCtrlDial(new DialControl),
73  mxDial(new weld::CustomWeld(*m_xBuilder, "orientationcontrol", *mxCtrlDial)),
74  mxFtFlip(m_xBuilder->weld_label("fliplabel")),
75  mxFlipTbx(m_xBuilder->weld_toolbar("selectrotationtype")),
76  mxFlipDispatch(new ToolbarUnoDispatcher(*mxFlipTbx, *m_xBuilder, rxFrame)),
77  mxArrangeTbx(m_xBuilder->weld_toolbar("arrangetoolbar")),
78  mxArrangeDispatch(new ToolbarUnoDispatcher(*mxArrangeTbx, *m_xBuilder, rxFrame)),
79  mxArrangeTbx2(m_xBuilder->weld_toolbar("arrangetoolbar2")),
80  mxArrangeDispatch2(new ToolbarUnoDispatcher(*mxArrangeTbx2, *m_xBuilder, rxFrame)),
81  mxAlignTbx(m_xBuilder->weld_toolbar("aligntoolbar")),
82  mxAlignDispatch(new ToolbarUnoDispatcher(*mxAlignTbx, *m_xBuilder, rxFrame)),
83  mxAlignTbx2(m_xBuilder->weld_toolbar("aligntoolbar2")),
84  mxAlignDispatch2(new ToolbarUnoDispatcher(*mxAlignTbx2, *m_xBuilder, rxFrame)),
85  mxBtnEditChart(m_xBuilder->weld_button("btnEditChart")),
86  maRect(),
87  mpView(nullptr),
88  mlOldWidth(1),
89  mlOldHeight(1),
90  mlRotX(0),
91  mlRotY(0),
92  maUIScale(),
93  mePoolUnit(),
94  meDlgUnit(FieldUnit::INCH), // #i124409# init with fallback default
95  maTransfPosXControl(SID_ATTR_TRANSFORM_POS_X, *pBindings, *this),
96  maTransfPosYControl(SID_ATTR_TRANSFORM_POS_Y, *pBindings, *this),
97  maTransfWidthControl(SID_ATTR_TRANSFORM_WIDTH, *pBindings, *this),
98  maTransfHeightControl(SID_ATTR_TRANSFORM_HEIGHT, *pBindings, *this),
99  maSvxAngleControl( SID_ATTR_TRANSFORM_ANGLE, *pBindings, *this),
100  maRotXControl(SID_ATTR_TRANSFORM_ROT_X, *pBindings, *this),
101  maRotYControl(SID_ATTR_TRANSFORM_ROT_Y, *pBindings, *this),
102  maProPosControl(SID_ATTR_TRANSFORM_PROTECT_POS, *pBindings, *this),
103  maProSizeControl(SID_ATTR_TRANSFORM_PROTECT_SIZE, *pBindings, *this),
104  maAutoWidthControl(SID_ATTR_TRANSFORM_AUTOWIDTH, *pBindings, *this),
105  maAutoHeightControl(SID_ATTR_TRANSFORM_AUTOHEIGHT, *pBindings, *this),
106  m_aMetricCtl(SID_ATTR_METRIC, *pBindings, *this),
107  maContext(),
108  mpBindings(pBindings),
109  mbSizeProtected(false),
110  mbPositionProtected(false),
111  mbAutoWidth(false),
112  mbAutoHeight(false),
113  mbAdjustEnabled(false),
114  mxSidebar(rxSidebar)
115 {
116  Initialize();
117 
118  mpBindings->Update( SID_ATTR_METRIC );
119  mpBindings->Update( SID_ATTR_TRANSFORM_WIDTH );
120  mpBindings->Update( SID_ATTR_TRANSFORM_HEIGHT );
121  mpBindings->Update( SID_ATTR_TRANSFORM_PROTECT_SIZE );
122 }
123 
125 {
126  disposeOnce();
127 }
128 
130 {
131  mxFtPosX.reset();
132  mxMtrPosX.reset();
133  mxFtPosY.reset();
134  mxMtrPosY.reset();
135  mxFtWidth.reset();
136  mxMtrWidth.reset();
137  mxFtHeight.reset();
138  mxMtrHeight.reset();
139  mxCbxScale.reset();
140  mxFtAngle.reset();
141  mxMtrAngle.reset();
142  mxDial.reset();
143  mxCtrlDial.reset();
144  mxFtFlip.reset();
145  mxFlipDispatch.reset();
146  mxFlipTbx.reset();
147  mxAlignDispatch.reset();
148  mxAlignDispatch2.reset();
149  mxAlignTbx.reset();
150  mxAlignTbx2.reset();
151  mxArrangeDispatch.reset();
152  mxArrangeDispatch2.reset();
153  mxArrangeTbx.reset();
154  mxArrangeTbx2.reset();
155  mxBtnEditChart.reset();
156 
161 
170 
172 }
173 
174 
175 namespace
176 {
177  bool hasText(const SdrView& rSdrView)
178  {
179  const SdrMarkList& rMarkList = rSdrView.GetMarkedObjectList();
180 
181  if(1 == rMarkList.GetMarkCount())
182  {
183  const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
184  const SdrObjKind eKind(static_cast<SdrObjKind>(pObj->GetObjIdentifier()));
185 
186  if((pObj->GetObjInventor() == SdrInventor::Default) && (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind))
187  {
188  const SdrTextObj* pSdrTextObj = dynamic_cast< const SdrTextObj* >(pObj);
189 
190  if(pSdrTextObj && pSdrTextObj->HasText())
191  {
192  return true;
193  }
194  }
195  }
196 
197  return false;
198  }
199 } // end of anonymous namespace
200 
201 
203 {
204  //Position : Horizontal / Vertical
205  mxMtrPosX->connect_value_changed( LINK( this, PosSizePropertyPanel, ChangePosXHdl ) );
206  mxMtrPosY->connect_value_changed( LINK( this, PosSizePropertyPanel, ChangePosYHdl ) );
207 
208  //Size : Width / Height
209  mxMtrWidth->connect_value_changed( LINK( this, PosSizePropertyPanel, ChangeWidthHdl ) );
210  mxMtrHeight->connect_value_changed( LINK( this, PosSizePropertyPanel, ChangeHeightHdl ) );
211 
212  //Size : Keep ratio
213  mxCbxScale->connect_toggled( LINK( this, PosSizePropertyPanel, ClickAutoHdl ) );
214 
215  //rotation control
216  mxCtrlDial->SetLinkedField(mxMtrAngle.get());
217  mxCtrlDial->SetModifyHdl(LINK( this, PosSizePropertyPanel, RotationHdl));
218 
219  //use same logic as DialControl_Impl::SetSize
220  weld::DrawingArea* pDrawingArea = mxCtrlDial->GetDrawingArea();
221  int nDim = (std::min<int>(pDrawingArea->get_approximate_digit_width() * 6,
222  pDrawingArea->get_text_height() * 3) - 1) | 1;
223  Size aSize(nDim, nDim);
224  pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
225  mxCtrlDial->Init(aSize);
226 
227  mxBtnEditChart->connect_clicked( LINK( this, PosSizePropertyPanel, ClickChartEditHdl ) );
228 
230  if ( pCurSh )
231  mpView = pCurSh->GetDrawView();
232  else
233  mpView = nullptr;
234 
235  if ( mpView != nullptr )
236  {
238  mbAdjustEnabled = hasText(*mpView);
239  }
240 
242 }
243 
245  vcl::Window* pParent,
246  const css::uno::Reference<css::frame::XFrame>& rxFrame,
247  SfxBindings* pBindings,
248  const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
249 {
250  if (pParent == nullptr)
251  throw lang::IllegalArgumentException("no parent Window given to PosSizePropertyPanel::Create", nullptr, 0);
252  if ( ! rxFrame.is())
253  throw lang::IllegalArgumentException("no XFrame given to PosSizePropertyPanel::Create", nullptr, 1);
254  if (pBindings == nullptr)
255  throw lang::IllegalArgumentException("no SfxBindings given to PosSizePropertyPanel::Create", nullptr, 2);
256 
258  pParent,
259  rxFrame,
260  pBindings,
261  rxSidebar);
262 }
263 
264 
266  const DataChangedEvent& /*rEvent*/)
267 {
268 }
269 
271  const vcl::EnumContext& rContext)
272 {
273  if (maContext == rContext)
274  {
275  // Nothing to do.
276  return;
277  }
278 
279  maContext = rContext;
280 
281  bool bShowPosition = false;
282  bool bShowAngle = false;
283  bool bShowFlip = false;
284  bool bShowEditChart = false;
285  bool bShowArrangeTbx2 = false;
286 
288  {
289  case CombinedEnumContext(Application::WriterVariants, Context::Draw):
290  bShowAngle = true;
291  bShowFlip = true;
292  bShowArrangeTbx2 = true;
293  break;
294 
295  case CombinedEnumContext(Application::WriterVariants, Context::Graphic):
296  bShowFlip = true;
297  bShowAngle = true; // RotGrfFlyFrame: Writer FlyFrames for Graphics now support angle
298  break;
299 
300  case CombinedEnumContext(Application::Calc, Context::Draw):
301  case CombinedEnumContext(Application::Calc, Context::DrawLine):
302  case CombinedEnumContext(Application::Calc, Context::Graphic):
303  case CombinedEnumContext(Application::DrawImpress, Context::Draw):
304  case CombinedEnumContext(Application::DrawImpress, Context::DrawLine):
305  case CombinedEnumContext(Application::DrawImpress, Context::TextObject):
306  case CombinedEnumContext(Application::DrawImpress, Context::Graphic):
307  bShowPosition = true;
308  bShowAngle = true;
309  bShowFlip = true;
310  break;
311 
312  case CombinedEnumContext(Application::WriterVariants, Context::OLE):
313  bShowEditChart = true;
314  break;
315 
316  case CombinedEnumContext(Application::Calc, Context::OLE):
317  case CombinedEnumContext(Application::DrawImpress, Context::OLE):
318  bShowPosition = true;
319  bShowEditChart = true;
320  break;
321 
322  case CombinedEnumContext(Application::Calc, Context::Chart):
323  case CombinedEnumContext(Application::Calc, Context::Form):
324  case CombinedEnumContext(Application::Calc, Context::Media):
325  case CombinedEnumContext(Application::Calc, Context::MultiObject):
326  case CombinedEnumContext(Application::DrawImpress, Context::Media):
327  case CombinedEnumContext(Application::DrawImpress, Context::Form):
328  case CombinedEnumContext(Application::DrawImpress, Context::ThreeDObject):
329  case CombinedEnumContext(Application::DrawImpress, Context::MultiObject):
330  bShowPosition = true;
331  break;
332  }
333 
334  // Position
335  mxFtPosX->set_visible(bShowPosition);
336  mxMtrPosX->set_visible(bShowPosition);
337  mxFtPosY->set_visible(bShowPosition);
338  mxMtrPosY->set_visible(bShowPosition);
339 
340  // Rotation
341  mxFtAngle->set_visible(bShowAngle);
342  mxMtrAngle->set_visible(bShowAngle);
343  mxCtrlDial->set_visible(bShowAngle);
344 
345  // Flip
346  mxFtFlip->set_visible(bShowFlip);
347  mxFlipTbx->set_visible(bShowFlip);
348 
349  // Edit Chart
350  mxBtnEditChart->set_visible(bShowEditChart);
351 
352  // Arrange tool bar 2
353  mxArrangeTbx2->set_visible(bShowArrangeTbx2);
354 
355  if (mxSidebar.is())
356  mxSidebar->requestLayout();
357 }
358 
359 
361 {
362  if( mxCbxScale->get_active() &&
363  mxCbxScale->get_sensitive() )
364  {
365  long nHeight = static_cast<long>( (static_cast<double>(mlOldHeight) * static_cast<double>(mxMtrWidth->get_value(FieldUnit::NONE))) / static_cast<double>(mlOldWidth) );
366  if( nHeight <= mxMtrHeight->get_max( FieldUnit::NONE ) )
367  {
368  mxMtrHeight->set_value( nHeight, FieldUnit::NONE );
369  }
370  else
371  {
372  nHeight = static_cast<long>(mxMtrHeight->get_max( FieldUnit::NONE ));
373  mxMtrHeight->set_value(nHeight, FieldUnit::NONE);
374  const long nWidth = static_cast<long>( (static_cast<double>(mlOldWidth) * static_cast<double>(nHeight)) / static_cast<double>(mlOldHeight) );
375  mxMtrWidth->set_value( nWidth, FieldUnit::NONE );
376  }
377  }
378  executeSize();
379 }
380 
381 
383 {
384  if( mxCbxScale->get_active() &&
385  mxCbxScale->get_sensitive() )
386  {
387  long nWidth = static_cast<long>( (static_cast<double>(mlOldWidth) * static_cast<double>(mxMtrHeight->get_value(FieldUnit::NONE))) / static_cast<double>(mlOldHeight) );
388  if( nWidth <= mxMtrWidth->get_max( FieldUnit::NONE ) )
389  {
390  mxMtrWidth->set_value( nWidth, FieldUnit::NONE );
391  }
392  else
393  {
394  nWidth = static_cast<long>(mxMtrWidth->get_max( FieldUnit::NONE ));
395  mxMtrWidth->set_value( nWidth, FieldUnit::NONE );
396  const long nHeight = static_cast<long>( (static_cast<double>(mlOldHeight) * static_cast<double>(nWidth)) / static_cast<double>(mlOldWidth) );
397  mxMtrHeight->set_value( nHeight, FieldUnit::NONE );
398  }
399  }
400  executeSize();
401 }
402 
403 
405 {
406  if ( mxMtrPosX->get_value_changed_from_saved())
407  {
408  long lX = GetCoreValue( *mxMtrPosX, mePoolUnit );
409 
410  Fraction aUIScale = mpView->GetModel()->GetUIScale();
411  lX = long( lX * aUIScale );
412 
413  SfxInt32Item aPosXItem( SID_ATTR_TRANSFORM_POS_X,static_cast<sal_uInt32>(lX));
414 
415  GetBindings()->GetDispatcher()->ExecuteList(
416  SID_ATTR_TRANSFORM, SfxCallMode::RECORD, { &aPosXItem });
417  }
418 }
419 
421 {
422  if ( mxMtrPosY->get_value_changed_from_saved() )
423  {
424  long lY = GetCoreValue( *mxMtrPosY, mePoolUnit );
425 
426  Fraction aUIScale = mpView->GetModel()->GetUIScale();
427  lY = long( lY * aUIScale );
428 
429  SfxInt32Item aPosYItem( SID_ATTR_TRANSFORM_POS_Y,static_cast<sal_uInt32>(lY));
430 
431  GetBindings()->GetDispatcher()->ExecuteList(
432  SID_ATTR_TRANSFORM, SfxCallMode::RECORD, { &aPosYItem });
433  }
434 }
435 
437 {
438  if ( mxCbxScale->get_active() )
439  {
440  mlOldWidth = std::max(GetCoreValue(*mxMtrWidth, mePoolUnit), 1);
441  mlOldHeight = std::max(GetCoreValue(*mxMtrHeight, mePoolUnit), 1);
442  }
443 
444  // mxCbxScale must synchronized with that on Position and Size tabpage on Shape Properties dialog
445  SvtViewOptions aPageOpt(EViewType::TabPage, "cui/ui/possizetabpage/PositionAndSize");
446  aPageOpt.SetUserItem( USERITEM_NAME, css::uno::makeAny( OUString::number( int(mxCbxScale->get_active()) ) ) );
447 }
448 
450 {
451  sal_Int32 nTmp = mxCtrlDial->GetRotation();
452 
453  // #i123993# Need to take UIScale into account when executing rotations
454  const double fUIScale(mpView && mpView->GetModel() ? double(mpView->GetModel()->GetUIScale()) : 1.0);
455  SfxInt32Item aAngleItem( SID_ATTR_TRANSFORM_ANGLE,static_cast<sal_uInt32>(nTmp));
456  SfxInt32Item aRotXItem( SID_ATTR_TRANSFORM_ROT_X, basegfx::fround(mlRotX * fUIScale));
457  SfxInt32Item aRotYItem( SID_ATTR_TRANSFORM_ROT_Y, basegfx::fround(mlRotY * fUIScale));
458 
459  GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_TRANSFORM,
460  SfxCallMode::RECORD, { &aAngleItem, &aRotXItem, &aRotYItem });
461 }
462 
464 {
466  if ( pCurSh)
467  {
468  pCurSh->DoVerb( -1 );
469  }
470 }
471 
472 namespace
473 {
474  void limitWidth(weld::MetricSpinButton& rMetricSpinButton)
475  {
476  // space is limited in the sidebar, so limit MetricSpinButtons to a width of 7 digits
477  const int nMaxDigits = 7;
478 
479  weld::SpinButton& rSpinButton = rMetricSpinButton.get_widget();
480  rSpinButton.set_width_chars(std::min(rSpinButton.get_width_chars(), nMaxDigits));
481  }
482 }
483 
485  sal_uInt16 nSID,
486  SfxItemState eState,
487  const SfxPoolItem* pState)
488 {
489  mxFtAngle->set_sensitive(true);
490  mxMtrAngle->set_sensitive(true);
491  mxDial->set_sensitive(true);
492  mxFtFlip->set_sensitive(true);
493  mxFlipTbx->set_sensitive(true);
494 
495  const SfxUInt32Item* pWidthItem;
496  const SfxUInt32Item* pHeightItem;
497 
499  if ( pCurSh )
500  mpView = pCurSh->GetDrawView();
501  else
502  mpView = nullptr;
503 
504  if ( mpView == nullptr )
505  return;
506 
507  mbAdjustEnabled = hasText(*mpView);
508 
509  // Pool unit and dialog unit may have changed, make sure that we
510  // have the current values.
512 
513  switch (nSID)
514  {
515  case SID_ATTR_TRANSFORM_WIDTH:
516  if ( SfxItemState::DEFAULT == eState )
517  {
518  pWidthItem = dynamic_cast< const SfxUInt32Item* >(pState);
519 
520  if(pWidthItem)
521  {
522  long lOldWidth1 = long( pWidthItem->GetValue() / maUIScale );
523  SetFieldUnit( *mxMtrWidth, meDlgUnit, true );
524  SetMetricValue( *mxMtrWidth, lOldWidth1, mePoolUnit );
525  limitWidth(*mxMtrWidth);
526  mlOldWidth = lOldWidth1;
527  mxMtrWidth->save_value();
528  break;
529  }
530  }
531 
532  mxMtrWidth->set_text( "" );
533  break;
534 
535  case SID_ATTR_TRANSFORM_HEIGHT:
536  if ( SfxItemState::DEFAULT == eState )
537  {
538  pHeightItem = dynamic_cast< const SfxUInt32Item* >(pState);
539 
540  if(pHeightItem)
541  {
542  long nTmp = long( pHeightItem->GetValue() / maUIScale);
545  limitWidth(*mxMtrHeight);
546  mlOldHeight = nTmp;
547  mxMtrHeight->save_value();
548  break;
549  }
550  }
551 
552  mxMtrHeight->set_text( "");
553  break;
554 
555  case SID_ATTR_TRANSFORM_POS_X:
556  if(SfxItemState::DEFAULT == eState)
557  {
558  const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState);
559 
560  if(pItem)
561  {
562  long nTmp = long(pItem->GetValue() / maUIScale);
563  SetFieldUnit( *mxMtrPosX, meDlgUnit, true );
565  limitWidth(*mxMtrPosX);
566  mxMtrPosX->save_value();
567  break;
568  }
569  }
570 
571  mxMtrPosX->set_text( "" );
572  break;
573 
574  case SID_ATTR_TRANSFORM_POS_Y:
575  if(SfxItemState::DEFAULT == eState)
576  {
577  const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState);
578 
579  if(pItem)
580  {
581  long nTmp = long(pItem->GetValue() / maUIScale);
582  SetFieldUnit( *mxMtrPosY, meDlgUnit, true );
584  limitWidth(*mxMtrPosY);
585  mxMtrPosY->save_value();
586  break;
587  }
588  }
589 
590  mxMtrPosY->set_text( "" );
591  break;
592 
593  case SID_ATTR_TRANSFORM_ROT_X:
594  if (SfxItemState::DEFAULT == eState)
595  {
596  const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState);
597 
598  if(pItem)
599  {
600  mlRotX = pItem->GetValue();
601  mlRotX = long( mlRotX / maUIScale );
602  }
603  }
604  break;
605 
606  case SID_ATTR_TRANSFORM_ROT_Y:
607  if (SfxItemState::DEFAULT == eState)
608  {
609  const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState);
610 
611  if(pItem)
612  {
613  mlRotY = pItem->GetValue();
614  mlRotY = long( mlRotY / maUIScale );
615  }
616  }
617  break;
618 
619  case SID_ATTR_TRANSFORM_PROTECT_POS:
620  if(SfxItemState::DEFAULT == eState)
621  {
622  const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
623 
624  if(pItem)
625  {
626  // record the state of position protect
627  mbPositionProtected = pItem->GetValue();
628  break;
629  }
630  }
631 
632  mbPositionProtected = false;
633  break;
634 
635  case SID_ATTR_TRANSFORM_PROTECT_SIZE:
636  if(SfxItemState::DEFAULT == eState)
637  {
638  const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
639 
640  if(pItem)
641  {
642  // record the state of size protect
643  mbSizeProtected = pItem->GetValue();
644  break;
645  }
646  }
647 
648  mbSizeProtected = false;
649  break;
650 
651  case SID_ATTR_TRANSFORM_AUTOWIDTH:
652  if(SfxItemState::DEFAULT == eState)
653  {
654  const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
655 
656  if(pItem)
657  {
658  mbAutoWidth = pItem->GetValue();
659  }
660  }
661  break;
662 
663  case SID_ATTR_TRANSFORM_AUTOHEIGHT:
664  if(SfxItemState::DEFAULT == eState)
665  {
666  const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
667 
668  if(pItem)
669  {
670  mbAutoHeight = pItem->GetValue();
671  }
672  }
673  break;
674 
675  case SID_ATTR_TRANSFORM_ANGLE:
676  if (eState >= SfxItemState::DEFAULT)
677  {
678  const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState);
679 
680  if(pItem)
681  {
682  long nTmp = pItem->GetValue();
683  nTmp = nTmp < 0 ? 36000+nTmp : nTmp;
684 
685  mxMtrAngle->set_value(nTmp, FieldUnit::DEGREE);
686  mxCtrlDial->SetRotation(nTmp);
687 
688  break;
689  }
690  }
691 
692  mxMtrAngle->set_text( "" );
693  mxCtrlDial->SetRotation( 0 );
694  break;
695 
696  case SID_ATTR_METRIC:
697  MetricState( eState, pState );
698  UpdateUIScale();
699  break;
700 
701  default:
702  break;
703  }
704 
705  const sal_Int32 nCombinedContext(maContext.GetCombinedContext_DI());
706  const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
707 
708  switch (rMarkList.GetMarkCount())
709  {
710  case 0:
711  break;
712 
713  case 1:
714  {
715  const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
716  const SdrObjKind eKind(static_cast<SdrObjKind>(pObj->GetObjIdentifier()));
717 
718  if(((nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::Draw)
719  || nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::TextObject)
720  ) && OBJ_EDGE == eKind)
721  || OBJ_CAPTION == eKind)
722  {
723  mxFtAngle->set_sensitive(false);
724  mxMtrAngle->set_sensitive(false);
725  mxDial->set_sensitive(false);
726  mxFlipTbx->set_sensitive(false);
727  mxFtFlip->set_sensitive(false);
728  }
729  break;
730  }
731 
732  default:
733  {
734  sal_uInt16 nMarkObj = 0;
735  bool isNoEdge = true;
736 
737  while(isNoEdge && rMarkList.GetMark(nMarkObj))
738  {
739  const SdrObject* pObj = rMarkList.GetMark(nMarkObj)->GetMarkedSdrObj();
740  const SdrObjKind eKind(static_cast<SdrObjKind>(pObj->GetObjIdentifier()));
741 
742  if(((nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::Draw)
743  || nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::TextObject)
744  ) && OBJ_EDGE == eKind)
745  || OBJ_CAPTION == eKind)
746  {
747  isNoEdge = false;
748  break;
749  }
750  nMarkObj++;
751  }
752 
753  if(!isNoEdge)
754  {
755  mxFtAngle->set_sensitive(false);
756  mxMtrAngle->set_sensitive(false);
757  mxDial->set_sensitive(false);
758  mxFlipTbx->set_sensitive(false);
759  mxFtFlip->set_sensitive(false);
760  }
761  break;
762  }
763  }
764 
765  if(nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::TextObject))
766  {
767  mxFlipTbx->set_sensitive(false);
768  mxFtFlip->set_sensitive(false);
769  }
770 
771  DisableControls();
772 
773  // mxCbxScale must synchronized with that on Position and Size tabpage on Shape Properties dialog
774  SvtViewOptions aPageOpt(EViewType::TabPage, "cui/ui/possizetabpage/PositionAndSize");
775  OUString sUserData;
776  css::uno::Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME );
777  OUString aTemp;
778  if ( aUserItem >>= aTemp )
779  sUserData = aTemp;
780  mxCbxScale->set_active(static_cast<bool>(sUserData.toInt32()));
781 }
782 
783 void PosSizePropertyPanel::GetControlState(const sal_uInt16 nSID, boost::property_tree::ptree& rState)
784 {
785  weld::MetricSpinButton* pControl = nullptr;
786  switch (nSID)
787  {
788  case SID_ATTR_TRANSFORM_POS_X:
789  pControl = mxMtrPosX.get();
790  break;
791  case SID_ATTR_TRANSFORM_POS_Y:
792  pControl = mxMtrPosY.get();
793  break;
794  case SID_ATTR_TRANSFORM_WIDTH:
795  pControl = mxMtrWidth.get();
796  break;
797  case SID_ATTR_TRANSFORM_HEIGHT:
798  pControl = mxMtrHeight.get();
799  break;
800  }
801 
802  if (pControl && !pControl->get_text().isEmpty())
803  {
805  getNum(pControl->get_value(pControl->get_unit()), pControl->get_digits(), false, false);
806  rState.put(pControl->get_buildable_name().getStr(), sValue.toUtf8().getStr());
807  }
808 }
809 
811 {
812  if ( !mxMtrWidth->get_value_changed_from_saved() && !mxMtrHeight->get_value_changed_from_saved())
813  return;
814 
815  Fraction aUIScale = mpView->GetModel()->GetUIScale();
816 
817  // get Width
818  double nWidth = static_cast<double>(mxMtrWidth->get_value(FieldUnit::MM_100TH));
819  long lWidth = long(nWidth * static_cast<double>(aUIScale));
820  lWidth = OutputDevice::LogicToLogic( lWidth, MapUnit::Map100thMM, mePoolUnit );
821  lWidth = static_cast<long>(mxMtrWidth->denormalize( lWidth ));
822 
823  // get Height
824  double nHeight = static_cast<double>(mxMtrHeight->get_value(FieldUnit::MM_100TH));
825  long lHeight = long(nHeight * static_cast<double>(aUIScale));
826  lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit );
827  lHeight = static_cast<long>(mxMtrHeight->denormalize( lHeight ));
828 
829  // put Width & Height to itemset
830  SfxUInt32Item aWidthItem( SID_ATTR_TRANSFORM_WIDTH, static_cast<sal_uInt32>(lWidth));
831  SfxUInt32Item aHeightItem( SID_ATTR_TRANSFORM_HEIGHT, static_cast<sal_uInt32>(lHeight));
832  SfxUInt16Item aPointItem (SID_ATTR_TRANSFORM_SIZE_POINT, sal_uInt16(RectPoint::LT));
833  const sal_Int32 nCombinedContext(maContext.GetCombinedContext_DI());
834 
835  if( nCombinedContext == CombinedEnumContext(Application::WriterVariants, Context::Graphic)
836  || nCombinedContext == CombinedEnumContext(Application::WriterVariants, Context::OLE)
837  )
838  {
839  GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_TRANSFORM,
840  SfxCallMode::RECORD, { &aWidthItem, &aHeightItem, &aPointItem });
841  }
842  else
843  {
844  if ( (mxMtrWidth->get_value_changed_from_saved()) && (mxMtrHeight->get_value_changed_from_saved()))
845  GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_TRANSFORM,
846  SfxCallMode::RECORD, { &aWidthItem, &aHeightItem, &aPointItem });
847  else if( mxMtrWidth->get_value_changed_from_saved())
848  GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_TRANSFORM,
849  SfxCallMode::RECORD, { &aWidthItem, &aPointItem });
850  else if ( mxMtrHeight->get_value_changed_from_saved())
851  GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_TRANSFORM,
852  SfxCallMode::RECORD, { &aHeightItem, &aPointItem });
853  }
854 }
855 
857 {
858  if (meDlgUnit != GetCurrentUnit(SfxItemState::DEFAULT, nullptr))
859  {
860  mpBindings->Update( SID_ATTR_METRIC );
861  }
862 
863  PanelLayout::DumpAsPropertyTree(rJsonWriter);
864 }
865 
867 {
868  bool bPosXBlank = false;
869  bool bPosYBlank = false;
870  bool bWidthBlank = false;
871  bool bHeightBlank = false;
872 
873  // #i124409# use the given Item to get the correct UI unit and initialize it
874  // and the Fields using it
875  meDlgUnit = GetCurrentUnit(eState,pState);
876 
877  if (mxMtrPosX->get_text().isEmpty())
878  bPosXBlank = true;
879  SetFieldUnit( *mxMtrPosX, meDlgUnit, true );
880  if(bPosXBlank)
881  mxMtrPosX->set_text(OUString());
882 
883  if (mxMtrPosY->get_text().isEmpty())
884  bPosYBlank = true;
885  SetFieldUnit( *mxMtrPosY, meDlgUnit, true );
886  if(bPosYBlank)
887  mxMtrPosY->set_text(OUString());
889 
890  if (mxMtrWidth->get_text().isEmpty())
891  bWidthBlank = true;
892  SetFieldUnit( *mxMtrWidth, meDlgUnit, true );
893  if(bWidthBlank)
894  mxMtrWidth->set_text(OUString());
895 
896  if (mxMtrHeight->get_text().isEmpty())
897  bHeightBlank = true;
899  if(bHeightBlank)
900  mxMtrHeight->set_text(OUString());
901 }
902 
903 
905 {
906  FieldUnit eUnit = FieldUnit::NONE;
907 
908  if ( pState && eState >= SfxItemState::DEFAULT )
909  {
910  eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pState)->GetValue());
911  }
912  else
913  {
915  SfxObjectShell* pSh = nullptr;
916  if ( pFrame )
917  pSh = pFrame->GetObjectShell();
918  if ( pSh )
919  {
920  SfxModule* pModule = pSh->GetModule();
921  if ( pModule )
922  {
923  const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC );
924  if ( pItem )
925  eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
926  }
927  else
928  {
929  SAL_WARN("svx.sidebar", "GetModuleFieldUnit(): no module found");
930  }
931  }
932  }
933 
934  return eUnit;
935 }
936 
937 
939 {
940  if( mbPositionProtected )
941  {
942  // the position is protected("Position protect" option in modal dialog is checked),
943  // disable all the Position controls in sidebar
944  mxFtPosX->set_sensitive(false);
945  mxMtrPosX->set_sensitive(false);
946  mxFtPosY->set_sensitive(false);
947  mxMtrPosY->set_sensitive(false);
948  mxFtAngle->set_sensitive(false);
949  mxMtrAngle->set_sensitive(false);
950  mxDial->set_sensitive(false);
951  mxFtFlip->set_sensitive(false);
952  mxFlipTbx->set_sensitive(false);
953 
954  mxFtWidth->set_sensitive(false);
955  mxMtrWidth->set_sensitive(false);
956  mxFtHeight->set_sensitive(false);
957  mxMtrHeight->set_sensitive(false);
958  mxCbxScale->set_sensitive(false);
959  }
960  else
961  {
962  mxFtPosX->set_sensitive(true);
963  mxMtrPosX->set_sensitive(true);
964  mxFtPosY->set_sensitive(true);
965  mxMtrPosY->set_sensitive(true);
966 
967  if( mbSizeProtected )
968  {
969  mxFtWidth->set_sensitive(false);
970  mxMtrWidth->set_sensitive(false);
971  mxFtHeight->set_sensitive(false);
972  mxMtrHeight->set_sensitive(false);
973  mxCbxScale->set_sensitive(false);
974  }
975  else
976  {
977  if( mbAdjustEnabled )
978  {
979  if( mbAutoWidth )
980  {
981  mxFtWidth->set_sensitive(false);
982  mxMtrWidth->set_sensitive(false);
983  mxCbxScale->set_sensitive(false);
984  }
985  else
986  {
987  mxFtWidth->set_sensitive(true);
988  mxMtrWidth->set_sensitive(true);
989  }
990  if( mbAutoHeight )
991  {
992  mxFtHeight->set_sensitive(false);
993  mxMtrHeight->set_sensitive(false);
994  mxCbxScale->set_sensitive(false);
995  }
996  else
997  {
998  mxFtHeight->set_sensitive(true);
999  mxMtrHeight->set_sensitive(true);
1000  }
1001  if( !mbAutoWidth && !mbAutoHeight )
1002  mxCbxScale->set_sensitive(true);
1003  }
1004  else
1005  {
1006  mxFtWidth->set_sensitive(true);
1007  mxMtrWidth->set_sensitive(true);
1008  mxFtHeight->set_sensitive(true);
1009  mxMtrHeight->set_sensitive(true);
1010  mxCbxScale->set_sensitive(true);
1011  }
1012  }
1013  }
1014 }
1015 
1017 {
1018  SdrPageView* pPV = mpView->GetSdrPageView();
1019  if (!pPV)
1020  return;
1022  pPV->LogicToPagePos(aTmpRect);
1024 
1025  tools::Rectangle aTmpRect2(mpView->GetWorkArea());
1026  pPV->LogicToPagePos(aTmpRect2);
1028 
1029  const Fraction aUIScale(mpView->GetModel()->GetUIScale());
1031  TransfrmHelper::ScaleRect( maRect, aUIScale );
1032 
1033  const sal_uInt16 nDigits(mxMtrPosX->get_digits());
1036 
1037  double fLeft(maWorkArea.getMinX());
1038  double fTop(maWorkArea.getMinY());
1039  double fRight(maWorkArea.getMaxX());
1040  double fBottom(maWorkArea.getMaxY());
1041 
1042  // seems that sidebar defaults to top left reference point
1043  // and there's no way to set it to something else
1044  fRight -= maRect.getWidth();
1045  fBottom -= maRect.getHeight();
1046 
1047  const double fMaxLong(static_cast<double>(vcl::ConvertValue( LONG_MAX, 0, MapUnit::Map100thMM, meDlgUnit ) - 1));
1048  fLeft = std::clamp(fLeft, -fMaxLong, fMaxLong);
1049  fRight = std::clamp(fRight, -fMaxLong, fMaxLong);
1050  fTop = std::clamp(fTop, - fMaxLong, fMaxLong);
1051  fBottom = std::clamp(fBottom, -fMaxLong, fMaxLong);
1052 
1053  mxMtrPosX->set_range(basegfx::fround64(fLeft), basegfx::fround64(fRight), FieldUnit::NONE);
1054  limitWidth(*mxMtrPosX);
1055  mxMtrPosY->set_range(basegfx::fround64(fTop), basegfx::fround64(fBottom), FieldUnit::NONE);
1056  limitWidth(*mxMtrPosY);
1057 
1058  double fMaxWidth = maWorkArea.getWidth() - (maRect.getWidth() - fLeft);
1059  double fMaxHeight = maWorkArea.getHeight() - (maRect.getHeight() - fTop);
1060  mxMtrWidth->set_max(basegfx::fround64(fMaxWidth*100), FieldUnit::NONE);
1061  limitWidth(*mxMtrWidth);
1062  mxMtrHeight->set_max(basegfx::fround64(fMaxHeight*100), FieldUnit::NONE);
1063  limitWidth(*mxMtrHeight);
1064 }
1065 
1067 {
1068  const Fraction aUIScale (mpView->GetModel()->GetUIScale());
1069  if (maUIScale == aUIScale)
1070  return;
1071 
1072  // UI scale has changed.
1073 
1074  // Remember the new UI scale.
1075  maUIScale = aUIScale;
1076 
1077  // The content of the position and size boxes is only updated when item changes are notified.
1078  // Request such notifications without changing the actual item values.
1079  GetBindings()->Invalidate(SID_ATTR_TRANSFORM_POS_X, true);
1080  GetBindings()->Invalidate(SID_ATTR_TRANSFORM_POS_Y, true);
1081  GetBindings()->Invalidate(SID_ATTR_TRANSFORM_WIDTH, true);
1082  GetBindings()->Invalidate(SID_ATTR_TRANSFORM_HEIGHT, true);
1083 }
1084 
1085 
1086 } // end of namespace svx::sidebar
1087 
1088 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GetValue() const
long Width() const
void SetUserItem(const OUString &sName, const css::uno::Any &aValue)
std::unique_ptr< weld::MetricSpinButton > mxMtrAngle
void SetFieldUnit(weld::MetricSpinButton &rField, FieldUnit eUnit, bool bAll)
sal_Int32 GetValue() const
const char USERITEM_NAME[]
void UpdateUIScale()
Check if the UI scale has changed and handle such a change.
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
FieldUnit
IMPL_LINK_NOARG(AreaPropertyPanelBase, ToolbarHdl_Impl, const OString &, void)
::sfx2::sidebar::ControllerItem maAutoHeightControl
size_t GetMarkCount() const
Definition: svdmark.hxx:180
SlideShowContext maContext
::sfx2::sidebar::ControllerItem maProPosControl
double getHeight() const
void MetricState(SfxItemState eState, const SfxPoolItem *pState)
::sfx2::sidebar::ControllerItem maTransfPosXControl
std::string GetValue
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
long Height() const
This control allows to input a rotation angle, visualized by a dial.
Definition: dialcontrol.hxx:75
periodic cubic Spline (ni)
Definition: svdobj.hxx:133
std::unique_ptr< ToolbarUnoDispatcher > mxFlipDispatch
static const AllSettings & GetSettings()
std::unique_ptr< weld::Toolbar > mxAlignTbx2
OString get_buildable_name()
std::unique_ptr< weld::MetricSpinButton > mxMtrHeight
virtual void HandleContextChange(const vcl::EnumContext &rContext) override
OUString get_text() const
MapUnit GetCoreMetric() const
::sfx2::sidebar::ControllerItem maSvxAngleControl
SdrMark * GetMark(size_t nNum) const
Definition: svdmark.cxx:229
OLE object.
Definition: svdobj.hxx:138
virtual int get_width_chars() const =0
std::unique_ptr< weld::MetricSpinButton > mxMtrWidth
virtual void set_width_chars(int nChars)=0
void Invalidate(sal_uInt16 nId)
weld::SpinButton & get_widget()
virtual SfxObjectShell * GetObjectShell() override
double getMaxX() const
virtual void DumpAsPropertyTree(tools::JsonWriter &) override
virtual bool HasText() const override
Definition: svdotxat.cxx:412
SfxModule * GetModule() const
std::unique_ptr< ToolbarUnoDispatcher > mxAlignDispatch
void LogicToPagePos(Point &rPnt) const
Definition: svdpagv.hxx:210
::sfx2::sidebar::ControllerItem m_aMetricCtl
double getWidth() const
connector object
Definition: svdobj.hxx:139
::sfx2::sidebar::ControllerItem maTransfWidthControl
std::unique_ptr< weld::Toolbar > mxAlignTbx
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem *pState) override
static SfxViewShell * Current()
std::unique_ptr< ToolbarUnoDispatcher > mxAlignDispatch2
std::unique_ptr< ToolbarUnoDispatcher > mxArrangeDispatch
double getMaxY() const
std::unique_ptr< weld::Toolbar > mxFlipTbx
B2IRange fround(const B2DRange &rRange)
sal_Int32 GetCombinedContext_DI() const
css::uno::Reference< css::ui::XSidebar > mxSidebar
std::unique_ptr< weld::Toolbar > mxArrangeTbx2
SdrObject * GetMarkedSdrObj() const
Definition: svdmark.hxx:68
std::unique_ptr< weld::Label > mxFtWidth
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
::sfx2::sidebar::ControllerItem maRotYControl
std::unique_ptr< weld::CheckButton > mxCbxScale
virtual void dispose()
virtual sal_uInt16 GetObjIdentifier() const
Definition: svdobj.cxx:558
std::unique_ptr< weld::Label > mxFtHeight
const SdrMarkList & GetMarkedObjectList() const
Definition: svdmrkv.hxx:252
int GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
std::unique_ptr< weld::MetricSpinButton > mxMtrPosX
virtual void DataChanged(const DataChangedEvent &rEvent) override
static FieldUnit GetCurrentUnit(SfxItemState eState, const SfxPoolItem *pState)
std::unique_ptr< weld::Label > mxFtPosY
std::unique_ptr< weld::Label > mxFtPosX
::sfx2::sidebar::ControllerItem maTransfPosYControl
void SetMetricValue(weld::MetricSpinButton &rField, int nCoreValue, MapUnit eUnit)
Abstract DrawObject.
Definition: svdobj.hxx:312
::sfx2::sidebar::ControllerItem maProSizeControl
const tools::Rectangle & GetAllMarkedRect() const
Definition: svdmrkv.hxx:420
const long LONG_MAX
virtual SdrInventor GetObjInventor() const
Definition: svdobj.cxx:553
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
std::unique_ptr< ToolbarUnoDispatcher > mxArrangeDispatch2
const LocaleDataWrapper & GetNeutralLocaleDataWrapper() const
void Update(sal_uInt16 nId)
virtual void dispose() override
const Fraction & GetUIScale() const
Definition: svdmodel.hxx:383
TitleText, special text object for StarDraw.
Definition: svdobj.hxx:135
std::unique_ptr< weld::CustomWeld > mxDial
double getMinY() const
static SfxViewFrame * Current()
SfxItemState
SdrObjKind
Definition: svdobj.hxx:116
std::unique_ptr< weld::MetricSpinButton > mxMtrPosY
virtual int get_text_height() const =0
static VclPtr< reference_type > Create(Arg &&...arg)
virtual ErrCode DoVerb(long nVerb)
std::unique_ptr< weld::Button > mxBtnEditChart
std::unique_ptr< svx::DialControl > mxCtrlDial
css::uno::Any GetUserItem(const OUString &sName) const
void ScaleRect(basegfx::B2DRange &rRange, const Fraction &rUIScale)
UnoViewSharedPtr mpView
::sfx2::sidebar::ControllerItem maRotXControl
virtual SdrView * GetDrawView() const
SdrPageView * GetSdrPageView() const
Definition: svdpntv.hxx:304
std::unique_ptr< weld::Label > mxFtFlip
sal_Int64 ConvertValue(sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits, FieldUnit eInUnit, FieldUnit eOutUnit)
sal_uInt32 GetValue() const
SfxDispatcher * GetDispatcher() const
int get_value(FieldUnit eDestUnit) const
#define SAL_WARN(area, stream)
double getMinX() const
::sfx2::sidebar::ControllerItem maAutoWidthControl
IMPL_STATIC_LINK_NOARG(PosSizePropertyPanel, ClickChartEditHdl, weld::Button &, void)
std::unique_ptr< weld::Label > mxFtAngle
unsigned int get_digits() const
static VclPtr< vcl::Window > Create(vcl::Window *pParent, const css::uno::Reference< css::frame::XFrame > &rxFrame, SfxBindings *pBindings, const css::uno::Reference< css::ui::XSidebar > &rxSidebar)
std::unique_ptr< weld::Toolbar > mxArrangeTbx
FieldUnit get_unit() const
virtual void set_size_request(int nWidth, int nHeight)=0
sal_Int64 fround64(double fVal)
SdrModel * GetModel() const
Definition: svdpntv.hxx:265
const tools::Rectangle & GetWorkArea() const
Definition: svddrgv.hxx:213
text object
Definition: svdobj.hxx:134
virtual float get_approximate_digit_width() const =0
::sfx2::sidebar::ControllerItem maTransfHeightControl
#define CombinedEnumContext(a, e)
void ConvertRect(basegfx::B2DRange &rRange, const sal_uInt16 nDigits, const MapUnit ePoolUnit, const FieldUnit eDlgUnit)
virtual void GetControlState(const sal_uInt16 nSId, boost::property_tree::ptree &rState) override