LibreOffice Module basctl (master) 1
dlgedobj.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#include <sal/log.hxx>
22
23#include <cassert>
24
25#include <dlged.hxx>
26#include <dlgeddef.hxx>
27#include <dlgedlist.hxx>
28#include <dlgedobj.hxx>
29#include <dlgedpage.hxx>
30#include <dlgedview.hxx>
31#include <localizationmgr.hxx>
32#include <strings.hxx>
33
34#include <com/sun/star/beans/NamedValue.hpp>
35#include <com/sun/star/form/binding/XBindableValue.hpp>
36#include <com/sun/star/form/binding/XValueBinding.hpp>
37#include <com/sun/star/form/binding/XListEntrySink.hpp>
38#include <com/sun/star/awt/XUnoControlContainer.hpp>
39#include <com/sun/star/awt/XVclContainerPeer.hpp>
40#include <com/sun/star/container/XContainer.hpp>
41#include <com/sun/star/lang/XServiceInfo.hpp>
42#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
43#include <com/sun/star/script/XScriptEventsSupplier.hpp>
44#include <com/sun/star/table/CellAddress.hpp>
45#include <com/sun/star/table/CellRangeAddress.hpp>
47#include <o3tl/functional.hxx>
48#include <svx/svdpagv.hxx>
50#include <vcl/svapp.hxx>
51#include <tools/debug.hxx>
52
53namespace basctl
54{
55
56using namespace ::com::sun::star;
57using namespace ::com::sun::star::uno;
58using namespace ::com::sun::star::beans;
59using namespace ::com::sun::star::container;
60using namespace ::com::sun::star::script;
61
62
64{
65 if (DlgEdForm* pFormThis = dynamic_cast<DlgEdForm*>(this))
66 return pFormThis->GetDlgEditor();
67 else
68 return pDlgEdForm->GetDlgEditor();
69}
70
72: SdrUnoObj(rSdrModel, OUString())
73 ,bIsListening(false)
74{
75}
76
77DlgEdObj::DlgEdObj(SdrModel& rSdrModel, DlgEdObj const & rSource)
78: SdrUnoObj(rSdrModel, rSource)
79 ,bIsListening(false)
80{
81 // set parent form
82 pDlgEdForm = rSource.pDlgEdForm;
83
84 // add child to parent form
85 pDlgEdForm->AddChild( this );
86
88 if ( xPSet.is() )
89 {
90 // set new name
91 OUString aOUniqueName( GetUniqueName() );
92 Any aUniqueName;
93 aUniqueName <<= aOUniqueName;
94 xPSet->setPropertyValue( DLGED_PROP_NAME, aUniqueName );
95
97 if ( xCont.is() )
98 {
99 // set tabindex
100 Sequence< OUString > aNames = xCont->getElementNames();
101 xPSet->setPropertyValue( DLGED_PROP_TABINDEX, Any(static_cast<sal_Int16>(aNames.getLength())) );
102
103 // insert control model in dialog model
104 Reference< awt::XControlModel > xCtrl( xPSet , UNO_QUERY );
105 xCont->insertByName( aOUniqueName, Any(xCtrl) );
106
107 pDlgEdForm->UpdateTabOrderAndGroups();
108 }
109 }
110
111 // start listening
113}
114
116 SdrModel& rSdrModel,
117 const OUString& rModelName,
118 const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSFac)
119: SdrUnoObj(rSdrModel, rModelName, rxSFac)
120 ,bIsListening(false)
121{
122}
123
125{
126 if ( isListening() )
127 EndListening(true);
128}
129
130namespace
131{
132 /* returns the DlgEdForm which the given DlgEdObj belongs to
133 (which might in fact be the object itself)
134
135 Failure to obtain the form will be reported with an assertion in the non-product
136 version.
137 */
138 bool lcl_getDlgEdForm( DlgEdObj* _pObject, DlgEdForm*& _out_pDlgEdForm )
139 {
140 _out_pDlgEdForm = dynamic_cast< DlgEdForm* >( _pObject );
141 if ( !_out_pDlgEdForm )
142 _out_pDlgEdForm = _pObject->GetDlgEdForm();
143 DBG_ASSERT( _out_pDlgEdForm, "lcl_getDlgEdForm: no form!" );
144 return ( _out_pDlgEdForm != nullptr );
145 }
146}
147
148uno::Reference< awt::XControl > DlgEdObj::GetControl() const
149{
150 uno::Reference< awt::XControl > xControl;
151 if (DlgEdForm const* pForm = GetDlgEdForm())
152 {
153 DlgEditor const& rEditor = pForm->GetDlgEditor();
154 xControl = GetUnoControl(rEditor.GetView(), *rEditor.GetWindow().GetOutDev());
155 }
156 return xControl;
157}
158
160 sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
161 sal_Int32& nXOut, sal_Int32& nYOut, sal_Int32& nWidthOut, sal_Int32& nHeightOut )
162{
163 // input position and size
164 Size aPos( nXIn, nYIn );
165 Size aSize( nWidthIn, nHeightIn );
166
167 // form position
168 DlgEdForm* pForm = nullptr;
169 if ( !lcl_getDlgEdForm( this, pForm ) )
170 return false;
171 tools::Rectangle aFormRect = pForm->GetSnapRect();
172 Size aFormPos( aFormRect.Left(), aFormRect.Top() );
173
174 // convert 100th_mm to pixel
176 DBG_ASSERT( pDevice, "DlgEdObj::TransformSdrToControlCoordinates: missing default device!" );
177 if ( !pDevice )
178 return false;
179 aPos = pDevice->LogicToPixel( aPos, MapMode( MapUnit::Map100thMM ) );
180 aSize = pDevice->LogicToPixel( aSize, MapMode( MapUnit::Map100thMM ) );
181 aFormPos = pDevice->LogicToPixel( aFormPos, MapMode( MapUnit::Map100thMM ) );
182
183 // subtract form position
184 aPos.AdjustWidth( -(aFormPos.Width()) );
185 aPos.AdjustHeight( -(aFormPos.Height()) );
186
187 // take window borders into account
188 Reference< beans::XPropertySet > xPSetForm( pForm->GetUnoControlModel(), UNO_QUERY );
189 DBG_ASSERT( xPSetForm.is(), "DlgEdObj::TransformFormToSdrCoordinates: no form property set!" );
190 if ( !xPSetForm.is() )
191 return false;
192 bool bDecoration = true;
193 xPSetForm->getPropertyValue( DLGED_PROP_DECORATION ) >>= bDecoration;
194 if( bDecoration )
195 {
196 awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
197 aPos.AdjustWidth( -(aDeviceInfo.LeftInset) );
198 aPos.AdjustHeight( -(aDeviceInfo.TopInset) );
199 }
200
201 // convert pixel to logic units
202 aPos = pDevice->PixelToLogic(aPos, MapMode(MapUnit::MapAppFont));
203 aSize = pDevice->PixelToLogic(aSize, MapMode(MapUnit::MapAppFont));
204
205 // set out parameters
206 nXOut = aPos.Width();
207 nYOut = aPos.Height();
208 nWidthOut = aSize.Width();
209 nHeightOut = aSize.Height();
210
211 return true;
212}
213
215 sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
216 sal_Int32& nXOut, sal_Int32& nYOut, sal_Int32& nWidthOut, sal_Int32& nHeightOut )
217{
218 // input position and size
219 Size aPos( nXIn, nYIn );
220 Size aSize( nWidthIn, nHeightIn );
221
222 // convert 100th_mm to pixel
224 DBG_ASSERT( pDevice, "DlgEdObj::TransformSdrToFormCoordinates: missing default device!" );
225 if ( !pDevice )
226 return false;
227 aPos = pDevice->LogicToPixel( aPos, MapMode( MapUnit::Map100thMM ) );
228 aSize = pDevice->LogicToPixel( aSize, MapMode( MapUnit::Map100thMM ) );
229
230 // take window borders into account
231 DlgEdForm* pForm = nullptr;
232 if ( !lcl_getDlgEdForm( this, pForm ) )
233 return false;
234
235 // take window borders into account
236 Reference< beans::XPropertySet > xPSetForm( pForm->GetUnoControlModel(), UNO_QUERY );
237 DBG_ASSERT( xPSetForm.is(), "DlgEdObj::TransformFormToSdrCoordinates: no form property set!" );
238 if ( !xPSetForm.is() )
239 return false;
240 bool bDecoration = true;
241 xPSetForm->getPropertyValue( DLGED_PROP_DECORATION ) >>= bDecoration;
242 if( bDecoration )
243 {
244 awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
245 aSize.AdjustWidth( -(aDeviceInfo.LeftInset + aDeviceInfo.RightInset) );
246 aSize.AdjustHeight( -(aDeviceInfo.TopInset + aDeviceInfo.BottomInset) );
247 }
248 // convert pixel to logic units
249 aPos = pDevice->PixelToLogic(aPos, MapMode(MapUnit::MapAppFont));
250 aSize = pDevice->PixelToLogic(aSize, MapMode(MapUnit::MapAppFont));
251
252 // set out parameters
253 nXOut = aPos.Width();
254 nYOut = aPos.Height();
255 nWidthOut = aSize.Width();
256 nHeightOut = aSize.Height();
257
258 return true;
259}
260
262 sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
263 sal_Int32& nXOut, sal_Int32& nYOut, sal_Int32& nWidthOut, sal_Int32& nHeightOut )
264{
265 // input position and size
266 Size aPos( nXIn, nYIn );
267 Size aSize( nWidthIn, nHeightIn );
268
269 // form position
270 DlgEdForm* pForm = nullptr;
271 if ( !lcl_getDlgEdForm( this, pForm ) )
272 return false;
273
274 Reference< beans::XPropertySet > xPSetForm( pForm->GetUnoControlModel(), UNO_QUERY );
275 DBG_ASSERT( xPSetForm.is(), "DlgEdObj::TransformControlToSdrCoordinates: no form property set!" );
276 if ( !xPSetForm.is() )
277 return false;
278 sal_Int32 nFormX = 0, nFormY = 0;
279 xPSetForm->getPropertyValue( DLGED_PROP_POSITIONX ) >>= nFormX;
280 xPSetForm->getPropertyValue( DLGED_PROP_POSITIONY ) >>= nFormY;
281 Size aFormPos( nFormX, nFormY );
282
283 // convert logic units to pixel
285 DBG_ASSERT( pDevice, "DlgEdObj::TransformControlToSdrCoordinates: missing default device!" );
286 if ( !pDevice )
287 return false;
288 aPos = pDevice->LogicToPixel(aPos, MapMode(MapUnit::MapAppFont));
289 aSize = pDevice->LogicToPixel(aSize, MapMode(MapUnit::MapAppFont));
290 aFormPos = pDevice->LogicToPixel(aFormPos, MapMode(MapUnit::MapAppFont));
291
292 // add form position
293 aPos.AdjustWidth(aFormPos.Width() );
294 aPos.AdjustHeight(aFormPos.Height() );
295
296 // take window borders into account
297 bool bDecoration = true;
298 xPSetForm->getPropertyValue( DLGED_PROP_DECORATION ) >>= bDecoration;
299 if( bDecoration )
300 {
301 awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
302 aPos.AdjustWidth(aDeviceInfo.LeftInset );
303 aPos.AdjustHeight(aDeviceInfo.TopInset );
304 }
305
306 // convert pixel to 100th_mm
307 aPos = pDevice->PixelToLogic( aPos, MapMode( MapUnit::Map100thMM ) );
308 aSize = pDevice->PixelToLogic( aSize, MapMode( MapUnit::Map100thMM ) );
309
310 // set out parameters
311 nXOut = aPos.Width();
312 nYOut = aPos.Height();
313 nWidthOut = aSize.Width();
314 nHeightOut = aSize.Height();
315
316 return true;
317}
318
320 sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
321 sal_Int32& nXOut, sal_Int32& nYOut, sal_Int32& nWidthOut, sal_Int32& nHeightOut )
322{
323 // input position and size
324 Size aPos( nXIn, nYIn );
325 Size aSize( nWidthIn, nHeightIn );
326
327 // convert logic units to pixel
329 DBG_ASSERT( pDevice, "DlgEdObj::TransformFormToSdrCoordinates: missing default device!" );
330 if ( !pDevice )
331 return false;
332
333 // take window borders into account
334 DlgEdForm* pForm = nullptr;
335 if ( !lcl_getDlgEdForm( this, pForm ) )
336 return false;
337
338 aPos = pDevice->LogicToPixel(aPos, MapMode(MapUnit::MapAppFont));
339 aSize = pDevice->LogicToPixel(aSize, MapMode(MapUnit::MapAppFont));
340
341 // take window borders into account
342 Reference< beans::XPropertySet > xPSetForm( pForm->GetUnoControlModel(), UNO_QUERY );
343 DBG_ASSERT( xPSetForm.is(), "DlgEdObj::TransformFormToSdrCoordinates: no form property set!" );
344 if ( !xPSetForm.is() )
345 return false;
346 bool bDecoration = true;
347 xPSetForm->getPropertyValue( DLGED_PROP_DECORATION ) >>= bDecoration;
348 if( bDecoration )
349 {
350 awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
351 aSize.AdjustWidth(aDeviceInfo.LeftInset + aDeviceInfo.RightInset );
352 aSize.AdjustHeight(aDeviceInfo.TopInset + aDeviceInfo.BottomInset );
353 }
354
355 // convert pixel to 100th_mm
356 aPos = pDevice->PixelToLogic( aPos, MapMode( MapUnit::Map100thMM ) );
357 aSize = pDevice->PixelToLogic( aSize, MapMode( MapUnit::Map100thMM ) );
358
359 // set out parameters
360 nXOut = aPos.Width();
361 nYOut = aPos.Height();
362 nWidthOut = aSize.Width();
363 nHeightOut = aSize.Height();
364
365 return true;
366}
367
369{
370 // get control position and size from properties
372 if ( !xPSet.is() )
373 return;
374
375 sal_Int32 nXIn = 0, nYIn = 0, nWidthIn = 0, nHeightIn = 0;
376 xPSet->getPropertyValue( DLGED_PROP_POSITIONX ) >>= nXIn;
377 xPSet->getPropertyValue( DLGED_PROP_POSITIONY ) >>= nYIn;
378 xPSet->getPropertyValue( DLGED_PROP_WIDTH ) >>= nWidthIn;
379 xPSet->getPropertyValue( DLGED_PROP_HEIGHT ) >>= nHeightIn;
380
381 // transform coordinates
382 sal_Int32 nXOut, nYOut, nWidthOut, nHeightOut;
383 if ( TransformControlToSdrCoordinates( nXIn, nYIn, nWidthIn, nHeightIn, nXOut, nYOut, nWidthOut, nHeightOut ) )
384 {
385 // set rectangle position and size
386 Point aPoint( nXOut, nYOut );
387 Size aSize( nWidthOut, nHeightOut );
388 SetSnapRect( tools::Rectangle( aPoint, aSize ) );
389 }
390}
391
393{
394 // get control position and size from rectangle
395 tools::Rectangle aRect_ = GetSnapRect();
396 sal_Int32 nXIn = aRect_.Left();
397 sal_Int32 nYIn = aRect_.Top();
398 sal_Int32 nWidthIn = aRect_.GetWidth();
399 sal_Int32 nHeightIn = aRect_.GetHeight();
400
401 // transform coordinates
402 sal_Int32 nXOut, nYOut, nWidthOut, nHeightOut;
403 if ( TransformSdrToControlCoordinates( nXIn, nYIn, nWidthIn, nHeightIn, nXOut, nYOut, nWidthOut, nHeightOut ) )
404 {
405 // set properties
407 if ( xPSet.is() )
408 {
409 xPSet->setPropertyValue( DLGED_PROP_POSITIONX, Any(nXOut) );
410 xPSet->setPropertyValue( DLGED_PROP_POSITIONY, Any(nYOut) );
411 xPSet->setPropertyValue( DLGED_PROP_WIDTH, Any(nWidthOut) );
412 xPSet->setPropertyValue( DLGED_PROP_HEIGHT, Any(nHeightOut) );
413 }
414 }
415}
416
417void DlgEdObj::PositionAndSizeChange( const beans::PropertyChangeEvent& evt )
418{
419 DBG_ASSERT( pDlgEdForm, "DlgEdObj::PositionAndSizeChange: no form!" );
420 DlgEdPage& rPage = pDlgEdForm->GetDlgEditor().GetPage();
421 {
422 Size aPageSize = rPage.GetSize();
423 sal_Int32 nPageWidthIn = aPageSize.Width();
424 sal_Int32 nPageHeightIn = aPageSize.Height();
425 sal_Int32 nPageX, nPageY, nPageWidth, nPageHeight;
426 if ( TransformSdrToControlCoordinates( 0/*nPageXIn*/, 0/*nPageYIn*/, nPageWidthIn, nPageHeightIn, nPageX, nPageY, nPageWidth, nPageHeight ) )
427 {
429 if ( xPSet.is() )
430 {
431 sal_Int32 nX = 0, nY = 0, nWidth = 0, nHeight = 0;
432 xPSet->getPropertyValue( DLGED_PROP_POSITIONX ) >>= nX;
433 xPSet->getPropertyValue( DLGED_PROP_POSITIONY ) >>= nY;
434 xPSet->getPropertyValue( DLGED_PROP_WIDTH ) >>= nWidth;
435 xPSet->getPropertyValue( DLGED_PROP_HEIGHT ) >>= nHeight;
436
437 sal_Int32 nValue = 0;
438 evt.NewValue >>= nValue;
439 sal_Int32 nNewValue = nValue;
440
441 if ( evt.PropertyName == DLGED_PROP_POSITIONX )
442 {
443 if ( nNewValue + nWidth > nPageX + nPageWidth )
444 nNewValue = nPageX + nPageWidth - nWidth;
445 if ( nNewValue < nPageX )
446 nNewValue = nPageX;
447 }
448 else if ( evt.PropertyName == DLGED_PROP_POSITIONY )
449 {
450 if ( nNewValue + nHeight > nPageY + nPageHeight )
451 nNewValue = nPageY + nPageHeight - nHeight;
452 if ( nNewValue < nPageY )
453 nNewValue = nPageY;
454 }
455 else if ( evt.PropertyName == DLGED_PROP_WIDTH )
456 {
457 if ( nX + nNewValue > nPageX + nPageWidth )
458 nNewValue = nPageX + nPageWidth - nX;
459 if ( nNewValue < 1 )
460 nNewValue = 1;
461 }
462 else if ( evt.PropertyName == DLGED_PROP_HEIGHT )
463 {
464 if ( nY + nNewValue > nPageY + nPageHeight )
465 nNewValue = nPageY + nPageHeight - nY;
466 if ( nNewValue < 1 )
467 nNewValue = 1;
468 }
469
470 if ( nNewValue != nValue )
471 {
472 EndListening( false );
473 xPSet->setPropertyValue( evt.PropertyName, Any(nNewValue) );
475 }
476 }
477 }
478 }
479
481}
482
483void DlgEdObj::NameChange( const css::beans::PropertyChangeEvent& evt )
484{
485 // get old name
486 OUString aOldName;
487 evt.OldValue >>= aOldName;
488
489 // get new name
490 OUString aNewName;
491 evt.NewValue >>= aNewName;
492
493 if ( aNewName == aOldName )
494 return;
495
497 if ( !(xNameAcc.is() && xNameAcc->hasByName(aOldName)) )
498 return;
499
500 if (!xNameAcc->hasByName(aNewName) && !aNewName.isEmpty())
501 {
502 // remove the control by the old name and insert the control by the new name in the container
503 Reference< container::XNameContainer > xCont(xNameAcc, UNO_QUERY );
504 if ( xCont.is() )
505 {
507 Any aAny;
508 aAny <<= xCtrl;
509 xCont->removeByName( aOldName );
510 xCont->insertByName( aNewName , aAny );
511
513 &GetDialogEditor(), aAny, aNewName
514 );
515 }
516 }
517 else
518 {
519 // set old name property
520 EndListening(false);
522 xPSet->setPropertyValue( DLGED_PROP_NAME, Any(aOldName) );
524 }
525}
526
527sal_Int32 DlgEdObj::GetStep() const
528{
529 // get step property
530 sal_Int32 nStep = 0;
531 uno::Reference< beans::XPropertySet > xPSet( GetUnoControlModel(), uno::UNO_QUERY );
532 if (xPSet.is())
533 {
534 xPSet->getPropertyValue( DLGED_PROP_STEP ) >>= nStep;
535 }
536 return nStep;
537}
538
540{
541 sal_Int32 nCurStep = GetDlgEdForm()->GetStep();
542 sal_Int32 nStep = GetStep();
543
544 SdrLayerAdmin& rLayerAdmin(getSdrModelFromSdrObject().GetLayerAdmin());
545 SdrLayerID nHiddenLayerId = rLayerAdmin.GetLayerID( "HiddenLayer" );
546 SdrLayerID nControlLayerId = rLayerAdmin.GetLayerID( rLayerAdmin.GetControlLayerName() );
547
548 if( nCurStep )
549 {
550 if ( nStep && (nStep != nCurStep) )
551 {
552 SetLayer( nHiddenLayerId );
553 }
554 else
555 {
556 SetLayer( nControlLayerId );
557 }
558 }
559 else
560 {
561 SetLayer( nControlLayerId );
562 }
563}
564
565void DlgEdObj::TabIndexChange( const beans::PropertyChangeEvent& evt )
566{
567 DlgEdForm* pForm = GetDlgEdForm();
568 if ( !pForm )
569 return;
570
571 // stop listening with all children
572 std::vector<DlgEdObj*> aChildList = pForm->GetChildren();
573 for (auto const& child : aChildList)
574 {
575 child->EndListening( false );
576 }
577
578 Reference< container::XNameAccess > xNameAcc( pForm->GetUnoControlModel() , UNO_QUERY );
579 if ( xNameAcc.is() )
580 {
581 // get sequence of control names
582 Sequence< OUString > aNames = xNameAcc->getElementNames();
583 const OUString* pNames = aNames.getConstArray();
584 sal_Int32 nCtrls = aNames.getLength();
585
586 // create a map of tab indices and control names, sorted by tab index
587 IndexToNameMap aIndexToNameMap;
588 for ( sal_Int32 i = 0; i < nCtrls; ++i )
589 {
590 // get control name
591 OUString aName( pNames[i] );
592
593 // get tab index
594 sal_Int16 nTabIndex = -1;
595 Any aCtrl = xNameAcc->getByName( aName );
597 aCtrl >>= xPSet;
598 if ( xPSet.is() && xPSet == Reference< beans::XPropertySet >( evt.Source, UNO_QUERY ) )
599 evt.OldValue >>= nTabIndex;
600 else if ( xPSet.is() )
601 xPSet->getPropertyValue( DLGED_PROP_TABINDEX ) >>= nTabIndex;
602
603 // insert into map
604 aIndexToNameMap.emplace( nTabIndex, aName );
605 }
606
607 // create a helper list of control names, sorted by tab index
608 std::vector< OUString > aNameList( aIndexToNameMap.size() );
609 std::transform(
610 aIndexToNameMap.begin(), aIndexToNameMap.end(),
611 aNameList.begin(),
613 );
614
615 // check tab index
616 sal_Int16 nOldTabIndex = 0;
617 evt.OldValue >>= nOldTabIndex;
618 sal_Int16 nNewTabIndex = 0;
619 evt.NewValue >>= nNewTabIndex;
620 if ( nNewTabIndex < 0 )
621 nNewTabIndex = 0;
622 else if ( nNewTabIndex > nCtrls - 1 )
623 nNewTabIndex = sal::static_int_cast<sal_Int16>( nCtrls - 1 );
624
625 // reorder helper list
626 OUString aCtrlName = aNameList[nOldTabIndex];
627 aNameList.erase( aNameList.begin() + nOldTabIndex );
628 aNameList.insert( aNameList.begin() + nNewTabIndex , aCtrlName );
629
630 // set new tab indices
631 for ( sal_Int32 i = 0; i < nCtrls; ++i )
632 {
633 Any aCtrl = xNameAcc->getByName( aNameList[i] );
635 aCtrl >>= xPSet;
636 if ( xPSet.is() )
637 {
638 assert(i >= SAL_MIN_INT16);
639 if (i > SAL_MAX_INT16)
640 {
641 SAL_WARN("basctl", "tab " << i << " > SAL_MAX_INT16");
642 continue;
643 }
644 xPSet->setPropertyValue( DLGED_PROP_TABINDEX, Any(static_cast<sal_Int16>(i)) );
645 }
646 }
647
648 // reorder objects in drawing page
649 getSdrModelFromSdrObject().GetPage(0)->SetObjectOrdNum( nOldTabIndex + 1, nNewTabIndex + 1 );
650
652 }
653
654 // start listening with all children
655 for (auto const& child : aChildList)
656 {
657 child->StartListening();
658 }
659}
660
661bool DlgEdObj::supportsService( OUString const & serviceName ) const
662{
663 bool bSupports = false;
664
665 Reference< lang::XServiceInfo > xServiceInfo( GetUnoControlModel() , UNO_QUERY );
666 // TODO: cache xServiceInfo as member?
667 if ( xServiceInfo.is() )
668 bSupports = xServiceInfo->supportsService( serviceName );
669
670 return bSupports;
671}
672
674{
675 OUString sResId;
676 OUString aDefaultName;
677 if ( supportsService( "com.sun.star.awt.UnoControlDialogModel" ) )
678 {
679 sResId = RID_STR_CLASS_DIALOG;
680 }
681 else if ( supportsService( "com.sun.star.awt.UnoControlButtonModel" ) )
682 {
683 sResId = RID_STR_CLASS_BUTTON;
684 }
685 else if ( supportsService( "com.sun.star.awt.UnoControlRadioButtonModel" ) )
686 {
688 }
689 else if ( supportsService( "com.sun.star.awt.UnoControlCheckBoxModel" ) )
690 {
691 sResId = RID_STR_CLASS_CHECKBOX;
692 }
693 else if ( supportsService( "com.sun.star.awt.UnoControlListBoxModel" ) )
694 {
695 sResId = RID_STR_CLASS_LISTBOX;
696 }
697 else if ( supportsService( "com.sun.star.awt.UnoControlComboBoxModel" ) )
698 {
699 sResId = RID_STR_CLASS_COMBOBOX;
700 }
701 else if ( supportsService( "com.sun.star.awt.UnoControlGroupBoxModel" ) )
702 {
703 sResId = RID_STR_CLASS_GROUPBOX;
704 }
705 else if ( supportsService( "com.sun.star.awt.UnoControlEditModel" ) )
706 {
707 sResId = RID_STR_CLASS_EDIT;
708 }
709 else if ( supportsService( "com.sun.star.awt.UnoControlFixedTextModel" ) )
710 {
712 }
713 else if ( supportsService( "com.sun.star.awt.UnoControlImageControlModel" ) )
714 {
716 }
717 else if ( supportsService( "com.sun.star.awt.UnoControlProgressBarModel" ) )
718 {
720 }
721 else if ( supportsService( "com.sun.star.awt.UnoControlScrollBarModel" ) )
722 {
724 }
725 else if ( supportsService( "com.sun.star.awt.UnoControlFixedLineModel" ) )
726 {
728 }
729 else if ( supportsService( "com.sun.star.awt.UnoControlDateFieldModel" ) )
730 {
732 }
733 else if ( supportsService( "com.sun.star.awt.UnoControlTimeFieldModel" ) )
734 {
736 }
737 else if ( supportsService( "com.sun.star.awt.UnoControlNumericFieldModel" ) )
738 {
740 }
741 else if ( supportsService( "com.sun.star.awt.UnoControlCurrencyFieldModel" ) )
742 {
744 }
745 else if ( supportsService( "com.sun.star.awt.UnoControlFormattedFieldModel" ) )
746 {
748 }
749 else if ( supportsService( "com.sun.star.awt.UnoControlPatternFieldModel" ) )
750 {
752 }
753 else if ( supportsService( "com.sun.star.awt.UnoControlFileControlModel" ) )
754 {
756 }
757 else if ( supportsService( "com.sun.star.awt.tree.TreeControlModel" ) )
758 {
760 }
761 else if ( supportsService( "com.sun.star.awt.grid.UnoControlGridModel" ) )
762 {
764 }
765 else if ( supportsService( "com.sun.star.awt.UnoControlFixedHyperlinkModel" ) )
766 {
768 }
769 else if ( supportsService( "com.sun.star.awt.UnoControlSpinButtonModel" ) )
770 {
772 }
773 else
774 {
775 sResId = RID_STR_CLASS_CONTROL;
776 }
777
778 if (!sResId.isEmpty())
779 aDefaultName = sResId;
780
781 return aDefaultName;
782}
783
785{
786 OUString aUniqueName;
787 uno::Reference< container::XNameAccess > xNameAcc((GetDlgEdForm()->GetUnoControlModel()), uno::UNO_QUERY);
788
789 if ( xNameAcc.is() )
790 {
791 sal_Int32 n = 0;
792 OUString aDefaultName = GetDefaultName();
793
794 do
795 {
796 aUniqueName = aDefaultName + OUString::number(++n);
797 } while (xNameAcc->hasByName(aUniqueName));
798 }
799
800 return aUniqueName;
801}
802
804{
805 return SdrInventor::BasicDialog;
806}
807
809{
810 if ( supportsService( "com.sun.star.awt.UnoControlDialogModel" ))
811 {
812 return SdrObjKind::BasicDialogDialog;
813 }
814 else if ( supportsService( "com.sun.star.awt.UnoControlButtonModel" ))
815 {
816 return SdrObjKind::BasicDialogPushButton;
817 }
818 else if ( supportsService( "com.sun.star.awt.UnoControlRadioButtonModel" ))
819 {
820 return SdrObjKind::BasicDialogRadioButton;
821 }
822 else if ( supportsService( "com.sun.star.awt.UnoControlCheckBoxModel" ))
823 {
824 return SdrObjKind::BasicDialogCheckbox;
825 }
826 else if ( supportsService( "com.sun.star.awt.UnoControlListBoxModel" ))
827 {
828 return SdrObjKind::BasicDialogListbox;
829 }
830 else if ( supportsService( "com.sun.star.awt.UnoControlComboBoxModel" ))
831 {
832 return SdrObjKind::BasicDialogCombobox;
833 }
834 else if ( supportsService( "com.sun.star.awt.UnoControlGroupBoxModel" ))
835 {
836 return SdrObjKind::BasicDialogGroupBox;
837 }
838 else if ( supportsService( "com.sun.star.awt.UnoControlEditModel" ))
839 {
840 return SdrObjKind::BasicDialogEdit;
841 }
842 else if ( supportsService( "com.sun.star.awt.UnoControlFixedTextModel" ))
843 {
844 return SdrObjKind::BasicDialogFixedText;
845 }
846 else if ( supportsService( "com.sun.star.awt.UnoControlImageControlModel" ))
847 {
848 return SdrObjKind::BasicDialogImageControl;
849 }
850 else if ( supportsService( "com.sun.star.awt.UnoControlProgressBarModel" ))
851 {
852 return SdrObjKind::BasicDialogProgressbar;
853 }
854 else if ( supportsService( "com.sun.star.awt.UnoControlScrollBarModel" ))
855 {
856 return SdrObjKind::BasicDialogHorizontalScrollbar;
857 }
858 else if ( supportsService( "com.sun.star.awt.UnoControlFixedLineModel" ))
859 {
860 return SdrObjKind::BasicDialogHorizontalFixedLine;
861 }
862 else if ( supportsService( "com.sun.star.awt.UnoControlDateFieldModel" ))
863 {
864 return SdrObjKind::BasicDialogDateField;
865 }
866 else if ( supportsService( "com.sun.star.awt.UnoControlTimeFieldModel" ))
867 {
868 return SdrObjKind::BasicDialogTimeField;
869 }
870 else if ( supportsService( "com.sun.star.awt.UnoControlNumericFieldModel" ))
871 {
872 return SdrObjKind::BasicDialogNumericField;
873 }
874 else if ( supportsService( "com.sun.star.awt.UnoControlCurrencyFieldModel" ))
875 {
876 return SdrObjKind::BasicDialogCurencyField;
877 }
878 else if ( supportsService( "com.sun.star.awt.UnoControlFormattedFieldModel" ))
879 {
880 return SdrObjKind::BasicDialogFormattedField;
881 }
882 else if ( supportsService( "com.sun.star.awt.UnoControlPatternFieldModel" ))
883 {
884 return SdrObjKind::BasicDialogPatternField;
885 }
886 else if ( supportsService( "com.sun.star.awt.UnoControlFileControlModel" ))
887 {
888 return SdrObjKind::BasicDialogFileControl;
889 }
890 else if ( supportsService( "com.sun.star.awt.tree.TreeControlModel" ))
891 {
892 return SdrObjKind::BasicDialogTreeControl;
893 }
894 else if ( supportsService( "com.sun.star.awt.grid.UnoControlGridModel" ))
895 {
896 return SdrObjKind::BasicDialogGridControl;
897 }
898 else if ( supportsService( "com.sun.star.awt.UnoControlFixedHyperlinkModel" ))
899 {
900 return SdrObjKind::BasicDialogHyperlinkControl;
901 }
902 else
903 {
904 return SdrObjKind::BasicDialogControl;
905 }
906}
907
909{
910 return new DlgEdObj(rTargetModel, *this);
911}
912
914{
915 // no need to really add the clone for dragging, it's a temporary
916 // object
918}
919
920void DlgEdObj::NbcMove( const Size& rSize )
921{
922 SdrUnoObj::NbcMove( rSize );
923
924 // stop listening
925 EndListening(false);
926
927 // set geometry properties
929
930 // start listening
932
933 // dialog model changed
935}
936
937void DlgEdObj::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
938{
939 SdrUnoObj::NbcResize( rRef, xFract, yFract );
940
941 // stop listening
942 EndListening(false);
943
944 // set geometry properties
946
947 // start listening
949
950 // dialog model changed
952}
953
955{
956 bool bResult = SdrUnoObj::EndCreate(rStat, eCmd);
957
958 // tdf#120674 after interactive creation, the SdrObject (this) has no SdrPage yet
959 // due to not being inserted. Usually this should be handled in a ::handlePageChange
960 // implementation. For historical reasons, the SdrPage (which is the DlgEdPage) was
961 // already set. For now, get it from the SdrDragStat and use it to access and set
962 // the local pDlgEdForm
963 if(!pDlgEdForm && nullptr != rStat.GetPageView())
964 {
965 const DlgEdPage* pDlgEdPage(dynamic_cast<const DlgEdPage*>(rStat.GetPageView()->GetPage()));
966
967 if(nullptr != pDlgEdPage)
968 {
969 // set parent form
970 pDlgEdForm = pDlgEdPage->GetDlgEdForm();
971 }
972 }
973
974 SetDefaults();
976
977 return bResult;
978}
979
981{
982 if ( !pDlgEdForm )
983 return;
984
985 // add child to parent form
986 pDlgEdForm->AddChild( this );
987
989 if ( xPSet.is() )
990 {
991 // get unique name
992 OUString aOUniqueName( GetUniqueName() );
993
994 // set name property
995 xPSet->setPropertyValue( DLGED_PROP_NAME, Any(aOUniqueName) );
996
997 // set labels
998 if ( supportsService( "com.sun.star.awt.UnoControlButtonModel" ) ||
999 supportsService( "com.sun.star.awt.UnoControlRadioButtonModel" ) ||
1000 supportsService( "com.sun.star.awt.UnoControlCheckBoxModel" ) ||
1001 supportsService( "com.sun.star.awt.UnoControlGroupBoxModel" ) ||
1002 supportsService( "com.sun.star.awt.UnoControlFixedTextModel" ) )
1003 {
1004 xPSet->setPropertyValue( DLGED_PROP_LABEL, Any(aOUniqueName) );
1005 }
1006
1007 // set number formats supplier for formatted field
1008 if ( supportsService( "com.sun.star.awt.UnoControlFormattedFieldModel" ) )
1009 {
1011 if ( xSupplier.is() )
1012 {
1013 xPSet->setPropertyValue( DLGED_PROP_FORMATSSUPPLIER, Any(xSupplier) );
1014 }
1015 }
1016
1017 // set geometry properties
1019
1021 if ( xCont.is() )
1022 {
1023 // set tabindex
1024 Sequence< OUString > aNames = xCont->getElementNames();
1025 uno::Any aTabIndex;
1026 aTabIndex <<= static_cast<sal_Int16>(aNames.getLength());
1027 xPSet->setPropertyValue( DLGED_PROP_TABINDEX, aTabIndex );
1028
1029 // set step
1030 Reference< beans::XPropertySet > xPSetForm( xCont, UNO_QUERY );
1031 if ( xPSetForm.is() )
1032 {
1033 Any aStep = xPSetForm->getPropertyValue( DLGED_PROP_STEP );
1034 xPSet->setPropertyValue( DLGED_PROP_STEP, aStep );
1035 }
1036
1037 // insert control model in dialog model
1038 Reference< awt::XControlModel > xCtrl( xPSet , UNO_QUERY );
1039 Any aAny;
1040 aAny <<= xCtrl;
1041 xCont->insertByName( aOUniqueName , aAny );
1042
1044 &GetDialogEditor(), aAny, aOUniqueName
1045 );
1046
1047 pDlgEdForm->UpdateTabOrderAndGroups();
1048 }
1049 }
1050
1051 // dialog model changed
1052 pDlgEdForm->GetDlgEditor().SetDialogModelChanged();
1053}
1054
1056{
1057 DBG_ASSERT(!isListening(), "DlgEdObj::StartListening: already listening!");
1058
1059 if (isListening())
1060 return;
1061
1062 bIsListening = true;
1063
1064 // XPropertyChangeListener
1065 Reference< XPropertySet > xControlModel( GetUnoControlModel() , UNO_QUERY );
1066 if (!m_xPropertyChangeListener.is() && xControlModel.is())
1067 {
1068 // create listener
1070
1071 // register listener to properties
1072 xControlModel->addPropertyChangeListener( OUString() , m_xPropertyChangeListener );
1073 }
1074
1075 // XContainerListener
1076 Reference< XScriptEventsSupplier > xEventsSupplier( GetUnoControlModel() , UNO_QUERY );
1077 if( !m_xContainerListener.is() && xEventsSupplier.is() )
1078 {
1079 // create listener
1081
1082 // register listener to script event container
1083 Reference< XNameContainer > xEventCont = xEventsSupplier->getEvents();
1084 DBG_ASSERT(xEventCont.is(), "DlgEdObj::StartListening: control model has no script event container!");
1085 Reference< XContainer > xCont( xEventCont , UNO_QUERY );
1086 if (xCont.is())
1087 xCont->addContainerListener( m_xContainerListener );
1088 }
1089}
1090
1091void DlgEdObj::EndListening(bool bRemoveListener)
1092{
1093 DBG_ASSERT(isListening(), "DlgEdObj::EndListening: not listening currently!");
1094
1095 if (!isListening())
1096 return;
1097
1098 bIsListening = false;
1099
1100 if (!bRemoveListener)
1101 return;
1102
1103 // XPropertyChangeListener
1104 Reference< XPropertySet > xControlModel(GetUnoControlModel(), UNO_QUERY);
1105 if ( m_xPropertyChangeListener.is() && xControlModel.is() )
1106 {
1107 // remove listener
1108 xControlModel->removePropertyChangeListener( OUString() , m_xPropertyChangeListener );
1109 }
1111
1112 // XContainerListener
1113 Reference< XScriptEventsSupplier > xEventsSupplier( GetUnoControlModel() , UNO_QUERY );
1114 if( m_xContainerListener.is() && xEventsSupplier.is() )
1115 {
1116 // remove listener
1117 Reference< XNameContainer > xEventCont = xEventsSupplier->getEvents();
1118 DBG_ASSERT(xEventCont.is(), "DlgEdObj::EndListening: control model has no script event container!");
1119 Reference< XContainer > xCont( xEventCont , UNO_QUERY );
1120 if (xCont.is())
1121 xCont->removeContainerListener( m_xContainerListener );
1122 }
1123 m_xContainerListener.clear();
1124}
1125
1126void DlgEdObj::_propertyChange( const css::beans::PropertyChangeEvent& evt )
1127{
1128 if (!isListening())
1129 return;
1130
1131 DlgEdForm* pRealDlgEdForm = dynamic_cast<DlgEdForm*>(this);
1132 if (!pRealDlgEdForm)
1133 pRealDlgEdForm = GetDlgEdForm();
1134 if (!pRealDlgEdForm)
1135 return;
1136 DlgEditor& rDlgEditor = pRealDlgEdForm->GetDlgEditor();
1137 if (rDlgEditor.isInPaint())
1138 return;
1139
1140 // dialog model changed
1141 rDlgEditor.SetDialogModelChanged();
1142
1143 // update position and size
1144 if ( evt.PropertyName == DLGED_PROP_POSITIONX || evt.PropertyName == DLGED_PROP_POSITIONY ||
1145 evt.PropertyName == DLGED_PROP_WIDTH || evt.PropertyName == DLGED_PROP_HEIGHT ||
1146 evt.PropertyName == DLGED_PROP_DECORATION )
1147 {
1148 PositionAndSizeChange( evt );
1149
1150 if ( evt.PropertyName == DLGED_PROP_DECORATION )
1152 }
1153 // change name of control in dialog model
1154 else if ( evt.PropertyName == DLGED_PROP_NAME )
1155 {
1156 if (!dynamic_cast<DlgEdForm*>(this))
1157 {
1158 try
1159 {
1160 NameChange(evt);
1161 }
1162 catch (container::NoSuchElementException const&)
1163 {
1164 css::uno::Any anyEx = cppu::getCaughtException();
1165 throw lang::WrappedTargetRuntimeException("", nullptr,
1166 anyEx);
1167 }
1168 }
1169 }
1170 // update step
1171 else if ( evt.PropertyName == DLGED_PROP_STEP )
1172 {
1173 UpdateStep();
1174 }
1175 // change tabindex
1176 else if ( evt.PropertyName == DLGED_PROP_TABINDEX )
1177 {
1178 if (!dynamic_cast<DlgEdForm*>(this))
1179 TabIndexChange(evt);
1180 }
1181}
1182
1184{
1185 if (isListening())
1186 {
1187 // dialog model changed
1189 }
1190}
1191
1193{
1194 if (isListening())
1195 {
1196 // dialog model changed
1198 }
1199}
1200
1202{
1203 if (isListening())
1204 {
1205 // dialog model changed
1207 }
1208}
1209
1211{
1212 SdrLayerID nOldLayer = GetLayer();
1213
1214 if ( nLayer != nOldLayer )
1215 {
1216 SdrUnoObj::SetLayer( nLayer );
1217
1218 DlgEdHint aHint( DlgEdHint::LAYERCHANGED, this );
1219 GetDlgEdForm()->GetDlgEditor().Broadcast( aHint );
1220 }
1221}
1222
1224 SdrModel& rSdrModel,
1225 DlgEditor& rDlgEditor_)
1226: DlgEdObj(rSdrModel),
1227 rDlgEditor(rDlgEditor_)
1228{
1229}
1230
1232{
1233}
1234
1236{
1237 // get form position and size from properties
1239 if ( !xPSet.is() )
1240 return;
1241
1242 sal_Int32 nXIn = 0, nYIn = 0, nWidthIn = 0, nHeightIn = 0;
1243 xPSet->getPropertyValue( DLGED_PROP_POSITIONX ) >>= nXIn;
1244 xPSet->getPropertyValue( DLGED_PROP_POSITIONY ) >>= nYIn;
1245 xPSet->getPropertyValue( DLGED_PROP_WIDTH ) >>= nWidthIn;
1246 xPSet->getPropertyValue( DLGED_PROP_HEIGHT ) >>= nHeightIn;
1247
1248 // transform coordinates
1249 sal_Int32 nXOut, nYOut, nWidthOut, nHeightOut;
1250 if ( TransformFormToSdrCoordinates( nXIn, nYIn, nWidthIn, nHeightIn, nXOut, nYOut, nWidthOut, nHeightOut ) )
1251 {
1252 // set rectangle position and size
1253 Point aPoint( nXOut, nYOut );
1254 Size aSize( nWidthOut, nHeightOut );
1255 SetSnapRect( tools::Rectangle( aPoint, aSize ) );
1256 }
1257}
1258
1260{
1261 // get form position and size from rectangle
1262 tools::Rectangle aRect_ = GetSnapRect();
1263 sal_Int32 nXIn = aRect_.Left();
1264 sal_Int32 nYIn = aRect_.Top();
1265 sal_Int32 nWidthIn = aRect_.GetWidth();
1266 sal_Int32 nHeightIn = aRect_.GetHeight();
1267
1268 // transform coordinates
1269 sal_Int32 nXOut, nYOut, nWidthOut, nHeightOut;
1270 if ( TransformSdrToFormCoordinates( nXIn, nYIn, nWidthIn, nHeightIn, nXOut, nYOut, nWidthOut, nHeightOut ) )
1271 {
1272 // set properties
1274 if ( xPSet.is() )
1275 {
1276 xPSet->setPropertyValue( DLGED_PROP_POSITIONX, Any(nXOut) );
1277 xPSet->setPropertyValue( DLGED_PROP_POSITIONY, Any(nYOut) );
1278 xPSet->setPropertyValue( DLGED_PROP_WIDTH, Any(nWidthOut) );
1279 xPSet->setPropertyValue( DLGED_PROP_HEIGHT, Any(nHeightOut) );
1280 }
1281 }
1282}
1283
1285{
1286 pChildren.push_back( pDlgEdObj );
1287}
1288
1290{
1291 pChildren.erase( std::remove( pChildren.begin() , pChildren.end() , pDlgEdObj ) );
1292}
1293
1294void DlgEdForm::PositionAndSizeChange( const beans::PropertyChangeEvent& evt )
1295{
1296 DlgEditor& rEditor = GetDlgEditor();
1297 DlgEdPage& rPage = rEditor.GetPage();
1298
1299 sal_Int32 nPageXIn = 0;
1300 sal_Int32 nPageYIn = 0;
1301 Size aPageSize = rPage.GetSize();
1302 sal_Int32 nPageWidthIn = aPageSize.Width();
1303 sal_Int32 nPageHeightIn = aPageSize.Height();
1304 sal_Int32 nPageX, nPageY, nPageWidth, nPageHeight;
1305 if ( TransformSdrToFormCoordinates( nPageXIn, nPageYIn, nPageWidthIn, nPageHeightIn, nPageX, nPageY, nPageWidth, nPageHeight ) )
1306 {
1307 Reference< beans::XPropertySet > xPSetForm( GetUnoControlModel(), UNO_QUERY );
1308 if ( xPSetForm.is() )
1309 {
1310 sal_Int32 nValue = 0;
1311 evt.NewValue >>= nValue;
1312 sal_Int32 nNewValue = nValue;
1313
1314 if ( evt.PropertyName == DLGED_PROP_POSITIONX )
1315 {
1316 if ( nNewValue < nPageX )
1317 nNewValue = nPageX;
1318 }
1319 else if ( evt.PropertyName == DLGED_PROP_POSITIONY )
1320 {
1321 if ( nNewValue < nPageY )
1322 nNewValue = nPageY;
1323 }
1324 else if ( evt.PropertyName == DLGED_PROP_WIDTH )
1325 {
1326 if ( nNewValue < 1 )
1327 nNewValue = 1;
1328 }
1329 else if ( evt.PropertyName == DLGED_PROP_HEIGHT )
1330 {
1331 if ( nNewValue < 1 )
1332 nNewValue = 1;
1333 }
1334
1335 if ( nNewValue != nValue )
1336 {
1337 EndListening( false );
1338 xPSetForm->setPropertyValue( evt.PropertyName, Any(nNewValue) );
1340 }
1341 }
1342 }
1343
1344 bool bAdjustedPageSize = rEditor.AdjustPageSize();
1346 std::vector<DlgEdObj*> const& aChildList = GetChildren();
1347
1348 if ( bAdjustedPageSize )
1349 {
1350 rEditor.InitScrollBars();
1351 aPageSize = rPage.GetSize();
1352 nPageWidthIn = aPageSize.Width();
1353 nPageHeightIn = aPageSize.Height();
1354 if ( TransformSdrToControlCoordinates( nPageXIn, nPageYIn, nPageWidthIn, nPageHeightIn, nPageX, nPageY, nPageWidth, nPageHeight ) )
1355 {
1356 for (auto const& child : aChildList)
1357 {
1358 Reference< beans::XPropertySet > xPSet( child->GetUnoControlModel(), UNO_QUERY );
1359 if ( xPSet.is() )
1360 {
1361 sal_Int32 nX = 0, nY = 0, nWidth = 0, nHeight = 0;
1362 xPSet->getPropertyValue( DLGED_PROP_POSITIONX ) >>= nX;
1363 xPSet->getPropertyValue( DLGED_PROP_POSITIONY ) >>= nY;
1364 xPSet->getPropertyValue( DLGED_PROP_WIDTH ) >>= nWidth;
1365 xPSet->getPropertyValue( DLGED_PROP_HEIGHT ) >>= nHeight;
1366
1367 sal_Int32 nNewX = nX;
1368 if ( nX + nWidth > nPageX + nPageWidth )
1369 {
1370 nNewX = nPageX + nPageWidth - nWidth;
1371 if ( nNewX < nPageX )
1372 nNewX = nPageX;
1373 }
1374 if ( nNewX != nX )
1375 {
1376 EndListening( false );
1377 xPSet->setPropertyValue( DLGED_PROP_POSITIONX, Any(nNewX) );
1379 }
1380
1381 sal_Int32 nNewY = nY;
1382 if ( nY + nHeight > nPageY + nPageHeight )
1383 {
1384 nNewY = nPageY + nPageHeight - nHeight;
1385 if ( nNewY < nPageY )
1386 nNewY = nPageY;
1387 }
1388 if ( nNewY != nY )
1389 {
1390 EndListening( false );
1391 xPSet->setPropertyValue( DLGED_PROP_POSITIONY, Any(nNewY) );
1393 }
1394 }
1395 }
1396 }
1397 }
1398
1399 for (auto const& child : aChildList)
1400 child->SetRectFromProps();
1401}
1402
1404{
1405 SdrPage* pSdrPage = getSdrPageFromSdrObject();
1406
1407 if ( pSdrPage )
1408 {
1409 const size_t nObjCount = pSdrPage->GetObjCount();
1410 for ( size_t i = 0 ; i < nObjCount ; i++ )
1411 {
1412 DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(pSdrPage->GetObj(i));
1413 if (pDlgEdObj && !dynamic_cast<DlgEdForm*>(pDlgEdObj))
1414 pDlgEdObj->UpdateStep();
1415 }
1416 }
1417}
1418
1420{
1421 // stop listening with all children
1422 for (auto const& child : pChildren)
1423 {
1424 child->EndListening( false );
1425 }
1426
1428 if ( xNameAcc.is() )
1429 {
1430 // get sequence of control names
1431 Sequence< OUString > aNames = xNameAcc->getElementNames();
1432 const OUString* pNames = aNames.getConstArray();
1433 sal_Int32 nCtrls = aNames.getLength();
1434
1435 // create a map of tab indices and control names, sorted by tab index
1436 IndexToNameMap aIndexToNameMap;
1437 for ( sal_Int32 i = 0; i < nCtrls; ++i )
1438 {
1439 // get name
1440 OUString aName( pNames[i] );
1441
1442 // get tab index
1443 sal_Int16 nTabIndex = -1;
1444 Any aCtrl = xNameAcc->getByName( aName );
1446 aCtrl >>= xPSet;
1447 if ( xPSet.is() )
1448 xPSet->getPropertyValue( DLGED_PROP_TABINDEX ) >>= nTabIndex;
1449
1450 // insert into map
1451 aIndexToNameMap.emplace( nTabIndex, aName );
1452 }
1453
1454 // set new tab indices
1455 sal_Int16 nNewTabIndex = 0;
1456 for (auto const& indexToName : aIndexToNameMap)
1457 {
1458 Any aCtrl = xNameAcc->getByName( indexToName.second );
1460 aCtrl >>= xPSet;
1461 if ( xPSet.is() )
1462 {
1463 xPSet->setPropertyValue( DLGED_PROP_TABINDEX, Any(nNewTabIndex) );
1464 nNewTabIndex++;
1465 }
1466 }
1467
1469 }
1470
1471 // start listening with all children
1472 for (auto const& child : pChildren)
1473 {
1474 child->StartListening();
1475 }
1476}
1477
1479{
1480 // When the tabindex of a control model changes, the dialog control is
1481 // notified about those changes. Due to #109067# (bad performance of
1482 // dialog editor) the dialog control doesn't activate the tab order
1483 // in design mode. When the dialog editor has reordered all
1484 // tabindices, this method allows to activate the taborder afterwards.
1485
1487 if ( xCont.is() )
1488 {
1489 Sequence< Reference< awt::XTabController > > aSeqTabCtrls = xCont->getTabControllers();
1490 const Reference< awt::XTabController >* pTabCtrls = aSeqTabCtrls.getConstArray();
1491 sal_Int32 nCount = aSeqTabCtrls.getLength();
1492 for ( sal_Int32 i = 0; i < nCount; ++i )
1493 pTabCtrls[i]->activateTabOrder();
1494 }
1495}
1496
1498{
1499 // The grouping of radio buttons in a dialog is done by vcl.
1500 // In the dialog editor we have two views (=controls) for one
1501 // radio button model. One control is owned by the dialog control,
1502 // but not visible in design mode. The other control is owned by
1503 // the drawing layer object. Whereas the grouping of the first
1504 // control is done by vcl, the grouping of the control in the
1505 // drawing layer has to be done here.
1506
1508 if ( !xTabModel.is() )
1509 return;
1510
1511 // create a global list of controls that belong to the dialog
1512 std::vector<DlgEdObj*> aChildList = GetChildren();
1513 sal_uInt32 nSize = aChildList.size();
1514 Sequence< Reference< awt::XControl > > aSeqControls( nSize );
1515 for ( sal_uInt32 i = 0; i < nSize; ++i )
1516 aSeqControls.getArray()[i] = aChildList[i]->GetControl();
1517
1518 sal_Int32 nGroupCount = xTabModel->getGroupCount();
1519 for ( sal_Int32 nGroup = 0; nGroup < nGroupCount; ++nGroup )
1520 {
1521 // get a list of control models that belong to this group
1522 OUString aName;
1524 xTabModel->getGroup( nGroup, aSeqModels, aName );
1525 const Reference< awt::XControlModel >* pModels = aSeqModels.getConstArray();
1526 sal_Int32 nModelCount = aSeqModels.getLength();
1527
1528 // create a list of peers that belong to this group
1529 Sequence< Reference< awt::XWindow > > aSeqPeers( nModelCount );
1530 for ( sal_Int32 nModel = 0; nModel < nModelCount; ++nModel )
1531 {
1532 // for each control model find the corresponding control in the global list
1533 const Reference< awt::XControl >* pControls = aSeqControls.getConstArray();
1534 sal_Int32 nControlCount = aSeqControls.getLength();
1535 for ( sal_Int32 nControl = 0; nControl < nControlCount; ++nControl )
1536 {
1537 const Reference< awt::XControl > xCtrl( pControls[nControl] );
1538 if ( xCtrl.is() )
1539 {
1540 Reference< awt::XControlModel > xCtrlModel( xCtrl->getModel() );
1541 if ( xCtrlModel.get() == pModels[nModel].get() )
1542 {
1543 // get the control peer and insert into the list of peers
1544 aSeqPeers.getArray()[ nModel ].set( xCtrl->getPeer(), UNO_QUERY );
1545 break;
1546 }
1547 }
1548 }
1549 }
1550
1551 // set the group at the dialog peer
1553 if ( xDlg.is() )
1554 {
1555 Reference< awt::XVclContainerPeer > xDlgPeer( xDlg->getPeer(), UNO_QUERY );
1556 if ( xDlgPeer.is() )
1557 xDlgPeer->setGroup( aSeqPeers );
1558 }
1559 }
1560}
1561
1563{
1565 UpdateGroups();
1566}
1567
1568void DlgEdForm::NbcMove( const Size& rSize )
1569{
1570 SdrUnoObj::NbcMove( rSize );
1571
1572 // set geometry properties of form
1573 EndListening(false);
1576
1577 // set geometry properties of all children
1578 for (auto const& child : pChildren)
1579 {
1580 child->EndListening(false);
1581 child->SetPropsFromRect();
1582 child->StartListening();
1583 }
1584
1585 // dialog model changed
1587}
1588
1589void DlgEdForm::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
1590{
1591 SdrUnoObj::NbcResize( rRef, xFract, yFract );
1592
1593 // set geometry properties of form
1594 EndListening(false);
1597
1598 // set geometry properties of all children
1599 for (auto const& child : pChildren)
1600 {
1601 child->EndListening(false);
1602 child->SetPropsFromRect();
1603 child->StartListening();
1604 }
1605
1606 // dialog model changed
1608}
1609
1611{
1612 bool bResult = SdrUnoObj::EndCreate(rStat, eCmd);
1613
1614 // stop listening
1615 EndListening(false);
1616
1617 // set geometry properties
1619
1620 // dialog model changed
1622
1623 // start listening
1625
1626 return bResult;
1627}
1628
1629awt::DeviceInfo DlgEdForm::getDeviceInfo() const
1630{
1631 awt::DeviceInfo aDeviceInfo;
1632
1633 DlgEditor& rEditor = GetDlgEditor();
1634 vcl::Window& rWindow = rEditor.GetWindow();
1635
1636 // obtain an XControl
1637 ::utl::SharedUNOComponent< awt::XControl > xDialogControl; // ensures auto-disposal, if needed
1639 if ( !xDialogControl.is() )
1640 {
1641 // don't create a temporary control all the time, this method here is called
1642 // way too often. Instead, use a cached DeviceInfo.
1643 // #i74065#
1644 if ( !!mpDeviceInfo )
1645 return *mpDeviceInfo;
1646
1647 Reference< awt::XControlContainer > xEditorControlContainer( rEditor.GetWindowControlContainer() );
1648 xDialogControl.reset(
1649 GetTemporaryControlForWindow(rWindow, xEditorControlContainer),
1651 );
1652 }
1653
1654 Reference< awt::XDevice > xDialogDevice;
1655 if ( xDialogControl.is() )
1656 xDialogDevice.set( xDialogControl->getPeer(), UNO_QUERY );
1657 DBG_ASSERT( xDialogDevice.is(), "DlgEdForm::getDeviceInfo: no device!" );
1658 if ( xDialogDevice.is() )
1659 aDeviceInfo = xDialogDevice->getInfo();
1660
1661 mpDeviceInfo = aDeviceInfo;
1662
1663 return aDeviceInfo;
1664}
1666{
1667 // Need to flesh this out, currently we will only support data-aware controls for calc
1668 // and only handle a subset of functionality e.g. linked-cell and cell range data source. Of course later
1669 // we need to disambiguate for writer ( and others ? ) and also support the generic form (db) bindings
1670 // we need some more work in xmlscript to be able to handle that
1674 if ( !xFac.is() )
1675 return;
1676
1677 //tdf#90361 and tdf#104011 CellValueBinding and CellRangeListSource are unusable
1678 //without being initialized, so use createInstanceWithArguments with a
1679 //dummy BoundCell and CellRange instead of createInstance. This at least results in
1680 //the dialog editor not falling.
1681 css::beans::NamedValue aCellValue;
1682 aCellValue.Name = "BoundCell";
1683 css::table::CellAddress aCellAddress;
1684 aCellValue.Value <<= aCellAddress;
1685
1686 css::beans::NamedValue aCellRange;
1687 aCellRange.Name = "CellRange";
1688 css::table::CellRangeAddress aRangeAddress;
1689 aCellRange.Value <<= aRangeAddress;
1690
1691 Sequence< Any > aArgs{ Any(aCellValue), Any(aCellRange) };
1692
1693 if ( xBindable.is() )
1694 {
1695 Reference< form::binding::XValueBinding > xBinding( xFac->createInstanceWithArguments( "com.sun.star.table.CellValueBinding", aArgs ), UNO_QUERY );
1696 xBindable->setValueBinding( xBinding );
1697 }
1698 if ( xListEntrySink.is() )
1699 {
1700 Reference< form::binding::XListEntrySource > xSource( xFac->createInstanceWithArguments( "com.sun.star.table.CellRangeListSource", aArgs ), UNO_QUERY );
1701 xListEntrySink->setListEntrySource( xSource );
1702 }
1703}
1704} // namespace basctl
1705
1706/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static OutputDevice * GetDefaultDevice()
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
virtual const tools::Rectangle & GetSnapRect() const override
SdrPageView * GetPageView() const
const OUString & GetControlLayerName() const
SdrLayerID GetLayerID(const OUString &rName) const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
virtual SdrObject * SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum)
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
SdrModel & getSdrModelFromSdrObject() const
SdrPage * getSdrPageFromSdrObject() const
virtual void SetSnapRect(const tools::Rectangle &rRect)
virtual SdrLayerID GetLayer() const
virtual void SetLayer(SdrLayerID nLayer)
SdrPage * GetPage() const
Size GetSize() const
virtual void NbcMove(const Size &rSiz) override
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
css::uno::Reference< css::awt::XControl > GetTemporaryControlForWindow(const vcl::Window &_rWindow, css::uno::Reference< css::awt::XControlContainer > &_inout_ControlContainer) const
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
css::uno::Reference< css::awt::XControl > GetUnoControl(const SdrView &_rView, const OutputDevice &_rOut) const
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
SdrUnoObj(SdrModel &rSdrModel, const OUString &rModelName)
void Broadcast(const SfxHint &rHint)
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
tools::Long AdjustWidth(tools::Long n)
constexpr tools::Long Width() const
virtual void PositionAndSizeChange(const css::beans::PropertyChangeEvent &evt) override
Definition: dlgedobj.cxx:1294
virtual void UpdateStep() override
Definition: dlgedobj.cxx:1403
virtual void SetRectFromProps() override
Definition: dlgedobj.cxx:1235
void RemoveChild(DlgEdObj *pDlgEdObj)
Definition: dlgedobj.cxx:1289
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: dlgedobj.cxx:1589
DlgEditor & GetDlgEditor() const
Definition: dlgedobj.hxx:172
std::vector< DlgEdObj * > const & GetChildren() const
Definition: dlgedobj.hxx:176
css::awt::DeviceInfo getDeviceInfo() const
Definition: dlgedobj.cxx:1629
virtual void NbcMove(const Size &rSize) override
Definition: dlgedobj.cxx:1568
mutable ::std::optional< css::awt::DeviceInfo > mpDeviceInfo
Definition: dlgedobj.hxx:156
std::vector< DlgEdObj * > pChildren
Definition: dlgedobj.hxx:154
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
Definition: dlgedobj.cxx:1610
void AddChild(DlgEdObj *pDlgEdObj)
Definition: dlgedobj.cxx:1284
virtual void SetPropsFromRect() override
Definition: dlgedobj.cxx:1259
void UpdateTabIndices()
Definition: dlgedobj.cxx:1419
virtual ~DlgEdForm() override
Definition: dlgedobj.cxx:1231
void UpdateTabOrderAndGroups()
Definition: dlgedobj.cxx:1562
rtl::Reference< DlgEdForm > pDlgEdForm
Definition: dlgedobj.hxx:53
css::uno::Reference< css::beans::XPropertyChangeListener > m_xPropertyChangeListener
Definition: dlgedobj.hxx:54
sal_Int32 GetStep() const
Definition: dlgedobj.cxx:527
css::uno::Reference< css::awt::XControl > GetControl() const
Definition: dlgedobj.cxx:148
virtual SdrObjKind GetObjIdentifier() const override
Definition: dlgedobj.cxx:808
css::uno::Reference< css::container::XContainerListener > m_xContainerListener
Definition: dlgedobj.hxx:55
bool isListening() const
Definition: dlgedobj.hxx:80
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
Definition: dlgedobj.cxx:954
bool TransformSdrToControlCoordinates(sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn, sal_Int32 &nXOut, sal_Int32 &nYOut, sal_Int32 &nWidthOut, sal_Int32 &nHeightOut)
Definition: dlgedobj.cxx:159
void _elementRemoved()
Definition: dlgedobj.cxx:1201
friend class DlgEdForm
Definition: dlgedobj.hxx:49
DlgEdForm * GetDlgEdForm() const
Definition: dlgedobj.hxx:97
bool supportsService(OUString const &serviceName) const
Definition: dlgedobj.cxx:661
void _elementInserted()
Definition: dlgedobj.cxx:1183
DlgEdObj(SdrModel &rSdrModel)
Definition: dlgedobj.cxx:71
OUString GetUniqueName() const
Definition: dlgedobj.cxx:784
virtual void SetRectFromProps()
Definition: dlgedobj.cxx:368
void StartListening()
Definition: dlgedobj.cxx:1055
void NameChange(const css::beans::PropertyChangeEvent &evt)
Definition: dlgedobj.cxx:483
void TabIndexChange(const css::beans::PropertyChangeEvent &evt)
Definition: dlgedobj.cxx:565
OUString GetDefaultName() const
Definition: dlgedobj.cxx:673
virtual void SetLayer(SdrLayerID nLayer) override
Definition: dlgedobj.cxx:1210
friend class DlgEdPropListenerImpl
Definition: dlgedobj.hxx:48
void MakeDataAware(const css::uno::Reference< css::frame::XModel > &xModel)
Definition: dlgedobj.cxx:1665
virtual ~DlgEdObj() override
Definition: dlgedobj.cxx:124
DlgEditor & GetDialogEditor()
Definition: dlgedobj.cxx:63
bool TransformControlToSdrCoordinates(sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn, sal_Int32 &nXOut, sal_Int32 &nYOut, sal_Int32 &nWidthOut, sal_Int32 &nHeightOut)
Definition: dlgedobj.cxx:261
bool TransformSdrToFormCoordinates(sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn, sal_Int32 &nXOut, sal_Int32 &nYOut, sal_Int32 &nWidthOut, sal_Int32 &nHeightOut)
Definition: dlgedobj.cxx:214
void SetDefaults()
Definition: dlgedobj.cxx:980
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const override
Definition: dlgedobj.cxx:908
void EndListening(bool bRemoveListener)
Definition: dlgedobj.cxx:1091
virtual SdrInventor GetObjInventor() const override
Definition: dlgedobj.cxx:803
virtual rtl::Reference< SdrObject > getFullDragClone() const override
Definition: dlgedobj.cxx:913
virtual void PositionAndSizeChange(const css::beans::PropertyChangeEvent &evt)
Definition: dlgedobj.cxx:417
bool TransformFormToSdrCoordinates(sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn, sal_Int32 &nXOut, sal_Int32 &nYOut, sal_Int32 &nWidthOut, sal_Int32 &nHeightOut)
Definition: dlgedobj.cxx:319
virtual void NbcMove(const Size &rSize) override
Definition: dlgedobj.cxx:920
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: dlgedobj.cxx:937
void _elementReplaced()
Definition: dlgedobj.cxx:1192
void _propertyChange(const css::beans::PropertyChangeEvent &evt)
Definition: dlgedobj.cxx:1126
virtual void UpdateStep()
Definition: dlgedobj.cxx:539
virtual void SetPropsFromRect()
Definition: dlgedobj.cxx:392
DlgEdForm * GetDlgEdForm() const
Definition: dlgedpage.hxx:45
bool AdjustPageSize()
Definition: dlged.cxx:1187
void SetDialogModelChanged()
Definition: dlged.hxx:175
css::uno::Reference< css::awt::XControlContainer > const & GetWindowControlContainer()
returns the control container associated with our window
Definition: dlged.cxx:247
void ResetDialog()
Definition: dlged.cxx:402
DlgEdView & GetView() const
Definition: dlged.hxx:167
vcl::Window & GetWindow() const
Definition: dlged.hxx:143
void InitScrollBars()
Definition: dlged.cxx:262
DlgEdPage & GetPage() const
Definition: dlged.hxx:168
css::uno::Reference< css::util::XNumberFormatsSupplier > const & GetNumberFormatsSupplier()
Definition: dlged.cxx:420
bool isInPaint() const
Definition: dlged.hxx:205
static void setControlResourceIDsForNewEditorObject(DlgEditor const *pEditor, const css::uno::Any &rControlAny, std::u16string_view aCtrlName)
static void renameControlResourceIDsForEditorObject(DlgEditor const *pEditor, const css::uno::Any &rControlAny, std::u16string_view aNewCtrlName)
constexpr tools::Long GetWidth() const
constexpr tools::Long Top() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
void reset(const css::uno::Reference< INTERFACE > &_rxComponent, AssignmentMode _eMode=TakeOwnership)
::OutputDevice const * GetOutDev() const
int nCount
#define DBG_ASSERT(sCon, aError)
sal_Int16 nValue
OUString aName
sal_Int64 n
#define SAL_WARN(area, stream)
constexpr OUStringLiteral DLGED_PROP_NAME
Definition: dlgeddef.hxx:33
constexpr OUStringLiteral DLGED_PROP_FORMATSSUPPLIER
Definition: dlgeddef.hxx:30
constexpr OUStringLiteral DLGED_PROP_LABEL
Definition: dlgeddef.hxx:32
std::multimap< sal_Int16, OUString > IndexToNameMap
Definition: dlgedobj.hxx:34
constexpr OUStringLiteral DLGED_PROP_STEP
Definition: dlgeddef.hxx:37
constexpr OUStringLiteral DLGED_PROP_WIDTH
Definition: dlgeddef.hxx:41
constexpr OUStringLiteral DLGED_PROP_POSITIONX
Definition: dlgeddef.hxx:35
constexpr OUStringLiteral DLGED_PROP_TABINDEX
Definition: dlgeddef.hxx:38
constexpr OUStringLiteral DLGED_PROP_HEIGHT
Definition: dlgeddef.hxx:31
constexpr OUStringLiteral DLGED_PROP_DECORATION
Definition: dlgeddef.hxx:42
constexpr OUStringLiteral DLGED_PROP_POSITIONY
Definition: dlgeddef.hxx:36
Any SAL_CALL getCaughtException()
int i
constexpr OUStringLiteral RID_STR_CLASS_DIALOG
Definition: strings.hxx:17
constexpr OUStringLiteral RID_STR_CLASS_CHECKBOX
Definition: strings.hxx:20
constexpr OUStringLiteral RID_STR_CLASS_FILECONTROL
Definition: strings.hxx:36
constexpr OUStringLiteral RID_STR_CLASS_GROUPBOX
Definition: strings.hxx:23
constexpr OUStringLiteral RID_STR_CLASS_FIXEDTEXT
Definition: strings.hxx:25
constexpr OUStringLiteral RID_STR_CLASS_TIMEFIELD
Definition: strings.hxx:31
constexpr OUStringLiteral RID_STR_CLASS_LISTBOX
Definition: strings.hxx:21
constexpr OUStringLiteral RID_STR_CLASS_FORMATTEDFIELD
Definition: strings.hxx:34
constexpr OUStringLiteral RID_STR_CLASS_PATTERNFIELD
Definition: strings.hxx:35
constexpr OUStringLiteral RID_STR_CLASS_GRIDCONTROL
Definition: strings.hxx:38
constexpr OUStringLiteral RID_STR_CLASS_RADIOBUTTON
Definition: strings.hxx:19
constexpr OUStringLiteral RID_STR_CLASS_TREECONTROL
Definition: strings.hxx:37
constexpr OUStringLiteral RID_STR_CLASS_CURRENCYFIELD
Definition: strings.hxx:33
constexpr OUStringLiteral RID_STR_CLASS_PROGRESSBAR
Definition: strings.hxx:27
constexpr OUStringLiteral RID_STR_CLASS_BUTTON
Definition: strings.hxx:18
constexpr OUStringLiteral RID_STR_CLASS_NUMERICFIELD
Definition: strings.hxx:32
constexpr OUStringLiteral RID_STR_CLASS_DATEFIELD
Definition: strings.hxx:30
constexpr OUStringLiteral RID_STR_CLASS_SPINCONTROL
Definition: strings.hxx:39
constexpr OUStringLiteral RID_STR_CLASS_SCROLLBAR
Definition: strings.hxx:28
constexpr OUStringLiteral RID_STR_CLASS_CONTROL
Definition: strings.hxx:16
constexpr OUStringLiteral RID_STR_CLASS_COMBOBOX
Definition: strings.hxx:22
constexpr OUStringLiteral RID_STR_CLASS_IMAGECONTROL
Definition: strings.hxx:26
constexpr OUStringLiteral RID_STR_CLASS_EDIT
Definition: strings.hxx:24
constexpr OUStringLiteral RID_STR_CLASS_HYPERLINKCONTROL
Definition: strings.hxx:40
constexpr OUStringLiteral RID_STR_CLASS_FIXEDLINE
Definition: strings.hxx:29
Reference< XModel > xModel
SdrInventor
SdrObjKind
SdrCreateCmd
#define SAL_MIN_INT16
#define SAL_MAX_INT16