diff options
author | Ariel Constenla-Haile <arielch@apache.org> | 2012-12-23 11:29:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-06-23 21:16:14 +0100 |
commit | 9052caae53ef6ec7eeab20f1ac56bd6310b4451b (patch) | |
tree | e3fa07a8a4bee383d9d17ae7e75500fdf88ac2da /framework | |
parent | Resolves: #i122317# Mark API name as not localizable (diff) | |
download | core-9052caae53ef6ec7eeab20f1ac56bd6310b4451b.tar.gz core-9052caae53ef6ec7eeab20f1ac56bd6310b4451b.zip |
Resolves: #i121542# Unify the Menu API
(cherry picked from commit 399946b82f5efec19cd82d1c320d5aa9295d235d)
Conflicts:
chart2/source/controller/main/ChartController_Window.cxx
framework/source/uielement/langselectionmenucontroller.cxx
framework/source/uielement/popupmenucontroller.cxx
framework/source/uielement/recentfilesmenucontroller.cxx
framework/source/uielement/toolbarsmenucontroller.cxx
odk/examples/DevelopersGuide/GUI/UnoMenu.java
odk/examples/DevelopersGuide/GUI/UnoMenu2.java
odk/examples/cpp/StatusbarController/SelectionModeStatusbarController/SelectionModeStatusbarController.cxx
offapi/com/sun/star/awt/MenuBar.idl
offapi/com/sun/star/awt/MenuEvent.idl
offapi/com/sun/star/awt/MenuItemStyle.idl
offapi/com/sun/star/awt/MenuItemType.idl
offapi/com/sun/star/awt/MenuLogo.idl
offapi/com/sun/star/awt/PopupMenu.idl
offapi/com/sun/star/awt/PopupMenuDirection.idl
offapi/com/sun/star/awt/XMenu.idl
offapi/com/sun/star/awt/XMenuBar.idl
offapi/com/sun/star/awt/XMenuBarExtended.idl
offapi/com/sun/star/awt/XMenuExtended.idl
offapi/com/sun/star/awt/XMenuExtended2.idl
offapi/com/sun/star/awt/XMenuListener.idl
offapi/com/sun/star/awt/XPopupMenu.idl
offapi/com/sun/star/awt/XPopupMenuExtended.idl
offapi/com/sun/star/awt/makefile.mk
offapi/type_reference/types.rdb
svtools/inc/svtools/popupmenucontrollerbase.hxx
svtools/source/uno/popupmenucontrollerbase.cxx
svx/source/tbxctrls/extrusioncontrols.cxx
toolkit/inc/pch/precompiled_toolkit.hxx
toolkit/inc/toolkit/awt/vclxmenu.hxx
toolkit/inc/toolkit/helper/listenermultiplexer.hxx
toolkit/source/awt/vclxmenu.cxx
Change-Id: I3d9a1e109b9ff35901a3075b44a4c27e7c12b5c7
Related: #i121542# css::awt::XPopupMenu::execute() needs a Rectangle
(cherry picked from commit c01a6f4f370b72f0751cf4f5c11310682e2b3248)
Conflicts:
odk/examples/DevelopersGuide/GUI/UnoMenu2.java
offapi/type_reference/types.rdb
toolkit/inc/toolkit/awt/vclxmenu.hxx
Change-Id: I2cccc95086fe3d1522d03346e3c577fb2f21f621
Diffstat (limited to 'framework')
13 files changed, 28 insertions, 35 deletions
diff --git a/framework/inc/uielement/controlmenucontroller.hxx b/framework/inc/uielement/controlmenucontroller.hxx index a5f4fcfd9fd2..9b86a6257a62 100644 --- a/framework/inc/uielement/controlmenucontroller.hxx +++ b/framework/inc/uielement/controlmenucontroller.hxx @@ -63,7 +63,7 @@ namespace framework virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ); // XMenuListener - virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); // XEventListener virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException ); diff --git a/framework/inc/uielement/fontmenucontroller.hxx b/framework/inc/uielement/fontmenucontroller.hxx index d642a9c37b17..df8c922fa725 100644 --- a/framework/inc/uielement/fontmenucontroller.hxx +++ b/framework/inc/uielement/fontmenucontroller.hxx @@ -57,7 +57,7 @@ namespace framework virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ); // XMenuListener - virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); // XEventListener virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException ); diff --git a/framework/inc/uielement/newmenucontroller.hxx b/framework/inc/uielement/newmenucontroller.hxx index f2ee4ac33f71..afacc16ded58 100644 --- a/framework/inc/uielement/newmenucontroller.hxx +++ b/framework/inc/uielement/newmenucontroller.hxx @@ -70,8 +70,8 @@ namespace framework virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ); // XMenuListener - virtual void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemSelected( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); // XEventListener virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException ); diff --git a/framework/inc/uielement/recentfilesmenucontroller.hxx b/framework/inc/uielement/recentfilesmenucontroller.hxx index fe5b59480c0d..1fb90a40e1af 100644 --- a/framework/inc/uielement/recentfilesmenucontroller.hxx +++ b/framework/inc/uielement/recentfilesmenucontroller.hxx @@ -48,8 +48,8 @@ namespace framework virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ); // XMenuListener - virtual void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemSelected( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); // XDispatchProvider virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, const OUString& sTarget, sal_Int32 nFlags ) throw( ::com::sun::star::uno::RuntimeException ); diff --git a/framework/inc/uielement/toolbarsmenucontroller.hxx b/framework/inc/uielement/toolbarsmenucontroller.hxx index 3547abbe3edc..638170f29455 100644 --- a/framework/inc/uielement/toolbarsmenucontroller.hxx +++ b/framework/inc/uielement/toolbarsmenucontroller.hxx @@ -67,8 +67,8 @@ namespace framework virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ); // XMenuListener - virtual void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemSelected( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); // XEventListener virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException ); diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx index bda92e0932a9..a861194babd4 100644 --- a/framework/source/uielement/controlmenucontroller.cxx +++ b/framework/source/uielement/controlmenucontroller.cxx @@ -317,7 +317,7 @@ void ControlMenuController::impl_select(const Reference< XDispatch >& /*_xDispat } } -void SAL_CALL ControlMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException) +void SAL_CALL ControlMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException) { osl::ResettableMutexGuard aLock( m_aMutex ); diff --git a/framework/source/uielement/fontmenucontroller.cxx b/framework/source/uielement/fontmenucontroller.cxx index 47e35095bde2..fd5186c42047 100644 --- a/framework/source/uielement/fontmenucontroller.cxx +++ b/framework/source/uielement/fontmenucontroller.cxx @@ -157,7 +157,7 @@ void FontMenuController::impl_select(const Reference< XDispatch >& _xDispatch,co _xDispatch->dispatch( aTargetURL, aArgs ); } -void SAL_CALL FontMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException) +void SAL_CALL FontMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException) { osl::MutexGuard aLock( m_aMutex ); diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx index db94d8f8ea65..38a4def0d0bb 100644 --- a/framework/source/uielement/langselectionmenucontroller.cxx +++ b/framework/source/uielement/langselectionmenucontroller.cxx @@ -33,7 +33,6 @@ #include <vcl/i18nhelp.hxx> #include <rtl/ustrbuf.hxx> #include <vcl/mnemonic.hxx> -#include <com/sun/star/awt/XMenuExtended.hpp> #include <comphelper/processfactory.hxx> #include <com/sun/star/document/XDocumentLanguages.hpp> diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx index 8773c819bb0f..903da76e7326 100644 --- a/framework/source/uielement/langselectionstatusbarcontroller.cxx +++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx @@ -184,10 +184,8 @@ throw (::com::sun::star::uno::RuntimeException) // now display the popup menu and execute every command ... Reference< awt::XWindowPeer > xParent( m_xParentWindow, UNO_QUERY ); - com::sun::star::awt::Rectangle aRectangle; - aRectangle.X = aPos.X; - aRectangle.Y = aPos.Y; - sal_Int16 nId = xPopupMenu->execute( xParent, aRectangle, com::sun::star::awt::PopupMenuDirection::EXECUTE_UP+16 ); + com::sun::star::awt::Rectangle aRect( aPos.X, aPos.Y, 0, 0 ); + sal_Int16 nId = xPopupMenu->execute( xParent, aRect, com::sun::star::awt::PopupMenuDirection::EXECUTE_UP+16 ); //click "More..." if ( nId && m_xFrame.is() ) { diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx index dea64a4a1489..156979ccf2ce 100644 --- a/framework/source/uielement/newmenucontroller.cxx +++ b/framework/source/uielement/newmenucontroller.cxx @@ -388,7 +388,7 @@ void SAL_CALL NewMenuController::statusChanged( const FeatureStateEvent& ) throw } // XMenuListener -void SAL_CALL NewMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException) +void SAL_CALL NewMenuController::itemSelected( const css::awt::MenuEvent& rEvent ) throw (RuntimeException) { Reference< css::awt::XPopupMenu > xPopupMenu; Reference< XDispatch > xDispatch; @@ -444,7 +444,7 @@ void SAL_CALL NewMenuController::select( const css::awt::MenuEvent& rEvent ) thr } } -void SAL_CALL NewMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException) +void SAL_CALL NewMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException) { SolarMutexGuard aSolarMutexGuard; if ( m_xFrame.is() && m_xPopupMenu.is() ) diff --git a/framework/source/uielement/popupmenucontroller.cxx b/framework/source/uielement/popupmenucontroller.cxx index d980f6e68cd2..759bad1c63ee 100644 --- a/framework/source/uielement/popupmenucontroller.cxx +++ b/framework/source/uielement/popupmenucontroller.cxx @@ -59,7 +59,7 @@ class PopupMenuControllerImpl }; //======================================================================== -// class PopupMenuController +// class PopupMenuController REMOVE REMOVE REMOVE //======================================================================== PopupMenuController::PopupMenuController( const Reference< uno::XComponentContext >& rxContext ) diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 62197dab0aeb..47f08687d9cd 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -267,20 +267,18 @@ void SAL_CALL RecentFilesMenuController::statusChanged( const FeatureStateEvent& m_bDisabled = !Event.IsEnabled; } -void SAL_CALL RecentFilesMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException) +void SAL_CALL RecentFilesMenuController::itemSelected( const css::awt::MenuEvent& rEvent ) throw (RuntimeException) { - Reference< css::awt::XPopupMenu > xPopupMenu; - Reference< css::awt::XMenuExtended > xMenuExt; + Reference< css::awt::XPopupMenu > xPopupMenu; osl::ClearableMutexGuard aLock( m_aMutex ); - xPopupMenu = m_xPopupMenu; - xMenuExt = Reference< css::awt::XMenuExtended >( m_xPopupMenu, UNO_QUERY ); + xPopupMenu = m_xPopupMenu; aLock.clear(); - if ( xMenuExt.is() ) + if ( xPopupMenu.is() ) { - const OUString aCommand( xMenuExt->getCommand( rEvent.MenuId ) ); - OSL_TRACE( "RecentFilesMenuController::select() - Command : %s", + const OUString aCommand( xPopupMenu->getCommand( rEvent.MenuId ) ); + OSL_TRACE( "RecentFilesMenuController::itemSelected() - Command : %s", OUStringToOString( aCommand, RTL_TEXTENCODING_UTF8 ).getStr() ); if ( aCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( CMD_CLEAR_LIST ) ) ) @@ -290,7 +288,7 @@ void SAL_CALL RecentFilesMenuController::select( const css::awt::MenuEvent& rEve } } -void SAL_CALL RecentFilesMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException) +void SAL_CALL RecentFilesMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException) { osl::MutexGuard aLock( m_aMutex ); impl_setPopupMenu(); diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index a93c96591aa9..a1d8cd78ae1a 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -163,8 +163,7 @@ void ToolbarsMenuController::addCommand( aLabel = rLabel; rPopupMenu->insertItem( nItemId, aLabel, 0, nItemId ); - Reference< awt::XMenuExtended > xMenuExtended( m_xPopupMenu, UNO_QUERY ); - xMenuExtended->setCommand( nItemId, rCommandURL ); + rPopupMenu->setCommand( nItemId, rCommandURL ); bool bInternal = ( rCommandURL.indexOf( STATIC_INTERNAL_CMD_PART ) == 0); if ( !bInternal ) @@ -354,9 +353,8 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r m_aCommandVector.clear(); // Retrieve layout manager for additional information - OUString aEmptyString; - Reference< awt::XMenuExtended > xMenuExtended( rPopupMenu, UNO_QUERY ); - Reference< XLayoutManager > xLayoutManager( getLayoutManagerFromFrame( m_xFrame )); + OUString aEmptyString; + Reference< XLayoutManager > xLayoutManager( getLayoutManagerFromFrame( m_xFrame )); m_bResetActive = sal_False; if ( xLayoutManager.is() ) @@ -467,7 +465,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r // Store complete uno-command so it can also be dispatched. This is necessary to support // the test tool! - xMenuExtended->setCommand( nIndex, aCmd ); + rPopupMenu->setCommand( nIndex, aCmd ); ++nIndex; } @@ -595,7 +593,7 @@ void SAL_CALL ToolbarsMenuController::statusChanged( const FeatureStateEvent& Ev } // XMenuListener -void SAL_CALL ToolbarsMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException) +void SAL_CALL ToolbarsMenuController::itemSelected( const css::awt::MenuEvent& rEvent ) throw (RuntimeException) { Reference< css::awt::XPopupMenu > xPopupMenu; Reference< XComponentContext > xContext; @@ -754,7 +752,7 @@ void SAL_CALL ToolbarsMenuController::select( const css::awt::MenuEvent& rEvent } } -void SAL_CALL ToolbarsMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException) +void SAL_CALL ToolbarsMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException) { std::vector< OUString > aCmdVector; Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY ); |