framework/source/uielement/menubarmanager.cxx | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
New commits: commit 88c8616270c2157d1a54ba54ddc4bdfae1cd1825 Author: Stephan Bergmann <[email protected]> Date: Tue Aug 28 17:07:56 2012 +0200 fdo#36149: Do not display error dialogs while showing a menu ...it apparently leads to crashes, but is probably not good from a usability perspective anyway (as the menu closes again when the dialog appears/is operated on by the user). For now, just disable the Java specific interaction handler here; might make sense to address this more generally though (there's framework::QuietInteraction btw). (cherry picked from commit 9cfc64c66ff9e0f0251a006f039bf4e26a63147a) Change-Id: I6ae303c0084549b5339d219e158cdb89e5a6b331 Reviewed-on: https://gerrit.libreoffice.org/505 Reviewed-by: Björn Michaelsen <[email protected]> Tested-by: Björn Michaelsen <[email protected]> diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 5b9cfb3..2234b05 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -57,6 +57,7 @@ #include <com/sun/star/container/XEnumeration.hpp> #include <com/sun/star/util/XStringWidth.hpp> #include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/uno/XCurrentContext.hpp> #include <com/sun/star/lang/XMultiComponentFactory.hpp> #include <com/sun/star/frame/XPopupMenuController.hpp> #include <com/sun/star/frame/XUIControllerRegistration.hpp> @@ -76,6 +77,8 @@ #include <comphelper/processfactory.hxx> #include <comphelper/extract.hxx> #include <svtools/menuoptions.hxx> +#include <svtools/javainteractionhandler.hxx> +#include <uno/current_context.hxx> #include <unotools/historyoptions.hxx> #include <unotools/pathoptions.hxx> #include <unotools/cmdoptions.hxx> @@ -819,11 +822,48 @@ static void lcl_CheckForChildren(Menu* pMenu, sal_uInt16 nItemId) // vcl handler //_________________________________________________________________________________________________________________ +namespace { + +class QuietInteractionContext: + public cppu::WeakImplHelper1< com::sun::star::uno::XCurrentContext >, + private boost::noncopyable +{ +public: + QuietInteractionContext( + com::sun::star::uno::Reference< com::sun::star::uno::XCurrentContext > + const & context): + context_(context) {} + +private: + virtual ~QuietInteractionContext() {} + + virtual com::sun::star::uno::Any SAL_CALL getValueByName( + rtl::OUString const & Name) + throw (com::sun::star::uno::RuntimeException) + { + return + (!Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM(JAVA_INTERACTION_HANDLER_NAME)) + && context_.is()) + ? context_->getValueByName(Name) + : com::sun::star::uno::Any(); + } + + com::sun::star::uno::Reference< com::sun::star::uno::XCurrentContext > + context_; +}; + +} + IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "[email protected]", "MenuBarManager::Activate" ); if ( pMenu == m_pVCLMenu ) { + com::sun::star::uno::ContextLayer layer( + new QuietInteractionContext( + com::sun::star::uno::getCurrentContext())); + // set/unset hiding disabled menu entries sal_Bool bDontHide = SvtMenuOptions().IsEntryHidingEnabled(); const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
