diff options
Diffstat (limited to 'toolkit/source/controls/controlmodelcontainerbase.cxx')
-rw-r--r-- | toolkit/source/controls/controlmodelcontainerbase.cxx | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index 1fd299636f29..3943007bed3b 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -39,11 +39,13 @@ #include "toolkit/controls/formattedcontrol.hxx" #include "toolkit/controls/roadmapcontrol.hxx" #include "toolkit/controls/tkscrollbar.hxx" +#include "toolkit/controls/tabpagemodel.hxx" #include <toolkit/controls/stdtabcontroller.hxx> #include <com/sun/star/awt/PosSize.hpp> #include <com/sun/star/awt/WindowAttribute.hpp> #include <com/sun/star/resource/XStringResourceResolver.hpp> #include <com/sun/star/graphic/XGraphicProvider.hpp> +#include <com/sun/star/lang/XInitialization.hpp> #include <cppuhelper/typeprovider.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> @@ -390,6 +392,8 @@ Reference< XInterface > ControlModelContainerBase::createInstance( const ::rtl:: pNewModel = new OGeometryControlModel< UnoControlTabPageContainerModel >( xFactory ); else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoMultiPageModel ) == 0 ) pNewModel = new OGeometryControlModel< UnoMultiPageModel >( xFactory ); + else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlTabPageModel ) == 0 ) + pNewModel = new OGeometryControlModel< UnoControlTabPageModel >( xFactory ); else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoPageModel ) == 0 ) pNewModel = new OGeometryControlModel< UnoPageModel >( xFactory ); else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoFrameModel ) == 0 ) @@ -422,9 +426,13 @@ Reference< XInterface > ControlModelContainerBase::createInstance( const ::rtl:: return xNewModel; } -Reference< XInterface > ControlModelContainerBase::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const Sequence< Any >& /* Arguments */ ) throw(Exception, RuntimeException) +Reference< XInterface > ControlModelContainerBase::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const Sequence< Any >& i_arguments ) throw(Exception, RuntimeException) { - return createInstance( ServiceSpecifier ); + const Reference< XInterface > xInstance( createInstance( ServiceSpecifier ) ); + const Reference< XInitialization > xInstanceInit( xInstance, UNO_QUERY ); + ENSURE_OR_RETURN( xInstanceInit.is(), "ControlModelContainerBase::createInstanceWithArguments: can't pass the arguments!", xInstance ); + xInstanceInit->initialize( i_arguments ); + return xInstance; } Sequence< ::rtl::OUString > ControlModelContainerBase::getAvailableServiceNames() throw(RuntimeException) @@ -1389,7 +1397,7 @@ void ControlContainerBase::ImplInsertControl( Reference< XControlModel >& rxMode Reference < XControl > xCtrl; maContext.createComponent( aDefCtrl, xCtrl ); - DBG_ASSERT( xCtrl.is(), "UnoDialogControl::ImplInsertControl: could not create the control!" ); + DBG_ASSERT( xCtrl.is(), "ControlContainerBase::ImplInsertControl: could not create the control!" ); if ( xCtrl.is() ) { xCtrl->setModel( rxModel ); @@ -1605,7 +1613,7 @@ void ControlContainerBase::elementInserted( const ContainerEvent& Event ) throw( Event.Accessor >>= aName; Event.Element >>= xModel; - ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementInserted: illegal element!" ); + ENSURE_OR_RETURN_VOID( xModel.is(), "ControlContainerBase::elementInserted: illegal element!" ); try { ImplInsertControl( xModel, aName ); @@ -1626,7 +1634,7 @@ void ControlContainerBase::elementRemoved( const ContainerEvent& Event ) throw(R Reference< XControlModel > xModel; Event.Element >>= xModel; - ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementRemoved: illegal element!" ); + ENSURE_OR_RETURN_VOID( xModel.is(), "ControlContainerBase::elementRemoved: illegal element!" ); try { ImplRemoveControl( xModel ); @@ -1649,7 +1657,7 @@ void ControlContainerBase::elementReplaced( const ContainerEvent& Event ) throw( Event.ReplacedElement >>= xModel; try { - OSL_ENSURE( xModel.is(), "UnoDialogControl::elementReplaced: invalid ReplacedElement!" ); + OSL_ENSURE( xModel.is(), "ControlContainerBase::elementReplaced: invalid ReplacedElement!" ); if ( xModel.is() ) ImplRemoveControl( xModel ); } @@ -1665,7 +1673,7 @@ void ControlContainerBase::elementReplaced( const ContainerEvent& Event ) throw( ::rtl::OUString aName; Event.Accessor >>= aName; Event.Element >>= xModel; - ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementReplaced: invalid new element!" ); + ENSURE_OR_RETURN_VOID( xModel.is(), "ControlContainerBase::elementReplaced: invalid new element!" ); try { ImplInsertControl( xModel, aName ); |