1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_extensions.hxx"
31 #include "controltype.hxx"
32 #include "propctrlr.hrc"
33 #include "extensio.hrc"
34 #include "fontdialog.hxx"
35 #include "formcomponenthandler.hxx"
36 #include "formlinkdialog.hxx"
37 #include "formmetadata.hxx"
38 #include "formresid.hrc"
39 #include "formstrings.hxx"
40 #include "handlerhelper.hxx"
41 #include "listselectiondlg.hxx"
42 #include "pcrcommon.hxx"
43 #include "selectlabeldialog.hxx"
44 #include "taborder.hxx"
45 #include "usercontrol.hxx"
47 /** === begin UNO includes === **/
48 #include <com/sun/star/lang/NullPointerException.hpp>
49 #include <com/sun/star/awt/XControlModel.hpp>
50 #include <com/sun/star/lang/XServiceInfo.hpp>
51 #include <com/sun/star/form/FormComponentType.hpp>
52 #include <com/sun/star/beans/PropertyAttribute.hpp>
53 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
54 #include <com/sun/star/container/XNameAccess.hpp>
55 #include <com/sun/star/form/XForm.hpp>
56 #include <com/sun/star/container/XChild.hpp>
57 #include <com/sun/star/sdbc/XConnection.hpp>
58 #include <com/sun/star/sdb/CommandType.hpp>
59 #include <com/sun/star/form/XGridColumnFactory.hpp>
60 #include <com/sun/star/sdb/SQLContext.hpp>
61 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
62 #include <com/sun/star/sdb/XQueriesSupplier.hpp>
63 #include <com/sun/star/form/ListSourceType.hpp>
64 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
65 #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
66 #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
67 #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
68 #include <com/sun/star/awt/XTabControllerModel.hpp>
69 #include <com/sun/star/form/FormSubmitEncoding.hpp>
70 #include <com/sun/star/awt/VisualEffect.hpp>
71 #include <com/sun/star/form/FormButtonType.hpp>
72 #include <com/sun/star/inspection/PropertyControlType.hpp>
73 #include <com/sun/star/util/MeasureUnit.hpp>
74 #include <com/sun/star/inspection/XObjectInspectorUI.hpp>
75 #include <com/sun/star/inspection/PropertyLineElement.hpp>
76 #include <com/sun/star/resource/XStringResourceManager.hpp>
77 #include <com/sun/star/resource/MissingResourceException.hpp>
78 #include <com/sun/star/graphic/GraphicObject.hpp>
79 #include <com/sun/star/text/WritingMode2.hpp>
80 /** === end UNO includes === **/
82 #include <comphelper/extract.hxx>
83 #include <connectivity/dbconversion.hxx>
84 #include <connectivity/dbexception.hxx>
85 #include <cppuhelper/exc_hlp.hxx>
86 #include <sfx2/app.hxx>
87 #include <sfx2/basedlgs.hxx>
88 #include <sfx2/docfilt.hxx>
89 #include <sfx2/filedlghelper.hxx>
90 #include <svl/ctloptions.hxx>
91 #include <svtools/colrdlg.hxx>
92 #include <svl/filenotation.hxx>
93 #include <svl/intitem.hxx>
94 #include <svl/itemset.hxx>
95 #include <unotools/moduleoptions.hxx>
96 #include <svl/numuno.hxx>
97 #include <svl/urihelper.hxx>
98 #include <svx/dialogs.hrc>
99 #include <svx/numinf.hxx>
100 #include <svx/svxdlg.hxx>
101 #include <svx/svxids.hrc>
102 #include <toolkit/helper/vclunohelper.hxx>
103 #include <tools/diagnose_ex.h>
104 #include <vcl/msgbox.hxx>
105 #include <vcl/stdtext.hxx>
106 #include <vcl/wrkwin.hxx>
107 #include <tools/StringListResource.hxx>
111 #define GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:"
112 //------------------------------------------------------------------------
113 extern "C" void SAL_CALL
createRegistryInfo_FormComponentPropertyHandler()
115 ::pcr::FormComponentPropertyHandler::registerImplementation();
118 //........................................................................
121 //........................................................................
123 using namespace ::com::sun::star
;
125 using namespace lang
;
126 using namespace beans
;
127 using namespace frame
;
128 using namespace script
;
129 using namespace form
;
130 using namespace util
;
133 using namespace sdbc
;
134 using namespace sdbcx
;
135 using namespace form
;
136 using namespace container
;
137 using namespace ui::dialogs
;
138 using namespace inspection
;
139 using namespace ::dbtools
;
141 namespace WritingMode2
= ::com::sun::star::text::WritingMode2
;
143 //====================================================================
144 //= FormComponentPropertyHandler
145 //====================================================================
146 DBG_NAME( FormComponentPropertyHandler
)
147 #define PROPERTY_ID_ROWSET 1
148 //--------------------------------------------------------------------
149 FormComponentPropertyHandler::FormComponentPropertyHandler( const Reference
< XComponentContext
>& _rxContext
)
150 :FormComponentPropertyHandler_Base( _rxContext
)
151 ,::comphelper::OPropertyContainer(FormComponentPropertyHandler_Base::rBHelper
)
152 ,m_sDefaultValueString( String( PcrRes( RID_STR_STANDARD
) ) )
153 ,m_eComponentClass( eUnknown
)
154 ,m_bComponentIsSubForm( false )
155 ,m_bHaveListSource( false )
156 ,m_bHaveCommand( false )
159 DBG_CTOR( FormComponentPropertyHandler
, NULL
);
160 registerProperty(PROPERTY_ROWSET
,PROPERTY_ID_ROWSET
,0,&m_xRowSet
,::getCppuType(&m_xRowSet
));
163 //--------------------------------------------------------------------
164 FormComponentPropertyHandler::~FormComponentPropertyHandler()
166 DBG_DTOR( FormComponentPropertyHandler
, NULL
);
168 //--------------------------------------------------------------------
169 IMPLEMENT_FORWARD_XINTERFACE2(FormComponentPropertyHandler
,FormComponentPropertyHandler_Base
,::comphelper::OPropertyContainer
)
170 //--------------------------------------------------------------------
171 ::rtl::OUString SAL_CALL
FormComponentPropertyHandler::getImplementationName_static( ) throw (RuntimeException
)
173 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.extensions.FormComponentPropertyHandler" ) );
176 //--------------------------------------------------------------------
177 Sequence
< ::rtl::OUString
> SAL_CALL
FormComponentPropertyHandler::getSupportedServiceNames_static( ) throw (RuntimeException
)
179 Sequence
< ::rtl::OUString
> aSupported( 1 );
180 aSupported
[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.inspection.FormComponentPropertyHandler" ) );
184 //============================================
185 // TODO: -> export from toolkit
186 struct LanguageDependentProp
188 const char* pPropName
;
189 sal_Int32 nPropNameLength
;
192 static LanguageDependentProp aLanguageDependentProp
[] =
198 { "CurrencySymbol", 14 },
199 { "StringItemList", 14 },
205 bool lcl_isLanguageDependentProperty( ::rtl::OUString aName
)
209 LanguageDependentProp
* pLangDepProp
= aLanguageDependentProp
;
210 while( pLangDepProp
->pPropName
!= 0 )
212 if( aName
.equalsAsciiL( pLangDepProp
->pPropName
, pLangDepProp
->nPropNameLength
))
222 Reference
< resource::XStringResourceResolver
> lcl_getStringResourceResolverForProperty
223 ( Reference
< XPropertySet
> _xComponent
, const ::rtl::OUString
& _rPropertyName
,
224 const Any
& _rPropertyValue
)
226 Reference
< resource::XStringResourceResolver
> xRet
;
227 const TypeClass eType
= _rPropertyValue
.getValueType().getTypeClass();
228 if ( (eType
== TypeClass_STRING
|| eType
== TypeClass_SEQUENCE
) &&
229 lcl_isLanguageDependentProperty( _rPropertyName
) )
231 static const ::rtl::OUString
s_sResourceResolverPropName(RTL_CONSTASCII_USTRINGPARAM("ResourceResolver"));
233 Reference
< resource::XStringResourceResolver
> xStringResourceResolver
;
236 xStringResourceResolver
.set( _xComponent
->getPropertyValue( s_sResourceResolverPropName
),UNO_QUERY
);
237 if( xStringResourceResolver
.is() &&
238 xStringResourceResolver
->getLocales().getLength() > 0 )
240 xRet
= xStringResourceResolver
;
243 catch(UnknownPropertyException
&)
253 //--------------------------------------------------------------------
254 Any
FormComponentPropertyHandler::impl_getPropertyValue_throw( const ::rtl::OUString
& _rPropertyName
) const
256 const PropertyId
nPropId( impl_getPropertyId_throw( _rPropertyName
) );
258 Any
aPropertyValue( m_xComponent
->getPropertyValue( _rPropertyName
) );
260 Reference
< resource::XStringResourceResolver
> xStringResourceResolver
261 = lcl_getStringResourceResolverForProperty( m_xComponent
, _rPropertyName
, aPropertyValue
);
262 if( xStringResourceResolver
.is() )
264 TypeClass eType
= aPropertyValue
.getValueType().getTypeClass();
265 if( eType
== TypeClass_STRING
)
267 ::rtl::OUString aPropStr
;
268 aPropertyValue
>>= aPropStr
;
269 if( aPropStr
.getLength() > 1 )
271 ::rtl::OUString aPureIdStr
= aPropStr
.copy( 1 );
272 if( xStringResourceResolver
->hasEntryForId( aPureIdStr
) )
274 ::rtl::OUString aResourceStr
= xStringResourceResolver
->resolveString( aPureIdStr
);
275 aPropertyValue
<<= aResourceStr
;
280 else if( eType
== TypeClass_SEQUENCE
)
282 Sequence
< ::rtl::OUString
> aStrings
;
283 aPropertyValue
>>= aStrings
;
285 const ::rtl::OUString
* pStrings
= aStrings
.getConstArray();
286 sal_Int32 nCount
= aStrings
.getLength();
288 Sequence
< ::rtl::OUString
> aResolvedStrings
;
289 aResolvedStrings
.realloc( nCount
);
290 ::rtl::OUString
* pResolvedStrings
= aResolvedStrings
.getArray();
293 for ( sal_Int32 i
= 0; i
< nCount
; ++i
)
295 ::rtl::OUString aIdStr
= pStrings
[i
];
296 ::rtl::OUString aPureIdStr
= aIdStr
.copy( 1 );
297 if( xStringResourceResolver
->hasEntryForId( aPureIdStr
) )
298 pResolvedStrings
[i
] = xStringResourceResolver
->resolveString( aPureIdStr
);
300 pResolvedStrings
[i
] = aIdStr
;
303 catch( resource::MissingResourceException
& )
305 aPropertyValue
<<= aResolvedStrings
;
309 impl_normalizePropertyValue_nothrow( aPropertyValue
, nPropId
);
311 return aPropertyValue
;
314 //--------------------------------------------------------------------
315 Any SAL_CALL
FormComponentPropertyHandler::getPropertyValue( const ::rtl::OUString
& _rPropertyName
) throw (UnknownPropertyException
, RuntimeException
)
317 if( _rPropertyName
== PROPERTY_ROWSET
)
318 return ::comphelper::OPropertyContainer::getPropertyValue( _rPropertyName
);
320 ::osl::MutexGuard
aGuard( m_aMutex
);
321 return impl_getPropertyValue_throw( _rPropertyName
);
324 //--------------------------------------------------------------------
325 void SAL_CALL
FormComponentPropertyHandler::setPropertyValue( const ::rtl::OUString
& _rPropertyName
, const Any
& _rValue
) throw (UnknownPropertyException
, RuntimeException
)
327 if( _rPropertyName
== PROPERTY_ROWSET
)
329 ::comphelper::OPropertyContainer::setPropertyValue( _rPropertyName
, _rValue
);
333 ::osl::MutexGuard
aGuard( m_aMutex
);
334 PropertyId
nPropId( impl_getPropertyId_throw( _rPropertyName
) ); // check if property is known by the handler
336 Reference
< graphic::XGraphicObject
> xGrfObj
;
337 if ( PROPERTY_ID_IMAGE_URL
== nPropId
&& ( _rValue
>>= xGrfObj
) )
339 DBG_ASSERT( xGrfObj
.is(), "FormComponentPropertyHandler::setPropertyValue() xGrfObj is invalid");
340 rtl::OUString
sObjectID( RTL_CONSTASCII_USTRINGPARAM( GRAPHOBJ_URLPREFIX
) );
341 sObjectID
= sObjectID
+ xGrfObj
->getUniqueID();
342 m_xComponent
->setPropertyValue( _rPropertyName
, uno::makeAny( sObjectID
) );
344 else if ( PROPERTY_ID_FONT
== nPropId
)
346 // special handling, the value is a faked value we generated ourself in impl_executeFontDialog_nothrow
347 Sequence
< NamedValue
> aFontPropertyValues
;
348 OSL_VERIFY( _rValue
>>= aFontPropertyValues
);
349 const NamedValue
* fontPropertyValue
= aFontPropertyValues
.getConstArray();
350 const NamedValue
* fontPropertyValueEnd
= fontPropertyValue
+ aFontPropertyValues
.getLength();
351 for ( ; fontPropertyValue
!= fontPropertyValueEnd
; ++fontPropertyValue
)
352 m_xComponent
->setPropertyValue( fontPropertyValue
->Name
, fontPropertyValue
->Value
);
356 Any aValue
= _rValue
;
358 Reference
< resource::XStringResourceResolver
> xStringResourceResolver
359 = lcl_getStringResourceResolverForProperty( m_xComponent
, _rPropertyName
, _rValue
);
360 if( xStringResourceResolver
.is() )
362 Reference
< resource::XStringResourceManager
>
363 xStringResourceManager( xStringResourceResolver
, UNO_QUERY
);
364 if( xStringResourceManager
.is() )
366 Any
aPropertyValue( m_xComponent
->getPropertyValue( _rPropertyName
) );
367 TypeClass eType
= aPropertyValue
.getValueType().getTypeClass();
368 if( eType
== TypeClass_STRING
)
370 ::rtl::OUString aPropStr
;
371 aPropertyValue
>>= aPropStr
;
372 if( aPropStr
.getLength() > 1 )
374 ::rtl::OUString aPureIdStr
= aPropStr
.copy( 1 );
375 ::rtl::OUString aValueStr
;
376 _rValue
>>= aValueStr
;
377 xStringResourceManager
->setString( aPureIdStr
, aValueStr
);
378 aValue
= aPropertyValue
; // set value to force modified
382 else if( eType
== TypeClass_SEQUENCE
)
384 static ::rtl::OUString aDot
= ::rtl::OUString::createFromAscii( "." );
385 static ::rtl::OUString aEsc
= ::rtl::OUString::createFromAscii( "&" );
387 // Put strings into resource using new ids
388 Sequence
< ::rtl::OUString
> aNewStrings
;
389 _rValue
>>= aNewStrings
;
391 const ::rtl::OUString
* pNewStrings
= aNewStrings
.getConstArray();
392 sal_Int32 nNewCount
= aNewStrings
.getLength();
395 ::rtl::OUString
* pNewPureIds
= new ::rtl::OUString
[nNewCount
];
396 ::rtl::OUString aIdStrBase
= aDot
;
397 Any aNameAny
= m_xComponent
->getPropertyValue(PROPERTY_NAME
);
398 ::rtl::OUString sControlName
;
399 aNameAny
>>= sControlName
;
400 aIdStrBase
+= sControlName
;
402 aIdStrBase
+= _rPropertyName
;
404 ::rtl::OUString aDummyStr
;
405 for ( i
= 0; i
< nNewCount
; ++i
)
407 sal_Int32 nUniqueId
= xStringResourceManager
->getUniqueNumericId();
408 ::rtl::OUString aPureIdStr
= ::rtl::OUString::valueOf( nUniqueId
);
409 aPureIdStr
+= aIdStrBase
;
410 pNewPureIds
[i
] = aPureIdStr
;
411 // Force usage of next Unique Id
412 xStringResourceManager
->setString( aPureIdStr
, aDummyStr
);
415 // Move strings to new Ids for all locales
416 Sequence
< Locale
> aLocaleSeq
= xStringResourceManager
->getLocales();
417 const Locale
* pLocale
= aLocaleSeq
.getConstArray();
418 sal_Int32 nLocaleCount
= aLocaleSeq
.getLength();
419 Sequence
< ::rtl::OUString
> aOldIdStrings
;
420 aPropertyValue
>>= aOldIdStrings
;
423 const ::rtl::OUString
* pOldIdStrings
= aOldIdStrings
.getConstArray();
424 sal_Int32 nOldIdCount
= aOldIdStrings
.getLength();
425 for ( i
= 0; i
< nNewCount
; ++i
)
427 ::rtl::OUString aOldIdStr
;
428 ::rtl::OUString aOldPureIdStr
;
429 if( i
< nOldIdCount
)
431 aOldIdStr
= pOldIdStrings
[i
];
432 aOldPureIdStr
= aOldIdStr
.copy( 1 );
434 ::rtl::OUString aNewPureIdStr
= pNewPureIds
[i
];
436 for ( sal_Int32 iLocale
= 0; iLocale
< nLocaleCount
; ++iLocale
)
438 Locale aLocale
= pLocale
[iLocale
];
440 ::rtl::OUString aResourceStr
;
441 if( aOldPureIdStr
.getLength() != 0 )
443 if( xStringResourceManager
->hasEntryForIdAndLocale( aOldPureIdStr
, aLocale
) )
445 aResourceStr
= xStringResourceManager
->
446 resolveStringForLocale( aOldPureIdStr
, aLocale
);
449 xStringResourceManager
->setStringForLocale( aNewPureIdStr
, aResourceStr
, aLocale
);
453 catch( resource::MissingResourceException
& )
457 // Set new strings for current locale and create
458 // new Id sequence as new property value
459 Sequence
< ::rtl::OUString
> aNewIdStrings
;
460 aNewIdStrings
.realloc( nNewCount
);
461 ::rtl::OUString
* pNewIdStrings
= aNewIdStrings
.getArray();
462 for ( i
= 0; i
< nNewCount
; ++i
)
464 ::rtl::OUString aPureIdStr
= pNewPureIds
[i
];
465 ::rtl::OUString aStr
= pNewStrings
[i
];
466 xStringResourceManager
->setString( aPureIdStr
, aStr
);
468 ::rtl::OUString aIdStr
= aEsc
;
469 aIdStr
+= aPureIdStr
;
470 pNewIdStrings
[i
] = aIdStr
;
472 aValue
<<= aNewIdStrings
;
474 // Remove old ids from resource for all locales
475 const ::rtl::OUString
* pOldIdStrings
= aOldIdStrings
.getConstArray();
476 sal_Int32 nOldIdCount
= aOldIdStrings
.getLength();
477 for( i
= 0 ; i
< nOldIdCount
; ++i
)
479 ::rtl::OUString aIdStr
= pOldIdStrings
[i
];
480 ::rtl::OUString aPureIdStr
= aIdStr
.copy( 1 );
481 for ( sal_Int32 iLocale
= 0; iLocale
< nLocaleCount
; ++iLocale
)
483 Locale aLocale
= pLocale
[iLocale
];
486 xStringResourceManager
->removeIdForLocale( aPureIdStr
, aLocale
);
488 catch( resource::MissingResourceException
& )
492 delete[] pNewPureIds
;
497 m_xComponent
->setPropertyValue( _rPropertyName
, aValue
);
501 //--------------------------------------------------------------------
502 Any SAL_CALL
FormComponentPropertyHandler::convertToPropertyValue( const ::rtl::OUString
& _rPropertyName
, const Any
& _rControlValue
) throw (UnknownPropertyException
, RuntimeException
)
504 ::osl::MutexGuard
aGuard( m_aMutex
);
505 PropertyId
nPropId( impl_getPropertyId_throw( _rPropertyName
) );
506 Property
aProperty( impl_getPropertyFromId_throw( nPropId
) );
508 Any
aPropertyValue( _rControlValue
);
509 if ( !aPropertyValue
.hasValue() )
511 if ( ( aProperty
.Attributes
& PropertyAttribute::MAYBEVOID
) == 0 )
512 // default construct an instance of the proper type
513 aPropertyValue
= Any( NULL
, aProperty
.Type
);
515 return aPropertyValue
;
518 /// care for the special "default" string, translate it to VOID
519 if ( m_aPropertiesWithDefListEntry
.find( _rPropertyName
) != m_aPropertiesWithDefListEntry
.end() )
521 // it's a control with a string list
522 ::rtl::OUString sStringValue
;
523 if ( _rControlValue
>>= sStringValue
)
524 { // note that ColorListBoxes might transfer values either as string or as css.util.Color,
525 // so this check here is important
526 if ( sStringValue
== m_sDefaultValueString
)
533 case PROPERTY_ID_DATASOURCE
:
535 ::rtl::OUString sControlValue
;
536 OSL_VERIFY( _rControlValue
>>= sControlValue
);
538 if ( sControlValue
.getLength() )
540 Reference
< XNameAccess
> xDatabaseContext
;
541 m_aContext
.createComponent( (::rtl::OUString
)SERVICE_DATABASE_CONTEXT
, xDatabaseContext
);
542 if ( !xDatabaseContext
.is() || !xDatabaseContext
->hasByName( sControlValue
) )
544 ::svt::OFileNotation
aTransformer(sControlValue
);
545 aPropertyValue
<<= ::rtl::OUString( aTransformer
.get( ::svt::OFileNotation::N_URL
) );
549 break; // case PROPERTY_ID_DATASOURCE
551 case PROPERTY_ID_SHOW_POSITION
:
552 case PROPERTY_ID_SHOW_NAVIGATION
:
553 case PROPERTY_ID_SHOW_RECORDACTIONS
:
554 case PROPERTY_ID_SHOW_FILTERSORT
:
556 ::rtl::OUString sControlValue
;
557 OSL_VERIFY( _rControlValue
>>= sControlValue
);
559 ::std::vector
< ::rtl::OUString
> aListEntries
;
560 tools::StringListResource
aRes( PcrRes( RID_RSC_ENUM_SHOWHIDE
), aListEntries
);
561 OSL_ENSURE( aListEntries
.size() == 2, "FormComponentPropertyHandler::convertToPropertyValue: broken resource for Show/Hide!" );
562 sal_Bool bShow
= ( aListEntries
.size() < 2 ) || ( sControlValue
== aListEntries
[1] );
564 aPropertyValue
<<= bShow
;
568 case PROPERTY_ID_TARGET_URL
:
569 case PROPERTY_ID_IMAGE_URL
:
571 ::rtl::OUString sControlValue
;
572 OSL_VERIFY( _rControlValue
>>= sControlValue
);
573 // Don't convert a placeholder
574 if ( nPropId
== PROPERTY_ID_IMAGE_URL
&& sControlValue
.equals( String( PcrRes( RID_EMBED_IMAGE_PLACEHOLDER
) ) ) )
575 aPropertyValue
<<= sControlValue
;
578 INetURLObject
aDocURL( impl_getDocumentURL_nothrow() );
579 aPropertyValue
<<= (::rtl::OUString
)URIHelper::SmartRel2Abs( aDocURL
, sControlValue
, Link(), false, true, INetURLObject::WAS_ENCODED
, INetURLObject::DECODE_TO_IURI
);
584 case PROPERTY_ID_DATEMIN
:
585 case PROPERTY_ID_DATEMAX
:
586 case PROPERTY_ID_DEFAULT_DATE
:
587 case PROPERTY_ID_DATE
:
590 OSL_VERIFY( _rControlValue
>>= aDate
);
591 aPropertyValue
<<= (sal_Int32
)DBTypeConversion::toINT32( aDate
);
595 case PROPERTY_ID_TIMEMIN
:
596 case PROPERTY_ID_TIMEMAX
:
597 case PROPERTY_ID_DEFAULT_TIME
:
598 case PROPERTY_ID_TIME
:
601 OSL_VERIFY( _rControlValue
>>= aTime
);
602 aPropertyValue
<<= (sal_Int32
)DBTypeConversion::toINT32( aTime
);
606 case PROPERTY_ID_WRITING_MODE
:
608 aPropertyValue
= FormComponentPropertyHandler_Base::convertToPropertyValue( _rPropertyName
, _rControlValue
);
610 sal_Int16
nNormalizedValue( 2 );
611 OSL_VERIFY( aPropertyValue
>>= nNormalizedValue
);
612 sal_Int16 nWritingMode
= WritingMode2::CONTEXT
;
613 switch ( nNormalizedValue
)
615 case 0: nWritingMode
= WritingMode2::LR_TB
; break;
616 case 1: nWritingMode
= WritingMode2::RL_TB
; break;
617 case 2: nWritingMode
= WritingMode2::CONTEXT
; break;
619 OSL_ENSURE( false, "FormComponentPropertyHandler::convertToPropertyValue: unexpected 'normalized value' for WritingMode!" );
620 nWritingMode
= WritingMode2::CONTEXT
;
624 aPropertyValue
<<= nWritingMode
;
629 aPropertyValue
= FormComponentPropertyHandler_Base::convertToPropertyValue( _rPropertyName
, _rControlValue
);
632 } // switch ( nPropId )
634 return aPropertyValue
;
637 //--------------------------------------------------------------------
638 Any SAL_CALL
FormComponentPropertyHandler::convertToControlValue( const ::rtl::OUString
& _rPropertyName
, const Any
& _rPropertyValue
, const Type
& _rControlValueType
) throw (UnknownPropertyException
, RuntimeException
)
640 ::osl::MutexGuard
aGuard( m_aMutex
);
641 sal_Int32 nPropId
= m_pInfoService
->getPropertyId( _rPropertyName
);
642 DBG_ASSERT( nPropId
!= -1, "FormComponentPropertyHandler::convertToPropertyValue: not one of my properties!!" );
644 Property
aProperty( impl_getPropertyFromId_throw( nPropId
) );
646 Any
aControlValue( _rPropertyValue
);
647 if ( !aControlValue
.hasValue() )
649 // if the property is represented with a list box or color list box, we need to
650 // translate this into the string "Default"
651 if ( m_aPropertiesWithDefListEntry
.find( _rPropertyName
) != m_aPropertiesWithDefListEntry
.end() )
652 aControlValue
<<= m_sDefaultValueString
;
654 return aControlValue
;
659 //////////////////////////////////////////////////////////////
660 case PROPERTY_ID_SHOW_POSITION
:
661 case PROPERTY_ID_SHOW_NAVIGATION
:
662 case PROPERTY_ID_SHOW_RECORDACTIONS
:
663 case PROPERTY_ID_SHOW_FILTERSORT
:
665 ::std::vector
< ::rtl::OUString
> aListEntries
;
666 tools::StringListResource
aRes( PcrRes( RID_RSC_ENUM_SHOWHIDE
), aListEntries
);
667 OSL_ENSURE( aListEntries
.size() == 2, "FormComponentPropertyHandler::convertToControlValue: broken resource for Show/Hide!" );
669 if ( aListEntries
.size() == 2 )
671 ::rtl::OUString sControlValue
= ::comphelper::getBOOL( _rPropertyValue
)
674 aControlValue
<<= sControlValue
;
679 //////////////////////////////////////////////////////////////
680 case PROPERTY_ID_DATASOURCE
:
682 OSL_ENSURE( _rControlValueType
.getTypeClass() == TypeClass_STRING
,
683 "FormComponentPropertyHandler::convertToControlValue: wrong ControlValueType!" );
685 ::rtl::OUString sDataSource
;
686 _rPropertyValue
>>= sDataSource
;
687 if ( sDataSource
.getLength() )
689 ::svt::OFileNotation
aTransformer( sDataSource
);
690 sDataSource
= aTransformer
.get( ::svt::OFileNotation::N_SYSTEM
);
692 aControlValue
<<= sDataSource
;
696 //////////////////////////////////////////////////////////////
697 case PROPERTY_ID_CONTROLLABEL
:
699 ::rtl::OUString sControlValue
;
701 Reference
< XPropertySet
> xSet
;
702 _rPropertyValue
>>= xSet
;
703 Reference
< XPropertySetInfo
> xPSI
;
705 xPSI
= xSet
->getPropertySetInfo();
706 if ( xPSI
.is() && xPSI
->hasPropertyByName( PROPERTY_LABEL
) )
708 ::rtl::OUStringBuffer aValue
;
709 aValue
.append( (sal_Unicode
)'<' );
710 ::rtl::OUString sLabel
;
711 OSL_VERIFY( xSet
->getPropertyValue( PROPERTY_LABEL
) >>= sLabel
);
712 aValue
.append( sLabel
);
713 aValue
.append( (sal_Unicode
)'>' );
714 sControlValue
= aValue
.makeStringAndClear();
717 aControlValue
<<= sControlValue
;
721 //////////////////////////////////////////////////////////////
722 case PROPERTY_ID_DATEMIN
:
723 case PROPERTY_ID_DATEMAX
:
724 case PROPERTY_ID_DEFAULT_DATE
:
725 case PROPERTY_ID_DATE
:
728 OSL_VERIFY( _rPropertyValue
>>= nDate
);
729 aControlValue
<<= DBTypeConversion::toDate( nDate
);
733 case PROPERTY_ID_TIMEMIN
:
734 case PROPERTY_ID_TIMEMAX
:
735 case PROPERTY_ID_DEFAULT_TIME
:
736 case PROPERTY_ID_TIME
:
739 OSL_VERIFY( _rPropertyValue
>>= nTime
);
740 aControlValue
<<= DBTypeConversion::toTime( nTime
);
744 case PROPERTY_ID_WRITING_MODE
:
746 sal_Int16
nWritingMode( WritingMode2::CONTEXT
);
747 OSL_VERIFY( _rPropertyValue
>>= nWritingMode
);
748 sal_Int16 nNormalized
= 2;
749 switch ( nWritingMode
)
751 case WritingMode2::LR_TB
: nNormalized
= 0; break;
752 case WritingMode2::RL_TB
: nNormalized
= 1; break;
753 case WritingMode2::CONTEXT
: nNormalized
= 2; break;
755 OSL_ENSURE( false, "FormComponentPropertyHandler::convertToControlValue: unsupported API value for WritingMode!" );
760 aControlValue
= FormComponentPropertyHandler_Base::convertToControlValue( _rPropertyName
, makeAny( nNormalized
), _rControlValueType
);
764 case PROPERTY_ID_FONT
:
766 FontDescriptor aFont
;
767 OSL_VERIFY( _rPropertyValue
>>= aFont
);
769 ::rtl::OUStringBuffer displayName
;
770 if ( !aFont
.Name
.getLength() )
772 displayName
.append( String( PcrRes( RID_STR_FONT_DEFAULT
) ) );
777 displayName
.append( aFont
.Name
);
778 displayName
.appendAscii( ", " );
781 ::FontWeight eWeight
= VCLUnoHelper::ConvertFontWeight( aFont
.Weight
);
782 USHORT nStyleResID
= RID_STR_FONTSTYLE_REGULAR
;
783 if ( aFont
.Slant
== FontSlant_ITALIC
)
785 if ( eWeight
> WEIGHT_NORMAL
)
786 nStyleResID
= RID_STR_FONTSTYLE_BOLD_ITALIC
;
788 nStyleResID
= RID_STR_FONTSTYLE_ITALIC
;
792 if ( eWeight
> WEIGHT_NORMAL
)
793 nStyleResID
= RID_STR_FONTSTYLE_BOLD
;
795 displayName
.append( String( PcrRes( nStyleResID
) ) );
800 displayName
.appendAscii( ", " );
801 displayName
.append( sal_Int32( aFont
.Height
) );
805 aControlValue
<<= displayName
.makeStringAndClear();
810 aControlValue
= FormComponentPropertyHandler_Base::convertToControlValue( _rPropertyName
, _rPropertyValue
, _rControlValueType
);
813 } // switch ( nPropId )
815 return aControlValue
;
818 //--------------------------------------------------------------------
819 PropertyState SAL_CALL
FormComponentPropertyHandler::getPropertyState( const ::rtl::OUString
& _rPropertyName
) throw (UnknownPropertyException
, RuntimeException
)
821 ::osl::MutexGuard
aGuard( m_aMutex
);
822 if ( m_xPropertyState
.is() )
823 return m_xPropertyState
->getPropertyState( _rPropertyName
);
824 return PropertyState_DIRECT_VALUE
;
827 //--------------------------------------------------------------------
828 void SAL_CALL
FormComponentPropertyHandler::addPropertyChangeListener( const Reference
< XPropertyChangeListener
>& _rxListener
) throw (RuntimeException
)
830 ::osl::MutexGuard
aGuard( m_aMutex
);
831 FormComponentPropertyHandler_Base::addPropertyChangeListener( _rxListener
);
832 if ( m_xComponent
.is() )
833 m_xComponent
->addPropertyChangeListener( ::rtl::OUString(), _rxListener
);
836 //--------------------------------------------------------------------
837 void SAL_CALL
FormComponentPropertyHandler::removePropertyChangeListener( const Reference
< XPropertyChangeListener
>& _rxListener
) throw (RuntimeException
)
839 ::osl::MutexGuard
aGuard( m_aMutex
);
840 if ( m_xComponent
.is() )
841 m_xComponent
->removePropertyChangeListener( ::rtl::OUString(), _rxListener
);
842 FormComponentPropertyHandler_Base::removePropertyChangeListener( _rxListener
);
845 //--------------------------------------------------------------------
846 void FormComponentPropertyHandler::onNewComponent()
848 FormComponentPropertyHandler_Base::onNewComponent();
849 if ( !m_xComponentPropertyInfo
.is() && m_xComponent
.is() )
850 throw NullPointerException();
852 m_xPropertyState
.set( m_xComponent
, UNO_QUERY
);
853 m_eComponentClass
= eUnknown
;
854 m_bComponentIsSubForm
= m_bHaveListSource
= m_bHaveCommand
= false;
857 impl_initComponentMetaData_throw();
860 //--------------------------------------------------------------------
861 Sequence
< Property
> SAL_CALL
FormComponentPropertyHandler::doDescribeSupportedProperties() const
863 if ( !m_xComponentPropertyInfo
.is() )
864 return Sequence
< Property
>();
866 ::std::vector
< Property
> aProperties
;
868 Sequence
< Property
> aAllProperties( m_xComponentPropertyInfo
->getProperties() );
869 aProperties
.reserve( aAllProperties
.getLength() );
871 // filter the properties
872 PropertyId
nPropId( 0 );
873 ::rtl::OUString sDisplayName
;
875 Property
* pProperty
= aAllProperties
.getArray();
876 Property
* pPropertiesEnd
= pProperty
+ aAllProperties
.getLength();
877 for ( ; pProperty
!= pPropertiesEnd
; ++pProperty
)
879 nPropId
= m_pInfoService
->getPropertyId( pProperty
->Name
);
882 pProperty
->Handle
= nPropId
;
884 sDisplayName
= m_pInfoService
->getPropertyTranslation( nPropId
);
885 if ( !sDisplayName
.getLength() )
888 sal_uInt32 nPropertyUIFlags
= m_pInfoService
->getPropertyUIFlags( nPropId
);
889 bool bIsVisibleForForms
= ( nPropertyUIFlags
& PROP_FLAG_FORM_VISIBLE
) != 0;
890 bool bIsVisibleForDialogs
= ( nPropertyUIFlags
& PROP_FLAG_DIALOG_VISIBLE
) != 0;
892 // depending on whether we're working for a form or a UNO dialog, some
893 // properties are not displayed
894 if ( ( m_eComponentClass
== eFormControl
&& !bIsVisibleForForms
)
895 || ( m_eComponentClass
== eDialogControl
&& !bIsVisibleForDialogs
)
899 // some generic sanity checks
900 if ( impl_shouldExcludeProperty_nothrow( *pProperty
) )
905 case PROPERTY_ID_BORDER
:
906 case PROPERTY_ID_TABSTOP
:
907 // BORDER and TABSTOP are normalized (see impl_normalizePropertyValue_nothrow)
908 // to not allow VOID values
909 pProperty
->Attributes
&= ~( PropertyAttribute::MAYBEVOID
);
912 case PROPERTY_ID_LISTSOURCE
:
913 // no cursor source if no Base is installed. #124939#
914 // This fix is not intendend to appear on the main trunk. If you find it there,
915 // please tell me! frank.schoenheit@sun.com
916 if ( SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::E_SDATABASE
) )
917 const_cast< FormComponentPropertyHandler
* >( this )->m_bHaveListSource
= true;
920 case PROPERTY_ID_COMMAND
:
921 // no cursor source if no Base is installed. #124939#
922 // This fix is not intendend to appear on the main trunk. If you find it there,
923 // please tell me! frank.schoenheit@sun.com
924 if ( SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::E_SDATABASE
) )
925 const_cast< FormComponentPropertyHandler
* >( this )->m_bHaveCommand
= true;
927 } // switch ( nPropId )
929 aProperties
.push_back( *pProperty
);
932 if ( aProperties
.empty() )
933 return Sequence
< Property
>();
934 return Sequence
< Property
>( &(*aProperties
.begin()), aProperties
.size() );
937 //--------------------------------------------------------------------
938 Sequence
< ::rtl::OUString
> SAL_CALL
FormComponentPropertyHandler::getSupersededProperties( ) throw (RuntimeException
)
940 return Sequence
< ::rtl::OUString
>( );
943 //--------------------------------------------------------------------
944 Sequence
< ::rtl::OUString
> SAL_CALL
FormComponentPropertyHandler::getActuatingProperties( ) throw (RuntimeException
)
946 ::osl::MutexGuard
aGuard( m_aMutex
);
947 ::std::vector
< ::rtl::OUString
> aInterestingProperties
;
948 aInterestingProperties
.push_back( PROPERTY_DATASOURCE
);
949 aInterestingProperties
.push_back( PROPERTY_COMMAND
);
950 aInterestingProperties
.push_back( PROPERTY_COMMANDTYPE
);
951 aInterestingProperties
.push_back( PROPERTY_LISTSOURCE
);
952 aInterestingProperties
.push_back( PROPERTY_LISTSOURCETYPE
);
953 aInterestingProperties
.push_back( PROPERTY_SUBMIT_ENCODING
);
954 aInterestingProperties
.push_back( PROPERTY_REPEAT
);
955 aInterestingProperties
.push_back( PROPERTY_TABSTOP
);
956 aInterestingProperties
.push_back( PROPERTY_BORDER
);
957 aInterestingProperties
.push_back( PROPERTY_CONTROLSOURCE
);
958 aInterestingProperties
.push_back( PROPERTY_DROPDOWN
);
959 aInterestingProperties
.push_back( PROPERTY_IMAGE_URL
);
960 aInterestingProperties
.push_back( PROPERTY_TARGET_URL
);
961 aInterestingProperties
.push_back( PROPERTY_STRINGITEMLIST
);
962 aInterestingProperties
.push_back( PROPERTY_BUTTONTYPE
);
963 aInterestingProperties
.push_back( PROPERTY_ESCAPE_PROCESSING
);
964 aInterestingProperties
.push_back( PROPERTY_TRISTATE
);
965 aInterestingProperties
.push_back( PROPERTY_DECIMAL_ACCURACY
);
966 aInterestingProperties
.push_back( PROPERTY_SHOWTHOUSANDSEP
);
967 aInterestingProperties
.push_back( PROPERTY_FORMATKEY
);
968 aInterestingProperties
.push_back( PROPERTY_EMPTY_IS_NULL
);
969 aInterestingProperties
.push_back( PROPERTY_TOGGLE
);
970 return Sequence
< ::rtl::OUString
>( &(*aInterestingProperties
.begin()), aInterestingProperties
.size() );
973 //--------------------------------------------------------------------
974 LineDescriptor SAL_CALL
FormComponentPropertyHandler::describePropertyLine( const ::rtl::OUString
& _rPropertyName
,
975 const Reference
< XPropertyControlFactory
>& _rxControlFactory
)
976 throw (UnknownPropertyException
, NullPointerException
, RuntimeException
)
978 if ( !_rxControlFactory
.is() )
979 throw NullPointerException();
981 ::osl::MutexGuard
aGuard( m_aMutex
);
982 PropertyId
nPropId( impl_getPropertyId_throw( _rPropertyName
) );
983 Property
aProperty( impl_getPropertyFromId_throw( nPropId
) );
985 //////////////////////////////////////////////////////////////////////
986 // for the MultiLine property, we have different UI translations depending on the control
988 if ( nPropId
== PROPERTY_ID_MULTILINE
)
990 if ( ( m_nClassId
== FormComponentType::FIXEDTEXT
)
991 || ( m_nClassId
== FormComponentType::COMMANDBUTTON
)
992 || ( m_nClassId
== FormComponentType::RADIOBUTTON
)
993 || ( m_nClassId
== FormComponentType::CHECKBOX
)
995 nPropId
= PROPERTY_ID_WORDBREAK
;
998 String sDisplayName
= m_pInfoService
->getPropertyTranslation( nPropId
);
999 if ( !sDisplayName
.Len() )
1001 DBG_ERROR( "FormComponentPropertyHandler::describePropertyLine: did getSupportedProperties not work properly?" );
1002 throw UnknownPropertyException();
1005 //////////////////////////////////////////////////////////////////////
1007 LineDescriptor aDescriptor
;
1008 aDescriptor
.HelpURL
= HelpIdUrl::getHelpURL( m_pInfoService
->getPropertyHelpId( nPropId
) );
1009 aDescriptor
.DisplayName
= sDisplayName
;
1011 // for the moment, assume a text field
1012 sal_Int16 nControlType
= PropertyControlType::TextField
;
1013 sal_Bool bReadOnly
= sal_False
;
1014 aDescriptor
.Control
.clear();
1016 //////////////////////////////////////////////////////////////////////
1018 bool bNeedDefaultStringIfVoidAllowed
= false;
1020 TypeClass eType
= aProperty
.Type
.getTypeClass();
1024 case PROPERTY_ID_DEFAULT_SELECT_SEQ
:
1025 case PROPERTY_ID_SELECTEDITEMS
:
1026 aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_SELECTION
;
1029 case PROPERTY_ID_FILTER
:
1030 aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_FILTER
;
1033 case PROPERTY_ID_SORT
:
1034 aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_ORDER
;
1037 case PROPERTY_ID_MASTERFIELDS
:
1038 case PROPERTY_ID_DETAILFIELDS
:
1039 nControlType
= PropertyControlType::StringListField
;
1040 aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_FORMLINKFIELDS
;
1043 case PROPERTY_ID_COMMAND
:
1044 aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_SQLCOMMAND
;
1047 case PROPERTY_ID_TABINDEX
:
1049 Reference
< XControlContainer
> xControlContext( impl_getContextControlContainer_nothrow() );
1050 if ( xControlContext
.is() )
1051 aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_TABINDEX
;
1052 nControlType
= PropertyControlType::NumericField
;
1056 case PROPERTY_ID_FONT
:
1057 bReadOnly
= sal_True
;
1058 aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_FONT_TYPE
;
1061 case PROPERTY_ID_TARGET_URL
:
1062 case PROPERTY_ID_IMAGE_URL
:
1064 aDescriptor
.Control
= new OFileUrlControl( impl_getDefaultDialogParent_nothrow(), WB_TABSTOP
| WB_BORDER
);
1066 aDescriptor
.PrimaryButtonId
= ( PROPERTY_ID_TARGET_URL
== nPropId
)
1067 ? UID_PROP_DLG_ATTR_TARGET_URL
: UID_PROP_DLG_IMAGE_URL
;
1071 case PROPERTY_ID_ECHO_CHAR
:
1072 nControlType
= PropertyControlType::CharacterField
;
1075 case PROPERTY_ID_BACKGROUNDCOLOR
:
1076 case PROPERTY_ID_FILLCOLOR
:
1077 case PROPERTY_ID_SYMBOLCOLOR
:
1078 case PROPERTY_ID_BORDERCOLOR
:
1079 nControlType
= PropertyControlType::ColorListBox
;
1083 case PROPERTY_ID_BACKGROUNDCOLOR
:
1084 aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_BACKGROUNDCOLOR
; break;
1085 case PROPERTY_ID_FILLCOLOR
:
1086 aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_FILLCOLOR
; break;
1087 case PROPERTY_ID_SYMBOLCOLOR
:
1088 aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_SYMBOLCOLOR
; break;
1089 case PROPERTY_ID_BORDERCOLOR
:
1090 aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_BORDERCOLOR
; break;
1094 case PROPERTY_ID_LABEL
:
1095 nControlType
= PropertyControlType::MultiLineTextField
;
1098 case PROPERTY_ID_DEFAULT_TEXT
:
1100 if (FormComponentType::FILECONTROL
== m_nClassId
)
1101 nControlType
= PropertyControlType::TextField
;
1103 nControlType
= PropertyControlType::MultiLineTextField
;
1107 case PROPERTY_ID_TEXT
:
1108 if ( impl_componentHasProperty_throw( PROPERTY_MULTILINE
) )
1109 nControlType
= PropertyControlType::MultiLineTextField
;
1112 case PROPERTY_ID_CONTROLLABEL
:
1113 bReadOnly
= sal_True
;
1114 aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_CONTROLLABEL
;
1117 case PROPERTY_ID_FORMATKEY
:
1118 case PROPERTY_ID_EFFECTIVE_MIN
:
1119 case PROPERTY_ID_EFFECTIVE_MAX
:
1120 case PROPERTY_ID_EFFECTIVE_DEFAULT
:
1121 case PROPERTY_ID_EFFECTIVE_VALUE
:
1123 // and the supplier is really available
1124 Reference
< XNumberFormatsSupplier
> xSupplier
;
1125 m_xComponent
->getPropertyValue( PROPERTY_FORMATSSUPPLIER
) >>= xSupplier
;
1128 Reference
< XUnoTunnel
> xTunnel(xSupplier
,UNO_QUERY
);
1129 DBG_ASSERT(xTunnel
.is(), "FormComponentPropertyHandler::describePropertyLine : xTunnel is invalid!");
1130 SvNumberFormatsSupplierObj
* pSupplier
= reinterpret_cast<SvNumberFormatsSupplierObj
*>(xTunnel
->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId()));
1132 if (pSupplier
!= NULL
)
1134 sal_Bool bIsFormatKey
= (PROPERTY_ID_FORMATKEY
== nPropId
);
1136 bReadOnly
= bIsFormatKey
;
1140 OFormatSampleControl
* pControl
= new OFormatSampleControl( impl_getDefaultDialogParent_nothrow(), WB_READONLY
| WB_TABSTOP
| WB_BORDER
);
1141 aDescriptor
.Control
= pControl
;
1142 pControl
->SetFormatSupplier( pSupplier
);
1144 aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_NUMBER_FORMAT
;
1148 OFormattedNumericControl
* pControl
= new OFormattedNumericControl( impl_getDefaultDialogParent_nothrow(), WB_TABSTOP
| WB_BORDER
);
1149 aDescriptor
.Control
= pControl
;
1151 FormatDescription aDesc
;
1152 aDesc
.pSupplier
= pSupplier
;
1153 Any aFormatKeyValue
= m_xComponent
->getPropertyValue(PROPERTY_FORMATKEY
);
1154 if ( !( aFormatKeyValue
>>= aDesc
.nKey
) )
1157 pControl
->SetFormatDescription( aDesc
);
1164 case PROPERTY_ID_DATEMIN
:
1165 case PROPERTY_ID_DATEMAX
:
1166 case PROPERTY_ID_DEFAULT_DATE
:
1167 case PROPERTY_ID_DATE
:
1168 nControlType
= PropertyControlType::DateField
;
1171 case PROPERTY_ID_TIMEMIN
:
1172 case PROPERTY_ID_TIMEMAX
:
1173 case PROPERTY_ID_DEFAULT_TIME
:
1174 case PROPERTY_ID_TIME
:
1175 nControlType
= PropertyControlType::TimeField
;
1178 case PROPERTY_ID_VALUEMIN
:
1179 case PROPERTY_ID_VALUEMAX
:
1180 case PROPERTY_ID_DEFAULT_VALUE
:
1181 case PROPERTY_ID_VALUE
:
1183 OFormattedNumericControl
* pControl
= new OFormattedNumericControl( impl_getDefaultDialogParent_nothrow(), WB_TABSTOP
| WB_BORDER
| WB_SPIN
| WB_REPEAT
);
1184 aDescriptor
.Control
= pControl
;
1186 // we don't set a formatter so the control uses a default (which uses the application
1187 // language and a default numeric format)
1188 // but we set the decimal digits
1189 pControl
->SetDecimalDigits(
1190 ::comphelper::getINT16( m_xComponent
->getPropertyValue( PROPERTY_DECIMAL_ACCURACY
) )
1193 // and the thousands separator
1194 pControl
->SetThousandsSep(
1195 ::comphelper::getBOOL( m_xComponent
->getPropertyValue(PROPERTY_SHOWTHOUSANDSEP
) )
1198 // and the default value for the property
1201 if (m_xPropertyState
.is() && ((PROPERTY_ID_VALUEMIN
== nPropId
) || (PROPERTY_ID_VALUEMAX
== nPropId
)))
1203 double nDefault
= 0;
1204 if ( m_xPropertyState
->getPropertyDefault( aProperty
.Name
) >>= nDefault
)
1205 pControl
->SetDefaultValue( nDefault
);
1213 // and allow empty values only for the default value and the value
1214 pControl
->EnableEmptyField( ( PROPERTY_ID_DEFAULT_VALUE
== nPropId
)
1215 || ( PROPERTY_ID_VALUE
== nPropId
) );
1220 if ( TypeClass_BYTE
<= eType
&& eType
<= TypeClass_DOUBLE
)
1222 sal_Int16 nDigits
= 0;
1223 sal_Int16 nValueUnit
= -1;
1224 sal_Int16 nDisplayUnit
= -1;
1225 if ( m_eComponentClass
== eFormControl
)
1227 if ( ( nPropId
== PROPERTY_ID_WIDTH
)
1228 || ( nPropId
== PROPERTY_ID_ROWHEIGHT
)
1229 || ( nPropId
== PROPERTY_ID_HEIGHT
)
1232 nValueUnit
= MeasureUnit::MM_10TH
;
1233 nDisplayUnit
= impl_getDocumentMeasurementUnit_throw();
1238 Optional
< double > aValueNotPresent( sal_False
, 0 );
1239 aDescriptor
.Control
= PropertyHandlerHelper::createNumericControl(
1240 _rxControlFactory
, nDigits
, aValueNotPresent
, aValueNotPresent
, sal_False
);
1242 Reference
< XNumericControl
> xNumericControl( aDescriptor
.Control
, UNO_QUERY_THROW
);
1243 if ( nValueUnit
!= -1 )
1244 xNumericControl
->setValueUnit( nValueUnit
);
1245 if ( nDisplayUnit
!= -1 )
1246 xNumericControl
->setDisplayUnit( nDisplayUnit
);
1251 //////////////////////////////////////////////////////////////////////
1252 if ( eType
== TypeClass_SEQUENCE
)
1253 nControlType
= PropertyControlType::StringListField
;
1255 //////////////////////////////////////////////////////////////////////
1257 if ( eType
== TypeClass_BOOLEAN
)
1259 USHORT nResId
= RID_RSC_ENUM_YESNO
;
1260 if ( ( nPropId
== PROPERTY_ID_SHOW_POSITION
)
1261 || ( nPropId
== PROPERTY_ID_SHOW_NAVIGATION
)
1262 || ( nPropId
== PROPERTY_ID_SHOW_RECORDACTIONS
)
1263 || ( nPropId
== PROPERTY_ID_SHOW_FILTERSORT
)
1265 nResId
= RID_RSC_ENUM_SHOWHIDE
;
1267 ::std::vector
< ::rtl::OUString
> aListEntries
;
1268 tools::StringListResource
aRes(PcrRes(nResId
),aListEntries
);
1269 aDescriptor
.Control
= PropertyHandlerHelper::createListBoxControl( _rxControlFactory
, aListEntries
, sal_False
, sal_False
);
1270 bNeedDefaultStringIfVoidAllowed
= true;
1273 //////////////////////////////////////////////////////////////////////
1275 sal_uInt32 nPropertyUIFlags
= m_pInfoService
->getPropertyUIFlags( nPropId
);
1276 bool bIsEnumProperty
= ( nPropertyUIFlags
& PROP_FLAG_ENUM
) != 0;
1277 if ( bIsEnumProperty
|| ( PROPERTY_ID_TARGET_FRAME
== nPropId
) )
1279 ::std::vector
< ::rtl::OUString
> aEnumValues
= m_pInfoService
->getPropertyEnumRepresentations( nPropId
);
1280 ::std::vector
< ::rtl::OUString
>::const_iterator pStart
= aEnumValues
.begin();
1281 ::std::vector
< ::rtl::OUString
>::const_iterator pEnd
= aEnumValues
.end();
1283 // for a checkbox: if "ambiguous" is not allowed, remove this from the sequence
1284 if ( ( PROPERTY_ID_DEFAULT_STATE
== nPropId
)
1285 || ( PROPERTY_ID_STATE
== nPropId
)
1288 if ( impl_componentHasProperty_throw( PROPERTY_TRISTATE
) )
1290 if ( !::comphelper::getBOOL( m_xComponent
->getPropertyValue( PROPERTY_TRISTATE
) ) )
1291 { // remove the last sequence element
1292 if ( pEnd
> pStart
)
1300 if ( PROPERTY_ID_LISTSOURCETYPE
== nPropId
)
1301 if ( FormComponentType::COMBOBOX
== m_nClassId
)
1302 // remove the first sequence element -> value list not possible for combo boxes
1305 // copy the sequence
1306 ::std::vector
< ::rtl::OUString
> aListEntries( pEnd
- pStart
);
1307 ::std::copy( pStart
, pEnd
, aListEntries
.begin() );
1309 // create the control
1310 if ( PROPERTY_ID_TARGET_FRAME
== nPropId
)
1311 aDescriptor
.Control
= PropertyHandlerHelper::createComboBoxControl( _rxControlFactory
, aListEntries
, sal_False
, sal_False
);
1314 aDescriptor
.Control
= PropertyHandlerHelper::createListBoxControl( _rxControlFactory
, aListEntries
, sal_False
, sal_False
);
1315 bNeedDefaultStringIfVoidAllowed
= true;
1319 //////////////////////////////////////////////////////////////////////
1322 case PROPERTY_ID_REPEAT_DELAY
:
1324 OTimeDurationControl
* pControl
= new OTimeDurationControl( impl_getDefaultDialogParent_nothrow(), WB_BORDER
| WB_TABSTOP
);
1325 aDescriptor
.Control
= pControl
;
1327 pControl
->setMinValue( Optional
< double >( sal_True
, 0 ) );
1328 pControl
->setMaxValue( Optional
< double >( sal_True
, ::std::numeric_limits
< double >::max() ) );
1332 case PROPERTY_ID_TABINDEX
:
1333 case PROPERTY_ID_BOUNDCOLUMN
:
1334 case PROPERTY_ID_VISIBLESIZE
:
1335 case PROPERTY_ID_MAXTEXTLEN
:
1336 case PROPERTY_ID_LINEINCREMENT
:
1337 case PROPERTY_ID_BLOCKINCREMENT
:
1338 case PROPERTY_ID_SPININCREMENT
:
1340 Optional
< double > aMinValue( sal_True
, 0 );
1341 Optional
< double > aMaxValue( sal_True
, 0x7FFFFFFF );
1343 if ( nPropId
== PROPERTY_ID_MAXTEXTLEN
)
1344 aMinValue
.Value
= -1;
1345 else if ( ( nPropId
== PROPERTY_ID_BOUNDCOLUMN
) || ( nPropId
== PROPERTY_ID_VISIBLESIZE
) )
1346 aMinValue
.Value
= 1;
1348 aMinValue
.Value
= 0;
1350 aDescriptor
.Control
= PropertyHandlerHelper::createNumericControl(
1351 _rxControlFactory
, 0, aMinValue
, aMaxValue
, sal_False
);
1355 case PROPERTY_ID_DECIMAL_ACCURACY
:
1357 Optional
< double > aMinValue( sal_True
, 0 );
1358 Optional
< double > aMaxValue( sal_True
, 20 );
1360 aDescriptor
.Control
= PropertyHandlerHelper::createNumericControl(
1361 _rxControlFactory
, 0, aMinValue
, aMaxValue
, sal_False
);
1365 //////////////////////////////////////////////////////////////////////
1367 case PROPERTY_ID_DATASOURCE
:
1369 aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_ATTR_DATASOURCE
;
1371 ::std::vector
< ::rtl::OUString
> aListEntries
;
1373 Reference
< XNameAccess
> xDatabaseContext
;
1374 m_aContext
.createComponent( (rtl::OUString
)SERVICE_DATABASE_CONTEXT
, xDatabaseContext
);
1375 if (xDatabaseContext
.is())
1377 Sequence
< ::rtl::OUString
> aDatasources
= xDatabaseContext
->getElementNames();
1378 aListEntries
.resize( aDatasources
.getLength() );
1379 ::std::copy( aDatasources
.getConstArray(), aDatasources
.getConstArray() + aDatasources
.getLength(),
1380 aListEntries
.begin() );
1382 aDescriptor
.Control
= PropertyHandlerHelper::createComboBoxControl(
1383 _rxControlFactory
, aListEntries
, sal_False
, sal_True
);
1387 case PROPERTY_ID_CONTROLSOURCE
:
1389 ::std::vector
< ::rtl::OUString
> aFieldNames
;
1390 impl_initFieldList_nothrow( aFieldNames
);
1391 aDescriptor
.Control
= PropertyHandlerHelper::createComboBoxControl(
1392 _rxControlFactory
, aFieldNames
, sal_False
, sal_False
);
1396 case PROPERTY_ID_COMMAND
:
1397 impl_describeCursorSource_nothrow( aDescriptor
, _rxControlFactory
);
1400 case PROPERTY_ID_LISTSOURCE
:
1401 impl_describeListSourceUI_throw( aDescriptor
, _rxControlFactory
);
1405 if ( !aDescriptor
.Control
.is() )
1406 aDescriptor
.Control
= _rxControlFactory
->createPropertyControl( nControlType
, bReadOnly
);
1408 if ( ( aProperty
.Attributes
& PropertyAttribute::MAYBEVOID
) != 0 )
1410 // insert the string "Default" string, if necessary
1411 if ( bNeedDefaultStringIfVoidAllowed
|| ( nControlType
== PropertyControlType::ColorListBox
) )
1413 Reference
< XStringListControl
> xStringList( aDescriptor
.Control
, UNO_QUERY_THROW
);
1414 xStringList
->prependListEntry( m_sDefaultValueString
);
1415 m_aPropertiesWithDefListEntry
.insert( _rPropertyName
);
1419 if ( aDescriptor
.PrimaryButtonId
)
1420 aDescriptor
.HasPrimaryButton
= sal_True
;
1421 if ( aDescriptor
.SecondaryButtonId
)
1422 aDescriptor
.HasSecondaryButton
= sal_True
;
1424 bool bIsDataProperty
= ( nPropertyUIFlags
& PROP_FLAG_DATA_PROPERTY
) != 0;
1425 aDescriptor
.Category
= ::rtl::OUString::createFromAscii( bIsDataProperty
? "Data" : "General" );
1429 //--------------------------------------------------------------------
1430 InteractiveSelectionResult SAL_CALL
FormComponentPropertyHandler::onInteractivePropertySelection( const ::rtl::OUString
& _rPropertyName
, sal_Bool
/*_bPrimary*/, Any
& _rData
, const Reference
< XObjectInspectorUI
>& _rxInspectorUI
) throw (UnknownPropertyException
, NullPointerException
, RuntimeException
)
1432 if ( !_rxInspectorUI
.is() )
1433 throw NullPointerException();
1435 ::osl::ClearableMutexGuard
aGuard( m_aMutex
);
1436 PropertyId
nPropId( impl_getPropertyId_throw( _rPropertyName
) );
1438 InteractiveSelectionResult eResult
= InteractiveSelectionResult_Cancelled
;
1441 case PROPERTY_ID_DEFAULT_SELECT_SEQ
:
1442 case PROPERTY_ID_SELECTEDITEMS
:
1443 if ( impl_dialogListSelection_nothrow( _rPropertyName
, aGuard
) )
1444 eResult
= InteractiveSelectionResult_Success
;
1447 case PROPERTY_ID_FILTER
:
1448 case PROPERTY_ID_SORT
:
1450 ::rtl::OUString sClause
;
1451 if ( impl_dialogFilterOrSort_nothrow( PROPERTY_ID_FILTER
== nPropId
, sClause
, aGuard
) )
1454 eResult
= InteractiveSelectionResult_ObtainedValue
;
1459 case PROPERTY_ID_MASTERFIELDS
:
1460 case PROPERTY_ID_DETAILFIELDS
:
1461 if ( impl_dialogLinkedFormFields_nothrow( aGuard
) )
1462 eResult
= InteractiveSelectionResult_Success
;
1465 case PROPERTY_ID_FORMATKEY
:
1466 if ( impl_dialogFormatting_nothrow( _rData
, aGuard
) )
1467 eResult
= InteractiveSelectionResult_ObtainedValue
;
1470 case PROPERTY_ID_IMAGE_URL
:
1471 if ( impl_browseForImage_nothrow( _rData
, aGuard
) )
1472 eResult
= InteractiveSelectionResult_ObtainedValue
;
1475 case PROPERTY_ID_TARGET_URL
:
1476 if ( impl_browseForTargetURL_nothrow( _rData
, aGuard
) )
1477 eResult
= InteractiveSelectionResult_ObtainedValue
;
1480 case PROPERTY_ID_FONT
:
1481 if ( impl_executeFontDialog_nothrow( _rData
, aGuard
) )
1482 eResult
= InteractiveSelectionResult_ObtainedValue
;
1485 case PROPERTY_ID_DATASOURCE
:
1486 if ( impl_browseForDatabaseDocument_throw( _rData
, aGuard
) )
1487 eResult
= InteractiveSelectionResult_ObtainedValue
;
1490 case PROPERTY_ID_BACKGROUNDCOLOR
:
1491 case PROPERTY_ID_FILLCOLOR
:
1492 case PROPERTY_ID_SYMBOLCOLOR
:
1493 case PROPERTY_ID_BORDERCOLOR
:
1494 if ( impl_dialogColorChooser_throw( nPropId
, _rData
, aGuard
) )
1495 eResult
= InteractiveSelectionResult_ObtainedValue
;
1498 case PROPERTY_ID_CONTROLLABEL
:
1499 if ( impl_dialogChooseLabelControl_nothrow( _rData
, aGuard
) )
1500 eResult
= InteractiveSelectionResult_ObtainedValue
;
1503 case PROPERTY_ID_TABINDEX
:
1504 if ( impl_dialogChangeTabOrder_nothrow( aGuard
) )
1505 eResult
= InteractiveSelectionResult_Success
;
1508 case PROPERTY_ID_COMMAND
:
1509 case PROPERTY_ID_LISTSOURCE
:
1510 if ( impl_doDesignSQLCommand_nothrow( _rxInspectorUI
, nPropId
) )
1511 eResult
= InteractiveSelectionResult_Pending
;
1514 DBG_ERROR( "FormComponentPropertyHandler::onInteractivePropertySelection: request for a property which does not have dedicated UI!" );
1520 //--------------------------------------------------------------------
1523 void lcl_rebuildAndResetCommand( const Reference
< XObjectInspectorUI
>& _rxInspectorUI
, const Reference
< XPropertyHandler
>& _rxHandler
)
1525 OSL_PRECOND( _rxInspectorUI
.is(), "lcl_rebuildAndResetCommand: invalid BrowserUI!" );
1526 OSL_PRECOND( _rxHandler
.is(), "lcl_rebuildAndResetCommand: invalid handler!" );
1527 _rxInspectorUI
->rebuildPropertyUI( PROPERTY_COMMAND
);
1528 _rxHandler
->setPropertyValue( PROPERTY_COMMAND
, makeAny( ::rtl::OUString() ) );
1532 //--------------------------------------------------------------------
1533 void SAL_CALL
FormComponentPropertyHandler::actuatingPropertyChanged( const ::rtl::OUString
& _rActuatingPropertyName
, const Any
& _rNewValue
, const Any
& /*_rOldValue*/, const Reference
< XObjectInspectorUI
>& _rxInspectorUI
, sal_Bool _bFirstTimeInit
) throw (NullPointerException
, RuntimeException
)
1535 if ( !_rxInspectorUI
.is() )
1536 throw NullPointerException();
1538 ::osl::MutexGuard
aGuard( m_aMutex
);
1539 PropertyId
nActuatingPropId( impl_getPropertyId_throw( _rActuatingPropertyName
) );
1541 ::std::vector
< PropertyId
> aDependentProperties
;
1543 switch ( nActuatingPropId
)
1545 // ----- EscapeProcessing -----
1546 case PROPERTY_ID_ESCAPE_PROCESSING
:
1547 aDependentProperties
.push_back( PROPERTY_ID_FILTER
);
1548 aDependentProperties
.push_back( PROPERTY_ID_SORT
);
1549 break; // case PROPERTY_ID_ESCAPE_PROCESSING
1551 // ----- CommandType -----
1552 case PROPERTY_ID_COMMANDTYPE
:
1553 // available commands (tables or queries) might have changed
1554 if ( !_bFirstTimeInit
&& m_bHaveCommand
)
1555 lcl_rebuildAndResetCommand( _rxInspectorUI
, this );
1556 aDependentProperties
.push_back( PROPERTY_ID_COMMAND
);
1557 break; // case PROPERTY_ID_COMMANDTYPE
1559 // ----- DataSourceName -----
1560 case PROPERTY_ID_DATASOURCE
:
1561 // reset the connection, now that we have a new data source
1562 impl_clearRowsetConnection_nothrow();
1564 // available list source values (tables or queries) might have changed
1565 if ( !_bFirstTimeInit
&& m_bHaveListSource
)
1566 _rxInspectorUI
->rebuildPropertyUI( PROPERTY_LISTSOURCE
);
1568 // available commands (tables or queries) might have changed
1569 if ( !_bFirstTimeInit
&& m_bHaveCommand
)
1570 lcl_rebuildAndResetCommand( _rxInspectorUI
, this );
1572 // Command also depends on DataSource
1573 aDependentProperties
.push_back( PROPERTY_ID_COMMAND
);
1576 // ----- Command -----
1577 case PROPERTY_ID_COMMAND
:
1578 aDependentProperties
.push_back( PROPERTY_ID_FILTER
);
1579 aDependentProperties
.push_back( PROPERTY_ID_SORT
);
1580 if ( m_bComponentIsSubForm
)
1581 aDependentProperties
.push_back( PROPERTY_ID_DETAILFIELDS
);
1584 // ----- ListSourceType -----
1585 case PROPERTY_ID_LISTSOURCETYPE
:
1586 if ( !_bFirstTimeInit
&& m_bHaveListSource
)
1587 // available list source values (tables or queries) might have changed
1588 _rxInspectorUI
->rebuildPropertyUI( PROPERTY_LISTSOURCE
);
1589 aDependentProperties
.push_back( PROPERTY_ID_BOUNDCOLUMN
);
1590 aDependentProperties
.push_back( PROPERTY_ID_STRINGITEMLIST
);
1593 // ----- StringItemList -----
1594 case PROPERTY_ID_STRINGITEMLIST
:
1595 aDependentProperties
.push_back( PROPERTY_ID_SELECTEDITEMS
);
1596 aDependentProperties
.push_back( PROPERTY_ID_DEFAULT_SELECT_SEQ
);
1599 // ----- ListSource -----
1600 case PROPERTY_ID_LISTSOURCE
:
1601 aDependentProperties
.push_back( PROPERTY_ID_STRINGITEMLIST
);
1604 // ----- DataField -----
1605 case PROPERTY_ID_CONTROLSOURCE
:
1607 ::rtl::OUString sControlSource
;
1608 _rNewValue
>>= sControlSource
;
1609 if ( impl_componentHasProperty_throw( PROPERTY_FILTERPROPOSAL
) )
1610 _rxInspectorUI
->enablePropertyUI( PROPERTY_FILTERPROPOSAL
, sControlSource
.getLength() > 0 );
1611 if ( impl_componentHasProperty_throw( PROPERTY_EMPTY_IS_NULL
) )
1612 _rxInspectorUI
->enablePropertyUI( PROPERTY_EMPTY_IS_NULL
, sControlSource
.getLength() > 0 );
1614 aDependentProperties
.push_back( PROPERTY_ID_BOUNDCOLUMN
);
1615 aDependentProperties
.push_back( PROPERTY_ID_SCALEIMAGE
);
1616 aDependentProperties
.push_back( PROPERTY_ID_SCALE_MODE
);
1617 aDependentProperties
.push_back( PROPERTY_ID_INPUT_REQUIRED
);
1621 case PROPERTY_ID_EMPTY_IS_NULL
:
1622 aDependentProperties
.push_back( PROPERTY_ID_INPUT_REQUIRED
);
1625 // ----- SubmitEncoding -----
1626 case PROPERTY_ID_SUBMIT_ENCODING
:
1628 FormSubmitEncoding eEncoding
= FormSubmitEncoding_URL
;
1629 OSL_VERIFY( _rNewValue
>>= eEncoding
);
1630 _rxInspectorUI
->enablePropertyUI( PROPERTY_SUBMIT_METHOD
, eEncoding
== FormSubmitEncoding_URL
);
1634 // ----- Repeat -----
1635 case PROPERTY_ID_REPEAT
:
1637 sal_Bool bIsRepeating
= sal_False
;
1638 OSL_VERIFY( _rNewValue
>>= bIsRepeating
);
1639 _rxInspectorUI
->enablePropertyUI( PROPERTY_REPEAT_DELAY
, bIsRepeating
);
1643 // ----- TabStop -----
1644 case PROPERTY_ID_TABSTOP
:
1646 if ( !impl_componentHasProperty_throw( PROPERTY_TABINDEX
) )
1648 sal_Bool bHasTabStop
= sal_False
;
1649 _rNewValue
>>= bHasTabStop
;
1650 _rxInspectorUI
->enablePropertyUI( PROPERTY_TABINDEX
, bHasTabStop
);
1654 // ----- Border -----
1655 case PROPERTY_ID_BORDER
:
1657 sal_Int16 nBordeType
= VisualEffect::NONE
;
1658 OSL_VERIFY( _rNewValue
>>= nBordeType
);
1659 _rxInspectorUI
->enablePropertyUI( PROPERTY_BORDERCOLOR
, nBordeType
== VisualEffect::FLAT
);
1663 // ----- DropDown -----
1664 case PROPERTY_ID_DROPDOWN
:
1666 if ( impl_isSupportedProperty_nothrow( PROPERTY_ID_LINECOUNT
) )
1668 sal_Bool bDropDown
= sal_True
;
1669 _rNewValue
>>= bDropDown
;
1670 _rxInspectorUI
->enablePropertyUI( PROPERTY_LINECOUNT
, bDropDown
);
1675 // ----- ImageURL -----
1676 case PROPERTY_ID_IMAGE_URL
:
1678 if ( impl_isSupportedProperty_nothrow( PROPERTY_ID_IMAGEPOSITION
) )
1680 ::rtl::OUString sImageURL
;
1681 OSL_VERIFY( _rNewValue
>>= sImageURL
);
1682 _rxInspectorUI
->enablePropertyUI( PROPERTY_IMAGEPOSITION
, sImageURL
.getLength() != 0 );
1685 aDependentProperties
.push_back( PROPERTY_ID_SCALEIMAGE
);
1686 aDependentProperties
.push_back( PROPERTY_ID_SCALE_MODE
);
1690 // ----- ButtonType -----
1691 case PROPERTY_ID_BUTTONTYPE
:
1693 FormButtonType
eButtonType( FormButtonType_PUSH
);
1694 OSL_VERIFY( _rNewValue
>>= eButtonType
);
1695 _rxInspectorUI
->enablePropertyUI( PROPERTY_TARGET_URL
, FormButtonType_URL
== eButtonType
);
1699 // ----- TargetURL -----
1700 case PROPERTY_ID_TARGET_URL
:
1701 aDependentProperties
.push_back( PROPERTY_ID_TARGET_FRAME
);
1702 break; // case PROPERTY_ID_TARGET_URL
1704 // ----- TriState -----
1705 case PROPERTY_ID_TRISTATE
:
1706 if ( !_bFirstTimeInit
)
1707 _rxInspectorUI
->rebuildPropertyUI( m_eComponentClass
== eFormControl
? PROPERTY_DEFAULT_STATE
: PROPERTY_STATE
);
1708 break; // case PROPERTY_ID_TRISTATE
1710 // ----- DecimalAccuracy -----
1711 case PROPERTY_ID_DECIMAL_ACCURACY
:
1712 // ----- ShowThousandsSeparator -----
1713 case PROPERTY_ID_SHOWTHOUSANDSEP
:
1715 sal_Bool bAccuracy
= (PROPERTY_ID_DECIMAL_ACCURACY
== nActuatingPropId
);
1716 sal_uInt16 nNewDigits
= 0;
1717 sal_Bool bUseSep
= sal_False
;
1719 OSL_VERIFY( _rNewValue
>>= nNewDigits
);
1721 OSL_VERIFY( _rNewValue
>>= bUseSep
);
1723 // propagate the changes to the min/max/default fields
1725 ::rtl::OUString aAffectedProps
[] = { PROPERTY_VALUE
, PROPERTY_DEFAULT_VALUE
, PROPERTY_VALUEMIN
, PROPERTY_VALUEMAX
};
1726 for (sal_uInt16 i
=0; i
<sizeof(aAffectedProps
)/sizeof(aAffectedProps
[0]); ++i
)
1728 Reference
< XPropertyControl
> xControl
;
1731 xControl
= _rxInspectorUI
->getPropertyControl( aAffectedProps
[i
] );
1733 catch( const UnknownPropertyException
& e
) { (void)e
; }
1734 if ( xControl
.is() )
1736 OFormattedNumericControl
* pControl
= dynamic_cast< OFormattedNumericControl
* >( xControl
.get() );
1737 DBG_ASSERT( pControl
, "FormComponentPropertyHandler::actuatingPropertyChanged: invalid control!" );
1741 pControl
->SetDecimalDigits( nNewDigits
);
1743 pControl
->SetThousandsSep( bUseSep
);
1750 // ----- FormatKey -----
1751 case PROPERTY_ID_FORMATKEY
:
1753 FormatDescription aNewDesc
;
1755 Reference
< XNumberFormatsSupplier
> xSupplier
;
1756 OSL_VERIFY( m_xComponent
->getPropertyValue( PROPERTY_FORMATSSUPPLIER
) >>= xSupplier
);
1758 Reference
< XUnoTunnel
> xTunnel( xSupplier
, UNO_QUERY
);
1759 DBG_ASSERT(xTunnel
.is(), "FormComponentPropertyHandler::actuatingPropertyChanged: xTunnel is invalid!");
1762 SvNumberFormatsSupplierObj
* pSupplier
= reinterpret_cast<SvNumberFormatsSupplierObj
*>(xTunnel
->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId()));
1765 aNewDesc
.pSupplier
= pSupplier
;
1766 if ( !( _rNewValue
>>= aNewDesc
.nKey
) )
1769 // give each control which has to know this an own copy of the description
1770 ::rtl::OUString aFormattedPropertyControls
[] = {
1771 PROPERTY_EFFECTIVE_MIN
, PROPERTY_EFFECTIVE_MAX
, PROPERTY_EFFECTIVE_DEFAULT
, PROPERTY_EFFECTIVE_VALUE
1773 for ( sal_uInt16 i
=0; i
<sizeof(aFormattedPropertyControls
)/sizeof(aFormattedPropertyControls
[0]); ++i
)
1775 Reference
< XPropertyControl
> xControl
;
1778 xControl
= _rxInspectorUI
->getPropertyControl( aFormattedPropertyControls
[i
] );
1780 catch( const UnknownPropertyException
& e
) { (void)e
; }
1781 if ( xControl
.is() )
1783 OFormattedNumericControl
* pControl
= dynamic_cast< OFormattedNumericControl
* >( xControl
.get() );
1784 DBG_ASSERT( pControl
, "FormComponentPropertyHandler::actuatingPropertyChanged: invalid control!" );
1786 pControl
->SetFormatDescription( aNewDesc
);
1793 case PROPERTY_ID_TOGGLE
:
1795 sal_Bool bIsToggleButton
= sal_False
;
1796 OSL_VERIFY( _rNewValue
>>= bIsToggleButton
);
1797 _rxInspectorUI
->enablePropertyUI( PROPERTY_DEFAULT_STATE
, bIsToggleButton
);
1802 DBG_ERROR( "FormComponentPropertyHandler::actuatingPropertyChanged: did not register for this property!" );
1805 } // switch ( nActuatingPropId )
1807 for ( ::std::vector
< PropertyId
>::const_iterator loopAffected
= aDependentProperties
.begin();
1808 loopAffected
!= aDependentProperties
.end();
1812 if ( impl_isSupportedProperty_nothrow( *loopAffected
) )
1813 impl_updateDependentProperty_nothrow( *loopAffected
, _rxInspectorUI
);
1817 //------------------------------------------------------------------------
1818 void FormComponentPropertyHandler::impl_updateDependentProperty_nothrow( PropertyId _nPropId
, const Reference
< XObjectInspectorUI
>& _rxInspectorUI
) const
1824 // ----- StringItemList -----
1825 case PROPERTY_ID_STRINGITEMLIST
:
1827 ListSourceType eLSType
= ListSourceType_VALUELIST
;
1828 OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_LISTSOURCETYPE
) >>= eLSType
);
1830 ::rtl::OUString sListSource
;
1832 Sequence
< ::rtl::OUString
> aListSource
;
1833 Any
aListSourceValue( impl_getPropertyValue_throw( PROPERTY_LISTSOURCE
) );
1834 if ( aListSourceValue
>>= aListSource
)
1836 if ( aListSource
.getLength() )
1837 sListSource
= aListSource
[0];
1840 OSL_VERIFY( aListSourceValue
>>= sListSource
);
1843 sal_Bool bIsEnabled
= ( ( eLSType
== ListSourceType_VALUELIST
)
1844 || ( sListSource
.getLength() == 0 )
1846 _rxInspectorUI
->enablePropertyUI( PROPERTY_STRINGITEMLIST
, bIsEnabled
);
1848 break; // case PROPERTY_ID_STRINGITEMLIST
1850 // ----- BoundColumn -----
1851 case PROPERTY_ID_BOUNDCOLUMN
:
1853 ::rtl::OUString sControlSource
;
1854 OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_CONTROLSOURCE
) >>= sControlSource
);
1856 ListSourceType eLSType
= ListSourceType_VALUELIST
;
1857 OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_LISTSOURCETYPE
) >>= eLSType
);
1859 _rxInspectorUI
->enablePropertyUI( PROPERTY_BOUNDCOLUMN
,
1860 ( sControlSource
.getLength() > 0 )
1861 && ( eLSType
!= ListSourceType_TABLEFIELDS
)
1862 && ( eLSType
!= ListSourceType_VALUELIST
)
1865 break; // case PROPERTY_ID_BOUNDCOLUMN
1867 // ----- ScaleImage, ScaleMode -----
1868 case PROPERTY_ID_SCALEIMAGE
:
1869 case PROPERTY_ID_SCALE_MODE
:
1871 ::rtl::OUString sControlSource
;
1872 if ( impl_isSupportedProperty_nothrow( PROPERTY_ID_CONTROLSOURCE
) )
1873 impl_getPropertyValue_throw( PROPERTY_CONTROLSOURCE
) >>= sControlSource
;
1875 ::rtl::OUString sImageURL
;
1876 impl_getPropertyValue_throw( PROPERTY_IMAGE_URL
) >>= sImageURL
;
1878 _rxInspectorUI
->enablePropertyUI( impl_getPropertyNameFromId_nothrow( _nPropId
),
1879 ( sControlSource
.getLength() != 0 ) || ( sImageURL
.getLength() != 0 )
1882 break; // case PROPERTY_ID_SCALEIMAGE, PROPERTY_ID_SCALE_MODE
1884 // ----- InputRequired -----
1885 case PROPERTY_ID_INPUT_REQUIRED
:
1887 ::rtl::OUString sControlSource
;
1888 OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_CONTROLSOURCE
) >>= sControlSource
);
1890 sal_Bool bEmptyIsNULL
= sal_False
;
1891 sal_Bool bHasEmptyIsNULL
= impl_componentHasProperty_throw( PROPERTY_EMPTY_IS_NULL
);
1892 if ( bHasEmptyIsNULL
)
1893 OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_EMPTY_IS_NULL
) >>= bEmptyIsNULL
);
1895 // if the control is not bound to a DB field, there is no sense in having the "Input required"
1897 // Also, if an empty input of this control are *not* written as NULL, but as empty strings,
1898 // then "Input required" does not make sense, too (since there's always an input, even if the control
1900 _rxInspectorUI
->enablePropertyUI( PROPERTY_INPUT_REQUIRED
,
1901 ( sControlSource
.getLength() != 0 ) && ( !bHasEmptyIsNULL
|| bEmptyIsNULL
)
1906 // ----- SelectedItems, DefaultSelection -----
1907 case PROPERTY_ID_SELECTEDITEMS
:
1908 case PROPERTY_ID_DEFAULT_SELECT_SEQ
:
1910 Sequence
< ::rtl::OUString
> aEntries
;
1911 impl_getPropertyValue_throw( PROPERTY_STRINGITEMLIST
) >>= aEntries
;
1912 bool isEnabled
= aEntries
.getLength() != 0;
1914 if ( ( m_nClassId
== FormComponentType::LISTBOX
) && ( m_eComponentClass
== eFormControl
) )
1916 ListSourceType eLSType
= ListSourceType_VALUELIST
;
1917 impl_getPropertyValue_throw( PROPERTY_LISTSOURCETYPE
) >>= eLSType
;
1918 isEnabled
&= ( eLSType
== ListSourceType_VALUELIST
);
1920 _rxInspectorUI
->enablePropertyUIElements( impl_getPropertyNameFromId_nothrow( _nPropId
),
1921 PropertyLineElement::PrimaryButton
, isEnabled
);
1923 break; // case PROPERTY_ID_DEFAULT_SELECT_SEQ
1925 // ----- TargetFrame ------
1926 case PROPERTY_ID_TARGET_FRAME
:
1928 ::rtl::OUString sTargetURL
;
1929 impl_getPropertyValue_throw( PROPERTY_TARGET_URL
) >>= sTargetURL
;
1930 FormButtonType
eButtonType( FormButtonType_URL
);
1931 if ( 0 != m_nClassId
)
1933 OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_BUTTONTYPE
) >>= eButtonType
);
1935 // if m_nClassId is 0, then we're inspecting a form. In this case, eButtonType is always
1936 // FormButtonType_URL here
1937 _rxInspectorUI
->enablePropertyUI( PROPERTY_TARGET_FRAME
,
1938 ( eButtonType
== FormButtonType_URL
) && ( sTargetURL
.getLength() > 0 )
1943 // ----- Order ------
1944 case PROPERTY_ID_SORT
:
1945 // ----- Filter ------
1946 case PROPERTY_ID_FILTER
:
1948 Reference
< XConnection
> xConnection
;
1949 bool bAllowEmptyDS
= ::dbtools::isEmbeddedInDatabase( m_xComponent
, xConnection
);
1951 // if there's no escape processing, we cannot enter any values for this property
1952 sal_Bool
bDoEscapeProcessing( sal_False
);
1953 impl_getPropertyValue_throw( PROPERTY_ESCAPE_PROCESSING
) >>= bDoEscapeProcessing
;
1954 _rxInspectorUI
->enablePropertyUI(
1955 impl_getPropertyNameFromId_nothrow( _nPropId
),
1959 // also care for the browse button - enabled if we have escape processing, and a valid
1960 // data source signature
1961 _rxInspectorUI
->enablePropertyUIElements(
1962 impl_getPropertyNameFromId_nothrow( _nPropId
),
1963 PropertyLineElement::PrimaryButton
,
1964 impl_hasValidDataSourceSignature_nothrow( m_xComponent
, bAllowEmptyDS
)
1965 && bDoEscapeProcessing
1968 break; // case PROPERTY_ID_FILTER:
1970 // ----- Command -----
1971 case PROPERTY_ID_COMMAND
:
1973 sal_Int32
nCommandType( CommandType::COMMAND
);
1974 OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_COMMANDTYPE
) >>= nCommandType
);
1976 impl_ensureRowsetConnection_nothrow();
1977 Reference
< XConnection
> xConnection
= m_xRowSetConnection
.getTyped();
1978 bool bAllowEmptyDS
= false;
1979 if ( !xConnection
.is() )
1980 bAllowEmptyDS
= ::dbtools::isEmbeddedInDatabase( m_xComponent
, xConnection
);
1982 bool doEnable
= ( nCommandType
== CommandType::COMMAND
)
1983 && ( m_xRowSetConnection
.is()
1985 || impl_hasValidDataSourceSignature_nothrow( m_xComponent
, bAllowEmptyDS
)
1988 _rxInspectorUI
->enablePropertyUIElements(
1990 PropertyLineElement::PrimaryButton
,
1994 break; // case PROPERTY_ID_COMMAND
1996 // ----- DetailFields -----
1997 case PROPERTY_ID_DETAILFIELDS
:
1999 Reference
< XConnection
> xConnection
;
2000 bool bAllowEmptyDS
= ::dbtools::isEmbeddedInDatabase( m_xComponent
, xConnection
);
2002 // both our current form, and it's parent form, need to have a valid
2003 // data source signature
2004 bool bDoEnableMasterDetailFields
=
2005 impl_hasValidDataSourceSignature_nothrow( m_xComponent
, bAllowEmptyDS
)
2006 && impl_hasValidDataSourceSignature_nothrow( Reference
< XPropertySet
>( m_xObjectParent
, UNO_QUERY
), bAllowEmptyDS
);
2008 // in opposite to the other properties, here in real *two* properties are
2010 _rxInspectorUI
->enablePropertyUIElements( PROPERTY_DETAILFIELDS
, PropertyLineElement::PrimaryButton
, bDoEnableMasterDetailFields
);
2011 _rxInspectorUI
->enablePropertyUIElements( PROPERTY_MASTERFIELDS
, PropertyLineElement::PrimaryButton
, bDoEnableMasterDetailFields
);
2016 OSL_ENSURE( false, "FormComponentPropertyHandler::impl_updateDependentProperty_nothrow: unexpected property to update!" );
2021 catch( const Exception
& )
2023 OSL_ENSURE( sal_False
, "FormComponentPropertyHandler::impl_updateDependentProperty_nothrow: caught an exception!" );
2027 //------------------------------------------------------------------------
2028 void SAL_CALL
FormComponentPropertyHandler::disposing()
2030 FormComponentPropertyHandler_Base::disposing();
2031 if ( m_xCommandDesigner
.is() && m_xCommandDesigner
->isActive() )
2032 m_xCommandDesigner
->dispose();
2035 //------------------------------------------------------------------------
2036 sal_Bool SAL_CALL
FormComponentPropertyHandler::suspend( sal_Bool _bSuspend
) throw (RuntimeException
)
2038 ::osl::MutexGuard
aGuard( m_aMutex
);
2040 if ( m_xCommandDesigner
.is() && m_xCommandDesigner
->isActive() )
2041 return m_xCommandDesigner
->suspend();
2045 //------------------------------------------------------------------------
2046 void FormComponentPropertyHandler::impl_initComponentMetaData_throw()
2050 //////////////////////////////////////////////////////////////////
2052 m_eComponentClass
= eUnknown
;
2054 if ( impl_componentHasProperty_throw( PROPERTY_WIDTH
)
2055 && impl_componentHasProperty_throw( PROPERTY_HEIGHT
)
2056 && impl_componentHasProperty_throw( PROPERTY_POSITIONX
)
2057 && impl_componentHasProperty_throw( PROPERTY_POSITIONY
)
2058 && impl_componentHasProperty_throw( PROPERTY_STEP
)
2059 && impl_componentHasProperty_throw( PROPERTY_TABINDEX
)
2062 m_eComponentClass
= eDialogControl
;
2066 m_eComponentClass
= eFormControl
;
2069 //////////////////////////////////////////////////////////////////
2070 // (database) sub form?
2071 Reference
< XForm
> xAsForm( m_xComponent
, UNO_QUERY
);
2074 Reference
< XChild
> xFormAsChild( xAsForm
, UNO_QUERY
);
2075 Reference
< XForm
> xFormsParent
;
2076 if ( xFormAsChild
.is() )
2077 xFormsParent
= xFormsParent
.query( xFormAsChild
->getParent() );
2078 m_bComponentIsSubForm
= xFormsParent
.is();
2081 //////////////////////////////////////////////////////////////////
2083 Reference
< XChild
> xCompAsChild( m_xComponent
, UNO_QUERY
);
2084 if ( xCompAsChild
.is() )
2085 m_xObjectParent
= xCompAsChild
->getParent();
2087 //////////////////////////////////////////////////////////////////
2089 impl_classifyControlModel_throw();
2091 catch( const RuntimeException
& )
2095 catch( const Exception
& )
2097 OSL_ENSURE( sal_False
, "FormComponentPropertyHandler::impl_initComponentMetaData_throw: caught an exception!" );
2101 //------------------------------------------------------------------------
2102 void FormComponentPropertyHandler::impl_classifyControlModel_throw( )
2104 if ( impl_componentHasProperty_throw( PROPERTY_CLASSID
) )
2106 OSL_VERIFY( m_xComponent
->getPropertyValue( PROPERTY_CLASSID
) >>= m_nClassId
);
2108 else if ( eDialogControl
== m_eComponentClass
)
2110 Reference
< XControlModel
> xControlModel( m_xComponent
, UNO_QUERY
);
2111 Reference
< XServiceInfo
> xServiceInfo( m_xComponent
, UNO_QUERY
);
2112 if ( xServiceInfo
.is() )
2114 // it's a control model, and can tell about it's supported services
2115 m_nClassId
= FormComponentType::CONTROL
;
2117 const sal_Char
* aControlModelServiceNames
[] =
2119 "UnoControlButtonModel",
2120 "UnoControlCheckBoxModel",
2121 "UnoControlComboBoxModel",
2122 "UnoControlCurrencyFieldModel",
2123 "UnoControlDateFieldModel",
2124 "UnoControlEditModel",
2125 "UnoControlFileControlModel",
2126 "UnoControlFixedTextModel",
2127 "UnoControlGroupBoxModel",
2128 "UnoControlImageControlModel",
2129 "UnoControlListBoxModel",
2130 "UnoControlNumericFieldModel",
2131 "UnoControlPatternFieldModel",
2132 "UnoControlRadioButtonModel",
2133 "UnoControlScrollBarModel",
2134 "UnoControlSpinButtonModel",
2135 "UnoControlTimeFieldModel",
2137 "UnoControlFixedLineModel",
2138 "UnoControlFormattedFieldModel",
2139 "UnoControlProgressBarModel"
2141 const sal_Int16 nClassIDs
[] =
2143 FormComponentType::COMMANDBUTTON
,
2144 FormComponentType::CHECKBOX
,
2145 FormComponentType::COMBOBOX
,
2146 FormComponentType::CURRENCYFIELD
,
2147 FormComponentType::DATEFIELD
,
2148 FormComponentType::TEXTFIELD
,
2149 FormComponentType::FILECONTROL
,
2150 FormComponentType::FIXEDTEXT
,
2151 FormComponentType::GROUPBOX
,
2152 FormComponentType::IMAGECONTROL
,
2153 FormComponentType::LISTBOX
,
2154 FormComponentType::NUMERICFIELD
,
2155 FormComponentType::PATTERNFIELD
,
2156 FormComponentType::RADIOBUTTON
,
2157 FormComponentType::SCROLLBAR
,
2158 FormComponentType::SPINBUTTON
,
2159 FormComponentType::TIMEFIELD
,
2161 ControlType::FIXEDLINE
,
2162 ControlType::FORMATTEDFIELD
,
2163 ControlType::PROGRESSBAR
2166 sal_Int32 nKnownControlTypes
= sizeof( aControlModelServiceNames
) / sizeof( aControlModelServiceNames
[ 0 ] );
2167 OSL_ENSURE( nKnownControlTypes
== sizeof( nClassIDs
) / sizeof( nClassIDs
[ 0 ] ),
2168 "FormComponentPropertyHandler::impl_classifyControlModel_throw: inconsistence" );
2170 for ( sal_Int32 i
= 0; i
< nKnownControlTypes
; ++i
)
2172 ::rtl::OUString
sServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt." ) );
2173 sServiceName
+= ::rtl::OUString::createFromAscii( aControlModelServiceNames
[ i
] );
2175 if ( xServiceInfo
->supportsService( sServiceName
) )
2177 m_nClassId
= nClassIDs
[ i
];
2185 //------------------------------------------------------------------------
2186 void FormComponentPropertyHandler::impl_normalizePropertyValue_nothrow( Any
& _rValue
, PropertyId _nPropId
) const
2190 case PROPERTY_ID_TABSTOP
:
2191 if ( !_rValue
.hasValue() )
2193 switch ( m_nClassId
)
2195 case FormComponentType::COMMANDBUTTON
:
2196 case FormComponentType::RADIOBUTTON
:
2197 case FormComponentType::CHECKBOX
:
2198 case FormComponentType::TEXTFIELD
:
2199 case FormComponentType::LISTBOX
:
2200 case FormComponentType::COMBOBOX
:
2201 case FormComponentType::FILECONTROL
:
2202 case FormComponentType::DATEFIELD
:
2203 case FormComponentType::TIMEFIELD
:
2204 case FormComponentType::NUMERICFIELD
:
2205 case ControlType::FORMATTEDFIELD
:
2206 case FormComponentType::CURRENCYFIELD
:
2207 case FormComponentType::PATTERNFIELD
:
2208 _rValue
= makeAny( (sal_Bool
)sal_True
);
2211 _rValue
= makeAny( (sal_Bool
)sal_False
);
2219 //------------------------------------------------------------------------
2220 bool FormComponentPropertyHandler::impl_shouldExcludeProperty_nothrow( const Property
& _rProperty
) const
2222 OSL_ENSURE( _rProperty
.Handle
== m_pInfoService
->getPropertyId( _rProperty
.Name
),
2223 "FormComponentPropertyHandler::impl_shouldExcludeProperty_nothrow: insonsistency in the property!" );
2225 if ( _rProperty
.Handle
== PROPERTY_ID_CONTROLLABEL
)
2226 // prevent that this is caught below
2229 if ( ( _rProperty
.Type
.getTypeClass() == TypeClass_INTERFACE
)
2230 || ( _rProperty
.Type
.getTypeClass() == TypeClass_ARRAY
)
2231 || ( _rProperty
.Type
.getTypeClass() == TypeClass_UNKNOWN
)
2235 if ( ( _rProperty
.Attributes
& PropertyAttribute::TRANSIENT
) && ( m_eComponentClass
!= eDialogControl
) )
2236 // strange enough, dialog controls declare a lot of their properties as transient
2239 if ( _rProperty
.Attributes
& PropertyAttribute::READONLY
)
2242 switch ( _rProperty
.Handle
)
2244 case PROPERTY_ID_MASTERFIELDS
:
2245 case PROPERTY_ID_DETAILFIELDS
:
2246 if ( !m_bComponentIsSubForm
)
2247 // no master and detail fields for forms which are no sub forms
2251 case PROPERTY_ID_DATASOURCE
:
2253 // don't show DataSource if the component is part of an embedded form document
2254 Reference
< XConnection
> xConn
;
2255 if ( isEmbeddedInDatabase( m_xComponent
, xConn
) )
2260 case PROPERTY_ID_TEXT
:
2261 // don't show the "Text" property of formatted fields
2262 if ( ControlType::FORMATTEDFIELD
== m_nClassId
)
2266 case PROPERTY_ID_FORMATKEY
:
2267 case PROPERTY_ID_EFFECTIVE_MIN
:
2268 case PROPERTY_ID_EFFECTIVE_MAX
:
2269 case PROPERTY_ID_EFFECTIVE_DEFAULT
:
2270 case PROPERTY_ID_EFFECTIVE_VALUE
:
2271 // only if the set has a formats supplier, too
2272 if ( !impl_componentHasProperty_throw( PROPERTY_FORMATSSUPPLIER
) )
2274 // (form) date and time fields also have a formats supplier, but the format itself
2275 // is reflected in another property
2276 if ( ( FormComponentType::DATEFIELD
== m_nClassId
)
2277 || ( FormComponentType::TIMEFIELD
== m_nClassId
)
2282 case PROPERTY_ID_SCALEIMAGE
:
2283 if ( impl_componentHasProperty_throw( PROPERTY_SCALE_MODE
) )
2284 // ScaleImage is superseded by ScaleMode
2288 case PROPERTY_ID_WRITING_MODE
:
2289 if ( !SvtCTLOptions().IsCTLFontEnabled() )
2294 sal_uInt32 nPropertyUIFlags
= m_pInfoService
->getPropertyUIFlags( _rProperty
.Handle
);
2296 // don't show experimental properties unless allowed to do so
2297 if ( ( nPropertyUIFlags
& PROP_FLAG_EXPERIMENTAL
) != 0 )
2303 // no data properties if no Base is installed. #124939#
2304 // This fix is not intendend to appear on the main trunk. If you find it there,
2305 // please tell me! frank.schoenheit@sun.com
2306 if ( ( nPropertyUIFlags
& PROP_FLAG_DATA_PROPERTY
) != 0 )
2307 if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::E_SDATABASE
) )
2313 //------------------------------------------------------------------------
2314 Reference
< XRowSet
> FormComponentPropertyHandler::impl_getRowSet_throw( ) const
2316 Reference
< XRowSet
> xRowSet
= m_xRowSet
;
2317 if ( !xRowSet
.is() )
2319 xRowSet
.set( m_xComponent
, UNO_QUERY
);
2320 if ( !xRowSet
.is() )
2322 xRowSet
= Reference
< XRowSet
>( m_xObjectParent
, UNO_QUERY
);
2323 if ( !xRowSet
.is() )
2325 // are we inspecting a grid column?
2326 if (Reference
< XGridColumnFactory
>( m_xObjectParent
, UNO_QUERY
) .is())
2328 Reference
< XChild
> xParentAsChild( m_xObjectParent
, UNO_QUERY
);
2329 if ( xParentAsChild
.is() )
2330 xRowSet
= Reference
< XRowSet
>( xParentAsChild
->getParent(), UNO_QUERY
);
2333 if ( !xRowSet
.is() )
2334 xRowSet
= m_xRowSet
;
2336 DBG_ASSERT( xRowSet
.is(), "FormComponentPropertyHandler::impl_getRowSet_throw: could not obtain the rowset for the introspectee!" );
2341 //------------------------------------------------------------------------
2342 Reference
< XRowSet
> FormComponentPropertyHandler::impl_getRowSet_nothrow( ) const
2344 Reference
< XRowSet
> xReturn
;
2347 xReturn
= impl_getRowSet_throw();
2349 catch( const Exception
& )
2351 OSL_ENSURE( sal_False
, "FormComponentPropertyHandler::impl_getRowSet_nothrow: caught an exception!" );
2356 //------------------------------------------------------------------------
2357 void FormComponentPropertyHandler::impl_initFieldList_nothrow( ::std::vector
< ::rtl::OUString
>& _rFieldNames
) const
2359 clearContainer( _rFieldNames
);
2362 WaitCursor
aWaitCursor( impl_getDefaultDialogParent_nothrow() );
2364 Reference
< XPreparedStatement
> xStatement
;
2366 // get the form of the control we're inspecting
2367 Reference
< XPropertySet
> xFormSet( impl_getRowSet_throw(), UNO_QUERY
);
2368 if ( !xFormSet
.is() )
2371 ::rtl::OUString sObjectName
;
2372 OSL_VERIFY( xFormSet
->getPropertyValue( PROPERTY_COMMAND
) >>= sObjectName
);
2373 // when there is no command we don't need to ask for columns
2374 if ( sObjectName
.getLength() && impl_ensureRowsetConnection_nothrow() )
2376 ::rtl::OUString aDatabaseName
;
2377 OSL_VERIFY( xFormSet
->getPropertyValue( PROPERTY_DATASOURCE
) >>= aDatabaseName
);
2378 sal_Int32 nObjectType
= CommandType::COMMAND
;
2379 OSL_VERIFY( xFormSet
->getPropertyValue( PROPERTY_COMMANDTYPE
) >>= nObjectType
);
2381 Sequence
< ::rtl::OUString
> aFields( ::dbtools::getFieldNamesByCommandDescriptor( m_xRowSetConnection
, nObjectType
, sObjectName
) );
2383 const ::rtl::OUString
* pFields
= aFields
.getConstArray();
2384 for ( sal_Int32 i
= 0; i
< aFields
.getLength(); ++i
, ++pFields
)
2385 _rFieldNames
.push_back( *pFields
);
2390 DBG_ERROR( "FormComponentPropertyHandler::impl_initFieldList_nothrow: caught an exception!" );
2394 //------------------------------------------------------------------------
2395 void FormComponentPropertyHandler::impl_clearRowsetConnection_nothrow()
2397 m_xRowSetConnection
.clear();
2400 //------------------------------------------------------------------------
2401 void FormComponentPropertyHandler::impl_displaySQLError_nothrow( const ::dbtools::SQLExceptionInfo
& _rErrorDescriptor
) const
2403 ::dbtools::showError( _rErrorDescriptor
, VCLUnoHelper::GetInterface( impl_getDefaultDialogParent_nothrow() ), m_aContext
.getLegacyServiceFactory() );
2406 //------------------------------------------------------------------------
2407 bool FormComponentPropertyHandler::impl_ensureRowsetConnection_nothrow() const
2409 if ( !m_xRowSetConnection
.is() )
2411 uno::Reference
<sdbc::XConnection
> xConnection(m_aContext
.getContextValueByAsciiName( "ActiveConnection" ),uno::UNO_QUERY
);
2412 m_xRowSetConnection
.reset(xConnection
,::dbtools::SharedConnection::NoTakeOwnership
);
2414 if ( m_xRowSetConnection
.is() )
2417 Reference
< XRowSet
> xRowSet( impl_getRowSet_throw() );
2418 Reference
< XPropertySet
> xRowSetProps( xRowSet
, UNO_QUERY
);
2420 // connect the row set - this is delegated to elsewhere - while observing errors
2421 SQLExceptionInfo aError
;
2424 if ( xRowSetProps
.is() )
2426 WaitCursor
aWaitCursor( impl_getDefaultDialogParent_nothrow() );
2427 m_xRowSetConnection
= ::dbtools::ensureRowSetConnection( xRowSet
, m_aContext
.getLegacyServiceFactory(), false );
2430 catch ( const SQLException
& ) { aError
= SQLExceptionInfo( ::cppu::getCaughtException() ); }
2431 catch ( const WrappedTargetException
& e
) { aError
= SQLExceptionInfo( e
.TargetException
); }
2432 catch ( const Exception
& ) { DBG_UNHANDLED_EXCEPTION(); }
2434 // report errors, if necessary
2435 if ( aError
.isValid() )
2437 ::rtl::OUString sDataSourceName
;
2440 xRowSetProps
->getPropertyValue( PROPERTY_DATASOURCE
) >>= sDataSourceName
;
2442 catch( const Exception
& )
2444 DBG_ERROR( "FormComponentPropertyHandler::impl_ensureRowsetConnection_nothrow: caught an exception during error handling!" );
2446 // additional info about what happended
2447 String
sInfo( PcrRes( RID_STR_UNABLETOCONNECT
) );
2448 INetURLObject
aParser( sDataSourceName
);
2449 if ( aParser
.GetProtocol() != INET_PROT_NOT_VALID
)
2450 sDataSourceName
= aParser
.getBase( INetURLObject::LAST_SEGMENT
, true, INetURLObject::DECODE_WITH_CHARSET
);
2451 sInfo
.SearchAndReplaceAllAscii( "$name$", sDataSourceName
);
2453 SQLContext aContext
;
2454 aContext
.Message
= sInfo
;
2455 aContext
.NextException
= aError
.get();
2456 impl_displaySQLError_nothrow( aContext
);
2459 return m_xRowSetConnection
.is();
2462 //------------------------------------------------------------------------
2463 void FormComponentPropertyHandler::impl_describeCursorSource_nothrow( LineDescriptor
& _out_rProperty
, const Reference
< XPropertyControlFactory
>& _rxControlFactory
) const
2467 WaitCursor
aWaitCursor( impl_getDefaultDialogParent_nothrow() );
2469 ////////////////////////////////////////////////////////////
2470 // Setzen der UI-Daten
2471 _out_rProperty
.DisplayName
= m_pInfoService
->getPropertyTranslation( PROPERTY_ID_COMMAND
);
2473 _out_rProperty
.HelpURL
= HelpIdUrl::getHelpURL( m_pInfoService
->getPropertyHelpId( PROPERTY_ID_COMMAND
) );
2474 _out_rProperty
.PrimaryButtonId
= UID_PROP_DLG_SQLCOMMAND
;
2476 ////////////////////////////////////////////////////////////
2477 sal_Int32 nCommandType
= CommandType::COMMAND
;
2478 impl_getPropertyValue_throw( PROPERTY_COMMANDTYPE
) >>= nCommandType
;
2480 switch ( nCommandType
)
2482 case CommandType::TABLE
:
2483 case CommandType::QUERY
:
2485 ::std::vector
< ::rtl::OUString
> aNames
;
2486 if ( impl_ensureRowsetConnection_nothrow() )
2488 if ( nCommandType
== CommandType::TABLE
)
2489 impl_fillTableNames_throw( aNames
);
2491 impl_fillQueryNames_throw( aNames
);
2493 _out_rProperty
.Control
= PropertyHandlerHelper::createComboBoxControl( _rxControlFactory
, aNames
, sal_False
, sal_True
);
2498 _out_rProperty
.Control
= _rxControlFactory
->createPropertyControl( PropertyControlType::MultiLineTextField
, sal_False
);
2504 DBG_ERROR("FormComponentPropertyHandler::impl_describeCursorSource_nothrow: caught an exception !");
2508 //------------------------------------------------------------------------
2509 void FormComponentPropertyHandler::impl_fillTableNames_throw( ::std::vector
< ::rtl::OUString
>& _out_rNames
) const
2511 OSL_PRECOND( m_xRowSetConnection
.is(), "FormComponentPropertyHandler::impl_fillTableNames_throw: need a connection!" );
2512 _out_rNames
.resize( 0 );
2514 Reference
< XTablesSupplier
> xSupplyTables( m_xRowSetConnection
, UNO_QUERY
);
2515 Reference
< XNameAccess
> xTableNames
;
2516 if ( xSupplyTables
.is() )
2517 xTableNames
= xSupplyTables
->getTables();
2518 DBG_ASSERT( xTableNames
.is(), "FormComponentPropertyHandler::impl_fillTableNames_throw: no way to obtain the tables of the connection!" );
2519 if ( !xTableNames
.is() )
2522 Sequence
< ::rtl::OUString
> aTableNames
= xTableNames
->getElementNames();
2523 sal_uInt32 nCount
= aTableNames
.getLength();
2524 const ::rtl::OUString
* pTableNames
= aTableNames
.getConstArray();
2526 for ( sal_uInt32 i
=0; i
<nCount
; ++i
,++pTableNames
)
2527 _out_rNames
.push_back( *pTableNames
);
2530 //------------------------------------------------------------------------
2531 void FormComponentPropertyHandler::impl_fillQueryNames_throw( ::std::vector
< ::rtl::OUString
>& _out_rNames
) const
2533 OSL_PRECOND( m_xRowSetConnection
.is(), "FormComponentPropertyHandler::impl_fillQueryNames_throw: need a connection!" );
2534 _out_rNames
.resize( 0 );
2536 Reference
< XQueriesSupplier
> xSupplyQueries( m_xRowSetConnection
, UNO_QUERY
);
2537 Reference
< XNameAccess
> xQueryNames
;
2538 if ( xSupplyQueries
.is() )
2540 xQueryNames
= xSupplyQueries
->getQueries();
2541 impl_fillQueryNames_throw(xQueryNames
,_out_rNames
);
2544 //------------------------------------------------------------------------
2545 void FormComponentPropertyHandler::impl_fillQueryNames_throw( const Reference
< XNameAccess
>& _xQueryNames
,::std::vector
< ::rtl::OUString
>& _out_rNames
,const ::rtl::OUString
& _sName
) const
2547 DBG_ASSERT( _xQueryNames
.is(), "FormComponentPropertyHandler::impl_fillQueryNames_throw: no way to obtain the queries of the connection!" );
2548 if ( !_xQueryNames
.is() )
2551 Sequence
< ::rtl::OUString
> aQueryNames
= _xQueryNames
->getElementNames();
2552 sal_uInt32 nCount
= aQueryNames
.getLength();
2553 const ::rtl::OUString
* pQueryNames
= aQueryNames
.getConstArray();
2554 sal_Bool bAdd
= _sName
.getLength();
2556 for ( sal_uInt32 i
=0; i
<nCount
; i
++, ++pQueryNames
)
2558 ::rtl::OUStringBuffer sTemp
;
2561 sTemp
.append(_sName
);
2562 sTemp
.appendAscii("/");
2564 sTemp
.append(*pQueryNames
);
2565 Reference
< XNameAccess
> xSubQueries(_xQueryNames
->getByName(*pQueryNames
),UNO_QUERY
);
2566 if ( xSubQueries
.is() )
2567 impl_fillQueryNames_throw(xSubQueries
,_out_rNames
,sTemp
.makeStringAndClear());
2569 _out_rNames
.push_back( sTemp
.makeStringAndClear() );
2573 //------------------------------------------------------------------------
2574 void FormComponentPropertyHandler::impl_describeListSourceUI_throw( LineDescriptor
& _out_rDescriptor
, const Reference
< XPropertyControlFactory
>& _rxControlFactory
) const
2576 OSL_PRECOND( m_xComponent
.is(), "FormComponentPropertyHandler::impl_describeListSourceUI_throw: no component!" );
2578 ////////////////////////////////////////////////////////////
2579 // Auslesen des ListSourceTypes
2580 Any
aListSourceType( m_xComponent
->getPropertyValue( PROPERTY_LISTSOURCETYPE
) );
2582 sal_Int32 nListSourceType
= ListSourceType_VALUELIST
;
2583 ::cppu::enum2int( nListSourceType
, aListSourceType
);
2585 _out_rDescriptor
.DisplayName
= m_pInfoService
->getPropertyTranslation( PROPERTY_ID_LISTSOURCE
);
2586 _out_rDescriptor
.HelpURL
= HelpIdUrl::getHelpURL( m_pInfoService
->getPropertyHelpId( PROPERTY_ID_LISTSOURCE
) );
2588 ////////////////////////////////////////////////////////////
2590 switch( nListSourceType
)
2592 case ListSourceType_VALUELIST
:
2593 _out_rDescriptor
.Control
= _rxControlFactory
->createPropertyControl( PropertyControlType::StringListField
, sal_False
);
2596 case ListSourceType_TABLEFIELDS
:
2597 case ListSourceType_TABLE
:
2598 case ListSourceType_QUERY
:
2600 ::std::vector
< ::rtl::OUString
> aListEntries
;
2601 if ( impl_ensureRowsetConnection_nothrow() )
2603 if ( nListSourceType
== ListSourceType_QUERY
)
2604 impl_fillQueryNames_throw( aListEntries
);
2606 impl_fillTableNames_throw( aListEntries
);
2608 _out_rDescriptor
.Control
= PropertyHandlerHelper::createComboBoxControl( _rxControlFactory
, aListEntries
, sal_False
, sal_False
);
2611 case ListSourceType_SQL
:
2612 case ListSourceType_SQLPASSTHROUGH
:
2613 impl_ensureRowsetConnection_nothrow();
2614 _out_rDescriptor
.HasPrimaryButton
= m_xRowSetConnection
.is();
2619 //------------------------------------------------------------------------
2620 bool FormComponentPropertyHandler::impl_dialogListSelection_nothrow( const ::rtl::OUString
& _rProperty
, ::osl::ClearableMutexGuard
& _rClearBeforeDialog
) const
2622 OSL_PRECOND( m_pInfoService
.get(), "FormComponentPropertyHandler::impl_dialogListSelection_nothrow: no property meta data!" );
2624 String
sPropertyUIName( m_pInfoService
->getPropertyTranslation( m_pInfoService
->getPropertyId( _rProperty
) ) );
2625 ListSelectionDialog
aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent
, _rProperty
, sPropertyUIName
);
2626 _rClearBeforeDialog
.clear();
2627 return ( RET_OK
== aDialog
.Execute() );
2630 //------------------------------------------------------------------------
2631 bool FormComponentPropertyHandler::impl_dialogFilterOrSort_nothrow( bool _bFilter
, ::rtl::OUString
& _out_rSelectedClause
, ::osl::ClearableMutexGuard
& _rClearBeforeDialog
) const
2633 OSL_PRECOND( Reference
< XRowSet
>( m_xComponent
, UNO_QUERY
).is(),
2634 "FormComponentPropertyHandler::impl_dialogFilterOrSort_nothrow: to be called for forms only!" );
2636 _out_rSelectedClause
= ::rtl::OUString();
2637 bool bSuccess
= false;
2638 SQLExceptionInfo aErrorInfo
;
2641 if ( !impl_ensureRowsetConnection_nothrow() )
2644 // get a composer for the statement which the form is currently based on
2645 Reference
< XSingleSelectQueryComposer
> xComposer( ::dbtools::getCurrentSettingsComposer( m_xComponent
, m_aContext
.getLegacyServiceFactory() ) );
2646 OSL_ENSURE( xComposer
.is(), "FormComponentPropertyHandler::impl_dialogFilterOrSort_nothrow: could not obtain a composer!" );
2647 if ( !xComposer
.is() )
2650 ::rtl::OUString
sPropertyUIName( m_pInfoService
->getPropertyTranslation( _bFilter
? PROPERTY_ID_FILTER
: PROPERTY_ID_SORT
) );
2652 const sal_Char
* pAsciiServiceName
= _bFilter
? "com.sun.star.sdb.FilterDialog" : "com.sun.star.sdb.OrderDialog";
2654 // create the dialog
2655 Reference
< XExecutableDialog
> xDialog
;
2656 if ( !m_aContext
.createComponent( pAsciiServiceName
, xDialog
) )
2658 ShowServiceNotAvailableError( impl_getDefaultDialogParent_nothrow(), ::rtl::OUString::createFromAscii( pAsciiServiceName
), sal_True
);
2662 // initialize the dialog
2663 Reference
< XPropertySet
> xDialogProps( xDialog
, UNO_QUERY_THROW
);
2664 xDialogProps
->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "QueryComposer" ) ), makeAny( xComposer
) );
2665 xDialogProps
->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowSet" ) ), makeAny( m_xComponent
) );
2666 xDialogProps
->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParentWindow" ) ), makeAny( VCLUnoHelper::GetInterface( impl_getDefaultDialogParent_nothrow() ) ) );
2667 xDialogProps
->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), makeAny( sPropertyUIName
) );
2669 _rClearBeforeDialog
.clear();
2670 bSuccess
= ( xDialog
->execute() != 0 );
2672 _out_rSelectedClause
= _bFilter
? xComposer
->getFilter() : xComposer
->getOrder();
2674 catch (SQLContext
& e
) { aErrorInfo
= e
; }
2675 catch (SQLWarning
& e
) { aErrorInfo
= e
; }
2676 catch (SQLException
& e
) { aErrorInfo
= e
; }
2677 catch( const Exception
& )
2679 OSL_ENSURE( sal_False
, "FormComponentPropertyHandler::impl_dialogFilterOrSort_nothrow: caught an exception!" );
2682 if ( aErrorInfo
.isValid() )
2683 impl_displaySQLError_nothrow( aErrorInfo
);
2688 //------------------------------------------------------------------------
2689 bool FormComponentPropertyHandler::impl_dialogLinkedFormFields_nothrow( ::osl::ClearableMutexGuard
& _rClearBeforeDialog
) const
2691 Reference
< XForm
> xDetailForm( m_xComponent
, UNO_QUERY
);
2692 Reference
< XForm
> xMasterForm( m_xObjectParent
, UNO_QUERY
);
2693 uno::Reference
<beans::XPropertySet
> xMasterProp(m_xObjectParent
,uno::UNO_QUERY
);
2694 OSL_PRECOND( xDetailForm
.is() && xMasterForm
.is(), "FormComponentPropertyHandler::impl_dialogLinkedFormFields_nothrow: no forms!" );
2695 if ( !xDetailForm
.is() || !xMasterForm
.is() )
2699 FormLinkDialog
aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent
, xMasterProp
, m_aContext
.getLegacyServiceFactory() );
2700 _rClearBeforeDialog
.clear();
2701 return ( RET_OK
== aDialog
.Execute() );
2704 //------------------------------------------------------------------------
2705 bool FormComponentPropertyHandler::impl_dialogFormatting_nothrow( Any
& _out_rNewValue
, ::osl::ClearableMutexGuard
& _rClearBeforeDialog
) const
2707 bool bChanged
= false;
2710 // create the itemset for the dialog
2711 SfxItemSet
aCoreSet(SFX_APP()->GetPool(),
2712 SID_ATTR_NUMBERFORMAT_VALUE
, SID_ATTR_NUMBERFORMAT_VALUE
,
2713 SID_ATTR_NUMBERFORMAT_INFO
, SID_ATTR_NUMBERFORMAT_INFO
,
2714 0); // ripped this somewhere ... don't understand it :(
2716 // get the number formats supplier
2717 Reference
< XNumberFormatsSupplier
> xSupplier
;
2718 m_xComponent
->getPropertyValue( PROPERTY_FORMATSSUPPLIER
) >>= xSupplier
;
2720 DBG_ASSERT(xSupplier
.is(), "FormComponentPropertyHandler::impl_dialogFormatting_nothrow: invalid call !" );
2721 Reference
< XUnoTunnel
> xTunnel( xSupplier
, UNO_QUERY_THROW
);
2722 SvNumberFormatsSupplierObj
* pSupplier
=
2723 reinterpret_cast< SvNumberFormatsSupplierObj
* >( xTunnel
->getSomething( SvNumberFormatsSupplierObj::getUnoTunnelId() ) );
2724 DBG_ASSERT( pSupplier
!= NULL
, "FormComponentPropertyHandler::impl_dialogFormatting_nothrow: invalid call !" );
2726 sal_Int32 nFormatKey
= 0;
2727 impl_getPropertyValue_throw( PROPERTY_FORMATKEY
) >>= nFormatKey
;
2728 aCoreSet
.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE
, nFormatKey
) );
2730 SvNumberFormatter
* pFormatter
= pSupplier
->GetNumberFormatter();
2731 double dPreviewVal
= OFormatSampleControl::getPreviewValue(pFormatter
,nFormatKey
);
2732 SvxNumberInfoItem
aFormatter( pFormatter
, dPreviewVal
, String( PcrRes( RID_STR_TEXT_FORMAT
) ), SID_ATTR_NUMBERFORMAT_INFO
);
2733 aCoreSet
.Put( aFormatter
);
2735 // a tab dialog with a single page
2736 ::std::auto_ptr
< SfxSingleTabDialog
> pDialog( new SfxSingleTabDialog( impl_getDefaultDialogParent_nothrow(), aCoreSet
, 0 ) );
2737 SvxAbstractDialogFactory
* pFact
= SvxAbstractDialogFactory::Create();
2738 DBG_ASSERT( pFact
, "CreateFactory fail!" );
2739 ::CreateTabPage fnCreatePage
= pFact
->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT
);
2740 if ( !fnCreatePage
)
2741 throw RuntimeException(); // caught below
2743 SfxTabPage
* pPage
= (*fnCreatePage
)( pDialog
.get(), aCoreSet
);
2744 pDialog
->SetTabPage( pPage
);
2746 _rClearBeforeDialog
.clear();
2747 if ( RET_OK
== pDialog
->Execute() )
2749 const SfxItemSet
* pResult
= pDialog
->GetOutputItemSet();
2751 const SfxPoolItem
* pItem
= pResult
->GetItem( SID_ATTR_NUMBERFORMAT_INFO
);
2752 const SvxNumberInfoItem
* pInfoItem
= dynamic_cast< const SvxNumberInfoItem
* >( pItem
);
2753 if (pInfoItem
&& pInfoItem
->GetDelCount())
2755 const sal_uInt32
* pDeletedKeys
= pInfoItem
->GetDelArray();
2757 for (sal_uInt16 i
=0; i
< pInfoItem
->GetDelCount(); ++i
, ++pDeletedKeys
)
2758 pFormatter
->DeleteEntry(*pDeletedKeys
);
2762 if ( SFX_ITEM_SET
== pResult
->GetItemState( SID_ATTR_NUMBERFORMAT_VALUE
, sal_False
, &pItem
) )
2764 _out_rNewValue
<<= (sal_Int32
)( static_cast< const SfxUInt32Item
* >( pItem
)->GetValue() );
2769 catch( const Exception
& )
2771 OSL_ENSURE( sal_False
, "FormComponentPropertyHandler::impl_dialogFormatting_nothrow: : caught an exception!" );
2776 //------------------------------------------------------------------------
2777 bool FormComponentPropertyHandler::impl_browseForImage_nothrow( Any
& _out_rNewValue
, ::osl::ClearableMutexGuard
& _rClearBeforeDialog
) const
2779 bool bIsLink
= true;// reflect the legacy behavior
2780 ::rtl::OUString aStrTrans
= m_pInfoService
->getPropertyTranslation( PROPERTY_ID_IMAGE_URL
);
2782 ::sfx2::FileDialogHelper
aFileDlg(SFXWB_GRAPHIC
);
2784 aFileDlg
.SetTitle(aStrTrans
);
2785 // non-linked images ( e.g. those located in the document
2786 // stream ) cannot *currently* be handled by openoffice basic dialogs.
2787 bool bHandleNonLink
= ( m_eComponentClass
== eFormControl
);
2789 Reference
< XFilePickerControlAccess
> xController(aFileDlg
.GetFilePicker(), UNO_QUERY
);
2790 DBG_ASSERT(xController
.is(), "FormComponentPropertyHandler::impl_browseForImage_nothrow: missing the controller interface on the file picker!");
2791 if (xController
.is())
2793 // do a preview by default
2794 xController
->setValue(ExtendedFilePickerElementIds::CHECKBOX_PREVIEW
, 0, ::cppu::bool2any(sal_True
));
2796 xController
->setValue(ExtendedFilePickerElementIds::CHECKBOX_LINK
, 0, ::cppu::bool2any(bIsLink
));
2797 xController
->enableControl(ExtendedFilePickerElementIds::CHECKBOX_LINK
, bHandleNonLink
);
2801 ::rtl::OUString sCurValue
;
2802 OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_IMAGE_URL
) >>= sCurValue
);
2803 if ( sCurValue
.getLength() != 0 && sCurValue
.compareToAscii(GRAPHOBJ_URLPREFIX
, RTL_CONSTASCII_LENGTH(GRAPHOBJ_URLPREFIX
) ) != 0 )
2805 aFileDlg
.SetDisplayDirectory( sCurValue
);
2806 // TODO: need to set the display directory _and_ the default name
2809 _rClearBeforeDialog
.clear();
2810 bool bSuccess
= ( 0 == aFileDlg
.Execute() );
2813 if ( bHandleNonLink
&& xController
.is() )
2815 xController
->getValue(ExtendedFilePickerElementIds::CHECKBOX_LINK
, 0) >>= bIsLink
;
2820 aFileDlg
.GetGraphic( aGraphic
);
2822 Reference
< graphic::XGraphicObject
> xGrfObj
= graphic::GraphicObject::create( m_aContext
.getUNOContext() );
2823 xGrfObj
->setGraphic( aGraphic
.GetXGraphic() );
2826 _out_rNewValue
<<= xGrfObj
;
2830 _out_rNewValue
<<= (::rtl::OUString
)aFileDlg
.GetPath();
2835 //------------------------------------------------------------------------
2836 bool FormComponentPropertyHandler::impl_browseForTargetURL_nothrow( Any
& _out_rNewValue
, ::osl::ClearableMutexGuard
& _rClearBeforeDialog
) const
2838 ::sfx2::FileDialogHelper
aFileDlg( WB_3DLOOK
);
2840 ::rtl::OUString sURL
;
2841 OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_TARGET_URL
) >>= sURL
);
2842 INetURLObject
aParser( sURL
);
2843 if ( INET_PROT_FILE
== aParser
.GetProtocol() )
2844 // set the initial directory only for file-URLs. Everything else
2845 // is considered to be potentially expensive
2846 // 106126 - 2002/12/10 - fs@openoffice.org
2847 aFileDlg
.SetDisplayDirectory( sURL
);
2849 _rClearBeforeDialog
.clear();
2850 bool bSuccess
= ( 0 == aFileDlg
.Execute() );
2852 _out_rNewValue
<<= (::rtl::OUString
)aFileDlg
.GetPath();
2856 //------------------------------------------------------------------------
2857 bool FormComponentPropertyHandler::impl_executeFontDialog_nothrow( Any
& _out_rNewValue
, ::osl::ClearableMutexGuard
& _rClearBeforeDialog
) const
2859 bool bSuccess
= false;
2861 // create an item set for use with the dialog
2862 SfxItemSet
* pSet
= NULL
;
2863 SfxItemPool
* pPool
= NULL
;
2864 SfxPoolItem
** pDefaults
= NULL
;
2865 ControlCharacterDialog::createItemSet(pSet
, pPool
, pDefaults
);
2866 ControlCharacterDialog::translatePropertiesToItems(m_xComponent
, pSet
);
2868 { // do this in an own block. The dialog needs to be destroyed before we call
2870 ControlCharacterDialog
aDlg( impl_getDefaultDialogParent_nothrow(), *pSet
);
2871 _rClearBeforeDialog
.clear();
2872 if ( RET_OK
== aDlg
.Execute() )
2874 const SfxItemSet
* pOut
= aDlg
.GetOutputItemSet();
2877 Sequence
< NamedValue
> aFontPropertyValues
;
2878 ControlCharacterDialog::translateItemsToProperties( *pOut
, aFontPropertyValues
);
2879 _out_rNewValue
<<= aFontPropertyValues
;
2885 ControlCharacterDialog::destroyItemSet(pSet
, pPool
, pDefaults
);
2889 //------------------------------------------------------------------------
2890 bool FormComponentPropertyHandler::impl_browseForDatabaseDocument_throw( Any
& _out_rNewValue
, ::osl::ClearableMutexGuard
& _rClearBeforeDialog
) const
2892 ::sfx2::FileDialogHelper
aFileDlg(WB_3DLOOK
|WB_OPEN
,::String::CreateFromAscii("sdatabase"));
2894 ::rtl::OUString sDataSource
;
2895 OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_DATASOURCE
) >>= sDataSource
);
2896 INetURLObject
aParser( sDataSource
);
2897 if ( INET_PROT_FILE
== aParser
.GetProtocol() )
2898 // set the initial directory only for file-URLs. Everything else
2899 // is considered to be potentially expensive
2900 // 106126 - 2002/12/10 - fs@openoffice.org
2901 aFileDlg
.SetDisplayDirectory( sDataSource
);
2903 const String s_sDatabaseType
= String::CreateFromAscii("StarOffice XML (Base)");
2904 const SfxFilter
* pFilter
= SfxFilter::GetFilterByName( s_sDatabaseType
);
2905 OSL_ENSURE(pFilter
,"Filter: StarOffice XML (Base) could not be found!");
2908 aFileDlg
.SetCurrentFilter(pFilter
->GetUIName());
2909 //aFileDlg.AddFilter(pFilter->GetFilterName(),pFilter->GetDefaultExtension());
2912 _rClearBeforeDialog
.clear();
2913 bool bSuccess
= ( 0 == aFileDlg
.Execute() );
2915 _out_rNewValue
<<= (::rtl::OUString
)aFileDlg
.GetPath();
2919 //------------------------------------------------------------------------
2920 bool FormComponentPropertyHandler::impl_dialogColorChooser_throw( sal_Int32 _nColorPropertyId
, Any
& _out_rNewValue
, ::osl::ClearableMutexGuard
& _rClearBeforeDialog
) const
2922 sal_Int32 nColor
= 0;
2923 OSL_VERIFY( impl_getPropertyValue_throw( impl_getPropertyNameFromId_nothrow( _nColorPropertyId
) ) >>= nColor
);
2924 ::Color
aColor( nColor
);
2925 SvColorDialog
aColorDlg( impl_getDefaultDialogParent_nothrow() );
2926 aColorDlg
.SetColor( aColor
);
2928 _rClearBeforeDialog
.clear();
2929 if ( !aColorDlg
.Execute() )
2932 aColor
= aColorDlg
.GetColor();
2933 nColor
= aColor
.GetColor();
2934 _out_rNewValue
<<= (sal_Int32
)nColor
;
2938 //------------------------------------------------------------------------
2939 bool FormComponentPropertyHandler::impl_dialogChooseLabelControl_nothrow( Any
& _out_rNewValue
, ::osl::ClearableMutexGuard
& _rClearBeforeDialog
) const
2941 OSelectLabelDialog
dlgSelectLabel( impl_getDefaultDialogParent_nothrow(), m_xComponent
);
2942 _rClearBeforeDialog
.clear();
2943 bool bSuccess
= ( RET_OK
== dlgSelectLabel
.Execute() );
2945 _out_rNewValue
<<= dlgSelectLabel
.GetSelected();
2949 //------------------------------------------------------------------------
2950 Reference
< XControlContainer
> FormComponentPropertyHandler::impl_getContextControlContainer_nothrow() const
2952 Reference
< XControlContainer
> xControlContext(
2953 m_aContext
.getContextValueByAsciiName( "ControlContext" ),
2955 return xControlContext
;
2958 //------------------------------------------------------------------------
2959 bool FormComponentPropertyHandler::impl_dialogChangeTabOrder_nothrow( ::osl::ClearableMutexGuard
& _rClearBeforeDialog
) const
2961 OSL_PRECOND( impl_getContextControlContainer_nothrow().is(), "FormComponentPropertyHandler::impl_dialogChangeTabOrder_nothrow: invalid control context!" );
2963 Reference
< XTabControllerModel
> xTabControllerModel( impl_getRowSet_nothrow(), UNO_QUERY
);
2964 TabOrderDialog
aDialog(
2965 impl_getDefaultDialogParent_nothrow(),
2966 xTabControllerModel
,
2967 impl_getContextControlContainer_nothrow(),
2968 m_aContext
.getLegacyServiceFactory()
2970 _rClearBeforeDialog
.clear();
2971 return ( RET_OK
== aDialog
.Execute() );
2974 //------------------------------------------------------------------------
2977 //--------------------------------------------------------------------
2978 //- ISQLCommandPropertyUI
2979 //--------------------------------------------------------------------
2980 class ISQLCommandPropertyUI
: public ISQLCommandAdapter
2983 /** returns the empty-string-terminated list of names of properties
2984 whose UI is to be disabled while the SQL command property is
2987 virtual ::rtl::OUString
* getPropertiesToDisable() = 0;
2990 //--------------------------------------------------------------------
2991 //- SQLCommandPropertyUI
2992 //--------------------------------------------------------------------
2993 class SQLCommandPropertyUI
: public ISQLCommandPropertyUI
2996 SQLCommandPropertyUI( const Reference
< XPropertySet
>& _rxObject
)
2997 :m_xObject( _rxObject
)
2999 if ( !m_xObject
.is() )
3000 throw NullPointerException();
3003 virtual oslInterlockedCount SAL_CALL
acquire()
3005 return osl_incrementInterlockedCount( &m_refCount
);
3008 virtual oslInterlockedCount SAL_CALL
release()
3010 if ( 0 == osl_decrementInterlockedCount( &m_refCount
) )
3019 Reference
< XPropertySet
> m_xObject
;
3022 oslInterlockedCount m_refCount
;
3025 //--------------------------------------------------------------------
3026 //- FormSQLCommandUI - declaration
3027 //--------------------------------------------------------------------
3028 class FormSQLCommandUI
: public SQLCommandPropertyUI
3031 FormSQLCommandUI( const Reference
< XPropertySet
>& _rxForm
);
3033 // ISQLCommandAdapter
3034 virtual ::rtl::OUString
getSQLCommand() const;
3035 virtual sal_Bool
getEscapeProcessing() const;
3036 virtual void setSQLCommand( const ::rtl::OUString
& _rCommand
) const;
3037 virtual void setEscapeProcessing( const sal_Bool _bEscapeProcessing
) const;
3039 // ISQLCommandPropertyUI
3040 virtual ::rtl::OUString
* getPropertiesToDisable();
3043 //--------------------------------------------------------------------
3044 //- FormSQLCommandUI - implementation
3045 //--------------------------------------------------------------------
3046 //....................................................................
3047 FormSQLCommandUI::FormSQLCommandUI( const Reference
< XPropertySet
>& _rxForm
)
3048 :SQLCommandPropertyUI( _rxForm
)
3052 //....................................................................
3053 ::rtl::OUString
FormSQLCommandUI::getSQLCommand() const
3055 ::rtl::OUString sCommand
;
3056 OSL_VERIFY( m_xObject
->getPropertyValue( PROPERTY_COMMAND
) >>= sCommand
);
3060 //....................................................................
3061 sal_Bool
FormSQLCommandUI::getEscapeProcessing() const
3063 sal_Bool
bEscapeProcessing( sal_False
);
3064 OSL_VERIFY( m_xObject
->getPropertyValue( PROPERTY_ESCAPE_PROCESSING
) >>= bEscapeProcessing
);
3065 return bEscapeProcessing
;
3068 //....................................................................
3069 void FormSQLCommandUI::setSQLCommand( const ::rtl::OUString
& _rCommand
) const
3071 m_xObject
->setPropertyValue( PROPERTY_COMMAND
, makeAny( _rCommand
) );
3074 //....................................................................
3075 void FormSQLCommandUI::setEscapeProcessing( const sal_Bool _bEscapeProcessing
) const
3077 m_xObject
->setPropertyValue( PROPERTY_ESCAPE_PROCESSING
, makeAny( _bEscapeProcessing
) );
3080 //....................................................................
3081 ::rtl::OUString
* FormSQLCommandUI::getPropertiesToDisable()
3083 static ::rtl::OUString s_aCommandProps
[] = {
3084 PROPERTY_DATASOURCE
,
3086 PROPERTY_COMMANDTYPE
,
3087 PROPERTY_ESCAPE_PROCESSING
,
3090 return s_aCommandProps
;
3092 //--------------------------------------------------------------------
3093 //- ValueListCommandUI - declaration
3094 //--------------------------------------------------------------------
3095 class ValueListCommandUI
: public SQLCommandPropertyUI
3098 ValueListCommandUI( const Reference
< XPropertySet
>& _rxListOrCombo
);
3100 // ISQLCommandAdapter
3101 virtual ::rtl::OUString
getSQLCommand() const;
3102 virtual sal_Bool
getEscapeProcessing() const;
3103 virtual void setSQLCommand( const ::rtl::OUString
& _rCommand
) const;
3104 virtual void setEscapeProcessing( const sal_Bool _bEscapeProcessing
) const;
3106 // ISQLCommandPropertyUI
3107 virtual ::rtl::OUString
* getPropertiesToDisable();
3109 mutable bool m_bPropertyValueIsList
;
3112 //--------------------------------------------------------------------
3113 //- ValueListCommandUI - implementation
3114 //--------------------------------------------------------------------
3115 //....................................................................
3116 ValueListCommandUI::ValueListCommandUI( const Reference
< XPropertySet
>& _rxListOrCombo
)
3117 :SQLCommandPropertyUI( _rxListOrCombo
)
3118 ,m_bPropertyValueIsList( false )
3122 //....................................................................
3123 ::rtl::OUString
ValueListCommandUI::getSQLCommand() const
3125 ::rtl::OUString sValue
;
3126 m_bPropertyValueIsList
= false;
3128 // for combo boxes, the property is a mere string
3129 Any
aValue( m_xObject
->getPropertyValue( PROPERTY_LISTSOURCE
) );
3130 if ( aValue
>>= sValue
)
3133 Sequence
< ::rtl::OUString
> aValueList
;
3134 if ( aValue
>>= aValueList
)
3136 m_bPropertyValueIsList
= true;
3137 if ( aValueList
.getLength() )
3138 sValue
= aValueList
[0];
3142 OSL_ENSURE( false, "ValueListCommandUI::getSQLCommand: unexpected property type!" );
3146 //....................................................................
3147 sal_Bool
ValueListCommandUI::getEscapeProcessing() const
3149 enum ListSourceType
eType( ListSourceType_SQL
);
3150 OSL_VERIFY( m_xObject
->getPropertyValue( PROPERTY_LISTSOURCETYPE
) >>= eType
);
3151 OSL_ENSURE( ( eType
== ListSourceType_SQL
) || ( eType
== ListSourceType_SQLPASSTHROUGH
),
3152 "ValueListCommandUI::getEscapeProcessing: unexpected list source type!" );
3153 return ( eType
== ListSourceType_SQL
);
3156 //....................................................................
3157 void ValueListCommandUI::setSQLCommand( const ::rtl::OUString
& _rCommand
) const
3160 if ( m_bPropertyValueIsList
)
3161 aValue
<<= Sequence
< ::rtl::OUString
>( &_rCommand
, 1 );
3163 aValue
<<= _rCommand
;
3164 m_xObject
->setPropertyValue( PROPERTY_LISTSOURCE
, aValue
);
3167 //....................................................................
3168 void ValueListCommandUI::setEscapeProcessing( const sal_Bool _bEscapeProcessing
) const
3170 m_xObject
->setPropertyValue( PROPERTY_LISTSOURCETYPE
, makeAny(
3171 _bEscapeProcessing
? ListSourceType_SQL
: ListSourceType_SQLPASSTHROUGH
) );
3174 //....................................................................
3175 ::rtl::OUString
* ValueListCommandUI::getPropertiesToDisable()
3177 static ::rtl::OUString s_aListSourceProps
[] = {
3178 PROPERTY_LISTSOURCETYPE
,
3179 PROPERTY_LISTSOURCE
,
3182 return s_aListSourceProps
;
3186 //------------------------------------------------------------------------
3187 bool FormComponentPropertyHandler::impl_doDesignSQLCommand_nothrow( const Reference
< XObjectInspectorUI
>& _rxInspectorUI
, PropertyId _nDesignForProperty
)
3191 if ( m_xCommandDesigner
.is() )
3193 if ( m_xCommandDesigner
->isActive() )
3195 m_xCommandDesigner
->raise();
3198 m_xCommandDesigner
->dispose();
3199 m_xCommandDesigner
.set( NULL
);
3202 if ( !impl_ensureRowsetConnection_nothrow() )
3205 Reference
< XPropertySet
> xComponentProperties( m_xComponent
, UNO_QUERY_THROW
);
3207 ::rtl::Reference
< ISQLCommandPropertyUI
> xCommandUI
;
3208 switch ( _nDesignForProperty
)
3210 case PROPERTY_ID_COMMAND
:
3211 xCommandUI
= new FormSQLCommandUI( xComponentProperties
);
3213 case PROPERTY_ID_LISTSOURCE
:
3214 xCommandUI
= new ValueListCommandUI( xComponentProperties
);
3217 OSL_ENSURE( false, "FormComponentPropertyHandler::OnDesignerClosed: invalid property id!" );
3221 m_xCommandDesigner
.set( new SQLCommandDesigner( m_aContext
.getUNOContext(), xCommandUI
.get(), m_xRowSetConnection
, LINK( this, FormComponentPropertyHandler
, OnDesignerClosed
) ) );
3223 DBG_ASSERT( _rxInspectorUI
.is(), "FormComponentPropertyHandler::OnDesignerClosed: no access to the property browser ui!" );
3224 if ( m_xCommandDesigner
->isActive() && _rxInspectorUI
.is() )
3226 m_xBrowserUI
= _rxInspectorUI
;
3227 // disable everything which would affect this property
3228 const ::rtl::OUString
* pToDisable
= xCommandUI
->getPropertiesToDisable();
3229 while ( pToDisable
->getLength() )
3231 m_xBrowserUI
->enablePropertyUIElements( *pToDisable
++, PropertyLineElement::All
, sal_False
);
3234 // but enable the browse button for the property itself - so it can be used to raise the query designer
3235 ::rtl::OUString
sPropertyName( impl_getPropertyNameFromId_nothrow( _nDesignForProperty
) );
3236 m_xBrowserUI
->enablePropertyUIElements( sPropertyName
, PropertyLineElement::PrimaryButton
, sal_True
);
3239 catch( const Exception
& )
3241 DBG_UNHANDLED_EXCEPTION();
3243 return m_xCommandDesigner
.is();
3246 //------------------------------------------------------------------------
3247 IMPL_LINK( FormComponentPropertyHandler
, OnDesignerClosed
, void*, /*NOTINTERESTEDIN*/ )
3249 OSL_ENSURE( m_xBrowserUI
.is() && m_xCommandDesigner
.is(), "FormComponentPropertyHandler::OnDesignerClosed: too many NULLs!" );
3250 if ( m_xBrowserUI
.is() && m_xCommandDesigner
.is() )
3254 ::rtl::Reference
< ISQLCommandPropertyUI
> xCommandUI(
3255 dynamic_cast< ISQLCommandPropertyUI
* >( m_xCommandDesigner
->getPropertyAdapter().get() ) );
3256 if ( !xCommandUI
.is() )
3257 throw NullPointerException();
3259 const ::rtl::OUString
* pToEnable
= xCommandUI
->getPropertiesToDisable();
3260 while ( pToEnable
->getLength() )
3262 m_xBrowserUI
->enablePropertyUIElements( *pToEnable
++, PropertyLineElement::All
, sal_True
);
3265 catch( const Exception
& )
3267 DBG_UNHANDLED_EXCEPTION();
3274 //------------------------------------------------------------------------
3275 bool FormComponentPropertyHandler::impl_hasValidDataSourceSignature_nothrow( const Reference
< XPropertySet
>& _xFormProperties
, bool _bAllowEmptyDataSourceName
) SAL_THROW(())
3278 if ( _xFormProperties
.is() )
3282 ::rtl::OUString sPropertyValue
;
3283 // first, we need the name of an existent data source
3284 if ( _xFormProperties
->getPropertySetInfo()->hasPropertyByName(PROPERTY_DATASOURCE
) )
3285 _xFormProperties
->getPropertyValue( PROPERTY_DATASOURCE
) >>= sPropertyValue
;
3286 bHas
= ( sPropertyValue
.getLength() != 0 ) || _bAllowEmptyDataSourceName
;
3288 // then, the command should not be empty
3291 if ( _xFormProperties
->getPropertySetInfo()->hasPropertyByName(PROPERTY_COMMAND
) )
3292 _xFormProperties
->getPropertyValue( PROPERTY_COMMAND
) >>= sPropertyValue
;
3293 bHas
= ( sPropertyValue
.getLength() != 0 );
3296 catch( const Exception
& )
3298 OSL_ENSURE( false, "FormComponentPropertyHandler::impl_hasValidDataSourceSignature_nothrow: caught an exception!" );
3303 //------------------------------------------------------------------------
3304 ::rtl::OUString
FormComponentPropertyHandler::impl_getDocumentURL_nothrow() const
3306 ::rtl::OUString sURL
;
3309 Reference
< XModel
> xDocument( impl_getContextDocument_nothrow() );
3310 if ( xDocument
.is() )
3311 sURL
= xDocument
->getURL();
3313 catch( const Exception
& )
3315 DBG_UNHANDLED_EXCEPTION();
3319 // -------------------------------------------------------------------------
3320 ::cppu::IPropertyArrayHelper
* FormComponentPropertyHandler::createArrayHelper( ) const
3322 uno::Sequence
< beans::Property
> aProps
;
3323 describeProperties(aProps
);
3324 return new ::cppu::OPropertyArrayHelper(aProps
);
3327 // -------------------------------------------------------------------------
3328 ::cppu::IPropertyArrayHelper
& FormComponentPropertyHandler::getInfoHelper()
3330 return *const_cast<FormComponentPropertyHandler
*>(this)->getArrayHelper();
3332 // -----------------------------------------------------------------------------
3333 uno::Reference
< beans::XPropertySetInfo
> SAL_CALL
FormComponentPropertyHandler::getPropertySetInfo( ) throw(uno::RuntimeException
)
3335 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
3338 //........................................................................
3340 //........................................................................