summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-12-10 14:10:16 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-12-12 09:15:31 +0000
commitf3fee25f5767f01a7d3e7edcddc145ebf1326e9b (patch)
treead409756107a3b75ea46b68becaf2bcd7f954b85
parent46e59e55eca5a32f9f1b4471809ed182da495a32 (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) Reviewed-on: https://gerrit.libreoffice.org/13425 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-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 c16c38b23b49..eb24cfd8b23d 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 5c5e17e09026..191e81a4c1ac 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1154,12 +1154,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);
}
}