diff options
| author | Rye <rye@alchemyviewer.org> | 2025-10-26 02:54:09 -0400 |
|---|---|---|
| committer | Rye <rye@alchemyviewer.org> | 2025-10-27 04:59:16 -0400 |
| commit | 9a049b660bf0295fd295ec9bff0340fca16a90b1 (patch) | |
| tree | 06a170cfe2ca2b682d2d7c27d83f185a5fbaa503 | |
| parent | 5964e02894f2d9387080fbd848f0db02abd06356 (diff) | |
Fix invalid cast warning from ubsan
Signed-off-by: Rye <rye@alchemyviewer.org>
| -rw-r--r-- | indra/llui/llcheckboxctrl.h | 5 | ||||
| -rw-r--r-- | indra/newview/llfloaterland.cpp | 23 |
2 files changed, 10 insertions, 18 deletions
diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h index 4068741978..3507d3f34a 100644 --- a/indra/llui/llcheckboxctrl.h +++ b/indra/llui/llcheckboxctrl.h @@ -124,6 +124,11 @@ public: virtual bool isDirty() const; // Returns true if the user has modified this control. virtual void resetDirty(); // Clear dirty state + LLTextBox* getTextBox() // Provide direct access to label textbox control + { + return mLabel; + } + protected: virtual std::string _getSearchText() const { diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 5c5219bcdd..ebc91255d9 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -108,18 +108,6 @@ public: virtual void changed() { LLFloaterLand::refreshAll(); } }; -// class needed to get full access to textbox inside checkbox, because LLCheckBoxCtrl::setLabel() has string as its argument. -// It was introduced while implementing EXT-4706 -class LLCheckBoxWithTBAcess : public LLCheckBoxCtrl -{ -public: - LLTextBox* getTextBox() - { - return mLabel; - } -}; - - class LLPanelLandExperiences : public LLPanel { @@ -2176,12 +2164,11 @@ void LLPanelLandOptions::refresh() mMatureCtrl->setVisible(true); LLStyle::Params style; style.image(LLUI::getUIImage(gFloaterView->getParentFloater(this)->getString("maturity_icon_moderate"))); - LLCheckBoxWithTBAcess* fullaccess_mature_ctrl = (LLCheckBoxWithTBAcess*)mMatureCtrl; - fullaccess_mature_ctrl->getTextBox()->setText(LLStringExplicit("")); - fullaccess_mature_ctrl->getTextBox()->appendImageSegment(style); - fullaccess_mature_ctrl->getTextBox()->appendText(getString("mature_check_mature"), false); - fullaccess_mature_ctrl->setToolTip(getString("mature_check_mature_tooltip")); - fullaccess_mature_ctrl->reshape(fullaccess_mature_ctrl->getRect().getWidth(), fullaccess_mature_ctrl->getRect().getHeight(), false); + mMatureCtrl->getTextBox()->setText(LLStringExplicit("")); + mMatureCtrl->getTextBox()->appendImageSegment(style); + mMatureCtrl->getTextBox()->appendText(getString("mature_check_mature"), false); + mMatureCtrl->setToolTip(getString("mature_check_mature_tooltip")); + mMatureCtrl->reshape(mMatureCtrl->getRect().getWidth(), mMatureCtrl->getRect().getHeight(), false); // they can see the checkbox, but its disposition depends on the // state of the region |
