Kaydet (Commit) d6f9ddb0 authored tarafından Efe Gürkan YALAMAN's avatar Efe Gürkan YALAMAN Kaydeden (comit) Kohei Yoshida

fdo#70465 SvTreeListBox::GetLevelChildCount refactored

Instead of iterating siblings returning count of parents child vector.
This slightly improves loading performance of "Expert Config" when accessibility enabled.

Change-Id: Ide1af3df19efaae9c0cc92086456bf3520ee5dd2
Reviewed-on: https://gerrit.libreoffice.org/7106Reviewed-by: 's avatarKohei Yoshida <libreoffice@kohei.us>
Tested-by: 's avatarKohei Yoshida <libreoffice@kohei.us>
üst fed8a0b2
...@@ -937,15 +937,16 @@ sal_uLong SvTreeListBox::GetLevelChildCount( SvTreeListEntry* _pParent ) const ...@@ -937,15 +937,16 @@ sal_uLong SvTreeListBox::GetLevelChildCount( SvTreeListEntry* _pParent ) const
{ {
DBG_CHKTHIS(SvTreeListBox,0); DBG_CHKTHIS(SvTreeListBox,0);
sal_uLong nCount = 0; //if _pParent is 0, then pEntry is the first child of the root.
SvTreeListEntry* pEntry = FirstChild( _pParent ); SvTreeListEntry* pEntry = FirstChild( _pParent );
while ( pEntry )
{
++nCount;
pEntry = NextSibling( pEntry );
}
return nCount; if( !pEntry )//there is only root, root don't have children
return 0;
if( !_pParent )//root and children of root
return pEntry->pParent->maChildren.size();
return _pParent->maChildren.size();
} }
SvViewDataEntry* SvTreeListBox::GetViewDataEntry( SvTreeListEntry* pEntry ) const SvViewDataEntry* SvTreeListBox::GetViewDataEntry( SvTreeListEntry* pEntry ) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment