Kaydet (Commit) c409b668 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Improve exception messages

Change-Id: I95b8d1bfcba66ba5670345e9159f0dca11e6d967
üst 73342dbb
...@@ -2643,12 +2643,16 @@ uno::Any SwXTextFieldMasters::getByName(const OUString& rName) ...@@ -2643,12 +2643,16 @@ uno::Any SwXTextFieldMasters::getByName(const OUString& rName)
OUString sName(rName), sTypeName; OUString sName(rName), sTypeName;
sal_uInt16 nResId = lcl_GetIdByName( sName, sTypeName ); sal_uInt16 nResId = lcl_GetIdByName( sName, sTypeName );
if( USHRT_MAX == nResId ) 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())); sName = sName.copy(std::min(sTypeName.getLength()+1, sName.getLength()));
SwFieldType* pType = GetDoc()->GetFldType(nResId, sName, sal_True); SwFieldType* pType = GetDoc()->GetFldType(nResId, sName, sal_True);
if(!pType) if(!pType)
throw container::NoSuchElementException(); throw container::NoSuchElementException(
"SwXTextFieldMasters::getByName(" + rName + ")",
css::uno::Reference<css::uno::XInterface>());
uno::Reference<beans::XPropertySet> const xRet( uno::Reference<beans::XPropertySet> const xRet(
SwXFieldMaster::CreateXFieldMaster(*GetDoc(), *pType)); SwXFieldMaster::CreateXFieldMaster(*GetDoc(), *pType));
...@@ -2978,7 +2982,9 @@ throw (container::NoSuchElementException, lang::WrappedTargetException, ...@@ -2978,7 +2982,9 @@ throw (container::NoSuchElementException, lang::WrappedTargetException,
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (!(m_pImpl->m_nNextIndex < m_pImpl->m_Items.getLength())) 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 #if OSL_DEBUG_LEVEL > 1
uno::Reference< text::XTextField > *pItems = m_pImpl->m_Items.getArray(); uno::Reference< text::XTextField > *pItems = m_pImpl->m_Items.getArray();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment