diff options
author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2024-05-06 16:52:34 +0200 |
---|---|---|
committer | Guru <alexandrgproductengine@lindenlab.com> | 2024-05-07 10:18:51 +0200 |
commit | f9473e8afcb624cc1b101195bf15943ec372b56f (patch) | |
tree | 27a9f85fa0ca8c9dd2138a5522e7a7970a063941 /indra/llui | |
parent | 15d4db0b5d52097de33ea036b8a1a4b7f5384e3f (diff) |
secondlife/viewer#1333 BOOL to bool conversion leftovers: ternaries
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llaccordionctrl.cpp | 12 | ||||
-rw-r--r-- | indra/llui/llaccordionctrltab.cpp | 4 | ||||
-rw-r--r-- | indra/llui/llfloaterreg.cpp | 10 | ||||
-rw-r--r-- | indra/llui/llfolderviewitem.cpp | 12 | ||||
-rw-r--r-- | indra/llui/lllayoutstack.cpp | 8 | ||||
-rw-r--r-- | indra/llui/lllineeditor.cpp | 12 | ||||
-rw-r--r-- | indra/llui/llmenugl.cpp | 6 | ||||
-rw-r--r-- | indra/llui/llradiogroup.cpp | 2 | ||||
-rw-r--r-- | indra/llui/llscrolllistctrl.cpp | 4 | ||||
-rw-r--r-- | indra/llui/lltexteditor.cpp | 2 | ||||
-rw-r--r-- | indra/llui/lltoolbar.cpp | 18 | ||||
-rw-r--r-- | indra/llui/llurlentry.cpp | 2 | ||||
-rw-r--r-- | indra/llui/llview.cpp | 4 | ||||
-rw-r--r-- | indra/llui/llxuiparser.cpp | 2 |
14 files changed, 49 insertions, 49 deletions
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index d88e1a1f11..f075aa564e 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -265,7 +265,7 @@ void LLAccordionCtrl::showScrollbar(S32 width, S32 height) void LLAccordionCtrl::hideScrollbar(S32 width, S32 height) { - if (mScrollbar->getVisible() == false) + if (!mScrollbar->getVisible()) return; mScrollbar->setVisible(false); @@ -391,7 +391,7 @@ void LLAccordionCtrl::updateNoTabsHelpTextVisibility() } } - mNoVisibleTabsHelpText->setVisible(visible_exists ? false : true); + mNoVisibleTabsHelpText->setVisible(!visible_exists); } void LLAccordionCtrl::arrangeSingle() @@ -407,7 +407,7 @@ void LLAccordionCtrl::arrangeSingle() { LLAccordionCtrlTab* accordion_tab = dynamic_cast<LLAccordionCtrlTab*>(mAccordionTabs[i]); - if (accordion_tab->getVisible() == false) // Skip hidden accordion tabs + if (!accordion_tab->getVisible()) // Skip hidden accordion tabs continue; if (!accordion_tab->isExpanded() ) { @@ -421,7 +421,7 @@ void LLAccordionCtrl::arrangeSingle() { LLAccordionCtrlTab* accordion_tab = dynamic_cast<LLAccordionCtrlTab*>(mAccordionTabs[i]); - if (accordion_tab->getVisible() == false) // Skip hidden accordion tabs + if (!accordion_tab->getVisible()) // Skip hidden accordion tabs continue; if (!accordion_tab->isExpanded() ) { @@ -469,7 +469,7 @@ void LLAccordionCtrl::arrangeMultiple() { LLAccordionCtrlTab* accordion_tab = dynamic_cast<LLAccordionCtrlTab*>(mAccordionTabs[i]); - if (accordion_tab->getVisible() == false) // Skip hidden accordion tabs + if (!accordion_tab->getVisible()) // Skip hidden accordion tabs continue; if (!accordion_tab->isExpanded() ) @@ -624,7 +624,7 @@ bool LLAccordionCtrl::autoScroll(S32 x, S32 y) } } - return scrolling ? true : false; + return scrolling; } void LLAccordionCtrl::updateLayout(S32 width, S32 height) diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index c8f75a1af2..5945c31407 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -643,7 +643,7 @@ void LLAccordionCtrlTab::setHeaderVisible(bool value) if (mHeader) { - mHeader->setVisible(value ? true : false); + mHeader->setVisible(value); } reshape(getRect().getWidth(), getRect().getHeight(), false); @@ -992,7 +992,7 @@ void LLAccordionCtrlTab::hideScrollbar(const LLRect& child_rect) if (!mContainerPanel || !mScrollbar) return; - if (mScrollbar->getVisible() == false) + if (!mScrollbar->getVisible()) return; mScrollbar->setVisible(false); diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index d87e4ce70f..1c3efaa9cf 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -281,15 +281,15 @@ bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key) bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key) { LLFloater* instance = findInstance(name, key); - if (LLFloater::isShown(instance)) + if (instance && instance->isShown()) { instance->closeHostedFloater(); return false; } - else - { - return showInstance(name, key, true) ? true : false; - } + + instance = showInstance(name, key, true); + + return instance != nullptr; } //static diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index bcbc0f9970..311056f541 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -484,7 +484,7 @@ void LLFolderViewItem::deselectItem(void) void LLFolderViewItem::selectItem(void) { - if (mIsSelected == false) + if (!mIsSelected) { mIsSelected = true; getViewModelItem()->selectItem(); @@ -1582,7 +1582,8 @@ void LLFolderViewFolder::gatherChildRangeExclusive(LLFolderViewItem* start, LLFo void LLFolderViewFolder::extendSelectionTo(LLFolderViewItem* new_selection) { - if (getRoot()->getAllowMultiSelect() == false) return; + if (!getRoot()->getAllowMultiSelect()) + return; LLFolderViewItem* cur_selected_item = getRoot()->getCurSelectedItem(); if (cur_selected_item == NULL) @@ -1593,14 +1594,15 @@ void LLFolderViewFolder::extendSelectionTo(LLFolderViewItem* new_selection) bool reverse = false; LLFolderViewFolder* common_ancestor = getCommonAncestor(cur_selected_item, new_selection, reverse); - if (!common_ancestor) return; + if (!common_ancestor) + return; LLFolderViewItem* last_selected_item_from_cur = cur_selected_item; LLFolderViewFolder* cur_folder = cur_selected_item->getParentFolder(); std::vector<LLFolderViewItem*> items_to_select_forward; - while(cur_folder != common_ancestor) + while (cur_folder != common_ancestor) { cur_folder->gatherChildRangeExclusive(last_selected_item_from_cur, NULL, reverse, items_to_select_forward); @@ -1612,7 +1614,7 @@ void LLFolderViewFolder::extendSelectionTo(LLFolderViewItem* new_selection) LLFolderViewItem* last_selected_item_from_new = new_selection; cur_folder = new_selection->getParentFolder(); - while(cur_folder != common_ancestor) + while (cur_folder != common_ancestor) { cur_folder->gatherChildRangeExclusive(last_selected_item_from_new, NULL, !reverse, items_to_select_reverse); diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 7c834e0127..cf8cfa6ea6 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -136,7 +136,7 @@ S32 LLLayoutPanel::getVisibleDim() const * (min_dim + (((F32)mTargetDim - min_dim) * (1.f - mCollapseAmt)))); } - + void LLLayoutPanel::setOrientation( LLView::EOrientation orientation ) { mOrientation = orientation; @@ -144,9 +144,7 @@ void LLLayoutPanel::setOrientation( LLView::EOrientation orientation ) ? getRect().getWidth() : getRect().getHeight())); - if (mAutoResize == false - && mUserResize == true - && mMinDim == -1 ) + if (!mAutoResize && mUserResize && mMinDim == -1) { setMinDim(layout_dim); } @@ -170,7 +168,7 @@ void LLLayoutPanel::reshape( S32 width, S32 height, bool called_from_parent /*= { if (width == getRect().getWidth() && height == getRect().getHeight() && !LLView::sForceReshape) return; - if (!mIgnoreReshape && mAutoResize == false) + if (!mIgnoreReshape && !mAutoResize) { mTargetDim = (mOrientation == LLLayoutStack::HORIZONTAL) ? width : height; LLLayoutStack* stackp = dynamic_cast<LLLayoutStack*>(getParent()); diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 505216d0ff..8a04342af0 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -1473,11 +1473,11 @@ bool LLLineEditor::handleSpecialKey(KEY key, MASK mask) // handle ctrl-uparrow if we have a history enabled line editor. case KEY_UP: - if( mHaveHistory && ((mIgnoreArrowKeys == false) || ( MASK_CONTROL == mask )) ) + if (mHaveHistory && (!mIgnoreArrowKeys || (MASK_CONTROL == mask))) { - if( mCurrentHistoryLine > mLineHistory.begin() ) + if (mCurrentHistoryLine > mLineHistory.begin()) { - mText.assign( *(--mCurrentHistoryLine) ); + mText.assign(*(--mCurrentHistoryLine)); setCursorToEnd(); } else @@ -1490,9 +1490,9 @@ bool LLLineEditor::handleSpecialKey(KEY key, MASK mask) // handle [ctrl]-downarrow if we have a history enabled line editor case KEY_DOWN: - if( mHaveHistory && ((mIgnoreArrowKeys == false) || ( MASK_CONTROL == mask )) ) + if (mHaveHistory && (!mIgnoreArrowKeys || (MASK_CONTROL == mask))) { - if( !mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.end() - 1 ) + if (!mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.end() - 1) { mText.assign( *(++mCurrentHistoryLine) ); setCursorToEnd(); @@ -2684,7 +2684,7 @@ void LLLineEditor::showContextMenu(S32 x, S32 y) // If the cursor is on a misspelled word, retrieve suggestions for it std::string misspelled_word = getMisspelledWord(mCursorPos); - if ((is_misspelled = !misspelled_word.empty()) == true) + if ((is_misspelled = !misspelled_word.empty())) { LLSpellChecker::instance().getSuggestions(misspelled_word, mSuggestionList); } diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 25f32d9671..5dc92e555a 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -1188,16 +1188,16 @@ void LLMenuItemBranchGL::updateBranchParent(LLView* parentp) } } -void LLMenuItemBranchGL::onVisibilityChange( bool new_visibility ) +void LLMenuItemBranchGL::onVisibilityChange(bool new_visibility) { - if (new_visibility == false && getBranch() && !getBranch()->getTornOff()) + if (!new_visibility && getBranch() && !getBranch()->getTornOff()) { getBranch()->setVisible(false); } LLMenuItemGL::onVisibilityChange(new_visibility); } -bool LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask ) +bool LLMenuItemBranchGL::handleKeyHere(KEY key, MASK mask) { LLMenuGL* branch = getBranch(); if (!branch) diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index 04553e1f9f..2a45a8118e 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -138,7 +138,7 @@ void LLRadioGroup::setIndexEnabled(S32 index, bool enabled) if (count == index) { child->setEnabled(enabled); - if (index == mSelectedIndex && enabled == false) + if (index == mSelectedIndex && !enabled) { setSelectedIndex(-1); } diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index dbfacafd00..535a880120 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -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()); } } else { - found = item->getValue().asString() == value.asString() ? true : false; + found = item->getValue().asString() == value.asString(); } if (found) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 81eaec620c..438b3d96b1 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2202,7 +2202,7 @@ void LLTextEditor::showContextMenu(S32 x, S32 y) // If the cursor is on a misspelled word, retrieve suggestions for it std::string misspelled_word = getMisspelledWord(mCursorPos); - if ((is_misspelled = !misspelled_word.empty()) == true) + if ((is_misspelled = !misspelled_word.empty())) { LLSpellChecker::instance().getSuggestions(misspelled_word, mSuggestionList); } diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 4e961a0a18..1c1414dd74 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -1049,20 +1049,20 @@ bool LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, std::string& tooltip_msg) { // If we have a drop callback, that means that we can handle the drop - bool handled = (mHandleDropCallback ? true : false); - + bool handled = mHandleDropCallback != nullptr; + // if drop is set, it's time to call the callback to get the operation done if (handled && drop) { - handled = mHandleDropCallback(cargo_data, x, y ,this); + handled = mHandleDropCallback(cargo_data, x, y, this); } - + // We accept only single tool drop on toolbars - *accept = (handled ? ACCEPT_YES_SINGLE : ACCEPT_NO); - + *accept = handled ? ACCEPT_YES_SINGLE : ACCEPT_NO; + // We'll use that flag to change the visual aspect of the toolbar target on draw() mDragAndDropTarget = false; - + // Convert drag position into insert position and rank if (!isReadOnly() && handled && !drop) { @@ -1073,7 +1073,7 @@ bool LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, int orig_rank = getRankFromPosition(dragged_command); mDragRank = getRankFromPosition(x, y); // Don't DaD if we're dragging a command on itself - mDragAndDropTarget = ((orig_rank != RANK_NONE) && ((mDragRank == orig_rank) || ((mDragRank-1) == orig_rank)) ? false : true); + mDragAndDropTarget = ((orig_rank != RANK_NONE) && ((mDragRank == orig_rank) || ((mDragRank - 1) == orig_rank))); //LL_INFOS() << "Merov debug : DaD, rank = " << mDragRank << ", dragged uui = " << inv_item->getUUID() << LL_ENDL; /* Do the following if you want to animate the button itself LLCommandId dragged_command(inv_item->getUUID()); @@ -1086,7 +1086,7 @@ bool LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, handled = false; } } - + return handled; } diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index aa9272f782..45668e4a87 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -229,7 +229,7 @@ bool LLUrlEntryBase::isWikiLinkCorrect(const std::string &labeled_url) const label = "http://" + label; } - return (LLUrlRegistry::instance().hasUrl(label)) ? false : true; + return !LLUrlRegistry::instance().hasUrl(label); } std::string LLUrlEntryBase::urlToLabelWithGreyQuery(const std::string &url) const diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 57c635b019..30cc5cd10a 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -342,11 +342,11 @@ void LLView::removeChild(LLView* child) if (child->mParentView == this) { // if we are removing an item we are currently iterating over, that would be bad - llassert(child->mInDraw == false); + llassert(!child->mInDraw); mChildList.remove( child ); child->mParentView = NULL; child_tab_order_t::iterator found = mTabOrder.find(child); - if(found != mTabOrder.end()) + if (found != mTabOrder.end()) { mTabOrder.erase(found); } diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 84507a58b6..6209058875 100644 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -935,7 +935,7 @@ bool LLXUIParser::readBoolValue(Parser& parser, void* val_ptr) bool value; LLXUIParser& self = static_cast<LLXUIParser&>(parser); bool success = self.mCurReadNode->getBoolValue(1, &value); - *((bool*)val_ptr) = (value != false); + *((bool*)val_ptr) = value; return success; } |