From 379ede58af15012f17e87673b0266235762a1230 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Tue, 4 Mar 2014 14:17:46 -0500 Subject: [PATCH] Style fixes to BMenuItem::GetContentSize and update docs Rename width and height to _width and _height matching the header. Update the documentation for this method as well. --- docs/user/interface/MenuItem.dox | 14 +++++++------- src/kits/interface/MenuItem.cpp | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/user/interface/MenuItem.dox b/docs/user/interface/MenuItem.dox index b858efce90..f852885b98 100644 --- a/docs/user/interface/MenuItem.dox +++ b/docs/user/interface/MenuItem.dox @@ -1,13 +1,13 @@ /* - * Copyright 2014 Haiku Inc. All rights reserved. + * Copyright 2014 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * John Scipione, jscipione@gmail.com * * Corresponds to: - * headers/os/interface/MenuItem.h hrev46953 - * src/kits/interface/MenuItem.cpp hrev46953 + * headers/os/interface/MenuItem.h hrev46969 + * src/kits/interface/MenuItem.cpp hrev46969 */ @@ -266,8 +266,8 @@ /*! - \fn void BMenuItem::GetContentSize(float* width, float* height) - \brief Fills out \a width and \a height with the content rectangle + \fn void BMenuItem::GetContentSize(float* _width, float* _height) + \brief Fills out \a _width and \a _height with the content rectangle dimensions. You only need to call this method if you're implementing your own @@ -280,8 +280,8 @@ The content rectangle can be calculated using this method as well as ContentLocation() to get location of the top left corner. - \param width Filled out with the \a width of the content rectangle. - \param height Filled out with the \a height of the content rectangle. + \param _width Filled out with the width of the content rectangle. + \param _height Filled out with the height of the content rectangle. \sa ContentLocation() \sa DrawContent() diff --git a/src/kits/interface/MenuItem.cpp b/src/kits/interface/MenuItem.cpp index 0cf8b99c99..e1a20a8c98 100644 --- a/src/kits/interface/MenuItem.cpp +++ b/src/kits/interface/MenuItem.cpp @@ -360,7 +360,7 @@ BMenuItem::Frame() const void -BMenuItem::GetContentSize(float* width, float* height) +BMenuItem::GetContentSize(float* _width, float* _height) { // TODO: Get rid of this. BMenu should handle this // automatically. Maybe it's not even needed, since our @@ -369,10 +369,10 @@ BMenuItem::GetContentSize(float* width, float* height) fCachedWidth = fSuper->StringWidth(fLabel); - if (width) - *width = (float)ceil(fCachedWidth); - if (height) - *height = MenuPrivate(fSuper).FontHeight(); + if (_width) + *_width = (float)ceil(fCachedWidth); + if (_height) + *_height = MenuPrivate(fSuper).FontHeight(); }