summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-02-14 18:07:39 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-02-15 09:36:43 +0100
commita460cf6822780cb41cd5f9a55b30652c1c4bf1c2 (patch)
treeec207fe4537faf44b83feac927eaf8597b19fb5c /xmloff
parent2affa16c998bc08c1e2adbc832c5fecf3d52c1f0 (diff)
xmloff: avoid unhandled exception warning
Happened e.g. when copy&pasting editeng content in Impress tables, document::XStorageBasedDocument is not implemented by SvxSimpleUnoModel, so it's not exceptional that the queryInterface() for mxModel fails. Change-Id: Iaed53941bb47ff8a0553896f18a553cf64e2224a Reviewed-on: https://gerrit.libreoffice.org/49747 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/xmlimp.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index c77193ba38cb..2d9e6b98afb3 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -988,10 +988,9 @@ void SAL_CALL SvXMLImport::setTargetDocument( const uno::Reference< lang::XCompo
try
{
- uno::Reference<document::XStorageBasedDocument> const xSBDoc(mxModel,
- uno::UNO_QUERY_THROW);
- uno::Reference<embed::XStorage> const xStor(
- xSBDoc->getDocumentStorage());
+ uno::Reference<document::XStorageBasedDocument> const xSBDoc(mxModel, uno::UNO_QUERY);
+ uno::Reference<embed::XStorage> const xStor(xSBDoc.is() ? xSBDoc->getDocumentStorage()
+ : nullptr);
if (xStor.is())
{
mpImpl->mbIsOOoXML =