diff options
author | Kurt Zenker <kz@openoffice.org> | 2004-02-25 14:49:16 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2004-02-25 14:49:16 +0000 |
commit | 21de8516ab053b9421df08af4bb9966209b4ba07 (patch) | |
tree | f39a4fbd44e44bcde2ea45b234a4d35ac281eb0c | |
parent | 528599d198689b1caa9c228b5a3bbaa4441b40fd (diff) |
INTEGRATION: CWS layoutmanager (1.35.76); FILE MERGED
2004/02/19 17:02:51 cd 1.35.76.5: RESYNC: (1.38-1.39); FILE MERGED
2004/01/29 19:25:10 cd 1.35.76.4: RESYNC: (1.36-1.38); FILE MERGED
2003/10/31 16:36:38 cd 1.35.76.3: #111899# Fixed some problems with OLE inplace editing
2003/10/06 11:30:46 cd 1.35.76.2: RESYNC: (1.35-1.36); FILE MERGED
2003/10/01 14:53:46 cd 1.35.76.1: #111899# Use UNO based menu implementation
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 74 |
1 files changed, 34 insertions, 40 deletions
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index d9ab7286dafc..e6f7bd70a44b 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -2,9 +2,9 @@ * * $RCSfile: viewsh.cxx,v $ * - * $Revision: 1.39 $ + * $Revision: 1.40 $ * - * last change: $Author: kz $ $Date: 2004-01-28 19:16:21 $ + * last change: $Author: kz $ $Date: 2004-02-25 15:49:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -90,6 +90,13 @@ #include <svtools/ehdl.hxx> #endif +#ifndef _DRAFTS_COM_SUN_STAR_FRAME_XLAYOUTMANAGER_HPP_ +#include <drafts/com/sun/star/frame/XLayoutManager.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif + #include <tools/urlobj.hxx> #include <svtools/pathoptions.hxx> #include <svtools/miscopt.hxx> @@ -134,6 +141,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::beans; //========================================================================= DBG_NAME(SfxViewShell); @@ -923,6 +931,7 @@ SfxViewShell::~SfxViewShell() // GetViewFrame()->GetFrame()->SetFrameSet_Impl( NULL ); // delete pImp->pSetDescr; +/* if ( pImp->pMenu && pImp->bOwnsMenu ) { SfxTopViewFrame* pTopView = PTR_CAST( SfxTopViewFrame, GetViewFrame()->GetTopViewFrame() ); @@ -936,7 +945,7 @@ SfxViewShell::~SfxViewShell() delete pImp->pMenu; } - +*/ if ( pImp->pController ) { pImp->pController->ReleaseShell_Impl(); @@ -1724,9 +1733,28 @@ SfxMenuBarManager* SfxViewShell::GetMenuBar_Impl( BOOL bPlugin ) { // get the accelerators GetAccMgr_Impl(); - if ( !pImp->pMenu ) - pImp->pMenu = GetObjectShell()->CreateMenuBarManager_Impl( GetViewFrame() ); - return pImp->pMenu; + + Reference < XPropertySet > xPropSet( GetViewFrame()->GetFrame()->GetFrameInterface(), UNO_QUERY ); + if ( xPropSet.is() ) + { + Reference< drafts::com::sun::star::frame::XLayoutManager > xLayoutManager; + + if ( xPropSet.is() ) + { + Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))); + aValue >>= xLayoutManager; + } + + if ( xLayoutManager.is() ) + { + rtl::OUString aMenuBarURL( RTL_CONSTASCII_USTRINGPARAM( "private:resource/menubar/menubar" )); + Reference< drafts::com::sun::star::ui::XUIElement > xMenuBarElement( xLayoutManager->getElement( aMenuBarURL )); + if ( !xMenuBarElement.is() ) + GetObjectShell()->CreateMenuBarManager_Impl( GetViewFrame() ); + } + } + + return NULL; } SfxAcceleratorManager* SfxViewShell::GetAccMgr_Impl() @@ -1739,40 +1767,6 @@ SfxAcceleratorManager* SfxViewShell::GetAccMgr_Impl() #endif } -/* -void SfxViewShell::SetMenuBar_Impl( const ResId& rId ) -{ - if ( !pImp->pMenuBarResId || - rId.GetId() != pImp->pMenuBarResId->GetId() || - rId.GetResMgr() != pImp->pMenuBarResId->GetResMgr() ) - { - DELETEZ( pImp->pMenuBarResId ); - - if ( pImp->pMenu ) - { - if ( pImp->bOwnsMenu ) - { - SfxTopViewFrame* pTopView = PTR_CAST( SfxTopViewFrame, GetViewFrame()->GetTopViewFrame() ); - SfxTopFrame *pTop = pTopView ? pTopView->GetTopFrame_Impl() : NULL; - if ( pTop ) - { - Menu* pMenu = pImp->pMenu->GetMenu()->GetSVMenu(); - if ( pMenu == pTop->GetMenuBar_Impl() ) - pTop->SetMenuBar_Impl( 0 ); - } - - DELETEZ( pImp->pMenu ); - } - else - pImp->pMenu = NULL; - } - - if ( rId.GetId() ) - pImp->pMenuBarResId = new ResId(rId); - } -} -*/ - void SfxViewShell::SetController( SfxBaseController* pController ) { pImp->pController = pController; |