summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-02-20 22:26:40 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-02-23 00:26:08 +0000
commit22f80362336f2332984ee2bccddd6eb39abfdea0 (patch)
tree98b2fc84935c26305993739abde866f4acb1699c
parentbb183f8a48f678aa4ece5b0058bec90d3d5082e4 (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/34497 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-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)
}