diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-09-04 09:04:09 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-09-04 09:18:57 +0100 |
commit | 0d0137f4aebb350f93b21296a59c19829624221a (patch) | |
tree | 81e225910415532a04de4c062fa75db9b156e853 /sw/source/uibase/uno/unoatxt.cxx | |
parent | 91c0bdf0816a5e62f4fa6cad7587ce8db975425f (diff) |
coverity#707336 Uncaught exception
and
coverity#707337 Uncaught exception
Change-Id: Id6ad65e382d2a5b5f8d13a312384d715b47e95db
Diffstat (limited to 'sw/source/uibase/uno/unoatxt.cxx')
-rw-r--r-- | sw/source/uibase/uno/unoatxt.cxx | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx index 3aa4ba1106fc..deb0019eac84 100644 --- a/sw/source/uibase/uno/unoatxt.cxx +++ b/sw/source/uibase/uno/unoatxt.cxx @@ -18,6 +18,7 @@ */ #include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <osl/mutex.hxx> #include <osl/diagnose.h> #include <vcl/svapp.hxx> @@ -427,11 +428,31 @@ uno::Reference< text::XAutoTextEntry > SwXAutoTextGroup::insertNewByName(const pGlossaries->PutGroupDoc( pGlosGroup ); } - uno::Reference< text::XAutoTextEntry > xEntry = pGlossaries ? - pGlossaries->GetAutoTextEntry( m_sGroupName, sName, sShortName, true ) : - uno::Reference< text::XAutoTextEntry >(); - OSL_ENSURE( xEntry.is(), "SwXAutoTextGroup::insertNewByName: no UNO object created? How this?" ); - // we just inserted the entry into the group, so why doesn't it exist? + uno::Reference< text::XAutoTextEntry > xEntry; + + try + { + xEntry = pGlossaries ? + pGlossaries->GetAutoTextEntry( m_sGroupName, sName, sShortName, true ) : + uno::Reference< text::XAutoTextEntry >(); + OSL_ENSURE( xEntry.is(), "SwXAutoTextGroup::insertNewByName: no UNO object created? How this?" ); + // we just inserted the entry into the group, so why doesn't it exist? + } + catch (const container::ElementExistException&) + { + throw; + } + catch (const uno::RuntimeException&) + { + throw; + } + catch (const uno::Exception& e) + { + throw css::lang::WrappedTargetRuntimeException( + "Error Getting AutoText!", + static_cast < OWeakObject * > ( this ), + makeAny( e ) ); + } return xEntry; } |