[Libreoffice-commits] core.git: sw/source

Stephan Bergmann sbergman at redhat.com
Fri Nov 22 00:04:01 PST 2013


 sw/source/core/unocore/unofield.cxx |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit c409b66842bd8eb368f9e6be4abb17dee3070682
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Nov 22 09:03:38 2013 +0100

    Improve exception messages
    
    Change-Id: I95b8d1bfcba66ba5670345e9159f0dca11e6d967

diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index d2b91b9..96ba067 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -2643,12 +2643,16 @@ uno::Any SwXTextFieldMasters::getByName(const OUString& rName)
     OUString sName(rName), sTypeName;
     sal_uInt16 nResId = lcl_GetIdByName( sName, sTypeName );
     if( USHRT_MAX == nResId )
-        throw container::NoSuchElementException();
+        throw container::NoSuchElementException(
+            "SwXTextFieldMasters::getByName(" + rName + ")",
+            css::uno::Reference<css::uno::XInterface>());
 
     sName = sName.copy(std::min(sTypeName.getLength()+1, sName.getLength()));
     SwFieldType* pType = GetDoc()->GetFldType(nResId, sName, sal_True);
     if(!pType)
-        throw container::NoSuchElementException();
+        throw container::NoSuchElementException(
+            "SwXTextFieldMasters::getByName(" + rName + ")",
+            css::uno::Reference<css::uno::XInterface>());
 
     uno::Reference<beans::XPropertySet> const xRet(
             SwXFieldMaster::CreateXFieldMaster(*GetDoc(), *pType));
@@ -2978,7 +2982,9 @@ throw (container::NoSuchElementException, lang::WrappedTargetException,
     SolarMutexGuard aGuard;
 
     if (!(m_pImpl->m_nNextIndex < m_pImpl->m_Items.getLength()))
-        throw container::NoSuchElementException();
+        throw container::NoSuchElementException(
+            "SwXFieldEnumeration::nextElement",
+            css::uno::Reference<css::uno::XInterface>());
 
 #if OSL_DEBUG_LEVEL > 1
     uno::Reference< text::XTextField > *pItems = m_pImpl->m_Items.getArray();


More information about the Libreoffice-commits mailing list