diff options
author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-02-20 23:46:23 +0100 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-02-21 03:00:25 +0200 |
commit | a5261a5fa8fad810ecb5c260d92c3e771822bf58 (patch) | |
tree | d9e9cda2137f01538f7ac98ce5e8dfa10980eaac /indra/llui/llscrolllistctrl.cpp | |
parent | 8c16ec2b53153a10f40181e0e8108d24331451d4 (diff) |
Convert BOOL to bool in llui
Diffstat (limited to 'indra/llui/llscrolllistctrl.cpp')
-rw-r--r-- | indra/llui/llscrolllistctrl.cpp | 226 |
1 files changed, 113 insertions, 113 deletions
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 56873ec11a..251ac46e2f 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -66,7 +66,7 @@ static LLDefaultChildRegistry::Register<LLScrollListCtrl> r("scroll_list"); // local structures & classes. struct SortScrollListItem { - SortScrollListItem(const std::vector<std::pair<S32, BOOL> >& sort_orders,const LLScrollListCtrl::sort_signal_t* sort_signal, bool alternate_sort) + SortScrollListItem(const std::vector<std::pair<S32, bool> >& sort_orders,const LLScrollListCtrl::sort_signal_t* sort_signal, bool alternate_sort) : mSortOrders(sort_orders) , mSortSignal(sort_signal) , mAltSort(alternate_sort) @@ -80,7 +80,7 @@ struct SortScrollListItem it != mSortOrders.rend(); ++it) { S32 col_idx = it->first; - BOOL sort_ascending = it->second; + bool sort_ascending = it->second; S32 order = sort_ascending ? 1 : -1; // ascending or descending sort for this column? @@ -114,7 +114,7 @@ struct SortScrollListItem } - typedef std::vector<std::pair<S32, BOOL> > sort_order_t; + typedef std::vector<std::pair<S32, bool> > sort_order_t; const LLScrollListCtrl::sort_signal_t* mSortSignal; const sort_order_t& mSortOrders; const bool mAltSort; @@ -357,7 +357,7 @@ LLScrollListCtrl::~LLScrollListCtrl() } -BOOL LLScrollListCtrl::setMaxItemCount(S32 max_count) +bool LLScrollListCtrl::setMaxItemCount(S32 max_count) { if (max_count >= getItemCount()) { @@ -376,7 +376,7 @@ S32 LLScrollListCtrl::getItemCount() const return mItemList.size(); } -BOOL LLScrollListCtrl::hasSelectedItem() const +bool LLScrollListCtrl::hasSelectedItem() const { item_list::iterator iter; for (iter = mItemList.begin(); iter < mItemList.end(); ) @@ -384,11 +384,11 @@ BOOL LLScrollListCtrl::hasSelectedItem() const LLScrollListItem* itemp = *iter; if (itemp && itemp->getSelected()) { - return TRUE; + return true; } iter++; } - return FALSE; + return false; } // virtual LLScrolListInterface function (was deleteAllItems) @@ -523,7 +523,7 @@ LLScrollListItem* LLScrollListCtrl::getItem(const LLSD& sd) const } -void LLScrollListCtrl::reshape( S32 width, S32 height, BOOL called_from_parent ) +void LLScrollListCtrl::reshape( S32 width, S32 height, bool called_from_parent ) { LLUICtrl::reshape( width, height, called_from_parent ); @@ -551,7 +551,7 @@ void LLScrollListCtrl::updateLayout() // how many lines of content in a single "page" S32 page_lines = getLinesPerPage(); - BOOL scrollbar_visible = mLineHeight * getItemCount() > mItemListRect.getHeight(); + bool scrollbar_visible = mLineHeight * getItemCount() > mItemListRect.getHeight(); if (scrollbar_visible) { // provide space on the right for scrollbar @@ -593,9 +593,9 @@ LLRect LLScrollListCtrl::getRequiredRect() } -BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos, BOOL requires_column ) +bool LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos, bool requires_column ) { - BOOL not_too_big = getItemCount() < mMaxItemCount; + bool not_too_big = getItemCount() < mMaxItemCount; if (not_too_big) { switch( pos ) @@ -851,12 +851,12 @@ void LLScrollListCtrl::setPageLines(S32 new_page_lines) updateLayout(); } -BOOL LLScrollListCtrl::selectFirstItem() +bool LLScrollListCtrl::selectFirstItem() { - BOOL success = FALSE; + bool success = false; // our $%&@#$()^%#$()*^ iterators don't let us check against the first item inside out iteration - BOOL first_item = TRUE; + bool first_item = true; item_list::iterator iter; for (iter = mItemList.begin(); iter != mItemList.end(); iter++) @@ -876,7 +876,7 @@ BOOL LLScrollListCtrl::selectFirstItem() selectItem(itemp, -1); } } - success = TRUE; + success = true; mOriginalSelection = 0; } else @@ -894,17 +894,17 @@ BOOL LLScrollListCtrl::selectFirstItem() // Deselects all other items // virtual -BOOL LLScrollListCtrl::selectNthItem( S32 target_index ) +bool LLScrollListCtrl::selectNthItem( S32 target_index ) { return selectItemRange(target_index, target_index); } // virtual -BOOL LLScrollListCtrl::selectItemRange( S32 first_index, S32 last_index ) +bool LLScrollListCtrl::selectItemRange( S32 first_index, S32 last_index ) { if (mItemList.empty()) { - return FALSE; + return false; } // make sure sort is up to date @@ -918,7 +918,7 @@ BOOL LLScrollListCtrl::selectItemRange( S32 first_index, S32 last_index ) else last_index = llclamp(last_index, first_index, listlen-1); - BOOL success = FALSE; + bool success = false; S32 index = 0; for (item_list::iterator iter = mItemList.begin(); iter != mItemList.end(); ) { @@ -934,8 +934,8 @@ BOOL LLScrollListCtrl::selectItemRange( S32 first_index, S32 last_index ) if( itemp->getEnabled() ) { // TODO: support range selection for cells - selectItem(itemp, -1, FALSE); - success = TRUE; + selectItem(itemp, -1, false); + success = true; } } else @@ -1083,7 +1083,7 @@ S32 LLScrollListCtrl::selectMultiple( uuid_vec_t ids ) if (item->getEnabled() && (item->getUUID() == (*iditr))) { // TODO: support multiple selection for cells - selectItem(item, -1, FALSE); + selectItem(item, -1, false); ++count; break; } @@ -1134,7 +1134,7 @@ S32 LLScrollListCtrl::getItemIndex( const LLUUID& target_id ) const return -1; } -void LLScrollListCtrl::selectPrevItem( BOOL extend_selection) +void LLScrollListCtrl::selectPrevItem( bool extend_selection) { LLScrollListItem* prev_item = NULL; @@ -1179,7 +1179,7 @@ void LLScrollListCtrl::selectPrevItem( BOOL extend_selection) } -void LLScrollListCtrl::selectNextItem( BOOL extend_selection) +void LLScrollListCtrl::selectNextItem( bool extend_selection) { LLScrollListItem* next_item = NULL; @@ -1224,7 +1224,7 @@ void LLScrollListCtrl::selectNextItem( BOOL extend_selection) -void LLScrollListCtrl::deselectAllItems(BOOL no_commit_on_change) +void LLScrollListCtrl::deselectAllItems(bool no_commit_on_change) { item_list::iterator iter; for (iter = mItemList.begin(); iter != mItemList.end(); iter++) @@ -1263,9 +1263,9 @@ LLScrollListItem* LLScrollListCtrl::addSeparator(EAddPosition pos) // Selects first enabled item of the given name. // Returns false if item not found. // Calls getItemByLabel in order to combine functionality -BOOL LLScrollListCtrl::selectItemByLabel(const std::string& label, BOOL case_sensitive, S32 column/* = 0*/) +bool LLScrollListCtrl::selectItemByLabel(const std::string& label, bool case_sensitive, S32 column/* = 0*/) { - deselectAllItems(TRUE); // ensure that no stale items are selected, even if we don't find a match + deselectAllItems(true); // ensure that no stale items are selected, even if we don't find a match LLScrollListItem* item = getItemByLabel(label, case_sensitive, column); bool found = NULL != item; @@ -1282,7 +1282,7 @@ BOOL LLScrollListCtrl::selectItemByLabel(const std::string& label, BOOL case_sen return found; } -LLScrollListItem* LLScrollListCtrl::getItemByLabel(const std::string& label, BOOL case_sensitive, S32 column) +LLScrollListItem* LLScrollListCtrl::getItemByLabel(const std::string& label, bool case_sensitive, S32 column) { if (label.empty()) //RN: assume no empty items { @@ -1313,16 +1313,16 @@ LLScrollListItem* LLScrollListCtrl::getItemByLabel(const std::string& label, BOO } -BOOL LLScrollListCtrl::selectItemByPrefix(const std::string& target, BOOL case_sensitive, S32 column) +bool LLScrollListCtrl::selectItemByPrefix(const std::string& target, bool case_sensitive, S32 column) { return selectItemByPrefix(utf8str_to_wstring(target), case_sensitive, column); } // Selects first enabled item that has a name where the name's first part matched the target string. // Returns false if item not found. -BOOL LLScrollListCtrl::selectItemByPrefix(const LLWString& target, BOOL case_sensitive, S32 column) +bool LLScrollListCtrl::selectItemByPrefix(const LLWString& target, bool case_sensitive, S32 column) { - BOOL found = FALSE; + bool found = false; LLWString target_trimmed( target ); S32 target_len = target_trimmed.size(); @@ -1336,11 +1336,11 @@ BOOL LLScrollListCtrl::selectItemByPrefix(const LLWString& target, BOOL case_sen LLScrollListItem* item = *iter; // Only select enabled items with matching names LLScrollListCell* cellp = item->getColumn(column == -1 ? getSearchColumn() : column); - BOOL select = cellp ? item->getEnabled() && ('\0' == cellp->getValue().asString()[0]) : FALSE; + bool select = cellp ? item->getEnabled() && ('\0' == cellp->getValue().asString()[0]) : false; if (select) { selectItem(item, -1); - found = TRUE; + found = true; break; } } @@ -1372,7 +1372,7 @@ BOOL LLScrollListCtrl::selectItemByPrefix(const LLWString& target, BOOL case_sen LLWString trimmed_label = item_label; LLWStringUtil::trim(trimmed_label); - BOOL select = item->getEnabled() && trimmed_label.compare(0, target_trimmed.size(), target_trimmed) == 0; + bool select = item->getEnabled() && trimmed_label.compare(0, target_trimmed.size(), target_trimmed) == 0; if (select) { @@ -1380,7 +1380,7 @@ BOOL LLScrollListCtrl::selectItemByPrefix(const LLWString& target, BOOL case_sen S32 offset = item_label.find(target_trimmed); cellp->highlightText(offset, target_trimmed.size()); selectItem(item, -1); - found = TRUE; + found = true; break; } } @@ -1413,7 +1413,7 @@ U32 LLScrollListCtrl::searchItems(const LLWString& substring, bool case_sensitiv } else { - deselectAllItems(TRUE); + deselectAllItems(true); if (!case_sensitive) { // do comparisons in lower case @@ -1447,7 +1447,7 @@ U32 LLScrollListCtrl::searchItems(const LLWString& substring, bool case_sensitiv { // find offset of matching text cellp->highlightText(found_iter, substring_trimmed.size()); - selectItem(item, -1, FALSE); + selectItem(item, -1, false); found++; @@ -1489,7 +1489,7 @@ const std::string LLScrollListCtrl::getSelectedItemLabel(S32 column) const // "StringUUID" interface: use this when you're creating a list that contains non-unique strings each of which // has an associated, unique UUID, and only one of which can be selected at a time. -LLScrollListItem* LLScrollListCtrl::addStringUUIDItem(const std::string& item_text, const LLUUID& id, EAddPosition pos, BOOL enabled) +LLScrollListItem* LLScrollListCtrl::addStringUUIDItem(const std::string& item_text, const LLUUID& id, EAddPosition pos, bool enabled) { if (getItemCount() < mMaxItemCount) { @@ -1504,16 +1504,16 @@ LLScrollListItem* LLScrollListCtrl::addStringUUIDItem(const std::string& item_te } // Select the line or lines that match this UUID -BOOL LLScrollListCtrl::selectByID( const LLUUID& id ) +bool LLScrollListCtrl::selectByID( const LLUUID& id ) { return selectByValue( LLSD(id) ); } -BOOL LLScrollListCtrl::setSelectedByValue(const LLSD& value, BOOL selected) +bool LLScrollListCtrl::setSelectedByValue(const LLSD& value, bool selected) { - BOOL found = FALSE; + bool found = false; - if (selected && !mAllowMultipleSelection) deselectAllItems(TRUE); + if (selected && !mAllowMultipleSelection) deselectAllItems(true); item_list::iterator iter; for (iter = mItemList.begin(); iter != mItemList.end(); iter++) @@ -1527,12 +1527,12 @@ BOOL LLScrollListCtrl::setSelectedByValue(const LLSD& value, BOOL selected) { LLSD::Binary data1 = value.asBinary(); LLSD::Binary data2 = item->getValue().asBinary(); - found = std::equal(data1.begin(), data1.end(), data2.begin()) ? TRUE : FALSE; + found = std::equal(data1.begin(), data1.end(), data2.begin()) ? true : false; } } else { - found = item->getValue().asString() == value.asString() ? TRUE : FALSE; + found = item->getValue().asString() == value.asString() ? true : false; } if (found) @@ -1558,7 +1558,7 @@ BOOL LLScrollListCtrl::setSelectedByValue(const LLSD& value, BOOL selected) return found; } -BOOL LLScrollListCtrl::isSelected(const LLSD& value) const +bool LLScrollListCtrl::isSelected(const LLSD& value) const { item_list::const_iterator iter; for (iter = mItemList.begin(); iter != mItemList.end(); iter++) @@ -1569,7 +1569,7 @@ BOOL LLScrollListCtrl::isSelected(const LLSD& value) const return item->getSelected(); } } - return FALSE; + return false; } LLUUID LLScrollListCtrl::getStringUUIDSelectedItem() const @@ -1736,7 +1736,7 @@ void LLScrollListCtrl::draw() LLUICtrl::draw(); } -void LLScrollListCtrl::setEnabled(BOOL enabled) +void LLScrollListCtrl::setEnabled(bool enabled) { mCanSelect = enabled; setTabStop(enabled); @@ -1828,11 +1828,11 @@ bool LLScrollListCtrl::handleToolTip(S32 x, S32 y, MASK mask) return handled; } -BOOL LLScrollListCtrl::selectItemAt(S32 x, S32 y, MASK mask) +bool LLScrollListCtrl::selectItemAt(S32 x, S32 y, MASK mask) { - if (!mCanSelect) return FALSE; + if (!mCanSelect) return false; - BOOL selection_changed = FALSE; + bool selection_changed = false; LLScrollListItem* hit_item = hitItem(x, y); @@ -1868,17 +1868,17 @@ BOOL LLScrollListCtrl::selectItemAt(S32 x, S32 y, MASK mask) LLScrollListItem *item = *itor; if (item == hit_item || item == lastSelected) { - selectItem(item, getColumnIndexFromOffset(x), FALSE); + selectItem(item, getColumnIndexFromOffset(x), false); selecting = !selecting; if (hit_item == lastSelected) { // stop selecting now, since we just clicked on our last selected item - selecting = FALSE; + selecting = false; } } if (selecting) { - selectItem(item, getColumnIndexFromOffset(x), FALSE); + selectItem(item, getColumnIndexFromOffset(x), false); } } } @@ -1893,7 +1893,7 @@ BOOL LLScrollListCtrl::selectItemAt(S32 x, S32 y, MASK mask) { if(!(mMaxSelectable > 0 && getAllSelected().size() >= mMaxSelectable)) { - selectItem(hit_item, getColumnIndexFromOffset(x), FALSE); + selectItem(hit_item, getColumnIndexFromOffset(x), false); } else { @@ -1906,7 +1906,7 @@ BOOL LLScrollListCtrl::selectItemAt(S32 x, S32 y, MASK mask) } else { - deselectAllItems(TRUE); + deselectAllItems(true); selectItem(hit_item, getColumnIndexFromOffset(x)); } } @@ -1927,7 +1927,7 @@ BOOL LLScrollListCtrl::selectItemAt(S32 x, S32 y, MASK mask) else { //mLastSelected = NULL; - //deselectAllItems(TRUE); + //deselectAllItems(true); } return selection_changed; @@ -1949,7 +1949,7 @@ bool LLScrollListCtrl::handleMouseDown(S32 x, S32 y, MASK mask) handleClick(x, y, mask); } - return TRUE; + return true; } bool LLScrollListCtrl::handleMouseUp(S32 x, S32 y, MASK mask) @@ -2030,7 +2030,7 @@ bool LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) menu->show(x, y); LLMenuGL::showPopup(this, menu, x, y); - return TRUE; + return true; } } return LLUICtrl::handleRightMouseDown(x, y, mask); @@ -2110,7 +2110,7 @@ void LLScrollListCtrl::copySLURLToClipboard(std::string id, bool is_group) bool LLScrollListCtrl::handleDoubleClick(S32 x, S32 y, MASK mask) { - //BOOL handled = FALSE; + //bool handled = false; bool handled = handleClick(x, y, mask); if (!handled) @@ -2130,16 +2130,16 @@ bool LLScrollListCtrl::handleDoubleClick(S32 x, S32 y, MASK mask) return true; } -BOOL LLScrollListCtrl::handleClick(S32 x, S32 y, MASK mask) +bool LLScrollListCtrl::handleClick(S32 x, S32 y, MASK mask) { // which row was clicked on? LLScrollListItem* hit_item = hitItem(x, y); - if (!hit_item) return FALSE; + if (!hit_item) return false; // get appropriate cell from that row S32 column_index = getColumnIndexFromOffset(x); LLScrollListCell* hit_cell = hit_item->getColumn(column_index); - if (!hit_cell) return FALSE; + if (!hit_cell) return false; // if cell handled click directly (i.e. clicked on an embedded checkbox) if (hit_cell->handleClick()) @@ -2175,7 +2175,7 @@ BOOL LLScrollListCtrl::handleClick(S32 x, S32 y, MASK mask) onCommit(); } // eat click (e.g. do not trigger double click callback) - return TRUE; + return true; } else { @@ -2184,7 +2184,7 @@ BOOL LLScrollListCtrl::handleClick(S32 x, S32 y, MASK mask) gFocusMgr.setMouseCapture(this); mNeedsScroll = true; // do not eat click (allow double click callback) - return FALSE; + return false; } } @@ -2337,9 +2337,9 @@ void LLScrollListCtrl::onMouseLeave(S32 x, S32 y, MASK mask) mouseOverHighlightNthItem(-1); } -BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) +bool LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) { - BOOL handled = FALSE; + bool handled = false; // not called from parent means we have keyboard focus or a child does if (mCanSelect) @@ -2352,18 +2352,18 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) if (mAllowKeyboardMovement || hasFocus()) { // commit implicit in call - selectPrevItem(FALSE); + selectPrevItem(false); mNeedsScroll = true; - handled = TRUE; + handled = true; } break; case KEY_DOWN: if (mAllowKeyboardMovement || hasFocus()) { // commit implicit in call - selectNextItem(FALSE); + selectNextItem(false); mNeedsScroll = true; - handled = TRUE; + handled = true; } break; case KEY_LEFT: @@ -2388,7 +2388,7 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) break; } item->setSelectedCell(cell); - handled = TRUE; + handled = true; } } break; @@ -2414,7 +2414,7 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) break; } item->setSelectedCell(cell); - handled = TRUE; + handled = true; } } break; @@ -2428,7 +2428,7 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) { onCommit(); } - handled = TRUE; + handled = true; } break; case KEY_PAGE_DOWN: @@ -2441,7 +2441,7 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) { onCommit(); } - handled = TRUE; + handled = true; } break; case KEY_HOME: @@ -2454,7 +2454,7 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) { onCommit(); } - handled = TRUE; + handled = true; } break; case KEY_END: @@ -2467,7 +2467,7 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) { onCommit(); } - handled = TRUE; + handled = true; } break; case KEY_RETURN: @@ -2478,7 +2478,7 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) { onCommit(); mSearchString.clear(); - handled = TRUE; + handled = true; } break; case KEY_BACKSPACE: @@ -2498,7 +2498,7 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) } } } - else if (selectItemByPrefix(wstring_to_utf8str(mSearchString), FALSE)) + else if (selectItemByPrefix(wstring_to_utf8str(mSearchString), false)) { mNeedsScroll = true; // update search string only on successful match @@ -2618,11 +2618,11 @@ void LLScrollListCtrl::reportInvalidInput() make_ui_sound("UISndBadKeystroke"); } -BOOL LLScrollListCtrl::isRepeatedChars(const LLWString& string) const +bool LLScrollListCtrl::isRepeatedChars(const LLWString& string) const { if (string.empty()) { - return FALSE; + return false; } llwchar first_char = string[0]; @@ -2631,14 +2631,14 @@ BOOL LLScrollListCtrl::isRepeatedChars(const LLWString& string) const { if (string[i] != first_char) { - return FALSE; + return false; } } - return TRUE; + return true; } -void LLScrollListCtrl::selectItem(LLScrollListItem* itemp, S32 cell, BOOL select_single_item) +void LLScrollListCtrl::selectItem(LLScrollListItem* itemp, S32 cell, bool select_single_item) { if (!itemp) return; @@ -2654,9 +2654,9 @@ void LLScrollListCtrl::selectItem(LLScrollListItem* itemp, S32 cell, BOOL select } if (select_single_item) { - deselectAllItems(TRUE); + deselectAllItems(true); } - itemp->setSelected(TRUE); + itemp->setSelected(true); switch (mSelectionType) { case CELL: @@ -2685,7 +2685,7 @@ void LLScrollListCtrl::deselectItem(LLScrollListItem* itemp) mLastSelected = NULL; } - itemp->setSelected(FALSE); + itemp->setSelected(false); LLScrollListCell* cellp = itemp->getColumn(getSearchColumn()); if (cellp) { @@ -2700,7 +2700,7 @@ void LLScrollListCtrl::commitIfChanged() if (mSelectionChanged) { mDirty = true; - mSelectionChanged = FALSE; + mSelectionChanged = false; onCommit(); } } @@ -2710,13 +2710,13 @@ struct SameSortColumn SameSortColumn(S32 column) : mColumn(column) {} S32 mColumn; - bool operator()(std::pair<S32, BOOL> sort_column) { return sort_column.first == mColumn; } + bool operator()(std::pair<S32, bool> sort_column) { return sort_column.first == mColumn; } }; -BOOL LLScrollListCtrl::setSort(S32 column_idx, BOOL ascending) +bool LLScrollListCtrl::setSort(S32 column_idx, bool ascending) { LLScrollListColumn* sort_column = getColumn(column_idx); - if (!sort_column) return FALSE; + if (!sort_column) return false; sort_column->mSortDirection = ascending ? LLScrollListColumn::ASCENDING : LLScrollListColumn::DESCENDING; @@ -2727,7 +2727,7 @@ BOOL LLScrollListCtrl::setSort(S32 column_idx, BOOL ascending) if (mSortColumns.empty()) { mSortColumns.push_back(new_sort_column); - return TRUE; + return true; } else { @@ -2765,7 +2765,7 @@ void LLScrollListCtrl::onScrollChange( S32 new_pos, LLScrollbar* scrollbar ) } -void LLScrollListCtrl::sortByColumn(const std::string& name, BOOL ascending) +void LLScrollListCtrl::sortByColumn(const std::string& name, bool ascending) { column_map_t::iterator itor = mColumns.find(name); if (itor != mColumns.end()) @@ -2775,7 +2775,7 @@ void LLScrollListCtrl::sortByColumn(const std::string& name, BOOL ascending) } // First column is column 0 -void LLScrollListCtrl::sortByColumnIndex(U32 column, BOOL ascending) +void LLScrollListCtrl::sortByColumnIndex(U32 column, bool ascending) { setSort(column, ascending); updateSort(); @@ -2796,9 +2796,9 @@ void LLScrollListCtrl::updateSort() const } // for one-shot sorts, does not save sort column/order -void LLScrollListCtrl::sortOnce(S32 column, BOOL ascending) +void LLScrollListCtrl::sortOnce(S32 column, bool ascending) { - std::vector<std::pair<S32, BOOL> > sort_column; + std::vector<std::pair<S32, bool> > sort_column; sort_column.push_back(std::make_pair(column, ascending)); // do stable sort to preserve any previous sorts @@ -2901,7 +2901,7 @@ void LLScrollListCtrl::copy() } // virtual -BOOL LLScrollListCtrl::canCopy() const +bool LLScrollListCtrl::canCopy() const { return (getFirstSelected() != NULL); } @@ -2914,7 +2914,7 @@ void LLScrollListCtrl::cut() } // virtual -BOOL LLScrollListCtrl::canCut() const +bool LLScrollListCtrl::canCut() const { return canCopy() && canDoDelete(); } @@ -2929,7 +2929,7 @@ void LLScrollListCtrl::selectAll() LLScrollListItem *itemp = *iter; if( itemp->getEnabled() ) { - selectItem(itemp, -1, FALSE); + selectItem(itemp, -1, false); } } @@ -2940,7 +2940,7 @@ void LLScrollListCtrl::selectAll() } // virtual -BOOL LLScrollListCtrl::canSelectAll() const +bool LLScrollListCtrl::canSelectAll() const { return getCanSelect() && mAllowMultipleSelection && !(mMaxSelectable > 0 && mItemList.size() > mMaxSelectable); } @@ -2952,7 +2952,7 @@ void LLScrollListCtrl::deselect() } // virtual -BOOL LLScrollListCtrl::canDeselect() const +bool LLScrollListCtrl::canDeselect() const { return getCanSelect(); } @@ -3093,7 +3093,7 @@ std::string LLScrollListCtrl::getSortColumnName() else return ""; } -BOOL LLScrollListCtrl::hasSortOrder() const +bool LLScrollListCtrl::hasSortOrder() const { return !mSortColumns.empty(); } @@ -3230,7 +3230,7 @@ LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLS && cell->isText() && !cell->getValue().asString().empty()) { - columnp->mHeader->setHasResizableElement(TRUE); + columnp->mHeader->setHasResizableElement(true); } } @@ -3258,7 +3258,7 @@ LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLS && cell->isText() && !cell->getValue().asString().empty()) { - columnp->mHeader->setHasResizableElement(TRUE); + columnp->mHeader->setHasResizableElement(true); } } } @@ -3315,26 +3315,26 @@ LLSD LLScrollListCtrl::getValue() const return item->getValue(); } -BOOL LLScrollListCtrl::operateOnSelection(EOperation op) +bool LLScrollListCtrl::operateOnSelection(EOperation op) { if (op == OP_DELETE) { deleteSelectedItems(); - return TRUE; + return true; } else if (op == OP_DESELECT) { deselectAllItems(); } - return FALSE; + return false; } -BOOL LLScrollListCtrl::operateOnAll(EOperation op) +bool LLScrollListCtrl::operateOnAll(EOperation op) { if (op == OP_DELETE) { clearRows(); - return TRUE; + return true; } else if (op == OP_DESELECT) { @@ -3344,10 +3344,10 @@ BOOL LLScrollListCtrl::operateOnAll(EOperation op) { selectAll(); } - return FALSE; + return false; } //virtual -void LLScrollListCtrl::setFocus(BOOL b) +void LLScrollListCtrl::setFocus(bool b) { // for tabbing into pristine scroll lists (Finder) if (!getFirstSelected()) @@ -3360,9 +3360,9 @@ void LLScrollListCtrl::setFocus(BOOL b) // virtual -BOOL LLScrollListCtrl::isDirty() const +bool LLScrollListCtrl::isDirty() const { - BOOL grubby = mDirty; + bool grubby = mDirty; if ( !mAllowMultipleSelection ) { grubby = (mOriginalSelection != getFirstSelectedIndex()); @@ -3373,7 +3373,7 @@ BOOL LLScrollListCtrl::isDirty() const // Clear dirty state void LLScrollListCtrl::resetDirty() { - mDirty = FALSE; + mDirty = false; mOriginalSelection = getFirstSelectedIndex(); } |