From cd603063f44c152bbc3a1f3eb3796722eb422c0e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 6 Oct 2014 16:00:35 +0100 Subject: Resolves: fdo#80101 inserting non-chart as chart -> unhandled exception Change-Id: I4d5438292d9a5c49f1336304ebd3dc4e155dd212 (cherry picked from commit 76d4db3181dfd1524620377bb12a8e0332ae8ab0) Reviewed-on: https://gerrit.libreoffice.org/11833 Reviewed-by: Eike Rathke Tested-by: Eike Rathke --- sc/source/ui/view/tabvwshb.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 3871bc8dce35..b8ae65bf290a 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -311,6 +311,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) break; case SID_INSERT_DIAGRAM_FROM_FILE: + try { sfx2::FileDialogHelper aDlg(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0, OUString("com.sun.star.chart2.ChartDocument")); @@ -321,6 +322,10 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) FuInsertChartFromFile(this, pWin, pView, pDrModel, rReq, aURL); } } + catch (const uno::Exception& e) + { + SAL_WARN( "sc", "Cannot Insert Chart: " << e.Message); + } break; case SID_OBJECTRESIZE: -- cgit v1.2.3