Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » ItemHide causing crashes again in 2.84 Collapse All
Subject Author Date
Offer Har Dec 22, 2008 - 8:39 AM

Hi,


There was a bu you fixed in this thread:


http://www.prof-uis.com/prof-uis/tech-support/support-forum/is-there-any-chance-i-will-get-an-answer-to-the-bugs-i-report-61545.aspx#@lt;/p>

I see it re-appear in 2.84.


I compare the methods you sent then and in 2.84, and there is a difference - these two lines are missing in the 2.84 implementaion:



          ULONG nVisibleContentWeight = pNode->_ContentWeight_CalcVisible();
          m_arrGridVis.RemoveAt( nVisibleOffset + nAdjustOffset, nVisibleContentWeight );

Please check, as I think this is the source of the problem,


Thanks,


Ron.

Technical Support Dec 24, 2008 - 8:04 AM

Thank you for reporting a very interesting and complicated issue. To fix it, please update the source code for the following methods:

void CExtTreeGridCellNode::_ContentWeight_IncrementNonExpanded(
      ULONG nWeight
      )
{
      ASSERT_VALID( this );
      ASSERT( m_nContentWeightExpanded <= m_nContentWeightAll );
      m_nContentWeightAll += nWeight;
CExtTreeGridCellNode * pNodeParent = TreeNodeGetParent();
      if( pNodeParent != NULL )
            pNodeParent->_ContentWeight_IncrementNonExpanded( nWeight );
}

void CExtTreeGridCellNode::TreeNodeHiddenSet(
      CExtTreeGridDataProvider & _DP,
      bool bHide
      )
{
      ASSERT_VALID( this );
      ASSERT_VALID( (&_DP) );
      ASSERT_KINDOF( CExtTreeGridDataProvider, (&_DP) );
bool bHidden = TreeNodeHiddenGet();
      if( ( bHidden && bHide ) || ( (!bHidden) && (!bHide) ) )
            return;
      if( bHide )
      {
            if( TreeNodeIsDisplayed() )
            {
                  ULONG nOffset = TreeNodeCalcOffset( true, false );
                  if( nOffset != ULONG(-1L) )
                  {
                        ASSERT( _DP.m_arrGridVis[ nOffset ] == this );
                        INT nCountToRemove = _ContentWeight_Get( true );
                        _DP.m_arrGridVis.RemoveAt( nOffset, nCountToRemove + 1 );
                        CExtTreeGridCellNode * pNodeParent = TreeNodeGetParent();
                        if( pNodeParent != NULL )
                        {
                              ASSERT_VALID( pNodeParent );
                              pNodeParent->_ContentWeight_Decrement( nCountToRemove + 1, true );
                        }
                  }
            }
            ModifyStyleEx( __EGCS_EX_HIDDEN_TREE_NODE, 0 );
      } // if( bHide )
      else
      {
            ModifyStyleEx( 0, __EGCS_EX_HIDDEN_TREE_NODE );
            if( TreeNodeIsDisplayed() )
            {
                  ULONG nOffset = TreeNodeCalcOffset( true, false );
                  if( nOffset != ULONG(-1L) )
                  {
                        m_nContentWeightAll = ULONG( m_arrChildren.GetSize() );
                        INT nCountToInsert = _ContentWeight_CalcVisible();
                        _DP.m_arrGridVis.InsertAt( nOffset, NULL, nCountToInsert + 1 );
                        _DP.m_arrGridVis.SetAt( nOffset, this );
                        nOffset ++;
                        _Content_FillVisibleArray( _DP.m_arrGridVis, nOffset );
                        CExtTreeGridCellNode * pNodeParent = TreeNodeGetParent();
                        if( pNodeParent != NULL )
                        {
                              ASSERT_VALID( pNodeParent );
                              pNodeParent->_ContentWeight_Increment( nCountToInsert + 1, true );
                        }
                  }
            }
      } // else from if( bHide )
}

Offer Har Dec 24, 2008 - 2:29 PM

Thanks!

Offer Har Dec 22, 2008 - 10:08 AM

I am sending you a sample application that reproduces the bug via mail.