From ade81c825107bb42b0e30e1654264ab97a2c1a97 Mon Sep 17 00:00:00 2001
From: Jens-Heiner Rechtien
Date: Thu, 27 Oct 2005 13:09:03 +0000
Subject: [PATCH] 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
---
extensions/source/activex/main/SOActiveX.cpp | 27 ++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/extensions/source/activex/main/SOActiveX.cpp b/extensions/source/activex/main/SOActiveX.cpp
index 03d318afd514..7138d15d4941 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& 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 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 pdispDesktop;
hr = GetIDispByFunc( mpDispFactory, L"createInstance", &CComVariant( L"com.sun.star.frame.Desktop" ), 1, pdispDesktop );