summaryrefslogtreecommitdiff
path: root/ridljar/test
ModeNameSize
d---------com / sun / star30logplain
d class='ctrl'>
authorJens-Heiner Rechtien <hr@openoffice.org>2008-11-20 15:13:11 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2008-11-20 15:13:11 +0000
commitc765b4858941f748fd5ed521e10123c505db5216 (patch)
tree1d9ba14074e5d0c35a09b24e455b419929de6d4e /embedserv
parent40d74b23ef163b6190d5711ba2b106cd285d41dd (diff)
CWS-TOOLING: integrate CWS buildid301_DEV300
Diffstat (limited to 'embedserv')
-rwxr-xr-xembedserv/prj/build.lst3
-rw-r--r--embedserv/source/embed/docholder.cxx22
-rwxr-xr-xembedserv/source/embed/ed_ioleobject.cxx73
-rwxr-xr-xembedserv/source/embed/ed_ipersiststr.cxx81
-rw-r--r--embedserv/source/embed/intercept.cxx14
-rwxr-xr-xembedserv/source/inc/common.h44
-rw-r--r--embedserv/source/inc/docholder.hxx3
-rwxr-xr-xembedserv/source/inc/embeddoc.hxx13
-rw-r--r--embedserv/source/inc/embeddocaccess.hxx28
-rw-r--r--embedserv/source/inc/embservconst.h89
-rw-r--r--embedserv/source/inprocserv/advisesink.cxx180
-rw-r--r--embedserv/source/inprocserv/advisesink.hxx102
-rw-r--r--embedserv/source/inprocserv/dllentry.cxx343
-rw-r--r--embedserv/source/inprocserv/exports.dxp5
-rw-r--r--embedserv/source/inprocserv/inprocembobj.cxx1811
-rw-r--r--embedserv/source/inprocserv/inprocembobj.h249
-rw-r--r--embedserv/source/inprocserv/makefile.mk77
-rw-r--r--embedserv/source/inprocserv/smartpointer.hxx189
18 files changed, 3236 insertions, 90 deletions
diff --git a/embedserv/prj/build.lst b/embedserv/prj/build.lst
index e3bf7922b047..73e2b81de182 100755
--- a/embedserv/prj/build.lst
+++ b/embedserv/prj/build.lst
@@ -1,4 +1,5 @@
es embedserv : offuh sal cppu cppuhelper comphelper NULL
es embedserv usr1 - w es_mkout NULL
es embedserv\source\embed nmake - w es_embed NULL
-es embedserv\util nmake - w es_util es_embed.w NULL
+es embedserv\source\inprocserv nmake - w es_inproc NULL
+es embedserv\util nmake - w es_util es_embed.w es_inproc.w NULL
diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx
index 2cdf388a684f..6b856be92e34 100644
--- a/embedserv/source/embed/docholder.cxx
+++ b/embedserv/source/embed/docholder.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: docholder.cxx,v $
- * $Revision: 1.31 $
+ * $Revision: 1.31.10.1 $
*
* This file is part of OpenOffice.org.
*
@@ -38,6 +38,7 @@
#include "intercept.hxx"
#include "syswinwrapper.hxx"
#include "iipaobj.hxx"
+
#include "common.h"
#include <Windows.h>
#include <com/sun/star/lang/SystemDependent.hpp>
@@ -455,8 +456,8 @@ HRESULT DocumentHolder::InPlaceActivate(
if ( m_xOleAccess.is() )
{
LockedEmbedDocument_Impl aDocLock = m_xOleAccess->GetEmbedDocument();
- if ( aDocLock.m_pEmbedDocument )
- aDocLock.m_pEmbedDocument->ShowObject();
+ if ( aDocLock.GetEmbedDocument() )
+ aDocLock.GetEmbedDocument()->ShowObject();
}
// setTitle(m_aDocumentNamePart);
@@ -469,6 +470,7 @@ HRESULT DocumentHolder::InPlaceActivate(
{
hr = ERROR;
}
+
return hr;
}
@@ -509,8 +511,8 @@ void DocumentHolder::InPlaceDeactivate(void)
if ( m_xOleAccess.is() )
{
LockedEmbedDocument_Impl aDocLock = m_xOleAccess->GetEmbedDocument();
- if ( aDocLock.m_pEmbedDocument )
- aDocLock.m_pEmbedDocument->SaveObject();
+ if ( aDocLock.GetEmbedDocument() )
+ aDocLock.GetEmbedDocument()->SaveObject();
}
return;
@@ -953,7 +955,7 @@ void DocumentHolder::resizeWin( const SIZEL& rNewSize )
if ( m_xOleAccess.is() )
aDocLock = m_xOleAccess->GetEmbedDocument();
- if ( m_xFrame.is() && aDocLock.m_pEmbedDocument )
+ if ( m_xFrame.is() && aDocLock.GetEmbedDocument() )
{
uno::Reference< awt::XWindow > xWindow(
m_xFrame->getContainerWindow(), uno::UNO_QUERY );
@@ -1529,8 +1531,8 @@ DocumentHolder::notifyClosing(
m_xFrame = uno::Reference< frame::XFrame >();
LockedEmbedDocument_Impl aDocLock = m_xOleAccess->GetEmbedDocument();
- if ( aDocLock.m_pEmbedDocument )
- aDocLock.m_pEmbedDocument->OLENotifyClosing();
+ if ( aDocLock.GetEmbedDocument() )
+ aDocLock.GetEmbedDocument()->OLENotifyClosing();
}
else if( m_xFrame.is() && m_xFrame == aSource.Source )
m_xFrame = uno::Reference< frame::XFrame >();
@@ -1570,8 +1572,8 @@ void SAL_CALL DocumentHolder::modified( const lang::EventObject& /*aEvent*/ )
if ( m_xOleAccess.is() )
{
LockedEmbedDocument_Impl aDocLock = m_xOleAccess->GetEmbedDocument();
- if ( aDocLock.m_pEmbedDocument )
- aDocLock.m_pEmbedDocument->notify();
+ if ( aDocLock.GetEmbedDocument() )
+ aDocLock.GetEmbedDocument()->notify();
}
}
diff --git a/embedserv/source/embed/ed_ioleobject.cxx b/embedserv/source/embed/ed_ioleobject.cxx
index 86fb52d35d0f..e17127d8adc6 100755
--- a/embedserv/source/embed/ed_ioleobject.cxx
+++ b/embedserv/source/embed/ed_ioleobject.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ed_ioleobject.cxx,v $
- * $Revision: 1.20 $
+ * $Revision: 1.20.10.1 $
*
* This file is part of OpenOffice.org.
*
@@ -73,26 +73,31 @@ STDMETHODIMP EmbedDocument_Impl::SetHostNames( LPCOLESTR szContainerApp, LPCOLES
STDMETHODIMP EmbedDocument_Impl::Close( DWORD dwSaveOption )
{
- if ( dwSaveOption == 2 && m_aFileName.getLength() )
+ HRESULT hr = S_OK;
+
+ if ( m_pDocHolder->HasFrame() )
{
- // ask the user about saving
- if ( m_pDocHolder->ExecuteSuspendCloseFrame() )
+ if ( dwSaveOption == 2 && m_aFileName.getLength() )
{
- m_pDocHolder->CloseDocument();
- return S_OK;
+ // ask the user about saving
+ if ( m_pDocHolder->ExecuteSuspendCloseFrame() )
+ {
+ m_pDocHolder->CloseDocument();
+ return S_OK;
+ }
+ else
+ return OLE_E_PROMPTSAVECANCELLED;
}
- else
- return OLE_E_PROMPTSAVECANCELLED;
- }
- HRESULT hr = S_OK;
+ if ( dwSaveOption != 1 )
+ hr = SaveObject(); // ADVF_DATAONSTOP);
- if ( dwSaveOption != 1 )
- hr = SaveObject(); // ADVF_DATAONSTOP);
+ m_pDocHolder->CloseFrame();
+ OLENotifyDeactivation();
+ }
m_pDocHolder->FreeOffice();
m_pDocHolder->CloseDocument();
- m_pDocHolder->CloseFrame();
OLENotifyClosing();
@@ -104,9 +109,6 @@ HRESULT EmbedDocument_Impl::OLENotifyClosing()
{
HRESULT hr = S_OK;
- if ( m_pClientSite )
- m_pClientSite->OnShowWindow( FALSE );
-
AdviseSinkHashMap aAHM(m_aAdviseHashMap);
for ( AdviseSinkHashMapIterator iAdvise = aAHM.begin();
@@ -258,7 +260,8 @@ STDMETHODIMP EmbedDocument_Impl::EnumVerbs( IEnumOLEVERB ** /*ppEnumOleVerb*/ )
STDMETHODIMP EmbedDocument_Impl::Update()
{
- return S_OK;
+ HRESULT hr = CACHE_E_NOCACHE_UPDATED;
+ return hr;
}
STDMETHODIMP EmbedDocument_Impl::IsUpToDate()
@@ -398,6 +401,18 @@ STDMETHODIMP EmbedDocument_Impl::Invoke( DISPID dispIdMember,
return DISP_E_MEMBERNOTFOUND;
}
+//-------------------------------------------------------------------------------
+// IExternalConnection
+
+DWORD STDMETHODCALLTYPE EmbedDocument_Impl::AddConnection( DWORD , DWORD )
+{
+ return AddRef();
+}
+
+DWORD STDMETHODCALLTYPE EmbedDocument_Impl::ReleaseConnection( DWORD , DWORD , BOOL )
+{
+ return Release();
+}
// C++ - methods
@@ -454,9 +469,33 @@ void EmbedDocument_Impl::notify( bool bDataChanged )
m_pDAdviseHolder->SendOnDataChange( (IDataObject*)this, 0, 0 );
}
+void EmbedDocument_Impl::Deactivate()
+{
+ HRESULT hr = S_OK;
+
+ if ( m_pDocHolder->HasFrame() )
+ {
+ hr = SaveObject();
+ m_pDocHolder->CloseFrame();
+ OLENotifyDeactivation();
+ }
+}
+
+HRESULT EmbedDocument_Impl::OLENotifyDeactivation()
+{
+ HRESULT hr = S_OK;
+
+ if ( m_pClientSite )
+ hr = m_pClientSite->OnShowWindow( FALSE );
+
+ return hr;
+
+}
+
// Fix strange warnings about some
// ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions.
// warning C4505: 'xxx' : unreferenced local function has been removed
#if defined(_MSC_VER)
#pragma warning(disable: 4505)
#endif
+
diff --git a/embedserv/source/embed/ed_ipersiststr.cxx b/embedserv/source/embed/ed_ipersiststr.cxx
index b977ce513ca6..4c2fa098cbbc 100755
--- a/embedserv/source/embed/ed_ipersiststr.cxx
+++ b/embedserv/source/embed/ed_ipersiststr.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ed_ipersiststr.cxx,v $
- * $Revision: 1.27 $
+ * $Revision: 1.27.10.1 $
*
* This file is part of OpenOffice.org.
*
@@ -272,6 +272,7 @@ HRESULT EmbedDocument_Impl::SaveTo_Impl( IStorage* pStg )
CComPtr< IStream > pOrigOwn = m_pOwnStream;
CComPtr< IStream > pOrigExt = m_pExtStream;
HRESULT hr = Save( pStg, sal_False );
+ pStg->Commit( STGC_ONLYIFCURRENT );
m_pOwnStream = pOrigOwn;
m_pExtStream = pOrigExt;
@@ -295,6 +296,12 @@ STDMETHODIMP EmbedDocument_Impl::QueryInterface( REFIID riid, void FAR* FAR* ppv
*ppv = (IPersist*) (IPersistStorage*) this;
return S_OK;
}
+ else if (IsEqualIID(riid, IID_IExternalConnection))
+ {
+ AddRef();
+ *ppv = (IExternalConnection*) this;
+ return S_OK;
+ }
else if (IsEqualIID(riid, IID_IPersistStorage))
{
AddRef();
@@ -715,6 +722,10 @@ STDMETHODIMP EmbedDocument_Impl::SaveCompleted( IStorage *pStgNew )
&m_pExtStream );
if ( FAILED( hr ) || !m_pExtStream ) return E_OUTOFMEMORY;
+ sal_Bool bModified = sal_False;
+ uno::Reference< util::XModifiable > xMod( m_pDocHolder->GetDocument(), uno::UNO_QUERY );
+ if ( xMod.is() )
+ bModified = xMod->isModified();
for ( AdviseSinkHashMapIterator iAdvise = m_aAdviseHashMap.begin(); iAdvise != m_aAdviseHashMap.end(); iAdvise++ )
{
@@ -722,6 +733,9 @@ STDMETHODIMP EmbedDocument_Impl::SaveCompleted( IStorage *pStgNew )
iAdvise->second->OnSave();
}
+ if ( xMod.is() )
+ bModified = xMod->isModified();
+
return S_OK;
}
@@ -922,13 +936,8 @@ STDMETHODIMP EmbedDocument_Impl::GetCurFile( LPOLESTR *ppszFileName )
LockedEmbedDocument_Impl EmbeddedDocumentInstanceAccess_Impl::GetEmbedDocument()
{
- LockedEmbedDocument_Impl aResult;
::osl::MutexGuard aGuard( m_aMutex );
-
- aResult.m_pLocker = static_cast< IPersistStorage* >( m_pEmbedDocument );
- aResult.m_pEmbedDocument = m_pEmbedDocument;
-
- return aResult;
+ return LockedEmbedDocument_Impl( m_pEmbedDocument );
}
void EmbeddedDocumentInstanceAccess_Impl::ClearEmbedDocument()
@@ -937,9 +946,67 @@ void EmbeddedDocumentInstanceAccess_Impl::ClearEmbedDocument()
m_pEmbedDocument = NULL;
}
+// ===============================================
+
+LockedEmbedDocument_Impl::LockedEmbedDocument_Impl()
+: m_pEmbedDocument( NULL )
+{}
+
+LockedEmbedDocument_Impl::LockedEmbedDocument_Impl( EmbedDocument_Impl* pEmbedDocument )
+: m_pEmbedDocument( pEmbedDocument )
+{
+ if ( m_pEmbedDocument )
+ m_pEmbedDocument->AddRef();
+}
+
+LockedEmbedDocument_Impl::LockedEmbedDocument_Impl( const LockedEmbedDocument_Impl& aDocLock )
+: m_pEmbedDocument( aDocLock.m_pEmbedDocument )
+{
+ if ( m_pEmbedDocument )
+ m_pEmbedDocument->AddRef();
+}
+
+LockedEmbedDocument_Impl& LockedEmbedDocument_Impl::operator=( const LockedEmbedDocument_Impl& aDocLock )
+{
+ if ( m_pEmbedDocument )
+ m_pEmbedDocument->Release();
+
+ m_pEmbedDocument = aDocLock.m_pEmbedDocument;
+ if ( m_pEmbedDocument )
+ m_pEmbedDocument->AddRef();
+
+ return *this;
+}
+
+LockedEmbedDocument_Impl::~LockedEmbedDocument_Impl()
+{
+ if ( m_pEmbedDocument )
+ m_pEmbedDocument->Release();
+}
+
+void LockedEmbedDocument_Impl::ExecuteMethod( sal_Int16 nId )
+{
+ if ( m_pEmbedDocument )
+ {
+ if ( nId == OLESERV_SAVEOBJECT )
+ m_pEmbedDocument->SaveObject();
+ else if ( nId == OLESERV_CLOSE )
+ m_pEmbedDocument->Close( 0 );
+ else if ( nId == OLESERV_NOTIFY )
+ m_pEmbedDocument->notify();
+ else if ( nId == OLESERV_NOTIFYCLOSING )
+ m_pEmbedDocument->OLENotifyClosing();
+ else if ( nId == OLESERV_SHOWOBJECT )
+ m_pEmbedDocument->ShowObject();
+ else if ( nId == OLESERV_DEACTIVATE )
+ m_pEmbedDocument->Deactivate();
+ }
+}
+
// Fix strange warnings about some
// ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions.
// warning C4505: 'xxx' : unreferenced local function has been removed
#if defined(_MSC_VER)
#pragma warning(disable: 4505)
#endif
+
diff --git a/embedserv/source/embed/intercept.cxx b/embedserv/source/embed/intercept.cxx
index dbdeff90b90b..9ab5edac01bd 100644
--- a/embedserv/source/embed/intercept.cxx
+++ b/embedserv/source/embed/intercept.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: intercept.cxx,v $
- * $Revision: 1.14 $
+ * $Revision: 1.14.10.1 $
*
* This file is part of OpenOffice.org.
*
@@ -199,15 +199,15 @@ Interceptor::dispatch(
if ( xOleAccess.is() )
{
LockedEmbedDocument_Impl aDocLock = xOleAccess->GetEmbedDocument();
- if ( aDocLock.m_pEmbedDocument )
+ if ( aDocLock.GetEmbedDocument() )
{
if( !m_bLink && URL.Complete == m_aInterceptedURL[0])
- aDocLock.m_pEmbedDocument->SaveObject();
+ aDocLock.GetEmbedDocument()->SaveObject();
else if(!m_bLink
- && ( URL.Complete == m_aInterceptedURL[2] ||
- URL.Complete == m_aInterceptedURL[3] ||
- URL.Complete == m_aInterceptedURL[4] ) )
- aDocLock.m_pEmbedDocument->Close( 0 );
+ && ( URL.Complete == m_aInterceptedURL[2] ||
+ URL.Complete == m_aInterceptedURL[3] ||
+ URL.Complete == m_aInterceptedURL[4] ) )
+ aDocLock.GetEmbedDocument()->Close( 0 );
else if ( URL.Complete == m_aInterceptedURL[5] )
{
uno::Sequence< beans::PropertyValue > aNewArgs = Arguments;
diff --git a/embedserv/source/inc/common.h b/embedserv/source/inc/common.h
index d7e94dc5d04b..a2d5707b8e3f 100755
--- a/