summaryrefslogtreecommitdiff
path: root/vcl/workben
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-13 21:28:05 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-13 21:28:05 +0000
commitee0f878da903f5054a03f526160bc6958c876128 (patch)
tree939cc1b0f6c099c038292062c967e01971546511 /vcl/workben
parent5b7497e5aad80774167a6c1f050aabe429280918 (diff)
coverity#1251596 Uncaught exception
Change-Id: I02b7abcd9ee17158ee063b2c9b6d0324eef70801
Diffstat (limited to 'vcl/workben')
-rw-r--r--vcl/workben/outdevgrind.cxx57
1 files changed, 35 insertions, 22 deletions
diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx
index cbcd1c555e85..528eae381abb 100644
--- a/vcl/workben/outdevgrind.cxx
+++ b/vcl/workben/outdevgrind.cxx
@@ -909,38 +909,51 @@ int GrindApp::Main()
SAL_IMPLEMENT_MAIN()
{
- bool bHelp = false;
-
- for( sal_uInt16 i = 0; i < Application::GetCommandLineParamCount(); i++ )
+ try
{
- OUString aParam = Application::GetCommandLineParam( i );
+ bool bHelp = false;
- if( aParam == "--help" || aParam == "-h" )
- bHelp = true;
- }
+ for( sal_uInt16 i = 0; i < Application::GetCommandLineParamCount(); i++ )
+ {
+ OUString aParam = Application::GetCommandLineParam( i );
- if( bHelp )
- {
- printf( "outdevgrind - Profile OutputDevice\n" );
- return EXIT_SUCCESS;
- }
+ if( aParam == "--help" || aParam == "-h" )
+ bHelp = true;
+ }
+
+ if( bHelp )
+ {
+ printf( "outdevgrind - Profile OutputDevice\n" );
+ return EXIT_SUCCESS;
+ }
- tools::extendApplicationEnvironment();
+ tools::extendApplicationEnvironment();
- uno::Reference< uno::XComponentContext > xContext = cppu::defaultBootstrap_InitialComponentContext();
- uno::Reference< lang::XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), uno::UNO_QUERY );
+ uno::Reference< uno::XComponentContext > xContext = cppu::defaultBootstrap_InitialComponentContext();
+ uno::Reference< lang::XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), uno::UNO_QUERY );
- if( !xServiceManager.is() )
- Application::Abort( "Failed to bootstrap" );
+ if( !xServiceManager.is() )
+ Application::Abort( "Failed to bootstrap" );
- comphelper::setProcessServiceFactory( xServiceManager );
+ comphelper::setProcessServiceFactory( xServiceManager );
- InitVCL();
+ InitVCL();
- GrindApp aGrindApp;
- aGrindApp.Main();
+ GrindApp aGrindApp;
+ aGrindApp.Main();
- DeInitVCL();
+ DeInitVCL();
+ }
+ catch (const css::uno::Exception& e)
+ {
+ SAL_WARN("vcl.app", "Fatal exception: " << e.Message);
+ return EXIT_FAILURE;
+ }
+ catch (const std::exception& e)
+ {
+ SAL_WARN("vcl.app", "Fatal exception: " << e.what());
+ return EXIT_FAILURE;
+ }
return EXIT_SUCCESS;
}