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