From 59f82b1fe159a508528a0b40e541d2abdb15d67c Mon Sep 17 00:00:00 2001 From: Christian Speckner Date: Thu, 29 Aug 2024 20:49:24 +0200 Subject: [PATCH] Remove cast. --- src/gui/BrowserDialog.cxx | 9 ++++----- src/gui/BrowserDialog.hxx | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gui/BrowserDialog.cxx b/src/gui/BrowserDialog.cxx index 0fa688d08..fa129f79b 100644 --- a/src/gui/BrowserDialog.cxx +++ b/src/gui/BrowserDialog.cxx @@ -111,7 +111,7 @@ 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, @@ -119,9 +119,8 @@ void BrowserDialog::show(GuiObject* parent, const GUI::Font& font, { uInt32 w = 0, h = 0; - const auto* parentDialog = static_cast(parent); - if (parentDialog) { - parentDialog->getDynamicBounds(w, h); + if (parent) { + parent->getDynamicBounds(w, h); } else { w = FBMinimum::Width; h = FBMinimum::Height; @@ -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, diff --git a/src/gui/BrowserDialog.hxx b/src/gui/BrowserDialog.hxx index e9e4c025d..f8d375f65 100644 --- a/src/gui/BrowserDialog.hxx +++ b/src/gui/BrowserDialog.hxx @@ -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, @@ -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,