From c8b77ecc6d3d910578223055fa88937e2b9a5bc7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 14 Nov 2015 12:58:22 +0000 Subject: coverity#1339308 Uncaught exception Change-Id: Id63bbdd11af66de6be8a3e9dfca1c7efbe74b08a --- l10ntools/inc/po.hxx | 2 +- l10ntools/source/merge.cxx | 13 +++++-------- l10ntools/source/po.cxx | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/l10ntools/inc/po.hxx b/l10ntools/inc/po.hxx index 830db7d9e054..24f9c28a4ed6 100644 --- a/l10ntools/inc/po.hxx +++ b/l10ntools/inc/po.hxx @@ -123,7 +123,7 @@ private: public: - enum Exception { INVALIDENTRY }; + class Exception : public std::exception { }; PoIfstream(); PoIfstream( const OString& rFileName ); diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index e7b552222e6a..dd6639b70dc8 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -45,15 +45,12 @@ namespace { rPoFile.readEntry( o_rPoEntry ); } - catch( PoIfstream::Exception& aException ) + catch (const PoIfstream::Exception&) { - if( aException == PoIfstream::INVALIDENTRY ) - { - printf( - "Warning : %s contains invalid entry\n", - rFileName.getStr() ); - return false; - } + printf( + "Warning : %s contains invalid entry\n", + rFileName.getStr() ); + return false; } return true; } diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 00f7d8270414..3019006c33bd 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -596,7 +596,7 @@ void PoIfstream::readEntry( PoEntry& rPoEntry ) } else { - throw INVALIDENTRY; + throw PoIfstream::Exception(); } } } -- cgit