diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2009-12-18 10:00:02 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2009-12-18 10:00:02 +0100 |
commit | c2c963816ed37546f48515b294fbe1c9233a483c (patch) | |
tree | 1efc2531efa532891d93df1c79daa1b5d3465582 | |
parent | 7255eca208d1cfdc2d294c168d0e849ae7150b22 (diff) | |
parent | d973b931c32fe0f78b8514ef0334dcc947cd2e76 (diff) |
autorecovery: merge
-rw-r--r-- | sfx2/inc/sfx2/frame.hxx | 5 | ||||
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/view/frame2.cxx | 17 |
3 files changed, 16 insertions, 15 deletions
diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index cfd0ee05c031..832389ad5981 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -138,8 +138,9 @@ protected: public: TYPEINFO(); - static SfxFrame* Create( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame ); - static SfxFrame* CreateBlank(); + static SfxFrame* Create( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame ); + static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > + CreateBlankFrame(); static SfxFrame* Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewId, bool bHidden ); SvCompatWeakHdl* GetHdl(); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 625acdb085fd..2fea15cc27e6 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -982,11 +982,12 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) aLoadArgs.put( "Model", pBasicIDE->GetModel() ); aLoadArgs.put( "URL", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:factory/sbasic" ) ) ); - Reference< XFrame > xStartModuleFrame( lcl_findStartModuleFrame( aContext ) ); - SfxFrame* pFrame = xStartModuleFrame.is() ? SfxFrame::Create( xStartModuleFrame ) : SfxFrame::CreateBlank(); - ENSURE_OR_THROW( pFrame, "could not create a SfxFrame to load the Basic IDE into!" ); + Reference< XFrame > xTargetFrame( lcl_findStartModuleFrame( aContext ) ); + if ( !xTargetFrame.is() ) + xTargetFrame = SfxFrame::CreateBlankFrame(); + ENSURE_OR_THROW( xTargetFrame.is(), "could not obtain a frameto load the Basic IDE into!" ); - xLoader->load( aLoadArgs.getPropertyValues(), pFrame->GetFrameInterface() ); + xLoader->load( aLoadArgs.getPropertyValues(), xTargetFrame ); } catch( const Exception& ) { diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index edb927d20001..65eab2e30b15 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -237,21 +237,20 @@ void SfxFrameWindow_Impl::DoResize() pFrame->Resize(); } -SfxFrame* SfxFrame::CreateBlank() +Reference < XFrame > SfxFrame::CreateBlankFrame() { - SfxFrame* pFrame = NULL; + Reference < XFrame > xFrame; try { ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); - Reference < XFrame > xFrame = xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ); - pFrame = Create( xFrame ); + xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW ); } catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } - return pFrame; + return xFrame; } SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewId, bool bHidden ) @@ -315,15 +314,15 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewI return pFrame; } -SfxFrame* SfxFrame::Create( Reference < XFrame > xFrame ) +SfxFrame* SfxFrame::Create( const Reference < XFrame >& i_rFrame ) { // create a new TopFrame to an external XFrame object ( wrap controller ) - ENSURE_OR_THROW( xFrame.is(), "NULL frame not allowed" ); - Window* pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); + ENSURE_OR_THROW( i_rFrame.is(), "NULL frame not allowed" ); + Window* pWindow = VCLUnoHelper::GetWindow( i_rFrame->getContainerWindow() ); ENSURE_OR_THROW( pWindow, "frame without container window not allowed" ); SfxFrame* pFrame = new SfxFrame( *pWindow, false ); - pFrame->SetFrameInterface_Impl( xFrame ); + pFrame->SetFrameInterface_Impl( i_rFrame ); return pFrame; } |