summaryrefslogtreecommitdiff
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:25:47 +0100
commit2b577a316ad000bbc9378e180844c14e31e63706 (patch)
treeed7c9ce997f2e588627451aefc2510074b47ba1c
parent9b8598fda9667e2b6c92c433d4c76dec6aeeaafb (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 (cherry picked from commit b86f5530161a417d31e28e75408ee80352fadad7)
-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 d70efff118fc..f985cdad0112 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1158,12 +1158,8 @@ void XMLTextImportHelper::InsertTextContent(
DBG_ASSERT(m_pImpl->m_xCursorAsRange.is(), "no range");
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);
}
}