diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-07 13:03:58 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-06-08 01:29:32 +0200 |
commit | 5708534b942c1d0ce384f6a8473da6bb569410e7 (patch) | |
tree | 2ec4fe87624541c15bf89c8b839e8f8dba8a89f4 /extensions | |
parent | 1e55a47e89a9d9d6cf9cb3993484022aaf2c097b (diff) |
look for unnecessary calls to Reference::is() after an UNO_QUERY_THROW
Since the previous call would throw if there was nothing to be assigned
to the value.
Idea from tml.
Used the following script to find places:
git grep -A3 -n UNO_QUERY_THROW | grep -B3 -F 'is()'
Change-Id: I36ba7b00bcd014bdf16c0455ab91056f82194969
Reviewed-on: https://gerrit.libreoffice.org/55417
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/abpilot/datasourcehandling.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx index eb149ea4b106..0923e9902943 100644 --- a/extensions/source/abpilot/datasourcehandling.cxx +++ b/extensions/source/abpilot/datasourcehandling.cxx @@ -203,16 +203,13 @@ namespace abp // create the UNO context m_pImpl->xContext.set( lcl_getDataSourceContext( _rxORB ), UNO_QUERY_THROW ); - if (m_pImpl->xContext.is()) - { - // collect the data source names - Sequence< OUString > aDSNames = m_pImpl->xContext->getElementNames(); - const OUString* pDSNames = aDSNames.getConstArray(); - const OUString* pDSNamesEnd = pDSNames + aDSNames.getLength(); + // collect the data source names + Sequence< OUString > aDSNames = m_pImpl->xContext->getElementNames(); + const OUString* pDSNames = aDSNames.getConstArray(); + const OUString* pDSNamesEnd = pDSNames + aDSNames.getLength(); - for ( ;pDSNames != pDSNamesEnd; ++pDSNames ) - m_pImpl->aDataSourceNames.insert( *pDSNames ); - } + for ( ;pDSNames != pDSNamesEnd; ++pDSNames ) + m_pImpl->aDataSourceNames.insert( *pDSNames ); } catch( const Exception& ) { |