summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2023-09-02 20:32:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-09-02 22:49:12 +0200
commit3c7a35dd28fbc337a23473873b3dd47392b883ae (patch)
tree1ce3db35db659f2d730e8627eb429193d1807969
parent21af3e5b5df02747691f08c453407d0abfc91242 (diff)
no need to use UNO_QUERY_THROW here
Change-Id: I01b4e401fec1792829fc2efaad5a74a035a418f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156476 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--scripting/source/vbaevents/eventhelper.cxx5
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx2
-rw-r--r--toolkit/source/controls/grid/defaultgridcolumnmodel.cxx5
-rw-r--r--toolkit/source/controls/grid/gridcontrol.cxx5
4 files changed, 10 insertions, 7 deletions
diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx
index 420161a22ee1..9f4bdc1f72fe 100644
--- a/scripting/source/vbaevents/eventhelper.cxx
+++ b/scripting/source/vbaevents/eventhelper.cxx
@@ -355,8 +355,9 @@ ScriptEventHelper::~ScriptEventHelper()
{
try
{
- uno::Reference< lang::XComponent > xComp( m_xControl, uno::UNO_QUERY_THROW );
- xComp->dispose();
+ uno::Reference< lang::XComponent > xComp( m_xControl, uno::UNO_QUERY );
+ if (xComp)
+ xComp->dispose();
}
// destructor can't throw
catch( uno::Exception& )
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 397bf0cdb205..0bdfdd41f42e 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -1471,7 +1471,7 @@ void SwXTextDocument::InitNewDoc()
{
// #i91798#, #i91895#
// dispose XDrawPage here. We are the owner and know that it is no longer in a valid condition.
- Reference<XComponent>(static_cast<cppu::OWeakObject*>(m_xDrawPage.get()), UNO_QUERY_THROW)->dispose();
+ m_xDrawPage->dispose();
m_xDrawPage->InvalidateSwDoc();
m_xDrawPage.clear();
}
diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
index f498001d1173..5e1a085ba06f 100644
--- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
+++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
@@ -285,8 +285,9 @@ private:
{
try
{
- const Reference< XComponent > xColComp( rEvent.Element, UNO_QUERY_THROW );
- xColComp->dispose();
+ const Reference< XComponent > xColComp( rEvent.Element, UNO_QUERY );
+ if (xColComp)
+ xColComp->dispose();
}
catch( const Exception& )
{
diff --git a/toolkit/source/controls/grid/gridcontrol.cxx b/toolkit/source/controls/grid/gridcontrol.cxx
index 0fb9e9695958..c60051e5612b 100644
--- a/toolkit/source/controls/grid/gridcontrol.cxx
+++ b/toolkit/source/controls/grid/gridcontrol.cxx
@@ -169,8 +169,9 @@ namespace
{
try
{
- const Reference< XComponent > xComponent( i_component, UNO_QUERY_THROW );
- xComponent->dispose();
+ const Reference< XComponent > xComponent( i_component, UNO_QUERY );
+ if (xComponent)
+ xComponent->dispose();
}
catch( const Exception& )
{