diff options
author | Kurt Zenker <kz@openoffice.org> | 2005-07-12 11:18:50 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2005-07-12 11:18:50 +0000 |
commit | e45beadafffc057bdbcbbc63af73b838cceed079 (patch) | |
tree | 105052e37fb8bda8c6b7b03dbf5840397fa1a7c4 /embeddedobj | |
parent | 858ca2dd2d842de4ba709efd701cdf3d411a4643 (diff) |
INTEGRATION: CWS mav18 (1.25.4); FILE MERGED
2005/06/02 13:13:54 mav 1.25.4.3: #i49369# get the size from IOleObject only in case there is no own cached size
2005/05/30 09:56:05 mav 1.25.4.2: #i49751# the view of an object in loaded state can not change
2005/05/26 08:49:51 mav 1.25.4.1: #i47679# do not deinit ole as SO7 did
Diffstat (limited to 'embeddedobj')
-rw-r--r-- | embeddedobj/source/msole/olecomponent.cxx | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx index 2d92e127513c..a5f21738962a 100644 --- a/embeddedobj/source/msole/olecomponent.cxx +++ b/embeddedobj/source/msole/olecomponent.cxx @@ -2,9 +2,9 @@ * * $RCSfile: olecomponent.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: obo $ $Date: 2005-04-27 09:16:13 $ + * last change: $Author: kz $ $Date: 2005-07-12 12:18:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -490,7 +490,10 @@ void OleComponent::Dispose() if ( m_bOleInitialized ) { - OleUninitialize(); + // since the disposing can happen not only from main thread but also from a clipboard + // the deinitialization might lead to a disaster, SO7 does not deinitialize OLE at all + // so currently the same approach is selected as workaround + // OleUninitialize(); m_bOleInitialized = sal_False; } @@ -1095,15 +1098,33 @@ awt::Size OleComponent::GetExtent( sal_Int64 nAspect ) //else // throw io::IOException(); // TODO - hr = m_pNativeImpl->m_pOleObject->GetExtent( nMSAspect, &aSize ); - if ( FAILED( hr ) ) - throw io::IOException(); // TODO + // actually the following method returns periodically a different value than the method from IViewObject + // for this reason it is separated in GetReccomendedExtent call + // hr = m_pNativeImpl->m_pOleObject->GetExtent( nMSAspect, &aSize ); + // if ( FAILED( hr ) ) + throw lang::IllegalArgumentException(); + // throw io::IOException(); // TODO } return awt::Size( aSize.cx, aSize.cy ); } //---------------------------------------------- +awt::Size OleComponent::GetReccomendedExtent( sal_Int64 nAspect ) +{ + if ( !m_pNativeImpl->m_pOleObject ) + throw embed::WrongStateException(); // TODO: the object is in wrong state + + DWORD nMSAspect = ( DWORD )nAspect; // first 32 bits are for MS aspects + SIZEL aSize; + HRESULT hr = m_pNativeImpl->m_pOleObject->GetExtent( nMSAspect, &aSize ); + if ( FAILED( hr ) ) + throw lang::IllegalArgumentException(); + + return awt::Size( aSize.cx, aSize.cy ); +} + +//---------------------------------------------- sal_Int64 OleComponent::GetMiscStatus( sal_Int64 nAspect ) { if ( !m_pNativeImpl->m_pOleObject ) |