reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx | 4 ++-- reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx | 5 +---- sc/source/ui/vba/vbaglobals.cxx | 9 ++------- sc/source/ui/vba/vbarange.cxx | 4 +--- sccomp/source/solver/CoinMPSolver.cxx | 4 +--- sccomp/source/solver/LpsolveSolver.cxx | 4 +--- 6 files changed, 8 insertions(+), 22 deletions(-)
New commits: commit 131503c1b1387fb1e7865b123c6161fc6709a718 Author: Stephan Bergmann <[email protected]> Date: Tue Feb 14 16:10:23 2017 +0100 Some simplifications, using UNO_QUERY_THROW Change-Id: I6723de749d0e741a79a3ec276e781ee0e5b49934 Reviewed-on: https://gerrit.libreoffice.org/34262 Tested-by: Stephan Bergmann <[email protected]> Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index a4ec3461..d736f52 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -299,8 +299,8 @@ void SAL_CALL ExportDocumentHandler::initialize( const uno::Sequence< uno::Any > if ( !m_xDelegatee.is() || !m_xModel.is() ) throw uno::Exception(); - m_xDatabaseDataProvider.set(m_xModel->getDataProvider(),uno::UNO_QUERY); - if ( !m_xDatabaseDataProvider.is() || !m_xDatabaseDataProvider->getActiveConnection().is() ) + m_xDatabaseDataProvider.set(m_xModel->getDataProvider(),uno::UNO_QUERY_THROW); + if ( !m_xDatabaseDataProvider->getActiveConnection().is() ) throw uno::Exception(); uno::Reference< reflection::XProxyFactory > xProxyFactory = reflection::ProxyFactory::create( m_xContext ); diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index 7d9c13a..488fcea 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -355,10 +355,7 @@ void SAL_CALL ImportDocumentHandler::initialize( const uno::Sequence< uno::Any > { static const char s_sDatabaseDataProvider[] = "com.sun.star.chart2.data.DatabaseDataProvider"; m_xDatabaseDataProvider.set(m_xContext->getServiceManager()->createInstanceWithContext(s_sDatabaseDataProvider - ,m_xContext),uno::UNO_QUERY); - if ( !m_xDatabaseDataProvider.is() ) - throw uno::Exception(); - + ,m_xContext),uno::UNO_QUERY_THROW); m_xDatabaseDataProvider->setRowLimit(10); uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xModel,uno::UNO_QUERY_THROW); commit 6113c68c7653f545f762b22f70adc518cf8d660d Author: Stephan Bergmann <[email protected]> Date: Tue Feb 14 16:10:19 2017 +0100 Some simplifications, using UNO_QUERY_THROW Change-Id: If7a8abbf739aca98616ecb5cc3546ced192361d9 Reviewed-on: https://gerrit.libreoffice.org/34261 Tested-by: Stephan Bergmann <[email protected]> Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx index 598390f..9799067 100644 --- a/sc/source/ui/vba/vbaglobals.cxx +++ b/sc/source/ui/vba/vbaglobals.cxx @@ -72,13 +72,8 @@ ScVbaGlobals::getExcel() uno::Reference< excel::XWorkbook > SAL_CALL ScVbaGlobals::getActiveWorkbook() { - uno::Reference< excel::XWorkbook > xWorkbook( getApplication()->getActiveWorkbook(), uno::UNO_QUERY); - if ( xWorkbook.is() ) - { - return xWorkbook; - } -// FIXME check if this is correct/desired behavior - throw uno::RuntimeException( "No activeWorkbook available" ); + uno::Reference< excel::XWorkbook > xWorkbook( getApplication()->getActiveWorkbook(), uno::UNO_QUERY_THROW); + return xWorkbook; } uno::Reference< excel::XWindow > SAL_CALL diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 4d444f2..e112341 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -3174,9 +3174,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L // After must be a single cell in the range if( xAfterRange->getCount() > 1 ) throw uno::RuntimeException("After must be a single cell." ); - uno::Reference< excel::XRange > xCell( Cells( uno::makeAny( xAfterRange->getRow() ), uno::makeAny( xAfterRange->getColumn() ) ), uno::UNO_QUERY ); - if( !xCell.is() ) - throw uno::RuntimeException("After must be in range." ); + uno::Reference< excel::XRange > xCell( Cells( uno::makeAny( xAfterRange->getRow() ), uno::makeAny( xAfterRange->getColumn() ) ), uno::UNO_QUERY_THROW ); xStartCell.set( xAfterRange->getCellRange(), uno::UNO_QUERY_THROW ); } commit 9a22e9691773e7d16fbc8da1568e5d67d76fcf08 Author: Stephan Bergmann <[email protected]> Date: Tue Feb 14 16:10:15 2017 +0100 Some simplifications, using UNO_QUERY_THROW Change-Id: Iab702a5ad9697f1c71cc12c7dea954ca620cfdbe Reviewed-on: https://gerrit.libreoffice.org/34260 Tested-by: Stephan Bergmann <[email protected]> Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/sccomp/source/solver/CoinMPSolver.cxx b/sccomp/source/solver/CoinMPSolver.cxx index d7f1751..36cead8 100644 --- a/sccomp/source/solver/CoinMPSolver.cxx +++ b/sccomp/source/solver/CoinMPSolver.cxx @@ -52,9 +52,7 @@ private: void SAL_CALL CoinMPSolver::solve() { - uno::Reference<frame::XModel> xModel( mxDoc, uno::UNO_QUERY ); - if ( !xModel.is() ) - throw uno::RuntimeException(); + uno::Reference<frame::XModel> xModel( mxDoc, uno::UNO_QUERY_THROW ); maStatus.clear(); mbSuccess = false; diff --git a/sccomp/source/solver/LpsolveSolver.cxx b/sccomp/source/solver/LpsolveSolver.cxx index 114a259..a81883d 100644 --- a/sccomp/source/solver/LpsolveSolver.cxx +++ b/sccomp/source/solver/LpsolveSolver.cxx @@ -83,9 +83,7 @@ private: void SAL_CALL LpsolveSolver::solve() { - uno::Reference<frame::XModel> xModel( mxDoc, uno::UNO_QUERY ); - if ( !xModel.is() ) - throw uno::RuntimeException(); + uno::Reference<frame::XModel> xModel( mxDoc, uno::UNO_QUERY_THROW ); maStatus.clear(); mbSuccess = false; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
