From 0200677891c6d592a12343f0d6f82c569cd7a9e0 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Mon, 20 Feb 2017 22:26:40 +0100 Subject: Resolves: tdf#106089 catch legal IllegalArgumentException on bad range string ... that for example doesn't match the document's current address convention. Further work is need to make that actually fly, but at least don't terminate the application but come up with a default Chart instead where the range can be edited. Change-Id: I6cb6400c56c896dac7ab949b8a986c784690dfd3 --- sc/source/ui/drawfunc/fuins2.cxx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'sc/source') diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index 6f1037385121..59c0ba07adca 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -185,7 +185,20 @@ void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& xObj, ScVie aArgs[3] = beans::PropertyValue( "DataRowSource", -1, uno::makeAny( eDataRowSource ), beans::PropertyState_DIRECT_VALUE ); - xReceiver->setArguments( aArgs ); + + try + { + xReceiver->setArguments( aArgs ); + } + catch (const lang::IllegalArgumentException& e) + { + // Can happen for invalid aRangeString, in which case a Chart + // will be created nevertheless and the range string can be + // edited. + SAL_WARN("sc.ui", + "lcl_ChartInit - caught IllegalArgumentException with message \"" << e.Message << "\"," + " might be due to aRangeString: " << aRangeString); + } // don't create chart listener here (range may be modified in chart dialog) } -- cgit