From 5cc28c5e9455a7923153f82dcf18e76570e36717 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 24 Apr 2018 21:58:59 +0300 Subject: Decrease fragility in odd use cases with no current document (yet) Especially, this happens when an Automation client wants to open a Calc document. Equivalent to the code for the same situation in getCurrentWordDoc(). Change-Id: I209a72dcae49f18cd265e0c6c2790618e1ebb4a1 --- vbahelper/source/vbahelper/vbahelper.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'vbahelper') diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 55c613341bcd..c34559b769f6 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -262,7 +262,13 @@ getCurrentExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) } catch (const uno::Exception&) { - xModel = getThisExcelDoc( xContext ); + try + { + xModel = getThisExcelDoc( xContext ); + } + catch (const uno::Exception&) + { + } } return xModel; } -- cgit