From c7ac773480bfbfcaac15c9bfdeeab400028a96d4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 18 Oct 2016 09:59:33 +0100 Subject: Resolves: tdf#101590 cannot interact with filepicker from import category the post-execute category dialog is picked as the toplevel parent, and gtk3 vclplug will grab events to that hierarchy, but can't interact with them in this state. Just dispose the category dialog so its not a candidate for the file dialog parent. Change-Id: I063fc6d687d556db229e2e200bb280a6cd3425f5 --- sfx2/source/doc/templatedlg.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 22ed084d32e6..1e6b910f8b33 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -557,10 +557,11 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg, MoveClickHdl, Button*, void) size_t nItemId = 0; - if(aDlg->Execute() == RET_OK) + if (aDlg->Execute() == RET_OK) { OUString sCategory = aDlg->GetSelectedCategory(); bool bIsNewCategory = aDlg->IsNewCategoryCreated(); + aDlg.disposeAndClear(); if(bIsNewCategory) { if (!sCategory.isEmpty()) @@ -596,10 +597,11 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg, ImportClickHdl, Button*, void) ScopedVclPtrInstance aDlg; aDlg->SetCategoryLBEntries(mpLocalView->getFolderNames()); - if(aDlg->Execute() == RET_OK) + if (aDlg->Execute() == RET_OK) { OUString sCategory = aDlg->GetSelectedCategory(); bool bIsNewCategory = aDlg->IsNewCategoryCreated(); + aDlg.disposeAndClear(); if(bIsNewCategory) { if(mpLocalView->createRegion(sCategory)) @@ -1146,10 +1148,10 @@ void SfxTemplateManagerDlg::OnCategoryDelete() aDlg->SetText(SfxResId(STR_CATEGORY_DELETE).toString()); aDlg->SetSelectLabelText(SfxResId(STR_CATEGORY_SELECT).toString()); - if(aDlg->Execute() == RET_OK) + if (aDlg->Execute() == RET_OK) { OUString sCategory = aDlg->GetSelectedCategory(); - aDlg->Close(); + aDlg.disposeAndClear(); ScopedVclPtrInstance< MessageDialog > popupDlg(this, SfxResId(STR_QMSG_SEL_FOLDER_DELETE), VclMessageType::Question, VCL_BUTTONS_YES_NO); -- cgit