summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-29 17:17:15 +0300
committerXisco FaulĂ­ <xiscofauli@libreoffice.org>2018-12-02 14:34:04 +0100
commit9ce21daf20faae0e5c8dd8eeb0909106e23a4319 (patch)
tree636c05a2155eff2778357c15e607a3035c9a49c4
parentcd2ed4a079a5da676b836dd9dd5b00cf99c68ef2 (diff)
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 <mike.kaganski@collabora.com> (cherry picked from commit 0a36be3fee1b4f1b47b55a64668b6aa99896ab24) Reviewed-on: https://gerrit.libreoffice.org/64280 Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org>
-rw-r--r--sfx2/source/notebookbar/SfxNotebookBar.cxx11
1 files changed, 10 insertions, 1 deletions
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 <vcl/tabctrl.hxx>
#include <sfx2/viewfrm.hxx>
#include <comphelper/processfactory.hxx>
+#include <com/sun/star/frame/UnknownModuleException.hpp>
#include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp>
#include <com/sun/star/ui/XContextChangeEventMultiplexer.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
@@ -208,7 +209,15 @@ bool SfxNotebookBar::IsActive()
return false;
const Reference<frame::XModuleManager> 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;