summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog
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 /sfx2/source/dialog
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 'sfx2/source/dialog')
-rw-r--r--sfx2/source/dialog/templdlg.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 09e320e05357..6acd68b51675 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -664,7 +664,11 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(const OUString& rEntry, StyleLis
static_cast<sal_uInt16>(m_aStyleList.GetFamilyItem()->GetFamily()), rStyleList);
}
else if (rEntry == "load")
- SfxGetpApp()->GetDispatcher_Impl()->Execute(SID_TEMPLATE_LOAD);
+ {
+ SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+ SfxFrameItem aFrameItem(SID_DOCFRAME, pViewFrame);
+ SfxGetpApp()->GetDispatcher_Impl()->ExecuteList(SID_TEMPLATE_LOAD, SfxCallMode::SLOT, { &aFrameItem });
+ }
else
SAL_WARN("sfx", "not implemented: " << rEntry);
}