[Libreoffice-commits] core.git: sfx2/source

Stephan Bergmann sbergman at redhat.com
Fri May 8 05:51:56 PDT 2015


 sfx2/source/menu/mnuitem.cxx |   45 -------------------------------------------
 1 file changed, 45 deletions(-)

New commits:
commit 8a051cb9543b49cc70f5e6728df3387b128d3daf
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri May 8 14:51:27 2015 +0200

    loplugin:unreffun
    
    Change-Id: I85ed112b1bfb44d47b8bd59e211b5b691b3fe02c

diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index 9d10b93..6cbd552 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -299,8 +299,6 @@ PopupMenu* SfxMenuControl::GetPopup () const
         return 0;
 }
 
-sal_IntPtr Select_Impl( void* pHdl, void* pVoid );
-
 SfxUnoMenuControl* SfxMenuControl::CreateControl( const OUString& rCmd,
         sal_uInt16 nId, Menu& rMenu, const OUString& sItemText,
         SfxBindings& rBindings, SfxVirtualMenu* pVirt)
@@ -336,49 +334,6 @@ struct MenuExecuteInfo
     DECL_STATIC_LINK( MenuExecuteInfo, ExecuteHdl_Impl, MenuExecuteInfo* );
 };
 
-sal_IntPtr Select_Impl( void* /*pHdl*/, void* pVoid )
-{
-    Menu* pMenu = static_cast<Menu*>(pVoid);
-    OUString aURL( pMenu->GetItemCommand( pMenu->GetCurItemId() ) );
-
-    if( aURL.isEmpty() )
-        return 0;
-
-    Reference < ::com::sun::star::frame::XDesktop2 > xDesktop =
-            ::com::sun::star::frame::Desktop::create( ::comphelper::getProcessComponentContext() );
-
-    URL aTargetURL;
-    aTargetURL.Complete = aURL;
-    Reference < XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
-    xTrans->parseStrict( aTargetURL );
-
-    Reference < XDispatch > xDisp;
-    if (aTargetURL.Protocol == "slot:")
-        xDisp = xDesktop->queryDispatch( aTargetURL, OUString(), 0 );
-    else
-    {
-        OUString aTargetFrame( "_blank" );
-        ::framework::MenuAttributes* pMenuAttributes =
-            reinterpret_cast< ::framework::MenuAttributes*>(pMenu->GetUserValue( pMenu->GetCurItemId() ));
-
-        if ( pMenuAttributes )
-            aTargetFrame = pMenuAttributes->aTargetFrame;
-
-        xDisp = xDesktop->queryDispatch( aTargetURL, aTargetFrame , 0 );
-    }
-
-    if ( xDisp.is() )
-    {
-        MenuExecuteInfo* pExecuteInfo = new MenuExecuteInfo;
-        pExecuteInfo->xDispatch     = xDisp;
-        pExecuteInfo->aTargetURL    = aTargetURL;
-        pExecuteInfo->aArgs         = Sequence< PropertyValue >();
-        Application::PostUserEvent( LINK( 0, MenuExecuteInfo, ExecuteHdl_Impl), pExecuteInfo );
-    }
-
-    return sal_IntPtr(true);
-}
-
 IMPL_STATIC_LINK_NOINSTANCE( MenuExecuteInfo, ExecuteHdl_Impl, MenuExecuteInfo*, pExecuteInfo )
 {
     pExecuteInfo->xDispatch->dispatch( pExecuteInfo->aTargetURL, pExecuteInfo->aArgs );


More information about the Libreoffice-commits mailing list