summaryrefslogtreecommitdiff
path: root/extensions/source/activex/main/SOActiveX.cpp
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2005-10-27 13:09:03 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2005-10-27 13:09:03 +0000
commit06d4461c668b260e1b58ab70bf8771d0e1ec58cd (patch)
treebf656cf4df1d5ba61080f38ba732f87eaa7c81e1 /extensions/source/activex/main/SOActiveX.cpp
parent998e064aa1f5bd6493f47be7bd5c9087172b582e (diff)
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
Diffstat (limited to 'extensions/source/activex/main/SOActiveX.cpp')
-rw-r--r--extensions/source/activex/main/SOActiveX.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/extensions/source/activex/main/SOActiveX.cpp b/extensions/source/activex/main/SOActiveX.cpp
index 1736f6ac1..99c02e3f3 100644
--- a/extensions/source/activex/main/SOActiveX.cpp
+++ b/extensions/source/activex/main/SOActiveX.cpp
@@ -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 );