INTEGRATION: CWS fwk24 (1.10.14); FILE MERGED

2005/10/12 09:18:01 cd 1.10.14.1: #i55566# Inform layout manager to not automatically show non-context sensitive toolbars
This commit is contained in:
Jens-Heiner Rechtien 2005-10-27 13:09:03 +00:00
parent ce4af60bff
commit ade81c8251

View File

@ -338,6 +338,30 @@ HRESULT CSOActiveX::GetUrlStruct( OLECHAR* sUrl, CComPtr<IDispatch>& pdispUrl )
return S_OK;
}
HRESULT CSOActiveX::SetLayoutManagerProps()
{
if ( !mpDispFrame )
return E_FAIL;
CComVariant pVarLayoutMgr;
OLECHAR* sLMPropName = L"LayoutManager";
HRESULT hr = GetPropertiesFromIDisp( mpDispFrame, &sLMPropName, &pVarLayoutMgr, 1 );
if( pVarLayoutMgr.vt != VT_DISPATCH || pVarLayoutMgr.pdispVal == NULL )
return E_FAIL;
CComPtr<IDispatch> pdispLM( pVarLayoutMgr.pdispVal );
if( !SUCCEEDED( hr ) || !pdispLM )
return E_FAIL;
OLECHAR* sATName = L"AutomaticToolbars";
CComVariant pATProp;
pATProp.vt = VT_BOOL; pATProp.boolVal = VARIANT_FALSE ;
hr = PutPropertiesToIDisp( pdispLM, &sATName, &pATProp, 1 );
return hr;
}
HRESULT CSOActiveX::CreateFrameOldWay( HWND hwnd, int width, int height )
{
@ -410,6 +434,9 @@ HRESULT CSOActiveX::CreateFrameOldWay( HWND hwnd, int width, int height )
hr = ExecuteFunc( mpDispFrame, L"initialize", &CComVariant( mpDispWin ), 1, &dummyResult );
if( !SUCCEEDED( hr ) ) return hr;
// set some properties to the layout manager, ignore errors for now
SetLayoutManagerProps();
// create desktop
CComPtr<IDispatch> pdispDesktop;
hr = GetIDispByFunc( mpDispFactory, L"createInstance", &CComVariant( L"com.sun.star.frame.Desktop" ), 1, pdispDesktop );