Some simplifications, using UNO_QUERY_THROW

Change-Id: I1a2239b596201bc0172f2a6ade177c10491be9c2
Reviewed-on: https://gerrit.libreoffice.org/34255
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2017-02-14 16:09:54 +01:00
parent c68b5c36cd
commit 5ed0dc5841
2 changed files with 3 additions and 7 deletions

View File

@ -803,11 +803,7 @@ SwVbaSelection::Tables( const uno::Any& aIndex )
}
// if the current selection is a XTextTableCursor and the index is 1 then we can service this request, otherwise we just have to throw
uno::Reference< text::XTextTableCursor > xTextTableCursor( mxModel->getCurrentSelection(), uno::UNO_QUERY );
if ( !xTextTableCursor.is() )
throw uno::RuntimeException();
uno::Reference< text::XTextTableCursor > xTextTableCursor( mxModel->getCurrentSelection(), uno::UNO_QUERY_THROW );
SwXTextTableCursor* pTTCursor = dynamic_cast< SwXTextTableCursor* >( xTextTableCursor.get() );
if ( pTTCursor )
{

View File

@ -737,8 +737,8 @@ SwUnoCursor* SwXTextDocument::CreateCursorForSearch(Reference< XTextCursor > & x
sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor > & xDesc)
{
SolarMutexGuard aGuard;
Reference< XUnoTunnel > xDescTunnel(xDesc, UNO_QUERY);
if(!IsValid() || !xDescTunnel.is() || !xDescTunnel->getSomething(SwXTextSearch::getUnoTunnelId()))
Reference< XUnoTunnel > xDescTunnel(xDesc, UNO_QUERY_THROW);
if(!IsValid() || !xDescTunnel->getSomething(SwXTextSearch::getUnoTunnelId()))
throw RuntimeException();
Reference< XTextCursor > xCursor;