tdf#114441 Convert sal_uLong to sal_uInt32 in TreeControlPeer

We are talking about a tree list in a gui which logically will not exceed sal_uInt32
They also must be unsigned integers because they represent counts & positions

changes are done to these variables:
- nPos (node position)
In all base classes you will found that all functions deal with and return sal_int32 concerning it
- nChild (node child)
It is assigned to TREELIST_APPEND which is MAX for sal_uInt32 and it is considered like that in all other functions
- nSelectionCount
all functions that deal with it (like GetSelectionCount()) returns sal_uInt32

Change-Id: I1771b9aa52c351063d007d7014484861d4b3e02a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164067
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
This commit is contained in:
AhmedHamed 2024-02-27 23:35:13 +02:00 committed by Ilmari Lauhakangas
parent 621322b6ac
commit e6ecd5a32c
2 changed files with 6 additions and 6 deletions

View file

@ -117,7 +117,7 @@ private:
void fillTree( UnoTreeListBoxImpl& rTree, const css::uno::Reference< css::awt::tree::XTreeDataModel >& xDataModel );
void addNode( UnoTreeListBoxImpl& rTree, const css::uno::Reference< css::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParentEntry );
UnoTreeListEntry* createEntry( const css::uno::Reference< css::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParent, sal_uLong nPos );
UnoTreeListEntry* createEntry( const css::uno::Reference< css::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParent, sal_uInt32 nPos );
void updateEntry( UnoTreeListEntry* pEntry );
void updateTree( const css::awt::tree::TreeDataModelEvent& rEvent );

View file

@ -94,7 +94,7 @@ public:
virtual ~UnoTreeListBoxImpl() override;
virtual void dispose() override;
void insert( SvTreeListEntry* pEntry, SvTreeListEntry* pParent, sal_uLong nPos );
void insert( SvTreeListEntry* pEntry, SvTreeListEntry* pParent, sal_uInt32 nPos );
virtual void RequestingChildren( SvTreeListEntry* pParent ) override;
@ -218,7 +218,7 @@ void TreeControlPeer::disposeControl()
}
UnoTreeListEntry* TreeControlPeer::createEntry( const Reference< XTreeNode >& xNode, UnoTreeListEntry* pParent, sal_uLong nPos /* = TREELIST_APPEND */ )
UnoTreeListEntry* TreeControlPeer::createEntry( const Reference< XTreeNode >& xNode, UnoTreeListEntry* pParent, sal_uInt32 nPos /* = TREELIST_APPEND */ )
{
UnoTreeListEntry* pEntry = nullptr;
if( mpTreeImpl )
@ -503,7 +503,7 @@ Any SAL_CALL TreeControlPeer::getSelection()
Any aRet;
sal_uLong nSelectionCount = rTree.GetSelectionCount();
sal_uInt32 nSelectionCount = rTree.GetSelectionCount();
if( nSelectionCount == 1 )
{
UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.FirstSelected() );
@ -1017,7 +1017,7 @@ void TreeControlPeer::updateNode( UnoTreeListBoxImpl const & rTree, const Refere
{
Reference< XTreeNode > xParentNode( xNode->getParent() );
UnoTreeListEntry* pParentEntry = nullptr;
sal_uLong nChild = TREELIST_APPEND;
sal_uInt32 nChild = TREELIST_APPEND;
if( xParentNode.is() )
{
@ -1463,7 +1463,7 @@ IMPL_LINK_NOARG(UnoTreeListBoxImpl, OnExpandedHdl, SvTreeListBox*, void)
}
void UnoTreeListBoxImpl::insert( SvTreeListEntry* pEntry,SvTreeListEntry* pParent,sal_uLong nPos )
void UnoTreeListBoxImpl::insert( SvTreeListEntry* pEntry,SvTreeListEntry* pParent,sal_uInt32 nPos )
{
if( pParent )
SvTreeListBox::Insert( pEntry, pParent, nPos );