Skip to content

Commit 9c3ce3d

Browse files
committed
Clean up LLUI and fix/add suggestions from VS (#2746)
# Conflicts: # indra/llui/lltextbase.h # indra/llui/lltexteditor.h # indra/llwindow/llwindowsdl.cpp
1 parent c7ebde4 commit 9c3ce3d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+238
-279
lines changed

indra/llui/llaccordionctrltab.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class LLAccordionCtrlTab : public LLUICtrl
126126

127127
void setSelected(bool is_selected);
128128

129-
bool getCollapsible() { return mCollapsible; };
129+
bool getCollapsible() const { return mCollapsible; };
130130

131131
void setCollapsible(bool collapsible) { mCollapsible = collapsible; };
132132
void changeOpenClose(bool is_open);
@@ -181,7 +181,7 @@ class LLAccordionCtrlTab : public LLUICtrl
181181

182182
void setHeaderVisible(bool value);
183183

184-
bool getHeaderVisible() { return mHeaderVisible;}
184+
bool getHeaderVisible() const { return mHeaderVisible;}
185185

186186
S32 mExpandedHeight; // Height of expanded ctrl.
187187
// Used to restore height after expand.

indra/llui/llcheckboxctrl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
// Constants
3737
//
3838

39-
const bool RADIO_STYLE = true;
40-
const bool CHECK_STYLE = false;
39+
constexpr bool RADIO_STYLE = true;
40+
constexpr bool CHECK_STYLE = false;
4141

4242
//
4343
// Classes
@@ -94,7 +94,7 @@ class LLCheckBoxCtrl
9494
// LLUICtrl interface
9595
virtual void setValue(const LLSD& value );
9696
virtual LLSD getValue() const;
97-
bool get() { return (bool)getValue().asBoolean(); }
97+
bool get() const { return (bool)getValue().asBoolean(); }
9898
void set(bool value) { setValue(value); }
9999

100100
virtual void setTentative(bool b);
@@ -106,7 +106,7 @@ class LLCheckBoxCtrl
106106
virtual void onCommit();
107107

108108
// LLCheckBoxCtrl interface
109-
virtual bool toggle() { return mButton->toggleState(); } // returns new state
109+
virtual bool toggle() { return mButton->toggleState(); } // returns new state
110110

111111
void setBtnFocus() { mButton->setFocus(true); }
112112

indra/llui/llcontainerview.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,21 @@ class LLContainerView : public LLView
6565
public:
6666
~LLContainerView();
6767

68-
/*virtual*/ bool postBuild();
69-
/*virtual*/ bool addChild(LLView* view, S32 tab_group = 0);
68+
bool postBuild() override;
69+
bool addChild(LLView* view, S32 tab_group = 0) override;
7070

71-
/*virtual*/ bool handleDoubleClick(S32 x, S32 y, MASK mask);
72-
/*virtual*/ bool handleMouseDown(S32 x, S32 y, MASK mask);
73-
/*virtual*/ bool handleMouseUp(S32 x, S32 y, MASK mask);
71+
bool handleDoubleClick(S32 x, S32 y, MASK mask) override;
72+
bool handleMouseDown(S32 x, S32 y, MASK mask) override;
73+
bool handleMouseUp(S32 x, S32 y, MASK mask) override;
7474

75-
/*virtual*/ void draw();
76-
/*virtual*/ void reshape(S32 width, S32 height, bool called_from_parent = true);
77-
/*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options.
75+
void draw() override;
76+
void reshape(S32 width, S32 height, bool called_from_parent = true) override;
77+
LLRect getRequiredRect() override; // Return the height of this object, given the set options.
7878

7979
void setLabel(const std::string& label);
8080
void showLabel(bool show) { mShowLabel = show; }
8181
void setDisplayChildren(bool displayChildren);
82-
bool getDisplayChildren() { return mDisplayChildren; }
82+
bool getDisplayChildren() const { return mDisplayChildren; }
8383
void setScrollContainer(LLScrollContainer* scroll) {mScrollContainer = scroll;}
8484

8585
private:

indra/llui/lldockablefloater.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ class LLDockableFloater : public LLFloater
112112
virtual bool overlapsScreenChannel() { return mOverlapsScreenChannel && getVisible() && isDocked(); }
113113
virtual void setOverlapsScreenChannel(bool overlaps) { mOverlapsScreenChannel = overlaps; }
114114

115-
bool getUniqueDocking() { return mUniqueDocking; }
116-
bool getUseTongue() { return mUseTongue; }
115+
bool getUniqueDocking() const { return mUniqueDocking; }
116+
bool getUseTongue() const { return mUseTongue; }
117117

118118
void setUseTongue(bool use_tongue) { mUseTongue = use_tongue;}
119119
private:

indra/llui/lldockcontrol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ void LLDockControl::repositionDockable()
156156
}
157157
}
158158

159-
bool LLDockControl::isDockVisible()
159+
bool LLDockControl::isDockVisible() const
160160
{
161161
bool res = true;
162162

indra/llui/lldockcontrol.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@ class LLDockControl
6161
void off();
6262
void forceRecalculatePosition();
6363
void setDock(LLView* dockWidget);
64-
LLView* getDock()
64+
LLView* getDock() const
6565
{
6666
return mDockWidgetHandle.get();
6767
}
6868
void repositionDockable();
6969
void drawToungue();
70-
bool isDockVisible();
70+
bool isDockVisible() const;
7171

7272
// gets a rect that bounds possible positions for a dockable control (EXT-1111)
7373
void getAllowedRect(LLRect& rect);
7474

75-
S32 getTongueWidth() { return mDockTongue->getWidth(); }
76-
S32 getTongueHeight() { return mDockTongue->getHeight(); }
75+
S32 getTongueWidth() const { return mDockTongue->getWidth(); }
76+
S32 getTongueHeight() const { return mDockTongue->getHeight(); }
7777

7878
private:
7979
virtual void moveDockable();

indra/llui/lldraghandle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class LLDragHandle : public LLView
6666
void setMaxTitleWidth(S32 max_width) {mMaxTitleWidth = llmin(max_width, mMaxTitleWidth); }
6767
S32 getMaxTitleWidth() const { return mMaxTitleWidth; }
6868
void setButtonsRect(const LLRect& rect){ mButtonsRect = rect; }
69-
LLRect getButtonsRect() { return mButtonsRect; }
69+
LLRect getButtonsRect() const { return mButtonsRect; }
7070
void setTitleVisible(bool visible);
7171

7272
virtual void setTitle( const std::string& title ) = 0;

indra/llui/llfiltereditor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class LLFilterEditor : public LLSearchEditor
4949
LLFilterEditor(const Params&);
5050
friend class LLUICtrlFactory;
5151

52-
/*virtual*/ void handleKeystroke();
52+
void handleKeystroke() override;
5353
};
5454

5555
#endif // LL_FILTEREDITOR_H

indra/llui/llflashtimer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ void LLFlashTimer::stopFlashing()
8585
mCurrentTickCount = 0;
8686
}
8787

88-
bool LLFlashTimer::isFlashingInProgress()
88+
bool LLFlashTimer::isFlashingInProgress() const
8989
{
9090
return mIsFlashingInProgress;
9191
}
9292

93-
bool LLFlashTimer::isCurrentlyHighlighted()
93+
bool LLFlashTimer::isCurrentlyHighlighted() const
9494
{
9595
return mIsCurrentlyHighlighted;
9696
}

indra/llui/llflashtimer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ class LLFlashTimer : public LLEventTimer
5151
void startFlashing();
5252
void stopFlashing();
5353

54-
bool isFlashingInProgress();
55-
bool isCurrentlyHighlighted();
54+
bool isFlashingInProgress() const;
55+
bool isCurrentlyHighlighted() const;
5656
/*
5757
* Use this instead of deleting this object.
5858
* The next call to tick() will return true and that will destroy this object.

0 commit comments

Comments
 (0)