sw/source/uibase/dialog/regionsw.cxx | 18 ++++++------------ sw/source/uibase/dochdl/swdtflvr.cxx | 13 ++++++------- sw/source/uibase/inc/wrtsh.hxx | 4 ++-- 3 files changed, 14 insertions(+), 21 deletions(-)
New commits: commit cd1dec8142280ba3977321c86cabaee45fd585ca Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jan 10 10:25:55 2019 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Sep 19 21:05:57 2019 +0200 make insert-section dialog async Change-Id: Ia48f4103b8f346a93ebe1f2c5078f21a90884e3f Reviewed-on: https://gerrit.libreoffice.org/66065 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> (cherry picked from commit 09f9b5f6ba9e4590227b12eb8232a56d003086ea) Reviewed-on: https://gerrit.libreoffice.org/79126 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx index 516f50074e07..56c2db1e9f5f 100644 --- a/sw/source/uibase/dialog/regionsw.cxx +++ b/sw/source/uibase/dialog/regionsw.cxx @@ -79,9 +79,9 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) // height=width for more consistent preview (analog to edit region) aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractInsertSectionTabDialog> aTabDlg(pFact->CreateInsertSectionTabDialog( + VclPtr<AbstractInsertSectionTabDialog> aTabDlg(pFact->CreateInsertSectionTabDialog( &GetView().GetViewFrame()->GetWindow(), aSet , rSh)); - aTabDlg->Execute(); + aTabDlg->StartExecuteAsync(nullptr); rReq.Ignore(); } else @@ -169,13 +169,8 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) } } -IMPL_LINK( SwWrtShell, InsertRegionDialog, void*, p, void ) +void SwWrtShell::StartInsertRegionDialog(SwSectionData& rSectionData) { - SwSectionData* pSect = static_cast<SwSectionData*>(p); - std::unique_ptr<SwSectionData> xSectionData(pSect); - if (!xSectionData) - return; - SfxItemSet aSet( GetView().GetPool(), svl::Items< @@ -191,11 +186,10 @@ IMPL_LINK( SwWrtShell, InsertRegionDialog, void*, p, void ) // height=width for more consistent preview (analog to edit region) aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractInsertSectionTabDialog> aTabDlg(pFact->CreateInsertSectionTabDialog( + VclPtr<AbstractInsertSectionTabDialog> aTabDlg(pFact->CreateInsertSectionTabDialog( &GetView().GetViewFrame()->GetWindow(),aSet , *this)); - aTabDlg->SetSectionData(*xSectionData); - aTabDlg->Execute(); - + aTabDlg->SetSectionData(rSectionData); + aTabDlg->StartExecuteAsync(nullptr); } void SwBaseShell::EditRegionDialog(SfxRequest const & rReq) diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index ad2433ff6b9e..ef5abb43a505 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -2659,17 +2659,16 @@ bool SwTransferable::PasteFileName( TransferableDataHelper& rData, ? nullptr : SwIoSystem::GetFileFilter(sFileURL); if( pFlt && dynamic_cast< const SwWebDocShell *>( rSh.GetView().GetDocShell() ) == nullptr ) { - // and then pull up the insert-region-dialog by PostUser event - SwSectionData * pSect = new SwSectionData( + // and then pull up the insert-region-dialog + SwSectionData aSect( FILE_LINK_SECTION, rSh.GetDoc()->GetUniqueSectionName() ); - pSect->SetLinkFileName( sFileURL ); - pSect->SetProtectFlag( true ); + aSect.SetLinkFileName( sFileURL ); + aSect.SetProtectFlag( true ); - Application::PostUserEvent( LINK( &rSh, SwWrtShell, - InsertRegionDialog ), pSect ); + rSh.StartInsertRegionDialog( aSect ); // starts dialog asynchronously bRet = true; - } + } else if( SwPasteSdr::SetAttr == nAction || ( bIsURLFile && SwPasteSdr::Insert == nAction )) { diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx index 6c9a4fa2d883..58d375c805f2 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -449,8 +449,8 @@ typedef bool (SwWrtShell:: *FNSimpleMove)(); void AutoUpdateFrame(SwFrameFormat* pFormat, const SfxItemSet& rStyleSet); void AutoUpdatePara(SwTextFormatColl* pColl, const SfxItemSet& rStyleSet, SwPaM* pPaM = nullptr ); - // link for inserting ranges via Drag&Drop/Clipboard - DECL_LINK( InsertRegionDialog, void*, void ); + // starts dialog for inserting ranges via Drag&Drop/Clipboard + void StartInsertRegionDialog(SwSectionData&); // ctor, the first one is a kind of a controlled copy ctor for more views of a document SwWrtShell( SwWrtShell&, vcl::Window *pWin, SwView &rShell); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits