vcl/jsdialog/jsdialogbuilder.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
New commits: commit acb71f8382004595778ba3f265c40dd46d72d125 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Jun 27 16:14:11 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat Jun 27 20:24:05 2020 +0200 cid#1464972 Unchecked dynamic_cast Change-Id: If40ee310e0a16af7ce93a5f93e2b436069aa153a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97317 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index e27bc81cb39f..28eecea4d713 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -56,12 +56,18 @@ void JSDialogNotifyIdle::Invoke() void JSDialogSender::notifyDialogState() { mpIdleNotify->Start(); } +namespace +{ +vcl::Window* extract_sal_widget(weld::Widget* pParent) +{ + SalInstanceWidget* pInstanceWidget = dynamic_cast<SalInstanceWidget*>(pParent); + return pInstanceWidget ? pInstanceWidget->getWidget() : nullptr; +} +} + JSInstanceBuilder::JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile) - : SalInstanceBuilder(dynamic_cast<SalInstanceWidget*>(pParent) - ? dynamic_cast<SalInstanceWidget*>(pParent)->getWidget() - : nullptr, - rUIRoot, rUIFile) + : SalInstanceBuilder(extract_sal_widget(pParent), rUIRoot, rUIFile) , m_nWindowId(0) , m_aParentDialog(nullptr) , m_bHasTopLevelDialog(false) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits