From e14a251c2d4478fe8cf085df792aa2181d15b4cf Mon Sep 17 00:00:00 2001 From: Noel Power Date: Fri, 29 Mar 2013 16:53:24 +0000 Subject: squash NoSuchElementExceptions when modifying keybindings Change-Id: I37882845660929e0001a834b6685a4087dfb465f --- sc/source/ui/vba/vbaapplication.cxx | 15 +++++++++++++++ sc/source/ui/vba/vbaapplication.hxx | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'sc') diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 0d39fa37eead..07e53cb93f03 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -1295,6 +1295,21 @@ ScVbaApplication::MenuBars( const uno::Any& aIndex ) throw (uno::RuntimeExceptio return uno::Any( xMenuBars ); } +void SAL_CALL ScVbaApplication::OnKey( const ::rtl::OUString& Key, const uno::Any& Procedure ) throw (uno::RuntimeException) +{ + try + { + // Perhaps we can catch some excel specific + // related behaviour here + VbaApplicationBase::OnKey( Key, Procedure ); + } + catch( container::NoSuchElementException& ) + { + // #TODO special handling for unhandled + // bindings + } +} + rtl::OUString ScVbaApplication::getServiceImplName() { diff --git a/sc/source/ui/vba/vbaapplication.hxx b/sc/source/ui/vba/vbaapplication.hxx index 072bd0ce7c1e..754117845722 100644 --- a/sc/source/ui/vba/vbaapplication.hxx +++ b/sc/source/ui/vba/vbaapplication.hxx @@ -96,7 +96,7 @@ public: virtual void SAL_CALL setStatusBar( const css::uno::Any& _statusbar ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getCursor() throw (css::uno::RuntimeException); virtual void SAL_CALL setCursor( ::sal_Int32 _cursor ) throw (css::uno::RuntimeException); - + virtual void SAL_CALL OnKey( const ::rtl::OUString& Key, const css::uno::Any& Procedure ) throw (css::uno::RuntimeException); virtual sal_Bool SAL_CALL getEnableEvents() throw (css::uno::RuntimeException); virtual void SAL_CALL setEnableEvents( sal_Bool bEnable ) throw (css::uno::RuntimeException); -- cgit