summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-02-20 22:26:40 +0100
committerEike Rathke <erack@redhat.com>2017-02-20 22:32:39 +0100
commit0200677891c6d592a12343f0d6f82c569cd7a9e0 (patch)
tree13b1bc7810e9030ab62ceb5d85e966519d831498
parent1324b7f1ce136cb3de617ee72b30468c8717aed9 (diff)
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
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx15
1 files changed, 14 insertions, 1 deletions
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)
}