INTEGRATION: CWS frmcontrols01 (1.24.30); FILE MERGED

2003/10/27 13:50:31 fs 1.24.30.2: RESYNC: (1.24-1.25); FILE MERGED
2003/10/22 13:07:57 fs 1.24.30.1: #21277# slightly changed the handling of supported service names, for easier creation of to-be-registered components
This commit is contained in:
Kurt Zenker 2003-12-11 11:28:53 +00:00
parent 77eb5bf904
commit b7e1f15656

View file

@ -2,9 +2,9 @@
* *
* $RCSfile: FormComponent.cxx,v $ * $RCSfile: FormComponent.cxx,v $
* *
* $Revision: 1.25 $ * $Revision: 1.26 $
* *
* last change: $Author: obo $ $Date: 2003-10-21 08:57:42 $ * last change: $Author: kz $ $Date: 2003-12-11 12:28:53 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@ -251,17 +251,30 @@ sal_Bool SAL_CALL OControl::supportsService(const rtl::OUString& _rsServiceName)
return sal_False; return sal_False;
} }
//------------------------------------------------------------------------------
Sequence< ::rtl::OUString > OControl::getAggregateServiceNames()
{
Sequence< ::rtl::OUString > aAggServices;
Reference< XServiceInfo > xInfo;
if ( query_aggregation( m_xAggregate, xInfo ) )
aAggServices = xInfo->getSupportedServiceNames();
return aAggServices;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Sequence<rtl::OUString> SAL_CALL OControl::getSupportedServiceNames() throw(RuntimeException) Sequence<rtl::OUString> SAL_CALL OControl::getSupportedServiceNames() throw(RuntimeException)
{ {
Sequence< rtl::OUString > aSupported; return ::comphelper::concatSequences(
getAggregateServiceNames(),
getSupportedServiceNames_Static()
);
}
// ask our aggregate //------------------------------------------------------------------------------
Reference< com::sun::star::lang::XServiceInfo > xInfo; Sequence< ::rtl::OUString > SAL_CALL OControl::getSupportedServiceNames_Static() throw( RuntimeException )
if ( query_aggregation( m_xAggregate, xInfo ) ) {
aSupported = xInfo->getSupportedServiceNames(); // no own supported service names
return Sequence< ::rtl::OUString >();
return aSupported;
} }
// XEventListener // XEventListener
@ -660,22 +673,32 @@ sal_Bool SAL_CALL OControlModel::supportsService(const rtl::OUString& _rServiceN
return sal_False; return sal_False;
} }
//------------------------------------------------------------------------------
Sequence< ::rtl::OUString > OControlModel::getAggregateServiceNames()
{
Sequence< ::rtl::OUString > aAggServices;
Reference< XServiceInfo > xInfo;
if ( query_aggregation( m_xAggregate, xInfo ) )
aAggServices = xInfo->getSupportedServiceNames();
return aAggServices;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Sequence<rtl::OUString> SAL_CALL OControlModel::getSupportedServiceNames() throw(RuntimeException) Sequence<rtl::OUString> SAL_CALL OControlModel::getSupportedServiceNames() throw(RuntimeException)
{ {
Sequence<rtl::OUString> aSupported; return ::comphelper::concatSequences(
getAggregateServiceNames(),
getSupportedServiceNames_Static()
);
}
// ask our aggregate //------------------------------------------------------------------------------
Reference<com::sun::star::lang::XServiceInfo> xInfo; Sequence< ::rtl::OUString > SAL_CALL OControlModel::getSupportedServiceNames_Static() throw( RuntimeException )
if (query_aggregation(m_xAggregate, xInfo)) {
aSupported = xInfo->getSupportedServiceNames(); Sequence< ::rtl::OUString > aServiceNames( 2 );
aServiceNames[ 0 ] = FRM_SUN_FORMCOMPONENT;
aSupported.realloc(aSupported.getLength() + 2); aServiceNames[ 1 ] = ::rtl::OUString::createFromAscii( "com.sun.star.form.FormControlModel" );
::rtl::OUString* pArray = aSupported.getArray(); return aServiceNames;
pArray[aSupported.getLength()-2] = FRM_SUN_FORMCOMPONENT;
pArray[aSupported.getLength()-1] = ::rtl::OUString::createFromAscii("com.sun.star.form.FormControlModel");
return aSupported;
} }
// XEventListener // XEventListener
@ -1299,14 +1322,23 @@ void SAL_CALL OBoundControlModel::disposing(const com::sun::star::lang::EventObj
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
StringSequence SAL_CALL OBoundControlModel::getSupportedServiceNames() throw(RuntimeException) StringSequence SAL_CALL OBoundControlModel::getSupportedServiceNames() throw(RuntimeException)
{ {
StringSequence aSupported = OControlModel::getSupportedServiceNames(); return ::comphelper::concatSequences(
aSupported.realloc(aSupported.getLength() + 1); getAggregateServiceNames(),
getSupportedServiceNames_Static()
::rtl::OUString* pArray = aSupported.getArray(); );
pArray[aSupported.getLength()-1] = ::rtl::OUString::createFromAscii("com.sun.star.form.DataAwareControlModel");
return aSupported;
} }
//------------------------------------------------------------------------------
Sequence< ::rtl::OUString > SAL_CALL OBoundControlModel::getSupportedServiceNames_Static() throw( RuntimeException )
{
Sequence< ::rtl::OUString > aOwnServiceNames( 1 );
aOwnServiceNames[ 0 ] = ::rtl::OUString::createFromAscii( "com.sun.star.form.DataAwareControlModel" );
return ::comphelper::concatSequences(
OControlModel::getSupportedServiceNames_Static(),
aOwnServiceNames
);
}
// XPersist // XPersist
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------