diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-08-13 09:13:09 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-08-13 09:27:47 +0200 |
commit | 3b9e7f49efc84d474151f6818a77de635efd3a47 (patch) | |
tree | d5fd5200750a9452ecab41a1ebedb939db57b601 /sd | |
parent | 8da923dfa6663197aab6f53ac03b97a3ab8fab40 (diff) |
Ignore exception when service ScannerManager is unavailable
Exception from an unavailable service ScannerManager propagated to
the top. This caused that presentations in android crashed
(DrawViewShell wasn't initialized).
Change-Id: I485d0cdad05e4d2d6096042e5762c0350a8339a9
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/drviewsa.cxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 627dfda9cfd0..9779ed22abb4 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -362,11 +362,20 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind) uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); - mxScannerManager = scanner::ScannerManager::create( xContext ); + try + { + mxScannerManager = scanner::ScannerManager::create( xContext ); - mxScannerListener = uno::Reference< lang::XEventListener >( - static_cast< ::cppu::OWeakObject* >( new ScannerEventListener( this ) ), - uno::UNO_QUERY ); + mxScannerListener = uno::Reference< lang::XEventListener >( + static_cast< ::cppu::OWeakObject* >( new ScannerEventListener( this ) ), + uno::UNO_QUERY ); + } + catch (Exception& exception) + { + // Eat the exception and log it + // We can still continue if scanner manager is not available. + SAL_WARN("sd", "Scanner manager exception: " << exception.Message); + } mpAnnotationManager.reset( new AnnotationManager( GetViewShellBase() ) ); mpViewOverlayManager.reset( new ViewOverlayManager( GetViewShellBase() ) ); |