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:
@@ -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
|
// 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 );
|
uno::Reference< text::XTextTableCursor > xTextTableCursor( mxModel->getCurrentSelection(), uno::UNO_QUERY_THROW );
|
||||||
|
|
||||||
if ( !xTextTableCursor.is() )
|
|
||||||
throw uno::RuntimeException();
|
|
||||||
|
|
||||||
SwXTextTableCursor* pTTCursor = dynamic_cast< SwXTextTableCursor* >( xTextTableCursor.get() );
|
SwXTextTableCursor* pTTCursor = dynamic_cast< SwXTextTableCursor* >( xTextTableCursor.get() );
|
||||||
if ( pTTCursor )
|
if ( pTTCursor )
|
||||||
{
|
{
|
||||||
|
@@ -737,8 +737,8 @@ SwUnoCursor* SwXTextDocument::CreateCursorForSearch(Reference< XTextCursor > & x
|
|||||||
sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor > & xDesc)
|
sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor > & xDesc)
|
||||||
{
|
{
|
||||||
SolarMutexGuard aGuard;
|
SolarMutexGuard aGuard;
|
||||||
Reference< XUnoTunnel > xDescTunnel(xDesc, UNO_QUERY);
|
Reference< XUnoTunnel > xDescTunnel(xDesc, UNO_QUERY_THROW);
|
||||||
if(!IsValid() || !xDescTunnel.is() || !xDescTunnel->getSomething(SwXTextSearch::getUnoTunnelId()))
|
if(!IsValid() || !xDescTunnel->getSomething(SwXTextSearch::getUnoTunnelId()))
|
||||||
throw RuntimeException();
|
throw RuntimeException();
|
||||||
|
|
||||||
Reference< XTextCursor > xCursor;
|
Reference< XTextCursor > xCursor;
|
||||||
|
Reference in New Issue
Block a user