diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-19 09:53:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-19 10:26:51 +0100 |
commit | bf89444ca8e7a544056a2162fc48dae43b05f9d2 (patch) | |
tree | 24e05ff8cafdb2270c39d5a14a98126fdb17e809 /starmath | |
parent | coverity#706525 Uncaught exception (diff) | |
download | core-bf89444ca8e7a544056a2162fc48dae43b05f9d2.tar.gz core-bf89444ca8e7a544056a2162fc48dae43b05f9d2.zip |
coverity#707196 Uncaught exception
Change-Id: I4f42040c7e12507365f12d09f80d3641b4d5ca02
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/smdetect.cxx | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx index 51a8f42f666b..27982f9db742 100644 --- a/starmath/source/smdetect.cxx +++ b/starmath/source/smdetect.cxx @@ -66,17 +66,27 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor if ( pInStrm->remainingSize() == 0 ) return OUString(); - SotStorageRef aStorage = new SotStorage( pInStrm, false ); - if ( !aStorage->GetError() ) + bool bStorageOk = false; + try { - if ( aStorage->IsStream("Equation Native") ) + SotStorageRef aStorage = new SotStorage( pInStrm, false ); + bStorageOk = !aStorage->GetError(); + if (bStorageOk) { - sal_uInt8 nVersion; - if ( GetMathTypeVersion( aStorage, nVersion ) && nVersion <=3 ) - return OUString("math_MathType_3x"); + if ( aStorage->IsStream("Equation Native") ) + { + sal_uInt8 nVersion; + if ( GetMathTypeVersion( aStorage, nVersion ) && nVersion <=3 ) + return OUString("math_MathType_3x"); + } } } - else + catch (const css::ucb::ContentCreationException &e) + { + SAL_WARN("starmath", "SmFilterDetect::detect caught " << e.Message); + } + + if (!bStorageOk) { // 200 should be enough for the XML // version, encoding and !DOCTYPE |