Skip to content

Commit

Permalink
Remove cast.
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtyHairy committed Aug 29, 2024
1 parent 498e8bc commit 59f82b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/gui/BrowserDialog.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,16 @@ BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font,

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// static
void BrowserDialog::show(GuiObject* parent, const GUI::Font& font,
void BrowserDialog::show(Dialog* parent, const GUI::Font& font,
string_view title, string_view startpath,
BrowserDialog::Mode mode,
const Command& command,
const FSNode::NameFilter& namefilter)
{
uInt32 w = 0, h = 0;

const auto* parentDialog = static_cast<Dialog*>(parent);
if (parentDialog) {
parentDialog->getDynamicBounds(w, h);
if (parent) {
parent->getDynamicBounds(w, h);
} else {
w = FBMinimum::Width;
h = FBMinimum::Height;
Expand All @@ -141,7 +140,7 @@ void BrowserDialog::show(GuiObject* parent, const GUI::Font& font,

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// static
void BrowserDialog::show(GuiObject* parent,
void BrowserDialog::show(Dialog* parent,
string_view title, string_view startpath,
BrowserDialog::Mode mode,
const Command& command,
Expand Down
4 changes: 2 additions & 2 deletions src/gui/BrowserDialog.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class BrowserDialog : public Dialog
@param command The command to run when 'OK' or 'Cancel' is clicked
@param namefilter Filter files/directories in browser display
*/
static void show(GuiObject* parent, const GUI::Font& font,
static void show(Dialog* parent, const GUI::Font& font,
string_view title,string_view startpath,
BrowserDialog::Mode mode,
const Command& command,
Expand All @@ -80,7 +80,7 @@ class BrowserDialog : public Dialog
@param command The command to run when 'OK' or 'Cancel' is clicked
@param namefilter Filter files/directories in browser display
*/
static void show(GuiObject* parent,
static void show(Dialog* parent,
string_view title, string_view startpath,
BrowserDialog::Mode mode,
const Command& command,
Expand Down

0 comments on commit 59f82b1

Please sign in to comment.