diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-11-06 10:12:48 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-06 12:16:05 +0000 |
commit | a8d95baea41f8bc91024429fa08e09a35a5c1e08 (patch) | |
tree | b63f94eb7e960c7b8000105471420f9175041083 /l10ntools/source | |
parent | 09414353ba069cc86ac9a0cc578d6345a68944c5 (diff) |
coverity#1338256 Uncaught exception
Change-Id: Iadfb2e59fd40aa178123dbfc20be093cc8f128d2
Diffstat (limited to 'l10ntools/source')
-rw-r--r-- | l10ntools/source/uimerge.cxx | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/l10ntools/source/uimerge.cxx b/l10ntools/source/uimerge.cxx index 8a0450d306e4..c2e42dd9c26f 100644 --- a/l10ntools/source/uimerge.cxx +++ b/l10ntools/source/uimerge.cxx @@ -182,26 +182,33 @@ bool Merge( SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { int nRetValue = 0; - - common::HandledArgs aArgs; - if ( !common::handleArguments(argc, argv, aArgs) ) + try { - common::writeUsage("uiex","*.ui"); - return 1; - } - sInputFileName = aArgs.m_sInputFile; - sOutputFile = aArgs.m_sOutputFile; + common::HandledArgs aArgs; + if ( !common::handleArguments(argc, argv, aArgs) ) + { + common::writeUsage("uiex","*.ui"); + return 1; + } - if (!aArgs.m_bMergeMode) - { - nRetValue = extractTranslations(); + sInputFileName = aArgs.m_sInputFile; + sOutputFile = aArgs.m_sOutputFile; + + if (!aArgs.m_bMergeMode) + { + nRetValue = extractTranslations(); + } + else + { + Merge(aArgs.m_sMergeSrc, sInputFileName, sOutputFile, aArgs.m_sLanguage); + } } - else + catch (std::exception& e) { - Merge(aArgs.m_sMergeSrc, sInputFileName, sOutputFile, aArgs.m_sLanguage); + fprintf(stderr, "exception: %s\n", e.what()); + return 1; } - return nRetValue; } |