summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-02 10:36:43 +0200
committerNoel Grandin <noelgrandin@gmail.com>2013-05-22 10:44:29 +0000
commit6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 (patch)
tree2746468845d6f1159e3759ee2cf7a620fca15b6e /toolkit
parent697a007c61b9cabceb9767fad87cd5822b300452 (diff)
Use the new type-checking Reference constructor to reduce code noise
Also create a Clang compiler plugin to detect such cases. Change-Id: I61ad1a1d6b1c017eeb51f226d2dde0e9bb7f1752 Reviewed-on: https://gerrit.libreoffice.org/4001 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx3
-rw-r--r--toolkit/source/controls/grid/defaultgridcolumnmodel.cxx3
-rw-r--r--toolkit/source/controls/tabpagecontainer.cxx3
3 files changed, 3 insertions, 6 deletions
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index 52f290fdd3d8..7c6682e8bab5 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -1405,8 +1405,7 @@ void ControlContainerBase::ImplRemoveControl( Reference< XControlModel >& rxMode
removeControl( xCtrl );
try
{
- Reference< XComponent > const xControlComp( xCtrl, UNO_QUERY_THROW );
- xControlComp->dispose();
+ xCtrl->dispose();
}
catch (const Exception&)
{
diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
index 37e8b8fb6a0e..584f1b0ef4ee 100644
--- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
+++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
@@ -187,8 +187,7 @@ namespace toolkit
// dispose the removed column
try
{
- Reference< XComponent > const xColComp( xColumn, UNO_QUERY_THROW );
- xColComp->dispose();
+ xColumn->dispose();
}
catch( const Exception& )
{
diff --git a/toolkit/source/controls/tabpagecontainer.cxx b/toolkit/source/controls/tabpagecontainer.cxx
index efbac8b28b54..26036c14a091 100644
--- a/toolkit/source/controls/tabpagecontainer.cxx
+++ b/toolkit/source/controls/tabpagecontainer.cxx
@@ -101,8 +101,7 @@ namespace
{
try
{
- Reference< XPropertySet > const xParentDelegator( i_parentModel, UNO_QUERY_THROW );
- Reference< XPropertySetInfo > const xPSI( xParentDelegator->getPropertySetInfo() );
+ Reference< XPropertySetInfo > const xPSI( i_parentModel->getPropertySetInfo() );
bool const isGeometryControlModel = xPSI.is() && xPSI->hasPropertyByName( OUString( "PositionX" ) );
Reference< XInterface > xInstance;