diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-19 10:00:09 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-19 10:26:52 +0100 |
commit | d176340628b55ad859d63c9b769822fd9467863e (patch) | |
tree | d931b85e1f2500b4a2201c3d8582d2f2fcdb01ff /sc | |
parent | 71293087a5121c5553e6e95bb8da2ec954e22e55 (diff) |
coverity#983728 Uncaught exception
Change-Id: Ifa6f0bf05e9a71aa3db6c63291f99dc0665e57bf
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/unoobj/exceldetect.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sc/source/ui/unoobj/exceldetect.cxx b/sc/source/ui/unoobj/exceldetect.cxx index 3f56fa494a31..40ea9be37b2f 100644 --- a/sc/source/ui/unoobj/exceldetect.cxx +++ b/sc/source/ui/unoobj/exceldetect.cxx @@ -58,14 +58,24 @@ bool hasStream(const uno::Reference<io::XInputStream>& xInStream, const OUString pStream->Seek(0); if (!nSize) + { // 0-size stream. Failed. return false; + } - SotStorageRef xStorage = new SotStorage(pStream, false); - if (!xStorage.Is() || xStorage->GetError()) - return false; + try + { + SotStorageRef xStorage = new SotStorage(pStream, false); + if (!xStorage.Is() || xStorage->GetError()) + return false; + return xStorage->IsStream(rName); + } + catch (const css::ucb::ContentCreationException &e) + { + SAL_WARN("sc", "hasStream caught " << e.Message); + } - return xStorage->IsStream(rName); + return false; } /** |