summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-22 17:23:14 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-03-22 21:03:50 +0000
commitbe630d7bd9298c1447983af99959aa7de2d6e2a1 (patch)
treeee933cce04f77f5d9aa64c6e15f5ffc71ba04804
parentcb2a1cb37035a634a3e30bd81480ca311bf11eba (diff)
catch structured storage exceptions during testing
Change-Id: Ibce297f85ebcf5ebde1a9e81afef9b0c41ebeb1a
-rw-r--r--sd/source/filter/ppt/pptin.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 4e3ca127c265..3b2589384909 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2759,9 +2759,17 @@ extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL ImportPPT(
extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportPPT(SvStream &rStream)
{
- tools::SvRef<SotStorage> xStorage(new SotStorage(rStream));
- if (xStorage->GetError())
+ tools::SvRef<SotStorage> xStorage;
+ try
+ {
+ xStorage = tools::SvRef<SotStorage>(new SotStorage(rStream));
+ if (xStorage->GetError())
+ return false;
+ }
+ catch (...)
+ {
return false;
+ }
tools::SvRef<SotStorageStream> xDocStream(xStorage->OpenSotStream( "PowerPoint Document", StreamMode::STD_READ));
if ( !xDocStream.is() )