| 1706 | //----------------------------------------------------------------------------- |
| 1707 | |
| 1708 | void GuiEditCtrl::selectParents( bool addToSelection ) |
| 1709 | { |
| 1710 | Vector< GuiControl* > parents; |
| 1711 | |
| 1712 | // Collect all parents. |
| 1713 | |
| 1714 | for( U32 i = 0; i < mSelectedControls.size(); ++ i ) |
| 1715 | { |
| 1716 | GuiControl* ctrl = mSelectedControls[ i ]; |
| 1717 | if( ctrl != mContentControl && ctrl->getParent() != mContentControl ) |
| 1718 | parents.push_back( mSelectedControls[ i ]->getParent() ); |
| 1719 | } |
| 1720 | |
| 1721 | // If there's no parents to select, don't |
| 1722 | // change the selection. |
| 1723 | |
| 1724 | if( parents.empty() ) |
| 1725 | return; |
| 1726 | |
| 1727 | // Blast selection if need be. |
| 1728 | |
| 1729 | if( !addToSelection ) |
| 1730 | clearSelection(); |
| 1731 | |
| 1732 | // Add the parents. |
| 1733 | |
| 1734 | for( U32 i = 0; i < parents.size(); ++ i ) |
| 1735 | addSelection( parents[ i ] ); |
| 1736 | } |
| 1737 | |
| 1738 | //----------------------------------------------------------------------------- |
| 1739 |
no test coverage detected