summaryrefslogtreecommitdiff
path: root/sw/source/ui/vba/vbarange.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-08-13 13:29:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-08-14 12:56:50 +0200
commit14b7b50701e3874034f7f98a73794ba8a79792bf (patch)
treed94492a3b9b19349edb10ba580f4e0ee60fa6953 /sw/source/ui/vba/vbarange.cxx
parentefe65eaaacfd155bfc38b91f51ed4e7e1d41c659 (diff)
use less exception throwing for flow control
Change-Id: I289f1a2204af02576a585392b7f428a5dc65cf1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171850 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'sw/source/ui/vba/vbarange.cxx')
-rw-r--r--sw/source/ui/vba/vbarange.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/ui/vba/vbarange.cxx b/sw/source/ui/vba/vbarange.cxx
index 39d369c92144..722dcfce92b1 100644
--- a/sw/source/ui/vba/vbarange.cxx
+++ b/sw/source/ui/vba/vbarange.cxx
@@ -134,8 +134,9 @@ SwVbaRange::setText( const OUString& rText )
uno::Reference< text::XTextContent > xBookmark = SwVbaRangeHelper::findBookmarkByPosition( mxTextDocument, xRange->getStart() );
if( xBookmark.is() )
{
- uno::Reference< container::XNamed > xNamed( xBookmark, uno::UNO_QUERY_THROW );
- sName = xNamed->getName();
+ uno::Reference< container::XNamed > xNamed( xBookmark, uno::UNO_QUERY );
+ if (xNamed)
+ sName = xNamed->getName();
}
}
catch (const uno::Exception&)