summaryrefslogtreecommitdiff
path: root/vcl/workben/mtfdemo.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-12-11 20:59:56 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-12-11 21:00:34 +0000
commitee037deada8ee2ac09f58f9fdc47d0ca904b3b7f (patch)
tree4d12f3a599f7a0ad9b5771a791b56cf067525b67 /vcl/workben/mtfdemo.cxx
parentd4b7bd9966f20cb34932970b6d34c901fa733bef (diff)
coverity#1257738 Uncaught exception
Change-Id: I44648fb951d03090759d8afaa20cab7d945f684d
Diffstat (limited to 'vcl/workben/mtfdemo.cxx')
-rw-r--r--vcl/workben/mtfdemo.cxx22
1 files changed, 17 insertions, 5 deletions
diff --git a/vcl/workben/mtfdemo.cxx b/vcl/workben/mtfdemo.cxx
index fc98d1cc56e8..9e76737566ff 100644
--- a/vcl/workben/mtfdemo.cxx
+++ b/vcl/workben/mtfdemo.cxx
@@ -87,13 +87,25 @@ public:
virtual int Main() SAL_OVERRIDE
{
- mpWin = new DemoMtfWin(*mpFileName);
- mpWin->SetText(OUString("Display metafile"));
-
- mpWin->Show();
+ try
+ {
+ mpWin = new DemoMtfWin(*mpFileName);
+ mpWin->SetText(OUString("Display metafile"));
- Application::Execute();
+ mpWin->Show();
+ Application::Execute();
+ }
+ catch (const css::uno::Exception& e)
+ {
+ SAL_WARN("vcl.app", "Fatal exception: " << e.Message);
+ return 1;
+ }
+ catch (const std::exception& e)
+ {
+ SAL_WARN("vcl.app", "Fatal exception: " << e.what());
+ return 1;
+ }
return 0;
}