summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-05 10:32:11 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-05 14:57:58 +0000
commitd6fdebc5439887f5998e9e8c21d87f5ccdcdc505 (patch)
treeafe46966ee79ee01ef409c85d408e20debc7ba62 /svx
parentf177ab81ced99975851897df389ce62d6e91adf4 (diff)
coverity#1000852 Uncaught exception
Change-Id: Iaab0c992497b7d6b2da67cf65ade099c784c7a94
Diffstat (limited to 'svx')
-rw-r--r--svx/source/gengal/gengal.cxx74
1 files changed, 41 insertions, 33 deletions
diff --git a/svx/source/gengal/gengal.cxx b/svx/source/gengal/gengal.cxx
index ca045cfd9de0..ea4e6188d9a4 100644
--- a/svx/source/gengal/gengal.cxx
+++ b/svx/source/gengal/gengal.cxx
@@ -275,45 +275,53 @@ ReadResponseFile(std::vector<INetURLObject> & rFiles, OUString const& rInput)
int GalApp::Main()
{
- OUString aPath, aDestDir;
- OUString aName( "Default name" );
- std::vector<INetURLObject> aFiles;
-
- for( sal_uInt32 i = 0; i < GetCommandLineParamCount(); i++ )
+ try
{
- OUString aParam = GetCommandLineParam( i );
+ OUString aPath, aDestDir;
+ OUString aName( "Default name" );
+ std::vector<INetURLObject> aFiles;
- if ( aParam.startsWith( "-env:" ) )
- continue;
- else if ( aParam == "--help" || aParam == "-h" )
- return PrintHelp();
- else if ( aParam == "--build-tree" )
+ for( sal_uInt32 i = 0; i < GetCommandLineParamCount(); i++ )
{
- mbRelativeURLs = true;
- mbInBuildTree = true;
+ OUString aParam = GetCommandLineParam( i );
+
+ if ( aParam.startsWith( "-env:" ) )
+ continue;
+ else if ( aParam == "--help" || aParam == "-h" )
+ return PrintHelp();
+ else if ( aParam == "--build-tree" )
+ {
+ mbRelativeURLs = true;
+ mbInBuildTree = true;
+ }
+ else if ( aParam == "--name" )
+ aName = GetCommandLineParam( ++i );
+ else if ( aParam == "--path" )
+ aPath = Smartify( GetCommandLineParam( ++i ) ).
+ GetMainURL(INetURLObject::NO_DECODE);
+ else if ( aParam == "--destdir" )
+ aDestDir = GetCommandLineParam( ++i );
+ else if ( aParam == "--relative-urls" )
+ mbRelativeURLs = true;
+ else if ( aParam == "--number-from" )
+ fprintf ( stderr, "--number-from is deprecated, themes now "
+ "have filenames based on their names\n" );
+ else if ( aParam == "--filenames" )
+ ReadResponseFile(aFiles, GetCommandLineParam(++i));
+ else
+ aFiles.push_back( Smartify( aParam ) );
}
- else if ( aParam == "--name" )
- aName = GetCommandLineParam( ++i );
- else if ( aParam == "--path" )
- aPath = Smartify( GetCommandLineParam( ++i ) ).
- GetMainURL(INetURLObject::NO_DECODE);
- else if ( aParam == "--destdir" )
- aDestDir = GetCommandLineParam( ++i );
- else if ( aParam == "--relative-urls" )
- mbRelativeURLs = true;
- else if ( aParam == "--number-from" )
- fprintf ( stderr, "--number-from is deprecated, themes now "
- "have filenames based on their names\n" );
- else if ( aParam == "--filenames" )
- ReadResponseFile(aFiles, GetCommandLineParam(++i));
- else
- aFiles.push_back( Smartify( aParam ) );
- }
- if( aFiles.empty() )
- return PrintHelp();
+ if( aFiles.empty() )
+ return PrintHelp();
- createTheme( aName, aPath, aDestDir, aFiles, mbRelativeURLs );
+ createTheme( aName, aPath, aDestDir, aFiles, mbRelativeURLs );
+ }
+ catch (const uno::Exception& e)
+ {
+ SAL_WARN("vcl.app", "Fatal exception: " << e.Message);
+ return EXIT_FAILURE;
+ }
return EXIT_SUCCESS;
}