diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-12-15 12:01:46 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-12-15 12:01:46 +0000 |
commit | bd14d6bc197144d99ab8339f7d018d2a4678f610 (patch) | |
tree | eaef7aee129df80b32e6e61cb385a5a5ad7fb4b7 /framework | |
parent | 095c77393155dfac5bbf3a62a5fdcabc6f0f93f2 (diff) |
CWS-TOOLING: integrate CWS tl56_DEV300
Diffstat (limited to 'framework')
4 files changed, 30 insertions, 8 deletions
diff --git a/framework/inc/classes/rootactiontriggercontainer.hxx b/framework/inc/classes/rootactiontriggercontainer.hxx index 924089fd3596..70e00d09033e 100644 --- a/framework/inc/classes/rootactiontriggercontainer.hxx +++ b/framework/inc/classes/rootactiontriggercontainer.hxx @@ -33,6 +33,7 @@ #include <helper/propertysetcontainer.hxx> #include <vcl/menu.hxx> +#include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> @@ -48,10 +49,11 @@ class RootActionTriggerContainer : public PropertySetContainer, public com::sun::star::lang::XMultiServiceFactory, public com::sun::star::lang::XServiceInfo, public com::sun::star::lang::XUnoTunnel, - public com::sun::star::lang::XTypeProvider + public com::sun::star::lang::XTypeProvider, + public com::sun::star::container::XNamed { public: - RootActionTriggerContainer( const Menu* pMenu, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager ); + RootActionTriggerContainer( const Menu* pMenu, const ::rtl::OUString* pMenuIdentifier, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager ); virtual ~RootActionTriggerContainer(); const Menu* GetMenu(); @@ -109,6 +111,10 @@ class RootActionTriggerContainer : public PropertySetContainer, virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException); + // XNamed + virtual ::rtl::OUString SAL_CALL getName( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException); + private: void FillContainer(); @@ -116,6 +122,7 @@ class RootActionTriggerContainer : public PropertySetContainer, sal_Bool m_bContainerChanged; sal_Bool m_bInContainerCreation; const Menu* m_pMenu; + const ::rtl::OUString* m_pMenuIdentifier; }; } diff --git a/framework/inc/helper/actiontriggerhelper.hxx b/framework/inc/helper/actiontriggerhelper.hxx index b684335d9f0f..76ae24a70a89 100644 --- a/framework/inc/helper/actiontriggerhelper.hxx +++ b/framework/inc/helper/actiontriggerhelper.hxx @@ -64,7 +64,7 @@ namespace framework // #110897# static com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer > CreateActionTriggerContainerFromMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, - const Menu* pMenu ); + const Menu* pMenu, const ::rtl::OUString* pMenuIdentifier ); // Fills the submitted rActionTriggerContainer with the structure of the menu // provided as the second parameter diff --git a/framework/source/classes/rootactiontriggercontainer.cxx b/framework/source/classes/rootactiontriggercontainer.cxx index 3d2dab60ccdb..09ae494c00f4 100644 --- a/framework/source/classes/rootactiontriggercontainer.cxx +++ b/framework/source/classes/rootactiontriggercontainer.cxx @@ -60,12 +60,13 @@ static Sequence< sal_Int8 > impl_getStaticIdentifier() } -RootActionTriggerContainer::RootActionTriggerContainer( const Menu* pMenu, const Reference< XMultiServiceFactory >& rServiceManager ) : +RootActionTriggerContainer::RootActionTriggerContainer( const Menu* pMenu, const ::rtl::OUString* pMenuIdentifier, const Reference< XMultiServiceFactory >& rServiceManager ) : PropertySetContainer( rServiceManager ) , m_bContainerCreated( sal_False ) , m_bContainerChanged( sal_False ) , m_bInContainerCreation( sal_False ) , m_pMenu( pMenu ) + , m_pMenuIdentifier( pMenuIdentifier ) { } @@ -106,7 +107,8 @@ throw ( RuntimeException ) SAL_STATIC_CAST( XMultiServiceFactory* , this ), SAL_STATIC_CAST( XServiceInfo* , this ), SAL_STATIC_CAST( XUnoTunnel* , this ), - SAL_STATIC_CAST( XTypeProvider* , this )); + SAL_STATIC_CAST( XTypeProvider* , this ), + SAL_STATIC_CAST( XNamed* , this )); if( a.hasValue() ) { @@ -314,7 +316,8 @@ Sequence< Type > SAL_CALL RootActionTriggerContainer::getTypes() throw ( Runtime ::getCppuType(( const Reference< XIndexReplace >*)NULL ) , ::getCppuType(( const Reference< XServiceInfo >*)NULL ) , ::getCppuType(( const Reference< XTypeProvider >*)NULL ) , - ::getCppuType(( const Reference< XUnoTunnel >*)NULL ) ) ; + ::getCppuType(( const Reference< XUnoTunnel >*)NULL ) , + ::getCppuType(( const Reference< XNamed >*)NULL )) ; // ... and set his address to static pointer! pTypeCollection = &aTypeCollection ; @@ -363,6 +366,17 @@ void RootActionTriggerContainer::FillContainer() m_pMenu ); m_bInContainerCreation = sal_False; } +::rtl::OUString RootActionTriggerContainer::getName() throw ( RuntimeException ) +{ + ::rtl::OUString sRet; + if( m_pMenuIdentifier ) + sRet = *m_pMenuIdentifier; + return sRet; +} +void RootActionTriggerContainer::setName( const ::rtl::OUString& ) throw ( RuntimeException) +{ + throw RuntimeException(); +} } diff --git a/framework/source/helper/actiontriggerhelper.cxx b/framework/source/helper/actiontriggerhelper.cxx index c04eba5fa3a1..15977c777f1e 100644 --- a/framework/source/helper/actiontriggerhelper.cxx +++ b/framework/source/helper/actiontriggerhelper.cxx @@ -404,9 +404,10 @@ void ActionTriggerHelper::FillActionTriggerContainerFromMenu( Reference< XIndexContainer > ActionTriggerHelper::CreateActionTriggerContainerFromMenu( // #110897# const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, - const Menu* pMenu ) + const Menu* pMenu, + const ::rtl::OUString* pMenuIdentifier ) { - return new RootActionTriggerContainer( pMenu, xServiceFactory ); + return new RootActionTriggerContainer( pMenu, pMenuIdentifier, xServiceFactory ); } } |