summaryrefslogtreecommitdiff
path: root/writerfilter/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-10-22 23:38:54 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-10-23 09:42:52 +0200
commit49e003177db4c5e83bfe9feeb4d12d472f97f3cb (patch)
treeb8dfa96255a54b46cae8a955decf94f8d7998569 /writerfilter/qa
parentde574fe542ccec288c3a5e240a6888d545e8d744 (diff)
fdo#51145 give better error message on import invalid RTF
Change-Id: Idd81e58b8b0b95b1027b7ece434cb362a689f124
Diffstat (limited to 'writerfilter/qa')
-rw-r--r--writerfilter/qa/cppunittests/rtftok/testrtftok.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/writerfilter/qa/cppunittests/rtftok/testrtftok.cxx b/writerfilter/qa/cppunittests/rtftok/testrtftok.cxx
index b416d78a490d..7cdec4979f9d 100644
--- a/writerfilter/qa/cppunittests/rtftok/testrtftok.cxx
+++ b/writerfilter/qa/cppunittests/rtftok/testrtftok.cxx
@@ -29,6 +29,7 @@
#include <unotest/filters-test.hxx>
#include <test/bootstrapfixture.hxx>
#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/io/WrongFormatException.hpp>
#include <osl/file.hxx>
#include <osl/process.h>
@@ -65,7 +66,14 @@ bool RtfTest::load(const OUString &, const OUString &rURL, const OUString &)
uno::Sequence< beans::PropertyValue > aDescriptor(1);
aDescriptor[0].Name = "URL";
aDescriptor[0].Value <<= rURL;
- return m_xFilter->filter(aDescriptor);
+ try
+ {
+ return m_xFilter->filter(aDescriptor);
+ }
+ catch (const io::WrongFormatException&)
+ {
+ return false;
+ }
}
void RtfTest::test()