From c285f59ce2a05703e3a1232fcaf3ee3aea714b3f Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 18 Feb 2024 12:52:19 +0100 Subject: Replace BOOL with bool in llwindow and dependent classes --- indra/llui/lllineeditor.cpp | 70 ++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'indra/llui/lllineeditor.cpp') diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 60dbfd68c6..a1b9b5696c 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -660,9 +660,9 @@ void LLLineEditor::onSpellCheckSettingsChange() mSpellCheckStart = mSpellCheckEnd = -1; } -BOOL LLLineEditor::handleDoubleClick(S32 x, S32 y, MASK mask) +bool LLLineEditor::handleDoubleClick(S32 x, S32 y, MASK mask) { - setFocus( TRUE ); + setFocus( true ); mTripleClickTimer.setTimerExpirySec(TRIPLE_CLICK_INTERVAL); if (mSelectionEnd == 0 && mSelectionStart == mText.length()) @@ -674,7 +674,7 @@ BOOL LLLineEditor::handleDoubleClick(S32 x, S32 y, MASK mask) { const LLWString& wtext = mText.getWString(); - BOOL doSelectAll = TRUE; + bool doSelectAll = true; // Select the word we're on if( LLWStringUtil::isPartOfWord( wtext[mCursorPos] ) ) @@ -709,7 +709,7 @@ BOOL LLLineEditor::handleDoubleClick(S32 x, S32 y, MASK mask) // We don't want handleMouseUp() to "finish" the selection (and thereby // set mSelectionEnd to where the mouse is), so we finish the selection // here. - mIsSelecting = FALSE; + mIsSelecting = false; // delay cursor flashing mKeystrokeTimer.reset(); @@ -717,15 +717,15 @@ BOOL LLLineEditor::handleDoubleClick(S32 x, S32 y, MASK mask) // take selection to 'primary' clipboard updatePrimary(); - return TRUE; + return true; } -BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask) +bool LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask) { // Check first whether the "clear search" button wants to deal with this. if(childrenHandleMouseDown(x, y, mask) != NULL) { - return TRUE; + return true; } if (!mSelectAllonFocusReceived @@ -737,7 +737,7 @@ BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask) if (mask & MASK_SHIFT) { // assume we're starting a drag select - mIsSelecting = TRUE; + mIsSelecting = true; // Handle selection extension S32 old_cursor_pos = getCursor(); @@ -793,14 +793,14 @@ BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask) // We don't want handleMouseUp() to "finish" the selection (and thereby // set mSelectionEnd to where the mouse is), so we finish the selection // here. - mIsSelecting = FALSE; + mIsSelecting = false; } } gFocusMgr.setMouseCapture( this ); } - setFocus(TRUE); + setFocus(true); // delay cursor flashing mKeystrokeTimer.reset(); @@ -808,40 +808,40 @@ BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask) if (mMouseDownSignal) (*mMouseDownSignal)(this,x,y,mask); - return TRUE; + return true; } -BOOL LLLineEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask) +bool LLLineEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask) { // LL_INFOS() << "MiddleMouseDown" << LL_ENDL; - setFocus( TRUE ); + setFocus( true ); if( canPastePrimary() ) { setCursorAtLocalPos(x); pastePrimary(); } - return TRUE; + return true; } -BOOL LLLineEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) +bool LLLineEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) { - setFocus(TRUE); + setFocus(true); if (!LLUICtrl::handleRightMouseDown(x, y, mask) && getShowContextMenu()) { showContextMenu(x, y); } - return TRUE; + return true; } -BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask) +bool LLLineEditor::handleHover(S32 x, S32 y, MASK mask) { - BOOL handled = FALSE; + bool handled = false; // Check first whether the "clear search" button wants to deal with this. if(!hasMouseCapture()) { if(childrenHandleHover(x, y, mask) != NULL) { - return TRUE; + return true; } } @@ -884,34 +884,34 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask) getWindow()->setCursor(UI_CURSOR_IBEAM); LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL; - handled = TRUE; + handled = true; } if( !handled ) { getWindow()->setCursor(UI_CURSOR_IBEAM); LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL; - handled = TRUE; + handled = true; } return handled; } -BOOL LLLineEditor::handleMouseUp(S32 x, S32 y, MASK mask) +bool LLLineEditor::handleMouseUp(S32 x, S32 y, MASK mask) { - BOOL handled = FALSE; + bool handled = false; if( hasMouseCapture() ) { gFocusMgr.setMouseCapture( NULL ); - handled = TRUE; + handled = true; } // Check first whether the "clear search" button wants to deal with this. if(!handled && childrenHandleMouseUp(x, y, mask) != NULL) { - return TRUE; + return true; } if( mIsSelecting ) @@ -919,7 +919,7 @@ BOOL LLLineEditor::handleMouseUp(S32 x, S32 y, MASK mask) setCursorAtLocalPos( x ); mSelectionEnd = getCursor(); - handled = TRUE; + handled = true; } if( handled ) @@ -1597,18 +1597,18 @@ BOOL LLLineEditor::handleKeyHere(KEY key, MASK mask ) } -BOOL LLLineEditor::handleUnicodeCharHere(llwchar uni_char) +bool LLLineEditor::handleUnicodeCharHere(llwchar uni_char) { if ((uni_char < 0x20) || (uni_char == 0x7F)) // Control character or DEL { - return FALSE; + return false; } - BOOL handled = FALSE; + bool handled = false; if ( (gFocusMgr.getKeyboardFocus() == this) && getVisible() && !mReadOnly) { - handled = TRUE; + handled = true; LLLineEditorRollback rollback( this ); @@ -2489,7 +2489,7 @@ void LLLineEditor::updatePreedit(const LLWString &preedit_string, mSpellCheckTimer.setTimerExpirySec(SPELLCHECK_DELAY); } -BOOL LLLineEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect *bounds, LLRect *control) const +bool LLLineEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect *bounds, LLRect *control) const { if (control) { @@ -2511,13 +2511,13 @@ BOOL LLLineEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect if (preedit_right_column < mScrollHPos) { // This should not occure... - return FALSE; + return false; } const S32 query = (query_offset >= 0 ? preedit_left_column + query_offset : getCursor()); if (query < mScrollHPos || query < preedit_left_column || query > preedit_right_column) { - return FALSE; + return false; } if (coord) @@ -2544,7 +2544,7 @@ BOOL LLLineEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect LLUI::getInstance()->screenRectToGL(preedit_rect_screen, bounds); } - return TRUE; + return true; } void LLLineEditor::getPreeditRange(S32 *position, S32 *length) const -- cgit v1.2.3 From 5486d87b566aabb43fa585de3ee86e5bc77391c9 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 19 Feb 2024 15:44:40 +0100 Subject: Change LLPreeditor::standouts_t to std::deque since std::vector since it's a specialization that does not necessarily behave like standard STL containers --- indra/llui/lllineeditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/lllineeditor.cpp') diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index a1b9b5696c..9b320fdf97 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -2590,7 +2590,7 @@ void LLLineEditor::markAsPreedit(S32 position, S32 length) mPreeditPositions[0] = position; mPreeditPositions[1] = position + length; mPreeditStandouts.resize(1); - mPreeditStandouts[0] = FALSE; + mPreeditStandouts[0] = false; } else { -- cgit v1.2.3 From a5261a5fa8fad810ecb5c260d92c3e771822bf58 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 20 Feb 2024 23:46:23 +0100 Subject: Convert BOOL to bool in llui --- indra/llui/lllineeditor.cpp | 178 ++++++++++++++++++++++---------------------- 1 file changed, 89 insertions(+), 89 deletions(-) (limited to 'indra/llui/lllineeditor.cpp') diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 9b320fdf97..6664117bcd 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -74,7 +74,7 @@ static LLDefaultChildRegistry::Register r1("line_editor"); // Compiler optimization, generate extern template template class LLLineEditor* LLView::getChild( - const std::string& name, BOOL recurse) const; + const std::string& name, bool recurse) const; // // Member functions @@ -127,10 +127,10 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) mTextLeftEdge(0), // computed in updateTextPadding() below mTextRightEdge(0), // computed in updateTextPadding() below mCommitOnFocusLost( p.commit_on_focus_lost ), - mKeystrokeOnEsc(FALSE), + mKeystrokeOnEsc(false), mRevertOnEsc( p.revert_on_esc ), mKeystrokeCallback( p.keystroke_callback() ), - mIsSelecting( FALSE ), + mIsSelecting( false ), mSelectionStart( 0 ), mSelectionEnd( 0 ), mLastSelectionX(-1), @@ -138,23 +138,23 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) mLastSelectionStart(-1), mLastSelectionEnd(-1), mBorderThickness( 0 ), - mIgnoreArrowKeys( FALSE ), + mIgnoreArrowKeys( false ), mIgnoreTab( p.ignore_tab ), mDrawAsterixes( p.is_password ), mSpellCheck( p.spellcheck ), mSpellCheckStart(-1), mSpellCheckEnd(-1), mSelectAllonFocusReceived( p.select_on_focus ), - mSelectAllonCommit( TRUE ), - mPassDelete(FALSE), - mReadOnly(FALSE), + mSelectAllonCommit( true ), + mPassDelete(false), + mReadOnly(false), mBgImage( p.background_image ), mBgImageDisabled( p.background_image_disabled ), mBgImageFocused( p.background_image_focused ), mShowImageFocused( p.bg_image_always_focused ), mUseBgColor(p.use_bg_color), - mHaveHistory(FALSE), - mReplaceNewlinesWithSpaces( TRUE ), + mHaveHistory(false), + mReplaceNewlinesWithSpaces( true ), mLabel(p.label), mCursorColor(p.cursor_color()), mBgColor(p.bg_color()), @@ -169,7 +169,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) { llassert( mMaxLengthBytes > 0 ); - LLUICtrl::setEnabled(TRUE); + LLUICtrl::setEnabled(true); setEnabled(p.enabled); mScrollTimer.reset(); @@ -214,7 +214,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) LLLineEditor::~LLLineEditor() { - mCommitOnFocusLost = FALSE; + mCommitOnFocusLost = false; // Make sure no context menu linger around once the widget is deleted LLContextMenu* menu = static_cast(mContextMenuHandle.get()); @@ -231,7 +231,7 @@ LLLineEditor::~LLLineEditor() void LLLineEditor::initFromParams(const LLLineEditor::Params& params) { LLUICtrl::initFromParams(params); - LLUICtrl::setEnabled(TRUE); + LLUICtrl::setEnabled(true); setEnabled(params.enabled); } @@ -280,9 +280,9 @@ void LLLineEditor::onCommit() if (mSelectAllonCommit) selectAll(); } -// Returns TRUE if user changed value at all +// Returns true if user changed value at all // virtual -BOOL LLLineEditor::isDirty() const +bool LLLineEditor::isDirty() const { return mText.getString() != mPrevText; } @@ -343,14 +343,14 @@ void LLLineEditor::updateHistory() } } -void LLLineEditor::reshape(S32 width, S32 height, BOOL called_from_parent) +void LLLineEditor::reshape(S32 width, S32 height, bool called_from_parent) { LLUICtrl::reshape(width, height, called_from_parent); updateTextPadding(); // For clamping side-effect. setCursor(mCursorPos); // For clamping side-effect. } -void LLLineEditor::setEnabled(BOOL enabled) +void LLLineEditor::setEnabled(bool enabled) { mReadOnly = !enabled; setTabStop(!mReadOnly); @@ -405,7 +405,7 @@ void LLLineEditor::setText(const LLStringExplicit &new_text, bool use_size_limit // Check to see if entire field is selected. S32 len = mText.length(); - BOOL all_selected = (len > 0) + bool all_selected = (len > 0) && (( mSelectionStart == 0 && mSelectionEnd == len ) || ( mSelectionStart == len && mSelectionEnd == 0 )); @@ -517,7 +517,7 @@ void LLLineEditor::resetScrollPosition() setCursor(getCursor()); } -BOOL LLLineEditor::canDeselect() const +bool LLLineEditor::canDeselect() const { return hasSelection(); } @@ -526,13 +526,13 @@ void LLLineEditor::deselect() { mSelectionStart = 0; mSelectionEnd = 0; - mIsSelecting = FALSE; + mIsSelecting = false; } void LLLineEditor::startSelection() { - mIsSelecting = TRUE; + mIsSelecting = true; mSelectionStart = getCursor(); mSelectionEnd = getCursor(); } @@ -541,14 +541,14 @@ void LLLineEditor::endSelection() { if( mIsSelecting ) { - mIsSelecting = FALSE; + mIsSelecting = false; mSelectionEnd = getCursor(); } } -BOOL LLLineEditor::canSelectAll() const +bool LLLineEditor::canSelectAll() const { - return TRUE; + return true; } void LLLineEditor::selectAll() @@ -562,7 +562,7 @@ void LLLineEditor::selectAll() mSelectionEnd = 0; setCursor(mSelectionEnd); //mScrollHPos = 0; - mIsSelecting = TRUE; + mIsSelecting = true; updatePrimary(); } @@ -976,19 +976,19 @@ void LLLineEditor::addChar(const llwchar uni_char) S32 new_bytes = wchar_utf8_length(new_c); - BOOL allow_char = TRUE; + bool allow_char = true; // Check byte length limit if ((new_bytes + cur_bytes) > mMaxLengthBytes) { - allow_char = FALSE; + allow_char = false; } else if (mMaxLengthChars) { S32 wide_chars = mText.getWString().size(); if ((wide_chars + 1) > mMaxLengthChars) { - allow_char = FALSE; + allow_char = false; } } @@ -1033,7 +1033,7 @@ void LLLineEditor::setSelection(S32 start, S32 end) { S32 len = mText.length(); - mIsSelecting = TRUE; + mIsSelecting = true; // JC, yes, this seems odd, but I think you have to presume a // selection dragged from the end towards the start. @@ -1042,7 +1042,7 @@ void LLLineEditor::setSelection(S32 start, S32 end) setCursor(start); } -void LLLineEditor::setDrawAsterixes(BOOL b) +void LLLineEditor::setDrawAsterixes(bool b) { mDrawAsterixes = b; updateAllowingLanguageInput(); @@ -1077,13 +1077,13 @@ S32 LLLineEditor::nextWordPos(S32 cursorPos) const } -BOOL LLLineEditor::handleSelectionKey(KEY key, MASK mask) +bool LLLineEditor::handleSelectionKey(KEY key, MASK mask) { - BOOL handled = FALSE; + bool handled = false; if( mask & MASK_SHIFT ) { - handled = TRUE; + handled = true; switch( key ) { @@ -1136,7 +1136,7 @@ BOOL LLLineEditor::handleSelectionKey(KEY key, MASK mask) } default: - handled = FALSE; + handled = false; break; } } @@ -1167,7 +1167,7 @@ void LLLineEditor::deleteSelection() } } -BOOL LLLineEditor::canCut() const +bool LLLineEditor::canCut() const { return !mReadOnly && !mDrawAsterixes && hasSelection(); } @@ -1191,7 +1191,7 @@ void LLLineEditor::cut() deleteSelection(); // Validate new string and rollback the if needed. - BOOL need_to_rollback = ( mPrevalidateFunc && !mPrevalidateFunc( mText.getWString() ) ); + bool need_to_rollback = ( mPrevalidateFunc && !mPrevalidateFunc( mText.getWString() ) ); if( need_to_rollback ) { rollback.doRollback( this ); @@ -1204,7 +1204,7 @@ void LLLineEditor::cut() } } -BOOL LLLineEditor::canCopy() const +bool LLLineEditor::canCopy() const { return !mDrawAsterixes && hasSelection(); } @@ -1221,7 +1221,7 @@ void LLLineEditor::copy() } } -BOOL LLLineEditor::canPaste() const +bool LLLineEditor::canPaste() const { return !mReadOnly && LLClipboard::instance().isTextAvailable(); } @@ -1319,7 +1319,7 @@ void LLLineEditor::pasteHelper(bool is_primary) deselect(); // Validate new string and rollback the if needed. - BOOL need_to_rollback = ( mPrevalidateFunc && !mPrevalidateFunc( mText.getWString() ) ); + bool need_to_rollback = ( mPrevalidateFunc && !mPrevalidateFunc( mText.getWString() ) ); if( need_to_rollback ) { rollback.doRollback( this ); @@ -1344,7 +1344,7 @@ void LLLineEditor::copyPrimary() } } -BOOL LLLineEditor::canPastePrimary() const +bool LLLineEditor::canPastePrimary() const { return !mReadOnly && LLClipboard::instance().isTextAvailable(true); } @@ -1357,9 +1357,9 @@ void LLLineEditor::updatePrimary() } } -BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) +bool LLLineEditor::handleSpecialKey(KEY key, MASK mask) { - BOOL handled = FALSE; + bool handled = false; switch( key ) { @@ -1369,7 +1369,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) gKeyboard->toggleInsertMode(); } - handled = TRUE; + handled = true; break; case KEY_BACKSPACE: @@ -1390,7 +1390,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) LLUI::getInstance()->reportBadKeystroke(); } } - handled = TRUE; + handled = true; break; case KEY_PAGE_UP: @@ -1398,7 +1398,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) if (!mIgnoreArrowKeys) { setCursor(0); - handled = TRUE; + handled = true; } break; @@ -1411,7 +1411,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) { setCursor(len); } - handled = TRUE; + handled = true; } break; @@ -1438,7 +1438,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) { LLUI::getInstance()->reportBadKeystroke(); } - handled = TRUE; + handled = true; } break; @@ -1465,7 +1465,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) { LLUI::getInstance()->reportBadKeystroke(); } - handled = TRUE; + handled = true; } break; @@ -1482,7 +1482,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) { LLUI::getInstance()->reportBadKeystroke(); } - handled = TRUE; + handled = true; } break; @@ -1499,7 +1499,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) { LLUI::getInstance()->reportBadKeystroke(); } - handled = TRUE; + handled = true; } break; @@ -1528,10 +1528,10 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) } -BOOL LLLineEditor::handleKeyHere(KEY key, MASK mask ) +bool LLLineEditor::handleKeyHere(KEY key, MASK mask ) { - BOOL handled = FALSE; - BOOL selection_modified = FALSE; + bool handled = false; + bool selection_modified = false; if ( gFocusMgr.getKeyboardFocus() == this ) { @@ -1566,7 +1566,7 @@ BOOL LLLineEditor::handleKeyHere(KEY key, MASK mask ) deselect(); } - BOOL need_to_rollback = FALSE; + bool need_to_rollback = false; // If read-only, don't allow changes need_to_rollback |= (mReadOnly && (mText.getString() == rollback.getText())); @@ -1625,7 +1625,7 @@ bool LLLineEditor::handleUnicodeCharHere(llwchar uni_char) deselect(); - BOOL need_to_rollback = FALSE; + bool need_to_rollback = false; // Validate new string and rollback the keystroke if needed. need_to_rollback |= ( mPrevalidateFunc && !mPrevalidateFunc( mText.getWString() ) ); @@ -1651,7 +1651,7 @@ bool LLLineEditor::handleUnicodeCharHere(llwchar uni_char) } -BOOL LLLineEditor::canDoDelete() const +bool LLLineEditor::canDoDelete() const { return ( !mReadOnly && (!mPassDelete || (hasSelection() || (getCursor() < mText.length()))) ); } @@ -1681,7 +1681,7 @@ void LLLineEditor::doDelete() } // Validate new string and rollback the if needed. - BOOL need_to_rollback = ( mPrevalidateFunc && !mPrevalidateFunc( mText.getWString() ) ); + bool need_to_rollback = ( mPrevalidateFunc && !mPrevalidateFunc( mText.getWString() ) ); if( need_to_rollback ) { rollback.doRollback( this ); @@ -1702,7 +1702,7 @@ void LLLineEditor::drawBackground() F32 alpha = getCurrentTransparency(); if (mUseBgColor) { - gl_rect_2d(getLocalRect(), mBgColor % alpha, TRUE); + gl_rect_2d(getLocalRect(), mBgColor % alpha, true); } else { @@ -1923,7 +1923,7 @@ void LLLineEditor::draw() &rendered_pixels_right); } #if 1 // for when we're ready for image art. - mBorder->setVisible(FALSE); // no more programmatic art. + mBorder->setVisible(false); // no more programmatic art. #endif if ( (getSpellCheck()) && (mText.length() > 2) ) @@ -2024,7 +2024,7 @@ void LLLineEditor::draw() // If we're editing... if( hasFocus()) { - //mBorder->setVisible(TRUE); // ok, programmer art just this once. + //mBorder->setVisible(true); // ok, programmer art just this once. // (Flash the cursor every half second) if (!mReadOnly && gFocusMgr.getAppHasFocus()) { @@ -2080,16 +2080,16 @@ void LLLineEditor::draw() LLFontGL::NO_SHADOW, S32_MAX, mTextRightEdge - ll_round(rendered_pixels_right), - &rendered_pixels_right, FALSE); + &rendered_pixels_right, false); } // Draw children (border) - //mBorder->setVisible(TRUE); - mBorder->setKeyboardFocusHighlight( TRUE ); + //mBorder->setVisible(true); + mBorder->setKeyboardFocusHighlight( true ); LLView::draw(); - mBorder->setKeyboardFocusHighlight( FALSE ); - //mBorder->setVisible(FALSE); + mBorder->setKeyboardFocusHighlight( false ); + //mBorder->setVisible(false); } else // does not have keyboard input { @@ -2105,7 +2105,7 @@ void LLLineEditor::draw() LLFontGL::NO_SHADOW, S32_MAX, mTextRightEdge - ll_round(rendered_pixels_right), - &rendered_pixels_right, FALSE); + &rendered_pixels_right, false); } // Draw children (border) LLView::draw(); @@ -2162,19 +2162,19 @@ void LLLineEditor::onTabInto() } //virtual -BOOL LLLineEditor::acceptsTextInput() const +bool LLLineEditor::acceptsTextInput() const { - return TRUE; + return true; } // Start or stop the editor from accepting text-editing keystrokes -void LLLineEditor::setFocus( BOOL new_state ) +void LLLineEditor::setFocus( bool new_state ) { - BOOL old_state = hasFocus(); + bool old_state = hasFocus(); if (!new_state) { - getWindow()->allowLanguageTextInput(this, FALSE); + getWindow()->allowLanguageTextInput(this, false); } @@ -2185,7 +2185,7 @@ void LLLineEditor::setFocus( BOOL new_state ) // We don't want handleMouseUp() to "finish" the selection (and thereby // set mSelectionEnd to where the mouse is), so we finish the selection // here. - mIsSelecting = FALSE; + mIsSelecting = false; } if( new_state ) @@ -2258,13 +2258,13 @@ bool LLLineEditor::prevalidateInput(const LLWString& wstr) } // static -BOOL LLLineEditor::postvalidateFloat(const std::string &str) +bool LLLineEditor::postvalidateFloat(const std::string &str) { LLLocale locale(LLLocale::USER_LOCALE); - BOOL success = TRUE; - BOOL has_decimal = FALSE; - BOOL has_digit = FALSE; + bool success = true; + bool has_decimal = false; + bool has_digit = false; LLWString trimmed = utf8str_to_wstring(str); LLWStringUtil::trim(trimmed); @@ -2289,22 +2289,22 @@ BOOL LLLineEditor::postvalidateFloat(const std::string &str) if( has_decimal ) { // can't have two - success = FALSE; + success = false; break; } else { - has_decimal = TRUE; + has_decimal = true; } } else if( LLStringOps::isDigit( trimmed[i] ) ) { - has_digit = TRUE; + has_digit = true; } else { - success = FALSE; + success = false; break; } } @@ -2316,7 +2316,7 @@ BOOL LLLineEditor::postvalidateFloat(const std::string &str) return success; } -BOOL LLLineEditor::evaluateFloat() +bool LLLineEditor::evaluateFloat() { bool success; F32 result = 0.f; @@ -2348,7 +2348,7 @@ void LLLineEditor::onMouseCaptureLost() } -void LLLineEditor::setSelectAllonFocusReceived(BOOL b) +void LLLineEditor::setSelectAllonFocusReceived(bool b) { mSelectAllonFocusReceived = b; } @@ -2369,16 +2369,16 @@ void LLLineEditor::setKeystrokeCallback(callback_t callback, void* user_data) } -BOOL LLLineEditor::setTextArg( const std::string& key, const LLStringExplicit& text ) +bool LLLineEditor::setTextArg( const std::string& key, const LLStringExplicit& text ) { mText.setArg(key, text); - return TRUE; + return true; } -BOOL LLLineEditor::setLabelArg( const std::string& key, const LLStringExplicit& text ) +bool LLLineEditor::setLabelArg( const std::string& key, const LLStringExplicit& text ) { mLabel.setArg(key, text); - return TRUE; + return true; } @@ -2398,15 +2398,15 @@ void LLLineEditor::updateAllowingLanguageInput() } if (hasFocus() && !mReadOnly && !mDrawAsterixes && mPrevalidateFunc == NULL) { - window->allowLanguageTextInput(this, TRUE); + window->allowLanguageTextInput(this, true); } else { - window->allowLanguageTextInput(this, FALSE); + window->allowLanguageTextInput(this, false); } } -BOOL LLLineEditor::hasPreeditString() const +bool LLLineEditor::hasPreeditString() const { return (mPreeditPositions.size() > 1); } @@ -2612,7 +2612,7 @@ S32 LLLineEditor::getPreeditFontSize() const return ll_round(mGLFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]); } -void LLLineEditor::setReplaceNewlinesWithSpaces(BOOL replace) +void LLLineEditor::setReplaceNewlinesWithSpaces(bool replace) { mReplaceNewlinesWithSpaces = replace; } -- cgit v1.2.3