From 3b9e7f49efc84d474151f6818a77de635efd3a47 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Wed, 13 Aug 2014 09:13:09 +0200 Subject: 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 --- sd/source/ui/view/drviewsa.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'sd') 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() ) ); -- cgit