diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-02-06 14:57:55 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-02-06 15:30:15 +0000 |
commit | 8c31a28a1fae2f2562f6248581a6ef321b77a4a6 (patch) | |
tree | c7fc9c3ee40085fed580c82ed65985a7397b3e3f /svtools/source/uno/addrtempuno.cxx | |
parent | 038c59bf4610768d3ad6bbad910e885bb98fe2c1 (diff) |
tweak OAddressBookSourceDialogUno conversion to work again
these properties aren't registered, so setting them throws.
The expectation is that they get used via
OAddressBookSourceDialogUno::implInitialize
so repackage them as PropertyValues
wizards->address data source->evolution->next->field assignment
and field assignment must not have an "address data source"
button in it
Change-Id: I5edb6f5117dd9bfa2ed40da040906a7107028433
Diffstat (limited to 'svtools/source/uno/addrtempuno.cxx')
-rw-r--r-- | svtools/source/uno/addrtempuno.cxx | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx index f6a88dd4c419..da4fa51dd5bd 100644 --- a/svtools/source/uno/addrtempuno.cxx +++ b/svtools/source/uno/addrtempuno.cxx @@ -153,7 +153,7 @@ namespace svt //------------------------------------------------------------------------- ::cppu::IPropertyArrayHelper& OAddressBookSourceDialogUno::getInfoHelper() { - return *const_cast<OAddressBookSourceDialogUno*>(this)->getArrayHelper(); + return *getArrayHelper(); } //------------------------------------------------------------------------------ @@ -174,30 +174,39 @@ namespace svt static_cast< AddressBookSourceDialog* >( m_pDialog )->getFieldMapping( m_aAliases ); } //------------------------------------------------------------------------------ - void SAL_CALL OAddressBookSourceDialogUno::initialize(const Sequence< Any >& aArguments) throw(Exception, RuntimeException) + void SAL_CALL OAddressBookSourceDialogUno::initialize(const Sequence< Any >& rArguments) throw(Exception, RuntimeException) { - if( aArguments.getLength() == 5 ) + if( rArguments.getLength() == 5 ) { Reference<com::sun::star::awt::XWindow> xParentWindow; Reference<com::sun::star::beans::XPropertySet> xDataSource; rtl::OUString sDataSourceName; rtl::OUString sCommand; rtl::OUString sTitle; - if ( (aArguments[0] >>= xParentWindow) - && (aArguments[1] >>= xDataSource) - && (aArguments[2] >>= sDataSourceName) - && (aArguments[3] >>= sCommand) - && (aArguments[4] >>= sTitle) ) + if ( (rArguments[0] >>= xParentWindow) + && (rArguments[1] >>= xDataSource) + && (rArguments[2] >>= sDataSourceName) + && (rArguments[3] >>= sCommand) + && (rArguments[4] >>= sTitle) ) { - setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParentWindow" ) ), makeAny( xParentWindow ) ); - setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataSource" ) ), makeAny( xDataSource ) ); - setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataSourceName" ) ), makeAny( sDataSourceName ) ); - setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Command" ) ), makeAny( sCommand ) ); - setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), makeAny( sTitle ) ); + + // convert the parameters for creating the dialog to PropertyValues + Sequence< Any > aArguments(5); + Any* pArguments = aArguments.getArray(); + // the parent window + *pArguments++ <<= PropertyValue(OUString( "ParentWindow" ), -1, makeAny( xParentWindow ), PropertyState_DIRECT_VALUE); + // the data source to use + *pArguments++ <<= PropertyValue(OUString( "DataSource" ), -1, makeAny( xDataSource ), PropertyState_DIRECT_VALUE); + *pArguments++ <<= PropertyValue(OUString( "DataSourceName" ), -1, makeAny( sDataSourceName ), PropertyState_DIRECT_VALUE); + // the table to use + *pArguments++ <<= PropertyValue(OUString( "Command" ), -1, makeAny( sCommand ), PropertyState_DIRECT_VALUE); + // the title + *pArguments++ <<= PropertyValue(OUString( "Title" ), -1, makeAny( sTitle ), PropertyState_DIRECT_VALUE); + OGenericUnoDialog::initialize(aArguments); return; } } - OGenericUnoDialog::initialize(aArguments); + OGenericUnoDialog::initialize(rArguments); } //------------------------------------------------------------------------------ void OAddressBookSourceDialogUno::implInitialize(const com::sun::star::uno::Any& _rValue) |