summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-12-10 14:10:16 +0100
committerMichael Stahl <mstahl@redhat.com>2014-12-10 16:21:09 +0100
commitb86f5530161a417d31e28e75408ee80352fadad7 (patch)
tree08e1c915bc4966393189049027394ee815f380a8 /xmloff
parent4a3328a98f00818044694a9b6a0f7cda392273c6 (diff)
fdo#87110: xmloff: don't catch IllegalArgumentException here
There are at least 2 callers of InsertTextContent() that have non-trivial catch handlers for this exception, which aren't called now. (regression from bebf8ccfba37f77d6a43c7874249b31736467b17) Change-Id: I085b710dfd5877e9b7e71610951543eddf6a6e46
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx10
-rw-r--r--xmloff/source/text/txtimp.cxx8
2 files changed, 11 insertions, 7 deletions
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index bf54f43a2878..baf62f6c062b 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -759,7 +759,15 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ )
XML_TEXT_FRAME_FLOATING_FRAME != nType)
{
Reference < XTextContent > xTxtCntnt( xPropSet, UNO_QUERY );
- xTextImportHelper->InsertTextContent( xTxtCntnt );
+ try
+ {
+ xTextImportHelper->InsertTextContent(xTxtCntnt);
+ }
+ catch (lang::IllegalArgumentException const& e)
+ {
+ SAL_WARN("xmloff.text", "Cannot import part of the text - probably an image in the text frame? " << e.Message);
+ return;
+ }
}
// #107848#
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 9d35a13a5e98..e1e454195c1f 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1158,12 +1158,8 @@ void XMLTextImportHelper::InsertTextContent(
assert(m_pImpl->m_xCursorAsRange.is());
if (m_pImpl->m_xText.is())
{
- try {
- m_pImpl->m_xText->insertTextContent( m_pImpl->m_xCursorAsRange, xContent, sal_False);
- } catch ( const lang::IllegalArgumentException & )
- {
- SAL_WARN( "xmloff", "Cannot import part of the text - probably an image in the text frame?" );
- }
+ // note: this may throw IllegalArgumentException and callers handle it
+ m_pImpl->m_xText->insertTextContent( m_pImpl->m_xCursorAsRange, xContent, sal_False);
}
}