From 7ed2ddbb5c19451e65595becf9b25e6d583fc48b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 17 Jan 2023 20:10:16 +0000 Subject: [PATCH] set a parent for this warning dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia15a3cf7cc5136d2db7463f7486bcc14f4f6a6b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145686 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- sfx2/source/appl/opengrf.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index 325c50422479..3c94ca7ffbc5 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -67,6 +67,7 @@ struct SvxOpenGrf_Impl sfx2::FileDialogHelper aFileDlg; OUString sDetectedFilter; + weld::Window* pDialogParent; uno::Reference < XFilePickerControlAccess > xCtrlAcc; }; @@ -74,6 +75,7 @@ struct SvxOpenGrf_Impl SvxOpenGrf_Impl::SvxOpenGrf_Impl(weld::Window* pPreferredParent, sal_Int16 nDialogType) : aFileDlg(nDialogType, FileDialogFlags::Graphic, pPreferredParent) + , pDialogParent(pPreferredParent) { uno::Reference < XFilePicker3 > xFP = aFileDlg.GetFilePicker(); xCtrlAcc.set(xFP, UNO_QUERY); @@ -152,7 +154,7 @@ ErrCode SvxOpenGraphicDialog::Execute() // could not load? if ( nFound == USHRT_MAX ) { - std::unique_ptr xWarn(Application::CreateMessageDialog(nullptr, + std::unique_ptr xWarn(Application::CreateMessageDialog(mpImpl->pDialogParent, VclMessageType::Warning, VclButtonsType::NONE, SfxResId(SvxOpenGrfErr2ResId(nImpRet)))); xWarn->add_button(GetStandardText(StandardButtonType::Retry), RET_RETRY);