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