From 57c5b09e1a3d0f36f94cbab11c96842d782b8eaf Mon Sep 17 00:00:00 2001 From: Ryan Leavengood Date: Sun, 5 Aug 2012 17:55:37 -0400 Subject: [PATCH] Use be_control_look != NULL everywhere in the Interface Kit. Should not be a functional change. It is not in the Haiku Coding Guidelines but I feel like 'if (object != NULL)' is generally preferred to 'if (object)', plus in this case of be_control_look that is the more common style. --- src/kits/interface/BMCPrivate.cpp | 2 +- src/kits/interface/CheckBox.cpp | 2 +- src/kits/interface/RadioButton.cpp | 2 +- src/kits/interface/ScrollBar.cpp | 2 +- src/kits/interface/Slider.cpp | 2 +- src/kits/interface/StatusBar.cpp | 2 +- src/kits/interface/TextInput.cpp | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/kits/interface/BMCPrivate.cpp b/src/kits/interface/BMCPrivate.cpp index ed270412ed..56c4efaf57 100644 --- a/src/kits/interface/BMCPrivate.cpp +++ b/src/kits/interface/BMCPrivate.cpp @@ -407,7 +407,7 @@ _BMCMenuBar_::_Init(bool setMaxContentWidth) bottom--; #endif - if (be_control_look) + if (be_control_look != NULL) left = right = be_control_look->DefaultLabelSpacing(); SetItemMargins(left, top, right + fShowPopUpMarker ? 10 : 0, bottom); diff --git a/src/kits/interface/CheckBox.cpp b/src/kits/interface/CheckBox.cpp index 2501327a47..cde4220fbd 100644 --- a/src/kits/interface/CheckBox.cpp +++ b/src/kits/interface/CheckBox.cpp @@ -96,7 +96,7 @@ BCheckBox::Archive(BMessage *archive, bool deep) const void BCheckBox::Draw(BRect updateRect) { - if (be_control_look) { + if (be_control_look != NULL) { rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR); uint32 flags = be_control_look->Flags(this); diff --git a/src/kits/interface/RadioButton.cpp b/src/kits/interface/RadioButton.cpp index 191d28e6f5..e3b3cfbee4 100644 --- a/src/kits/interface/RadioButton.cpp +++ b/src/kits/interface/RadioButton.cpp @@ -89,7 +89,7 @@ BRadioButton::Draw(BRect updateRect) font_height fontHeight; GetFontHeight(&fontHeight); - if (be_control_look) { + if (be_control_look != NULL) { rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR); uint32 flags = be_control_look->Flags(this); diff --git a/src/kits/interface/ScrollBar.cpp b/src/kits/interface/ScrollBar.cpp index a12fdd3b9d..971c59676e 100644 --- a/src/kits/interface/ScrollBar.cpp +++ b/src/kits/interface/ScrollBar.cpp @@ -1081,7 +1081,7 @@ BScrollBar::Draw(BRect updateRect) } // fill the clickable surface of the thumb - if (be_control_look) { + if (be_control_look != NULL) { be_control_look->DrawButtonBackground(this, rect, updateRect, normal, 0, BControlLook::B_ALL_BORDERS, fOrientation); } else { diff --git a/src/kits/interface/Slider.cpp b/src/kits/interface/Slider.cpp index 063c52bee2..a91b973261 100644 --- a/src/kits/interface/Slider.cpp +++ b/src/kits/interface/Slider.cpp @@ -1000,7 +1000,7 @@ BSlider::DrawHashMarks() BRect frame = HashMarksFrame(); BView* view = OffscreenView(); - if (be_control_look) { + if (be_control_look != NULL) { rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR); uint32 flags = be_control_look->Flags(this); be_control_look->DrawSliderHashMarks(view, frame, frame, base, diff --git a/src/kits/interface/StatusBar.cpp b/src/kits/interface/StatusBar.cpp index b17062f908..d346f11608 100644 --- a/src/kits/interface/StatusBar.cpp +++ b/src/kits/interface/StatusBar.cpp @@ -574,7 +574,7 @@ BStatusBar::SetTo(float value, const char* text, const char* trailingText) } // TODO: Ask the BControlLook in the first place about dirty rect. - if (be_control_look) + if (be_control_look != NULL) update.InsetBy(-1, -1); Invalidate(update); diff --git a/src/kits/interface/TextInput.cpp b/src/kits/interface/TextInput.cpp index c1d8ce1857..9b1b570e81 100644 --- a/src/kits/interface/TextInput.cpp +++ b/src/kits/interface/TextInput.cpp @@ -174,7 +174,7 @@ _BTextInput_::AlignTextRect() float vInset = max_c(1, floorf((textRect.Height() - LineHeight(0)) / 2.0)); float hInset = 2; - if (be_control_look) + if (be_control_look != NULL) hInset = be_control_look->DefaultLabelSpacing(); textRect.InsetBy(hInset, vInset);