summaryrefslogtreecommitdiff
path: root/sw/source/filter/rtf
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-11-28 21:23:14 +0100
committerMichael Stahl <mstahl@redhat.com>2012-11-28 21:33:54 +0100
commit07ab53c03ffdaca1851ad6d9d1353edf4478c938 (patch)
tree2dc29f6bde2d883fb668281a470fd18a48302aa9 /sw/source/filter/rtf
parent232ad2f2588beff50cb5c1f3b689c581ba317583 (diff)
SwRTFReader::Read: catch all exceptions
... so the filter does not crash soffice with unhandled exceptions. Change-Id: Ia09815009dfb0c9e5163b94aecb76e3e70e6f945
Diffstat (limited to 'sw/source/filter/rtf')
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index e06c02ba6208..e60dc971ab92 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -184,7 +184,15 @@ sal_uLong SwRTFReader::Read( SwDoc &rDoc, const String& /*rBaseURL*/, SwPaM& rPa
aDescriptor[1].Value <<= sal_False;
aDescriptor[2].Name = "TextInsertModeRange";
aDescriptor[2].Value <<= xInsertTextRange;
- xFilter->filter(aDescriptor);
+ sal_uLong ret(0);
+ try {
+ xFilter->filter(aDescriptor);
+ }
+ catch (uno::Exception const& e)
+ {
+ SAL_WARN("sw.rtf", "SwRTFReader::Read(): exception: " << e.Message);
+ ret = ERR_SWG_READ_ERROR;
+ }
// Clean up the fake paragraphs.
SwUnoInternalPaM aPam(rDoc);
@@ -219,7 +227,7 @@ sal_uLong SwRTFReader::Read( SwDoc &rDoc, const String& /*rBaseURL*/, SwPaM& rPa
}
}
- return 0;
+ return ret;
}
extern "C" SAL_DLLPUBLIC_EXPORT Reader* SAL_CALL ImportRTF()