diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-08-20 00:16:32 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-08-20 16:40:17 +0200 |
commit | b8a28f81ecfabbbac7992f120aeedc7b36dfcbf8 (patch) | |
tree | 11215150d880dae3c185d40f02e751f8e5c35dab | |
parent | eb09b803aa578d11b61ec9052ceccd0d9270ff68 (diff) |
better error handing in SwXTextField::attach()
Change-Id: I4b8b4ef1f34ba5662bd56bfbb335b87fb5aa4b51
-rw-r--r-- | sw/source/core/unocore/unofield.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index c271a8200c33..5ae7debea9c2 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -1933,6 +1933,8 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) break; default: OSL_FAIL("was ist das fuer ein Typ?"); } + if (!pFld) + throw uno::RuntimeException("no SwField created?"); if (pFld) { pFld->SetAutomaticLanguage(!m_pImpl->m_pProps->bBool4); @@ -1986,9 +1988,12 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) } } } + else // could theoretically happen, if paragraph is full + throw uno::RuntimeException("no SwTxtAttr inserted?"); } delete pFld; + assert(m_pImpl->m_pFmtFld); m_pImpl->m_pDoc = pDoc; m_pImpl->m_pDoc->GetUnoCallBack()->Add(m_pImpl.get()); m_pImpl->m_bIsDescriptor = false; |