diff options
-rw-r--r-- | svtools/source/misc/acceleratorexecute.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index 3648e200e7c27..b1ed64352fbf3 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.cxx @@ -33,6 +33,10 @@ #include <cppuhelper/implbase.hxx> #include <vcl/evntpost.hxx> +#include <sal/log.hxx> +#include <vcl/lok.hxx> +#include <vcl/window.hxx> +#include <vcl/svapp.hxx> #include <osl/mutex.hxx> namespace svt @@ -201,8 +205,21 @@ bool AcceleratorExecute::execute(const css::awt::KeyEvent& aAWTKey) { // Note: Such instance can be used one times only and destroy itself afterwards .-) css::uno::Reference<css::lang::XComponent> xFrame(xProvider, css::uno::UNO_QUERY); - AsyncAccelExec* pExec = AsyncAccelExec::createOneShotInstance(xFrame, xDispatch, aURL); - pExec->execAsync(); + if (vcl::lok::isUnipoll()) + { // tdf#130382 - all synchronous really. + try { + xDispatch->dispatch (aURL, css::uno::Sequence< css::beans::PropertyValue >()); + } + catch(const css::uno::Exception&ev) + { + SAL_INFO("svtools", "exception on key emission: " << ev.Message); + } + } + else + { + AsyncAccelExec* pExec = AsyncAccelExec::createOneShotInstance(xFrame, xDispatch, aURL); + pExec->execAsync(); + } } return bRet; |