summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-02-20 22:26:40 +0100
committerJulien Nabet <serval2412@yahoo.fr>2017-02-21 22:13:26 +0000
commit69bc288b0aac0672cf560dec2c4c946e9620ea62 (patch)
treef9ad49c85f1b07eff74d457d46794e0f0ed73d98
parent06c81a3e61e2d5743ffd8a50d85e5ecee989e46b (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/34496 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-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 41610a0ea11a..9a9e1328274e 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)
}