mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-29 10:25:27 +08:00
Add wxGtkTreeModelNode::ResortChildrenIfNeeded()
No real changes, just factor out a common fragment into a function.
This commit is contained in:
+11
-10
@@ -355,11 +355,7 @@ public:
|
||||
|
||||
m_children.Add( id );
|
||||
|
||||
if ( !m_internal->IsSortFrozen() && m_internal->ShouldBeSorted() )
|
||||
{
|
||||
gs_internal = m_internal;
|
||||
m_children.Sort( &wxGtkTreeModelChildCmp );
|
||||
}
|
||||
ResortChildrenIfNeeded();
|
||||
}
|
||||
|
||||
void InsertNode( wxGtkTreeModelNode* child, unsigned pos )
|
||||
@@ -402,11 +398,7 @@ public:
|
||||
{
|
||||
m_children.Insert( id, pos );
|
||||
|
||||
if ( !m_internal->IsSortFrozen() && m_internal->ShouldBeSorted() )
|
||||
{
|
||||
gs_internal = m_internal;
|
||||
m_children.Sort( &wxGtkTreeModelChildCmp );
|
||||
}
|
||||
ResortChildrenIfNeeded();
|
||||
}
|
||||
|
||||
void DeleteChild( void* id )
|
||||
@@ -458,6 +450,15 @@ public:
|
||||
void Resort();
|
||||
|
||||
private:
|
||||
void ResortChildrenIfNeeded()
|
||||
{
|
||||
if ( !m_internal->IsSortFrozen() && m_internal->ShouldBeSorted() )
|
||||
{
|
||||
gs_internal = m_internal;
|
||||
m_children.Sort( &wxGtkTreeModelChildCmp );
|
||||
}
|
||||
}
|
||||
|
||||
// Only null for the root node, i.e. wxDataViewCtrlInternal::m_root.
|
||||
wxGtkTreeModelNode *m_parent;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user