summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-02-20 22:26:40 +0100
committerKohei Yoshida <libreoffice@kohei.us>2017-02-22 13:36:05 +0000
commite0f2340927f5c7f734a4d4774badf729cafc1386 (patch)
treec6a833b71218bf53cca48e49b9272054167541a6
parente4712ae1365851d5d3d0695525a645eb5bcd55c2 (diff)
Resolves: tdf#106089 generate range string with current address convention
This is a combination of 2 commits. 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. (cherry picked from commit 0200677891c6d592a12343f0d6f82c569cd7a9e0) Related: tdf#106089 generate range string with current address convention ... so subsequent parsing actually works. (cherry picked from commit 3ec3d7ead0f2e47a4e24ba0d6953fea0f49815ed) 47d661d24552104b56827248b4c5e6a6617c5d63 Change-Id: I6cb6400c56c896dac7ab949b8a986c784690dfd3 Reviewed-on: https://gerrit.libreoffice.org/34498 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us> Tested-by: Kohei Yoshida <libreoffice@kohei.us>
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 6fa3ead43578..d4985cbde754 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -114,7 +114,7 @@ void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& xObj, ScVie
pDoc->LimitChartArea( nTab1, nCol1,nRow1, nCol2,nRow2 );
ScRange aRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
- aRangeString = aRange.Format(ScRefFlags::RANGE_ABS_3D, &rScDoc);
+ aRangeString = aRange.Format(ScRefFlags::RANGE_ABS_3D, &rScDoc, rScDoc.GetAddressConvention());
}
}
}
@@ -186,7 +186,20 @@ void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& xObj, ScVie
aArgs[3] = beans::PropertyValue(
OUString("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)
}