summaryrefslogtreecommitdiff
path: root/embedserv/source
diff options
context:
space:
mode:
authorAndreas Bille <abi@openoffice.org>2003-03-28 15:31:27 +0000
committerAndreas Bille <abi@openoffice.org>2003-03-28 15:31:27 +0000
commitd2eec04f8b8a0df85863ed74db6acce5051034e1 (patch)
tree1de7d227704d5c86a0680cda7b96b48a50ac8db8 /embedserv/source
parent6652c8336ff201af224d6c0b787f5d79ec4f1810 (diff)
#i2822# fixed to update before closing and intercepting CloseWin and CloseFrame also
Diffstat (limited to 'embedserv/source')
-rwxr-xr-xembedserv/source/embed/ed_ioleobject.cxx21
-rw-r--r--embedserv/source/embed/intercept.cxx22
-rwxr-xr-xembedserv/source/inc/embeddoc.hxx6
3 files changed, 33 insertions, 16 deletions
diff --git a/embedserv/source/embed/ed_ioleobject.cxx b/embedserv/source/embed/ed_ioleobject.cxx
index e40201835cdc..7e3523d85ead 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.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: abi $ $Date: 2003-03-27 16:18:27 $
+ * last change: $Author: abi $ $Date: 2003-03-28 16:31:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -97,10 +97,7 @@ STDMETHODIMP EmbedDocument_Impl::Close( DWORD dwSaveOption )
HRESULT hr = S_OK;
if ( dwSaveOption && m_pClientSite )
- hr = m_pClientSite->SaveObject();
-
- if ( m_pDAdviseHolder )
- m_pDAdviseHolder->SendOnDataChange( (IDataObject*)this, 0, ADVF_DATAONSTOP );
+ hr = SaveObject(); // ADVF_DATAONSTOP);
m_pDocHolder->CloseFrame();
@@ -142,7 +139,9 @@ STDMETHODIMP EmbedDocument_Impl::GetClipboardData( DWORD dwReserved, IDataObject
STDMETHODIMP EmbedDocument_Impl::DoVerb( LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect )
{
- if ( iVerb == OLEIVERB_PRIMARY || iVerb == OLEIVERB_SHOW || iVerb == OLEIVERB_OPEN )
+ if ( iVerb == OLEIVERB_PRIMARY ||
+ iVerb == OLEIVERB_SHOW ||
+ iVerb == OLEIVERB_OPEN )
{
if( m_pDocHolder )
m_pDocHolder->show();
@@ -297,10 +296,12 @@ STDMETHODIMP EmbedDocument_Impl::SetColorScheme( LOGPALETTE *pLogpal )
// C++ - methods
-void EmbedDocument_Impl::SaveObject()
+HRESULT EmbedDocument_Impl::SaveObject()
{
+ HRESULT hr = S_OK;
+
if(m_pClientSite) {
- m_pClientSite->SaveObject();
+ hr = m_pClientSite->SaveObject();
for ( AdviseSinkHashMapIterator iAdvise =
m_aAdviseHashMap.begin();
@@ -311,6 +312,8 @@ void EmbedDocument_Impl::SaveObject()
}
notify();
+
+ return hr;
}
diff --git a/embedserv/source/embed/intercept.cxx b/embedserv/source/embed/intercept.cxx
index 8981a5f71d5e..f009eba0dd13 100644
--- a/embedserv/source/embed/intercept.cxx
+++ b/embedserv/source/embed/intercept.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: intercept.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: abi $ $Date: 2003-03-27 16:18:27 $
+ * last change: $Author: abi $ $Date: 2003-03-28 16:31:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -71,7 +71,7 @@ using namespace ::com::sun::star;
-#define IUL 3
+#define IUL 5
@@ -88,6 +88,10 @@ Interceptor::Interceptor(EmbedDocument_Impl* pOLEInterface)
RTL_CONSTASCII_USTRINGPARAM(".uno:SaveAll"));
m_aInterceptedURL[2] = rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(".uno:CloseDoc"));
+ m_aInterceptedURL[3] = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(".uno:CloseWin"));
+ m_aInterceptedURL[4] = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(".uno:CloseFrame"));
}
@@ -104,7 +108,9 @@ Interceptor::dispatch(
if(m_pOLEInterface)
if(URL.Complete == m_aInterceptedURL[0])
m_pOLEInterface->SaveObject();
- else if(URL.Complete == m_aInterceptedURL[2])
+ else if(URL.Complete == m_aInterceptedURL[2] ||
+ URL.Complete == m_aInterceptedURL[3] ||
+ URL.Complete == m_aInterceptedURL[4])
m_pOLEInterface->Close(1);
}
@@ -167,6 +173,10 @@ Interceptor::queryDispatch(
return (frame::XDispatch*)0 ;
else if(URL.Complete == m_aInterceptedURL[2])
return (frame::XDispatch*)this;
+ else if(URL.Complete == m_aInterceptedURL[3])
+ return (frame::XDispatch*)this;
+ else if(URL.Complete == m_aInterceptedURL[4])
+ return (frame::XDispatch*)this;
else {
if(m_xSlaveDispatchProvider.is())
return m_xSlaveDispatchProvider->queryDispatch(
@@ -197,6 +207,10 @@ Interceptor::queryDispatches(
aRet[i] = (frame::XDispatch*) 0;
else if(m_aInterceptedURL[2] == Requests[i].FeatureURL.Complete)
aRet[i] = (frame::XDispatch*) this;
+ else if(m_aInterceptedURL[3] == Requests[i].FeatureURL.Complete)
+ aRet[i] = (frame::XDispatch*) this;
+ else if(m_aInterceptedURL[4] == Requests[i].FeatureURL.Complete)
+ aRet[i] = (frame::XDispatch*) this;
return aRet;
}
diff --git a/embedserv/source/inc/embeddoc.hxx b/embedserv/source/inc/embeddoc.hxx
index 48516d2b00c9..dc904faa2eb8 100755
--- a/embedserv/source/inc/embeddoc.hxx
+++ b/embedserv/source/inc/embeddoc.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: embeddoc.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: abi $ $Date: 2003-03-27 16:09:42 $
+ * last change: $Author: abi $ $Date: 2003-03-28 16:31:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -163,7 +163,7 @@ public:
// c++ - methods
void notify();
- void SaveObject();
+ HRESULT SaveObject();
protected:
oslInterlockedCount m_refCount;