diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-02-14 16:10:19 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-02-15 14:17:57 +0000 |
commit | 6113c68c7653f545f762b22f70adc518cf8d660d (patch) | |
tree | c1aa951c20c38f4e210bb815ac1a966e55243298 /sc | |
parent | 9a22e9691773e7d16fbc8da1568e5d67d76fcf08 (diff) |
Some simplifications, using UNO_QUERY_THROW
Change-Id: If7a8abbf739aca98616ecb5cc3546ced192361d9
Reviewed-on: https://gerrit.libreoffice.org/34261
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/vba/vbaglobals.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 4 |
2 files changed, 3 insertions, 10 deletions
diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx index 598390fc8074..9799067e26e1 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 4d444f2aaebc..e11234142647 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 ); } |