BMenuItem: Style fixes
* explict NULL check * explicit boolean comparison and pointer style fixes
This commit is contained in:
@@ -285,7 +285,7 @@ BMenuItem::SetShortcut(char shortcut, uint32 modifiers)
|
|||||||
if (fShortcutChar != 0 && (fModifiers & B_COMMAND_KEY) && fWindow)
|
if (fShortcutChar != 0 && (fModifiers & B_COMMAND_KEY) && fWindow)
|
||||||
fWindow->AddShortcut(fShortcutChar, fModifiers, this);
|
fWindow->AddShortcut(fShortcutChar, fModifiers, this);
|
||||||
|
|
||||||
if (fSuper) {
|
if (fSuper != NULL) {
|
||||||
fSuper->InvalidateLayout();
|
fSuper->InvalidateLayout();
|
||||||
|
|
||||||
if (fSuper->LockLooper()) {
|
if (fSuper->LockLooper()) {
|
||||||
@@ -740,29 +740,29 @@ BMenuItem::_DrawShortcutSymbol()
|
|||||||
|
|
||||||
// TODO: It would be nice to draw these taking into account the text (low)
|
// TODO: It would be nice to draw these taking into account the text (low)
|
||||||
// color.
|
// color.
|
||||||
if (fModifiers & B_COMMAND_KEY) {
|
if ((fModifiers & B_COMMAND_KEY) != 0) {
|
||||||
const BBitmap *command = MenuPrivate::MenuItemCommand();
|
const BBitmap* command = MenuPrivate::MenuItemCommand();
|
||||||
const BRect &rect = command->Bounds();
|
const BRect &rect = command->Bounds();
|
||||||
where.x -= rect.Width() + 1;
|
where.x -= rect.Width() + 1;
|
||||||
fSuper->DrawBitmap(command, where);
|
fSuper->DrawBitmap(command, where);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fModifiers & B_CONTROL_KEY) {
|
if ((fModifiers & B_CONTROL_KEY) != 0) {
|
||||||
const BBitmap *control = MenuPrivate::MenuItemControl();
|
const BBitmap* control = MenuPrivate::MenuItemControl();
|
||||||
const BRect &rect = control->Bounds();
|
const BRect &rect = control->Bounds();
|
||||||
where.x -= rect.Width() + 1;
|
where.x -= rect.Width() + 1;
|
||||||
fSuper->DrawBitmap(control, where);
|
fSuper->DrawBitmap(control, where);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fModifiers & B_OPTION_KEY) {
|
if ((fModifiers & B_OPTION_KEY) != 0) {
|
||||||
const BBitmap *option = MenuPrivate::MenuItemOption();
|
const BBitmap* option = MenuPrivate::MenuItemOption();
|
||||||
const BRect &rect = option->Bounds();
|
const BRect &rect = option->Bounds();
|
||||||
where.x -= rect.Width() + 1;
|
where.x -= rect.Width() + 1;
|
||||||
fSuper->DrawBitmap(option, where);
|
fSuper->DrawBitmap(option, where);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fModifiers & B_SHIFT_KEY) {
|
if ((fModifiers & B_SHIFT_KEY) != 0) {
|
||||||
const BBitmap *shift = MenuPrivate::MenuItemShift();
|
const BBitmap* shift = MenuPrivate::MenuItemShift();
|
||||||
const BRect &rect = shift->Bounds();
|
const BRect &rect = shift->Bounds();
|
||||||
where.x -= rect.Width() + 1;
|
where.x -= rect.Width() + 1;
|
||||||
fSuper->DrawBitmap(shift, where);
|
fSuper->DrawBitmap(shift, where);
|
||||||
|
|||||||
Reference in New Issue
Block a user