summaryrefslogtreecommitdiff
path: root/embedserv/source/embed
diff options
context:
space:
mode:
authorAndreas Bille <abi@openoffice.org>2003-03-26 10:13:34 +0000
committerAndreas Bille <abi@openoffice.org>2003-03-26 10:13:34 +0000
commit8d45b4a32eaee1c0649809fac2be6520d74a1806 (patch)
treeb2df3a9b3c3bfb25e6859738620271ebf66e7b33 /embedserv/source/embed
parent74d5462d024bbb66e74e9c9dc912110b918516b4 (diff)
#i2822# part of impl of IOleObject
Diffstat (limited to 'embedserv/source/embed')
-rwxr-xr-xembedserv/source/embed/ed_ioleobject.cxx62
-rwxr-xr-xembedserv/source/embed/ed_ipersiststr.cxx20
2 files changed, 56 insertions, 26 deletions
diff --git a/embedserv/source/embed/ed_ioleobject.cxx b/embedserv/source/embed/ed_ioleobject.cxx
index eb811339082d..eb05cd1a7064 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.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: mav $ $Date: 2003-03-11 13:02:14 $
+ * last change: $Author: abi $ $Date: 2003-03-26 11:13:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,6 +61,20 @@
#include "embeddoc.hxx"
+#ifndef _COM_SUN_STAR_FRAME_XController_HPP_
+#include <com/sun/star/frame/XController.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+
+
+using namespace ::com::sun::star;
+
+
+extern ::rtl::OUString getFilterNameFromGUID_Impl( GUID* );
+
+
STDMETHODIMP EmbedDocument_Impl::SetClientSite( IOleClientSite* pSite )
{
m_pClientSite = pSite;
@@ -120,29 +134,47 @@ STDMETHODIMP EmbedDocument_Impl::GetClipboardData( DWORD dwReserved, IDataObject
return E_NOTIMPL;
}
+
+void EmbedDocument_Impl::notify()
+{
+ for ( AdviseSinkHashMapIterator iAdvise =
+ m_aAdviseHashMap.begin();
+ iAdvise != m_aAdviseHashMap.end();
+ iAdvise++ )
+ if ( iAdvise->second )
+ iAdvise->second->OnViewChange( DVASPECT_CONTENT, -1 );
+
+ if ( m_pDAdviseHolder )
+ m_pDAdviseHolder->SendOnDataChange( (IDataObject*)this, 0, 0 );
+}
+
+
STDMETHODIMP EmbedDocument_Impl::DoVerb( LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect )
{
- if ( iVerb == OLEIVERB_PRIMARY || iVerb == OLEIVERB_OPEN || iVerb == OLEIVERB_SHOW )
+ if ( iVerb == OLEIVERB_PRIMARY || iVerb == OLEIVERB_SHOW || iVerb == OLEIVERB_OPEN )
{
+ if( m_pDocHolder )
+ m_pDocHolder->show();
+
if ( m_pClientSite )
- {
m_pClientSite->OnShowWindow( TRUE );
- m_pClientSite->OnShowWindow( FALSE );
- }
-
- for ( AdviseSinkHashMapIterator iAdvise = m_aAdviseHashMap.begin(); iAdvise != m_aAdviseHashMap.end(); iAdvise++ )
- {
- if ( iAdvise->second )
- iAdvise->second->OnViewChange( DVASPECT_CONTENT, -1 );
- }
- if ( m_pDAdviseHolder )
- m_pDAdviseHolder->SendOnDataChange( (IDataObject*)this, 0, 0 );
+ notify();
return S_OK;
}
+ else if( iVerb == OLEIVERB_HIDE )
+ {
+ if(m_pDocHolder)
+ m_pDocHolder->hide();
- return E_NOTIMPL;
+ if( m_pClientSite )
+ m_pClientSite->OnShowWindow( FALSE );
+
+ return S_OK;
+ }
+ else
+ return E_NOTIMPL;
}
STDMETHODIMP EmbedDocument_Impl::EnumVerbs( IEnumOLEVERB **ppEnumOleVerb )
diff --git a/embedserv/source/embed/ed_ipersiststr.cxx b/embedserv/source/embed/ed_ipersiststr.cxx
index ba59628433c8..794b97ede956 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.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: mav $ $Date: 2003-03-25 08:22:13 $
+ * last change: $Author: abi $ $Date: 2003-03-26 11:13:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -234,7 +234,7 @@ EmbedDocument_Impl::EmbedDocument_Impl( const uno::Reference< lang::XMultiServic
, m_nAdviseNum( 0 )
//, m_bLoadedFromFile( sal_False )
{
- m_pDocHolder = new DocumentHolder( xFactory );
+ m_pDocHolder = new DocumentHolder( xFactory,this );
m_pDocHolder->acquire();
}
@@ -252,7 +252,7 @@ uno::Sequence< beans::PropertyValue > EmbedDocument_Impl::fillArgsForLoading_Imp
aArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "FilterName" ) );
aArgs[0].Value <<= getFilterNameFromGUID_Impl( &m_guid );
aArgs[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ReadOnly" ) );
- aArgs[1].Value <<= ( ( nStreamMode & ( STGM_READWRITE | STGM_WRITE ) ) ? sal_True : sal_False );
+ aArgs[1].Value <<= sal_False; //( ( nStreamMode & ( STGM_READWRITE | STGM_WRITE ) ) ? sal_True : sal_False );
if ( xStream.is() )
{
@@ -285,8 +285,6 @@ uno::Sequence< beans::PropertyValue > EmbedDocument_Impl::fillArgsForLoading_Imp
sDocUrl = aURL.Complete;
}
}
- else // REMOVE
- sDocUrl = getTestFileURLFromGUID_Impl( &m_guid ); // REMOVE
aArgs[3].Value <<= sDocUrl;
}
@@ -425,15 +423,15 @@ STDMETHODIMP EmbedDocument_Impl::InitNew( IStorage *pStg )
uno::UNO_QUERY );
if ( aDocument.is() )
{
- m_pDocHolder->SetDocument( aDocument );
+ m_pDocHolder->SetDocument( aDocument,nStreamMode );
uno::Reference< frame::XLoadable > xLoadable( m_pDocHolder->GetDocument(), uno::UNO_QUERY );
if( xLoadable.is() )
{
try
{
- // xLoadable->initNew();
- xLoadable->load( fillArgsForLoading_Impl( uno::Reference< io::XInputStream >(), nStreamMode ) );
+ xLoadable->initNew();
+ // xLoadable->load( fillArgsForLoading_Impl( uno::Reference< io::XInputStream >(), nStreamMode ) );
hr = S_OK;
}
catch( uno::Exception& )
@@ -510,7 +508,7 @@ STDMETHODIMP EmbedDocument_Impl::Load( IStorage *pStg )
uno::UNO_QUERY );
if ( aDocument.is() )
{
- m_pDocHolder->SetDocument( aDocument );
+ m_pDocHolder->SetDocument( aDocument,nStreamMode );
uno::Reference< frame::XLoadable > xLoadable( m_pDocHolder->GetDocument(), uno::UNO_QUERY );
if( xLoadable.is() )
@@ -690,7 +688,7 @@ STDMETHODIMP EmbedDocument_Impl::Load( LPCOLESTR pszFileName, DWORD dwMode )
uno::UNO_QUERY );
if ( aDocument.is() )
{
- m_pDocHolder->SetDocument( aDocument );
+ m_pDocHolder->SetDocument( aDocument,nStreamMode );
uno::Reference< frame::XLoadable > xLoadable( m_pDocHolder->GetDocument(), uno::UNO_QUERY );
if( xLoadable.is() )