summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-12-21 16:48:47 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-12-21 21:57:51 +0100
commit4072e87b4e1b3a5e6c84be5f008a72dea04fb48c (patch)
treed9913270b476c091e05d74b4775b3ae396406854 /sw
parent6eb53d3ecc839d5988a581132c81bfdf9ee2fa69 (diff)
crash reporting: use SfxRequest to get parent for dialogs
0: return pWindow ? pWindow->GetFrameWeld() : nullptr; 2: SfxNewFileDialog aNewFileDlg(GetView()->GetFrameWeld(), SfxNewFileDialogMode::LoadTemplate); Reproducible by adding "LoadStyles" to the menu in writer, then print preview and then use that "LoadStyles" entry. Also dispatch "SID_TEMPLATE_LOAD", as used by "Load Styles from Template" entry in the dropdown from the "Styles Action" toolbar of the style panel, with an explicit frame it is associated with. Change-Id: I3d536b897fbf6be9e20e4238e6a761df56ac9701 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179084 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/app/docsh2.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 733121e9dd0e..207ec8769a71 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -549,14 +549,16 @@ void SwDocShell::Execute(SfxRequest& rReq)
if ( aFileName.isEmpty() )
{
- SfxNewFileDialog aNewFileDlg(GetView()->GetFrameWeld(), SfxNewFileDialogMode::LoadTemplate);
+ weld::Window* pDialogParent = rReq.GetFrameWeld();
+ SAL_WARN_IF(!pDialogParent, "sw.ui", "missing parameter for DialogParent");
+ SfxNewFileDialog aNewFileDlg(pDialogParent, SfxNewFileDialogMode::LoadTemplate);
aNewFileDlg.SetTemplateFlags(nFlags);
sal_uInt16 nRet = aNewFileDlg.run();
if(RET_TEMPLATE_LOAD == nRet)
{
FileDialogHelper aDlgHelper(TemplateDescription::FILEOPEN_SIMPLE,
- FileDialogFlags::NONE, GetView()->GetFrameWeld());
+ FileDialogFlags::NONE, pDialogParent);
aDlgHelper.SetContext(FileDialogHelper::WriterLoadTemplate);
uno::Reference < XFilePicker3 > xFP = aDlgHelper.GetFilePicker();