diff options
author | Andreas Bille <abi@openoffice.org> | 2003-04-04 10:41:06 +0000 |
---|---|---|
committer | Andreas Bille <abi@openoffice.org> | 2003-04-04 10:41:06 +0000 |
commit | 50191cd079729bf74513813eb4b5e2da95b19f30 (patch) | |
tree | f6bbc042835d7134f48589b371ea6d7fd030c960 /embedserv/source | |
parent | cc946122a26bc44355672fef61999704940f5a07 (diff) |
#i2822# notifying after namechnnge
Diffstat (limited to 'embedserv/source')
-rw-r--r-- | embedserv/source/embed/docholder.cxx | 16 | ||||
-rw-r--r-- | embedserv/source/embed/intercept.cxx | 62 | ||||
-rw-r--r-- | embedserv/source/inc/docholder.hxx | 7 | ||||
-rw-r--r-- | embedserv/source/inc/intercept.hxx | 7 |
4 files changed, 82 insertions, 10 deletions
diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx index 330e7508b44f..729042c14df5 100644 --- a/embedserv/source/embed/docholder.cxx +++ b/embedserv/source/embed/docholder.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docholder.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: abi $ $Date: 2003-04-04 09:31:56 $ + * last change: $Author: abi $ $Date: 2003-04-04 11:41:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -123,7 +123,8 @@ extern ::rtl::OUString getFilterNameFromGUID_Impl( GUID* ); DocumentHolder::DocumentHolder( const uno::Reference< lang::XMultiServiceFactory >& xFactory,EmbedDocument_Impl *pOLEInterface) : m_xFactory( xFactory ), - m_pOLEInterface(pOLEInterface) + m_pOLEInterface(pOLEInterface), + m_pInterceptor(0) { const ::rtl::OUString aServiceName ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.frame.Desktop" ) ); uno::Reference< frame::XDesktop > xDesktop( m_xFactory->createInstance( aServiceName ), uno::UNO_QUERY ); @@ -259,12 +260,16 @@ uno::Reference< frame::XFrame > DocumentHolder::DocumentFrame() xDPI(m_xFrame,uno::UNO_QUERY); if(xDPI.is()) xDPI->registerDispatchProviderInterceptor( - new Interceptor(m_pOLEInterface,this)); + m_pInterceptor = new Interceptor(m_pOLEInterface,this)); } return m_xFrame; } +void DocumentHolder::ClearInterceptor() +{ + m_pInterceptor = 0; +} void DocumentHolder::show() { @@ -433,6 +438,9 @@ void DocumentHolder::setTitle(const rtl::OUString& aDocumentName) } m_aDocumentNamePart = aDocumentName; + + if(m_pInterceptor) + m_pInterceptor->generateFeatureStateEvent(); } diff --git a/embedserv/source/embed/intercept.cxx b/embedserv/source/embed/intercept.cxx index 9917fcdbeb2c..f23811bb0d6a 100644 --- a/embedserv/source/embed/intercept.cxx +++ b/embedserv/source/embed/intercept.cxx @@ -2,9 +2,9 @@ * * $RCSfile: intercept.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: abi $ $Date: 2003-04-04 09:47:27 $ + * last change: $Author: abi $ $Date: 2003-04-04 11:41:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -190,6 +190,8 @@ Interceptor::~Interceptor() if(m_pStatCL) delete m_pStatCL; + + m_pDocH->ClearInterceptor(); } @@ -212,6 +214,62 @@ Interceptor::dispatch( } +void Interceptor::generateFeatureStateEvent() +{ + if(m_pStatCL) + { + for(int i = 0; i < IUL; ++i) + { + if( i == 1 ) + continue; + + cppu::OInterfaceContainerHelper* pICH = + m_pStatCL->getContainer(m_aInterceptedURL[i]); + uno::Sequence<uno::Reference<uno::XInterface> > aSeq; + if(pICH) + aSeq = pICH->getElements(); + if(!aSeq.getLength()) + continue; + + frame::FeatureStateEvent aStateEvent; + aStateEvent.IsEnabled = sal_True; + aStateEvent.Requery = sal_False; + if(i == 0) + { + + aStateEvent.FeatureURL.Complete = m_aInterceptedURL[0]; + aStateEvent.FeatureDescriptor = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Update")); + aStateEvent.State <<= (rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("($1) ")) + + m_pDocH->getTitle()); + + } + else + { + frame::FeatureStateEvent aStateEvent; + aStateEvent.FeatureURL.Complete = m_aInterceptedURL[i]; + aStateEvent.FeatureDescriptor = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Close and Return")); + aStateEvent.State <<= (rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("($2) ")) + + m_pDocH->getTitle()); + + } + + for(sal_Int32 k = 0; k < aSeq.getLength(); ++k) + { + uno::Reference<frame::XStatusListener> + Control(aSeq[k],uno::UNO_QUERY); + if(Control.is()) + Control->statusChanged(aStateEvent); + + } + } + } +} + + void SAL_CALL Interceptor::addStatusListener( const uno::Reference< diff --git a/embedserv/source/inc/docholder.hxx b/embedserv/source/inc/docholder.hxx index d2880952031f..ed1a0852f5e5 100644 --- a/embedserv/source/inc/docholder.hxx +++ b/embedserv/source/inc/docholder.hxx @@ -2,9 +2,9 @@ * * $RCSfile: docholder.hxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: abi $ $Date: 2003-04-04 09:31:55 $ + * last change: $Author: abi $ $Date: 2003-04-04 11:41:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -81,6 +81,7 @@ #endif class EmbedDocument_Impl; +class Interceptor; class DocumentHolder : public ::cppu::WeakImplHelper3< @@ -91,6 +92,7 @@ class DocumentHolder : private: EmbedDocument_Impl* m_pOLEInterface; + Interceptor* m_pInterceptor; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; @@ -110,6 +112,7 @@ public: void CloseDocument(); void CloseFrame(); + void ClearInterceptor(); void FreeOffice(); void resizeWin( const SIZEL& rNewSize ); diff --git a/embedserv/source/inc/intercept.hxx b/embedserv/source/inc/intercept.hxx index 02b9cef97c80..d77b4113792f 100644 --- a/embedserv/source/inc/intercept.hxx +++ b/embedserv/source/inc/intercept.hxx @@ -2,9 +2,9 @@ * * $RCSfile: intercept.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: abi $ $Date: 2003-04-04 09:31:54 $ + * last change: $Author: abi $ $Date: 2003-04-04 11:41:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -97,8 +97,11 @@ public: Interceptor(EmbedDocument_Impl* pOLEInterface,DocumentHolder* pDocH); ~Interceptor(); + void generateFeatureStateEvent(); + // overwritten to release the statuslistner. + // XComponent virtual void SAL_CALL addEventListener( |