From 0a36be3fee1b4f1b47b55a64668b6aa99896ab24 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 29 Nov 2018 17:17:15 +0300 Subject: tdf#121591, tdf#119945: ModuleManager::identify throws for embedded modules Change-Id: Ief1a664fdf26c837fd55c9a236f45aa045067309 Reviewed-on: https://gerrit.libreoffice.org/64256 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sfx2/source/notebookbar/SfxNotebookBar.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sfx2/source/notebookbar') diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index 953bacf4bfe8..5dcaea7861d8 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -208,7 +209,15 @@ bool SfxNotebookBar::IsActive() return false; const Reference xModuleManager = frame::ModuleManager::create( ::comphelper::getProcessComponentContext() ); - eApp = vcl::EnumContext::GetApplicationEnum(xModuleManager->identify(xFrame)); + try + { + eApp = vcl::EnumContext::GetApplicationEnum(xModuleManager->identify(xFrame)); + } + catch (css::frame::UnknownModuleException& e) + { + SAL_WARN("sfx.appl", "SfxNotebookBar::IsActive(): " + e.Message); + return false; + } } else return false; -- cgit