| 385 | } |
| 386 | |
| 387 | BOOL FindProperty(IProperty* prop, int& iItem, int& iSubItem) const |
| 388 | { |
| 389 | // Looks up the item index based on the property class. |
| 390 | // The property class may be a subitem, so we need to scan ALL properties. |
| 391 | ATLASSERT(prop); |
| 392 | // Hmm, this would be an awfully slooow method! |
| 393 | // So most of the time we're really searching for the in-place editor... |
| 394 | if( m_iInplaceRow != -1 ) { |
| 395 | IProperty** props = reinterpret_cast<IProperty**>(TBase::GetItemData(m_iInplaceRow)); |
| 396 | if( props != NULL ) { |
| 397 | for( int i = 0; i < m_nColumns; i++ ) { |
| 398 | if( props[i] == prop ) { |
| 399 | iItem = m_iInplaceRow; |
| 400 | iSubItem = i; |
| 401 | return TRUE; |
| 402 | } |
| 403 | } |
| 404 | } |
| 405 | } |
| 406 | // Ok, scan all items... |
| 407 | iItem = GetNextItem(-1, LVNI_ALL); |
| 408 | while( iItem != -1 ) { |
| 409 | IProperty** props = reinterpret_cast<IProperty**>(TBase::GetItemData(iItem)); |
| 410 | for( int i = 0; i < m_nColumns; i++ ) { |
| 411 | if( props[i] == prop ) { |
| 412 | iSubItem = i; |
| 413 | return TRUE; |
| 414 | } |
| 415 | } |
| 416 | iItem = GetNextItem(iItem, LVNI_ALL); |
| 417 | } |
| 418 | return FALSE; |
| 419 | } |
| 420 | |
| 421 | IProperty* GetProperty(int iRow, int iCol) const |
| 422 | { |
no test coverage detected