From 4d3553cb4d6a8ad439e36a694e788668b4a6003a Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 27 Mar 2014 09:47:55 +0000 Subject: fdo#62155 - don't crash if we can't create an instance of a calc addin. Change-Id: I478d7777949683a91e7adf9fa6b54e9d01ced676 Reviewed-on: https://gerrit.libreoffice.org/8771 Reviewed-by: Eike Rathke Tested-by: Eike Rathke --- sc/source/core/tool/addincol.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'sc') diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index d5c5401317ad..1aa393c659d1 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -602,11 +602,19 @@ void ScUnoAddInCollection::LoadComponent( const ScUnoAddInFuncData& rFuncData ) { OUString aServiceName = aFullName.copy( 0, nPos ); - uno::Reference xServiceFactory = comphelper::getProcessServiceFactory(); - uno::Reference xInterface( xServiceFactory->createInstance( aServiceName ) ); + try + { + uno::Reference xServiceFactory = comphelper::getProcessServiceFactory(); + uno::Reference xInterface( xServiceFactory->createInstance( aServiceName ) ); - if (xInterface.is()) - UpdateFromAddIn( xInterface, aServiceName ); + if (xInterface.is()) + UpdateFromAddIn( xInterface, aServiceName ); + } + catch (const uno::Exception &) + { + SAL_WARN ("sc", "Failed to create addin component '" + << aServiceName << "'"); + } } } -- cgit v1.2.3