Remove cast.

This commit is contained in:
Christian Speckner 2024-08-29 20:49:24 +02:00
parent 498e8bc4de
commit 59f82b1fe1
2 changed files with 6 additions and 7 deletions

View File

@ -111,7 +111,7 @@ BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// static // 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, string_view title, string_view startpath,
BrowserDialog::Mode mode, BrowserDialog::Mode mode,
const Command& command, const Command& command,
@ -119,9 +119,8 @@ void BrowserDialog::show(GuiObject* parent, const GUI::Font& font,
{ {
uInt32 w = 0, h = 0; uInt32 w = 0, h = 0;
const auto* parentDialog = static_cast<Dialog*>(parent); if (parent) {
if (parentDialog) { parent->getDynamicBounds(w, h);
parentDialog->getDynamicBounds(w, h);
} else { } else {
w = FBMinimum::Width; w = FBMinimum::Width;
h = FBMinimum::Height; h = FBMinimum::Height;
@ -141,7 +140,7 @@ void BrowserDialog::show(GuiObject* parent, const GUI::Font& font,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// static // static
void BrowserDialog::show(GuiObject* parent, void BrowserDialog::show(Dialog* parent,
string_view title, string_view startpath, string_view title, string_view startpath,
BrowserDialog::Mode mode, BrowserDialog::Mode mode,
const Command& command, const Command& command,

View File

@ -63,7 +63,7 @@ class BrowserDialog : public Dialog
@param command The command to run when 'OK' or 'Cancel' is clicked @param command The command to run when 'OK' or 'Cancel' is clicked
@param namefilter Filter files/directories in browser display @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, string_view title,string_view startpath,
BrowserDialog::Mode mode, BrowserDialog::Mode mode,
const Command& command, const Command& command,
@ -80,7 +80,7 @@ class BrowserDialog : public Dialog
@param command The command to run when 'OK' or 'Cancel' is clicked @param command The command to run when 'OK' or 'Cancel' is clicked
@param namefilter Filter files/directories in browser display @param namefilter Filter files/directories in browser display
*/ */
static void show(GuiObject* parent, static void show(Dialog* parent,
string_view title, string_view startpath, string_view title, string_view startpath,
BrowserDialog::Mode mode, BrowserDialog::Mode mode,
const Command& command, const Command& command,