summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uno/unoatxt.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-09-04 09:04:09 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-09-04 09:18:57 +0100
commit0d0137f4aebb350f93b21296a59c19829624221a (patch)
tree81e225910415532a04de4c062fa75db9b156e853 /sw/source/uibase/uno/unoatxt.cxx
parent91c0bdf0816a5e62f4fa6cad7587ce8db975425f (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.cxx31
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;
}