summaryrefslogtreecommitdiff
path: root/embedserv
diff options
context:
space:
mode:
authorAndreas Bille <abi@openoffice.org>2003-03-26 12:51:23 +0000
committerAndreas Bille <abi@openoffice.org>2003-03-26 12:51:23 +0000
commitcaa2a9eb27f7e266bc844a3ad215ec35bd804b1a (patch)
tree20b633838842e9bc42872e7362a78eb9c8451cf4 /embedserv
parent4507deb1ecfc4f48b263781b2f611a0c6af24cea (diff)
#i2822# Close
Diffstat (limited to 'embedserv')
-rw-r--r--embedserv/source/embed/docholder.cxx37
-rwxr-xr-xembedserv/source/embed/ed_ioleobject.cxx6
-rwxr-xr-xembedserv/source/embed/ed_ipersiststr.cxx10
-rw-r--r--embedserv/source/inc/docholder.hxx9
4 files changed, 33 insertions, 29 deletions
diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx
index f62ab64d7f30..86dd2e8093b7 100644
--- a/embedserv/source/embed/docholder.cxx
+++ b/embedserv/source/embed/docholder.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docholder.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: abi $ $Date: 2003-03-26 11:37:55 $
+ * last change: $Author: abi $ $Date: 2003-03-26 13:51:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -103,7 +103,6 @@ extern ::rtl::OUString getFilterNameFromGUID_Impl( GUID* );
DocumentHolder::DocumentHolder( const uno::Reference< lang::XMultiServiceFactory >& xFactory,EmbedDocument_Impl *pOLEInterface)
: m_xFactory( xFactory ),
- m_nStreamMode(0),
m_pOLEInterface(pOLEInterface)
{
const ::rtl::OUString aServiceName ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.frame.Desktop" ) );
@@ -117,6 +116,9 @@ DocumentHolder::~DocumentHolder()
if ( m_xDocument.is() )
CloseDocument();
+ if( m_xFrame.is() )
+ CloseFrame();
+
if ( m_xFactory.is() )
FreeOffice();
}
@@ -167,8 +169,11 @@ void DocumentHolder::CloseDocument()
}
}
m_xDocument = uno::Reference< frame::XModel >();
- m_nStreamMode = 0;
+}
+
+void DocumentHolder::CloseFrame()
+{
uno::Reference<util::XCloseable> xCloseable(
m_xFrame,uno::UNO_QUERY);
if(xCloseable.is())
@@ -177,28 +182,23 @@ void DocumentHolder::CloseDocument()
}
catch( const uno::Exception& ) {
}
+ else
+ uno::Reference<lang::XComponent>(m_xFrame,uno::UNO_QUERY)->dispose();
m_xFrame = uno::Reference< frame::XFrame >();
}
-void DocumentHolder::SetDocument( const uno::Reference< frame::XModel >& xDoc,
- DWORD nStreamMode)
+void DocumentHolder::SetDocument( const uno::Reference< frame::XModel >& xDoc)
{
if ( m_xDocument.is() )
CloseDocument();
m_xDocument = xDoc;
- m_nStreamMode = nStreamMode;
uno::Reference< util::XCloseBroadcaster > xBroadcaster( m_xDocument, uno::UNO_QUERY );
if ( xBroadcaster.is() )
xBroadcaster->addCloseListener( (util::XCloseListener*)this );
-// uno::Reference< util::XModifyBroadcaster > xMB(
-// m_xDocument,uno::UNO_QUERY );
-// if(xMB.is())
-// xMB->addModifyListener((util::XModifyListener*)this);
-
if ( m_xDocument.is() )
{
// set the document mode to embedded
@@ -285,8 +285,12 @@ void SAL_CALL DocumentHolder::disposing( const com::sun::star::lang::EventObject
{
if ( m_xDocument.is() && m_xDocument == aSource.Source )
m_xDocument = uno::Reference< frame::XModel >();
+
+ if( m_xFrame.is() && m_xFrame == aSource.Source )
+ m_xFrame = uno::Reference< frame::XFrame >();
}
+
void SAL_CALL DocumentHolder::queryClosing( const lang::EventObject& aSource, sal_Bool bGetsOwnership )
throw( util::CloseVetoException )
{
@@ -301,13 +305,11 @@ void SAL_CALL DocumentHolder::notifyClosing( const lang::EventObject& aSource )
if ( xEventBroadcaster.is() )
xEventBroadcaster->removeCloseListener( (util::XCloseListener*)this );
- uno::Reference< util::XModifyBroadcaster > xModifyBroadcaster(
- aSource.Source,uno::UNO_QUERY );
- if(xModifyBroadcaster.is())
- xModifyBroadcaster->removeModifyListener((util::XModifyListener*)this);
-
if ( m_xDocument.is() && m_xDocument == aSource.Source )
m_xDocument = uno::Reference< frame::XModel >();
+
+ if( m_xFrame.is() && m_xFrame == aSource.Source )
+ m_xFrame = uno::Reference< frame::XFrame >();
}
void SAL_CALL DocumentHolder::queryTermination( const lang::EventObject& aSource )
@@ -335,3 +337,4 @@ void SAL_CALL DocumentHolder::modified( const lang::EventObject& aEvent )
if(m_pOLEInterface)
m_pOLEInterface->notify();
}
+
diff --git a/embedserv/source/embed/ed_ioleobject.cxx b/embedserv/source/embed/ed_ioleobject.cxx
index eb05cd1a7064..cfd7bbe2ee10 100755
--- a/embedserv/source/embed/ed_ioleobject.cxx
+++ b/embedserv/source/embed/ed_ioleobject.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ed_ioleobject.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: abi $ $Date: 2003-03-26 11:13:34 $
+ * last change: $Author: abi $ $Date: 2003-03-26 13:51:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -102,6 +102,8 @@ STDMETHODIMP EmbedDocument_Impl::Close( DWORD dwSaveOption )
if ( m_pDAdviseHolder )
m_pDAdviseHolder->SendOnDataChange( (IDataObject*)this, 0, ADVF_DATAONSTOP );
+ m_pDocHolder->CloseFrame();
+
if ( m_pClientSite )
m_pClientSite->OnShowWindow( FALSE );
diff --git a/embedserv/source/embed/ed_ipersiststr.cxx b/embedserv/source/embed/ed_ipersiststr.cxx
index 794b97ede956..2788da831f1e 100755
--- a/embedserv/source/embed/ed_ipersiststr.cxx
+++ b/embedserv/source/embed/ed_ipersiststr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ed_ipersiststr.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: abi $ $Date: 2003-03-26 11:13:34 $
+ * last change: $Author: abi $ $Date: 2003-03-26 13:51:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -423,7 +423,7 @@ STDMETHODIMP EmbedDocument_Impl::InitNew( IStorage *pStg )
uno::UNO_QUERY );
if ( aDocument.is() )
{
- m_pDocHolder->SetDocument( aDocument,nStreamMode );
+ m_pDocHolder->SetDocument( aDocument );
uno::Reference< frame::XLoadable > xLoadable( m_pDocHolder->GetDocument(), uno::UNO_QUERY );
if( xLoadable.is() )
@@ -508,7 +508,7 @@ STDMETHODIMP EmbedDocument_Impl::Load( IStorage *pStg )
uno::UNO_QUERY );
if ( aDocument.is() )
{
- m_pDocHolder->SetDocument( aDocument,nStreamMode );
+ m_pDocHolder->SetDocument( aDocument );
uno::Reference< frame::XLoadable > xLoadable( m_pDocHolder->GetDocument(), uno::UNO_QUERY );
if( xLoadable.is() )
@@ -688,7 +688,7 @@ STDMETHODIMP EmbedDocument_Impl::Load( LPCOLESTR pszFileName, DWORD dwMode )
uno::UNO_QUERY );
if ( aDocument.is() )
{
- m_pDocHolder->SetDocument( aDocument,nStreamMode );
+ m_pDocHolder->SetDocument( aDocument );
uno::Reference< frame::XLoadable > xLoadable( m_pDocHolder->GetDocument(), uno::UNO_QUERY );
if( xLoadable.is() )
diff --git a/embedserv/source/inc/docholder.hxx b/embedserv/source/inc/docholder.hxx
index 924291d8c639..0f751bf0f5c8 100644
--- a/embedserv/source/inc/docholder.hxx
+++ b/embedserv/source/inc/docholder.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docholder.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: abi $ $Date: 2003-03-26 11:38:37 $
+ * last change: $Author: abi $ $Date: 2003-03-26 13:51:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -95,8 +95,6 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xDocument;
- DWORD m_nStreamMode;
-
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > DocumentFrame();
@@ -106,9 +104,10 @@ public:
DocumentHolder( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,EmbedDocument_Impl *pOLEInterface);
~DocumentHolder();
- void SetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xDoc,DWORD nStreamMode );
+ void SetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xDoc);
void CloseDocument();
+ void CloseFrame();
void FreeOffice();
void show();