diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-16 15:47:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-17 07:44:18 +0100 |
commit | 1c9f0d9d8ee1a13d30be924cddaa94343fd8c840 (patch) | |
tree | 60348a9a4784cf2e5cb963045b7f796e4694f909 /toolkit | |
parent | 27078ce8cb03f6ba61be5ce75c5231bc8798d6fe (diff) |
loplugin:referencecasting in test..toolkit
Change-Id: Ia290ff4849f4d7eda978c7b1e2c7f36de744056f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110997
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxwindows.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/controls/grid/defaultgridcolumnmodel.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/controls/grid/sortablegriddatamodel.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/controls/tree/treedatamodel.cxx | 12 | ||||
-rw-r--r-- | toolkit/source/controls/unocontrolmodel.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/helper/unowrapper.cxx | 2 |
6 files changed, 10 insertions, 12 deletions
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 8b9c247190c3..56792659f9b4 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -6986,7 +6986,7 @@ css::uno::Any SVTXFormattedField::getProperty( const OUString& PropertyName ) { if (!bIsStandardSupplier) { // ansonsten void - css::uno::Reference< css::util::XNumberFormatsSupplier > xSupplier = m_xCurrentSupplier.get(); + css::uno::Reference< css::util::XNumberFormatsSupplier > xSupplier = m_xCurrentSupplier; aReturn <<= xSupplier; } } diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx index 3d65945cede3..90ecc7576b49 100644 --- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx +++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx @@ -267,7 +267,7 @@ private: for ( sal_Int32 i=0; i<rowElements; ++i ) { ::rtl::Reference< GridColumn > const pGridColumn = new GridColumn(); - Reference< XGridColumn > const xColumn( pGridColumn.get() ); + Reference< XGridColumn > const xColumn( pGridColumn ); OUString colTitle = "Column " + OUString::number( i + 1 ); pGridColumn->setTitle( colTitle ); pGridColumn->setColumnWidth( 80 /* APPFONT */ ); diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx index ffd9b0f9067b..e657b2d613a2 100644 --- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx @@ -843,7 +843,7 @@ void lcl_clear( STLCONTAINER& i_container ) { m_currentSortColumn = -1; - Reference< XComponent > const delegatorComponent( m_delegator.get() ); + Reference< XComponent > const delegatorComponent( m_delegator ); m_delegator->removeGridDataListener( this ); m_delegator.clear(); delegatorComponent->dispose(); diff --git a/toolkit/source/controls/tree/treedatamodel.cxx b/toolkit/source/controls/tree/treedatamodel.cxx index 34d3bf4ab67b..73aea80a53ea 100644 --- a/toolkit/source/controls/tree/treedatamodel.cxx +++ b/toolkit/source/controls/tree/treedatamodel.cxx @@ -190,7 +190,7 @@ void SAL_CALL MutableTreeDataModel::setRoot( const Reference< XMutableTreeNode > throw IllegalArgumentException(); xImpl->mbIsInserted = true; - mxRootNode.set(xImpl.get()); + mxRootNode = xImpl; Reference< XTreeNode > xParentNode; broadcast( structure_changed, xParentNode, mxRootNode ); @@ -305,8 +305,7 @@ void SAL_CALL MutableTreeNode::setDataValue( const Any& _datavalue ) void SAL_CALL MutableTreeNode::appendChild( const Reference< XMutableTreeNode >& xChildNode ) { ::osl::Guard< ::osl::Mutex > aGuard( maMutex ); - Reference< XTreeNode > xNode( xChildNode.get() ); - MutableTreeNodeRef xImpl( dynamic_cast< MutableTreeNode* >( xNode.get() ) ); + MutableTreeNodeRef xImpl( dynamic_cast< MutableTreeNode* >( xChildNode.get() ) ); if( !xImpl.is() || xImpl->mbIsInserted || (this == xImpl.get()) ) throw IllegalArgumentException(); @@ -315,7 +314,7 @@ void SAL_CALL MutableTreeNode::appendChild( const Reference< XMutableTreeNode >& xImpl->setParent(this); xImpl->mbIsInserted = true; - broadcast_changes( xNode, true ); + broadcast_changes( xChildNode, true ); } void SAL_CALL MutableTreeNode::insertChildByIndex( sal_Int32 nChildIndex, const Reference< XMutableTreeNode >& xChildNode ) @@ -325,8 +324,7 @@ void SAL_CALL MutableTreeNode::insertChildByIndex( sal_Int32 nChildIndex, const if( (nChildIndex < 0) || (nChildIndex > static_cast<sal_Int32>(maChildren.size())) ) throw IndexOutOfBoundsException(); - Reference< XTreeNode > xNode( xChildNode.get() ); - MutableTreeNodeRef xImpl( dynamic_cast< MutableTreeNode* >( xNode.get() ) ); + MutableTreeNodeRef xImpl( dynamic_cast< MutableTreeNode* >( xChildNode.get() ) ); if( !xImpl.is() || xImpl->mbIsInserted || (this == xImpl.get()) ) throw IllegalArgumentException(); @@ -338,7 +336,7 @@ void SAL_CALL MutableTreeNode::insertChildByIndex( sal_Int32 nChildIndex, const maChildren.insert( aIter, xImpl ); xImpl->setParent( this ); - broadcast_changes( xNode, true ); + broadcast_changes( xChildNode, true ); } void SAL_CALL MutableTreeNode::removeChildByIndex( sal_Int32 nChildIndex ) diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index 80ebb041299c..a5f7b785f06c 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -450,7 +450,7 @@ IMPLEMENT_FORWARD_XTYPEPROVIDER2( UnoControlModel, UnoControlModel_Base, ::cppu: uno::Reference< util::XCloneable > UnoControlModel::createClone() { rtl::Reference<UnoControlModel> pClone = Clone(); - return pClone.get(); + return pClone; } // css::lang::XComponent diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index edac7fe62b34..c3240eee2c4b 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -141,7 +141,7 @@ css::uno::Reference< css::awt::XToolkit> UnoWrapper::GetVCLToolkit() { if ( !mxToolkit.is() ) mxToolkit = VCLUnoHelper::CreateToolkit(); - return mxToolkit.get(); + return mxToolkit; } css::uno::Reference< css::awt::XWindowPeer> UnoWrapper::GetWindowInterface( vcl::Window* pWindow ) |