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