diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-21 13:51:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-21 17:14:42 +0100 |
commit | 82233965486f88f4ce1313dcf35b4bc688e1832a (patch) | |
tree | ba10593b268cec21107c4d718629da118c3c6bea /dbaccess/source/filter/xml/xmlfilter.cxx | |
parent | 489bce598626390d9c0aa5e5b8514e26070add61 (diff) |
loplugin:flatten in desktop..drawinglayer
Change-Id: Ie6594c9961aba5517c6ff61fb3bc1142081b1197
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127225
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source/filter/xml/xmlfilter.cxx')
-rw-r--r-- | dbaccess/source/filter/xml/xmlfilter.cxx | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 88765c186961..6848d5a1bb2d 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -132,42 +132,40 @@ static ErrCode ReadThroughComponent( OSL_ENSURE( xStorage.is(), "Need storage!"); OSL_ENSURE(nullptr != pStreamName, "Please, please, give me a name!"); - if ( xStorage.is() ) - { - uno::Reference< io::XStream > xDocStream; + if ( !xStorage ) + // TODO/LATER: better error handling + return ErrCode(1); - try - { - // open stream (and set parser input) - OUString sStreamName = OUString::createFromAscii(pStreamName); - if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) ) - { - // stream name not found! return immediately with OK signal - return ERRCODE_NONE; - } + uno::Reference< io::XStream > xDocStream; - // get input stream - xDocStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ ); - } - catch (const packages::WrongPasswordException&) - { - return ERRCODE_SFX_WRONGPASSWORD; - } - catch (const uno::Exception&) + try + { + // open stream (and set parser input) + OUString sStreamName = OUString::createFromAscii(pStreamName); + if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) ) { - return ErrCode(1); // TODO/LATER: error handling + // stream name not found! return immediately with OK signal + return ERRCODE_NONE; } - uno::Reference< XInputStream > xInputStream = xDocStream->getInputStream(); - // read from the stream - return ReadThroughComponent( xInputStream - ,xModelComponent - ,rxContext - ,_rFilter ); + // get input stream + xDocStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ ); + } + catch (const packages::WrongPasswordException&) + { + return ERRCODE_SFX_WRONGPASSWORD; + } + catch (const uno::Exception&) + { + return ErrCode(1); // TODO/LATER: error handling } - // TODO/LATER: better error handling - return ErrCode(1); + uno::Reference< XInputStream > xInputStream = xDocStream->getInputStream(); + // read from the stream + return ReadThroughComponent( xInputStream + ,xModelComponent + ,rxContext + ,_rFilter ); } |