summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-08-03 20:32:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-04 08:42:52 +0200
commit854ba4bf47f713f5c82525a9000439c5c44e66b2 (patch)
tree7483ce8239daf0fea969e8ef450b789e17e05155 /toolkit
parentf7ee6baa1b14410fa79aac5dd9d6877df44a823a (diff)
getReference is unnecessary
Change-Id: I156c2e6dc714468f6af42f5c0f7cae923aec175c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119948 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/controls/tree/treedatamodel.cxx18
1 files changed, 5 insertions, 13 deletions
diff --git a/toolkit/source/controls/tree/treedatamodel.cxx b/toolkit/source/controls/tree/treedatamodel.cxx
index 444f2ff1dc1a..7ccfc949d034 100644
--- a/toolkit/source/controls/tree/treedatamodel.cxx
+++ b/toolkit/source/controls/tree/treedatamodel.cxx
@@ -117,11 +117,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
- static Reference< XTreeNode > getReference( MutableTreeNode* pNode )
- {
- return Reference< XTreeNode >( pNode );
- }
-
private:
TreeNodeVector maChildren;
Any maDisplayValue;
@@ -276,9 +271,7 @@ void MutableTreeNode::broadcast_changes()
{
if( mxModel.is() )
{
- Reference< XTreeNode > xParent( getReference( mpParent ) );
- Reference< XTreeNode > xNode( getReference( this ) );
- mxModel->broadcast( nodes_changed, xParent, xNode );
+ mxModel->broadcast( nodes_changed, mpParent, this );
}
}
@@ -286,8 +279,7 @@ void MutableTreeNode::broadcast_changes(const Reference< XTreeNode >& xNode, boo
{
if( mxModel.is() )
{
- Reference< XTreeNode > xParent( getReference( this ) );
- mxModel->broadcast( bNew ? nodes_inserted : nodes_removed, xParent, xNode );
+ mxModel->broadcast( bNew ? nodes_inserted : nodes_removed, this, xNode );
}
}
@@ -361,7 +353,7 @@ void SAL_CALL MutableTreeNode::removeChildByIndex( sal_Int32 nChildIndex )
xImpl->setParent(nullptr);
xImpl->mbIsInserted = false;
- broadcast_changes( getReference( xImpl.get() ), false );
+ broadcast_changes( xImpl, false );
}
void SAL_CALL MutableTreeNode::setHasChildrenOnDemand( sal_Bool bChildrenOnDemand )
@@ -436,7 +428,7 @@ Reference< XTreeNode > SAL_CALL MutableTreeNode::getChildAt( sal_Int32 nChildInd
if( (nChildIndex < 0) || (nChildIndex >= static_cast<sal_Int32>(maChildren.size())) )
throw IndexOutOfBoundsException();
- return getReference( maChildren[nChildIndex].get() );
+ return maChildren[nChildIndex];
}
sal_Int32 SAL_CALL MutableTreeNode::getChildCount( )
@@ -448,7 +440,7 @@ sal_Int32 SAL_CALL MutableTreeNode::getChildCount( )
Reference< XTreeNode > SAL_CALL MutableTreeNode::getParent( )
{
std::scoped_lock aGuard( maMutex );
- return getReference( mpParent );
+ return mpParent;
}
sal_Int32 SAL_CALL MutableTreeNode::getIndex( const Reference< XTreeNode >& xNode )