diff options
author | Henry Castro <hcastro@collabora.com> | 2018-03-01 16:11:44 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-26 07:46:09 +0200 |
commit | d68c571dad0564517702d90da314cf3f1e7b2b94 (patch) | |
tree | dbf636d20bb07a0e8545ccad03087e9272372412 /sfx2 | |
parent | 2cb11dc380c27215d244126960fdf62dc36e6f44 (diff) |
lokdialog: convert the dialog File -> Properties... to async exec
Change-Id: I677760e9b154256c00ea4e99fd40204744f3cd21
Reviewed-on: https://gerrit.libreoffice.org/50600
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Henry Castro <hcastro@collabora.com>
(cherry picked from commit 0950917b9514069e8dbf92b9c0fbd44b492a7cd1)
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index e104116f1d17..3df7d9b2759f 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -465,30 +465,39 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) // creating dialog is done via virtual method; application will // add its own statistics page - ScopedVclPtr<SfxDocumentInfoDialog> pDlg(CreateDocumentInfoDialog(aSet)); - if ( RET_OK == pDlg->Execute() ) + VclAbstractDialog::AsyncContext aCtx; + std::shared_ptr<SfxRequest> pReq = std::make_shared<SfxRequest>(rReq); + VclPtr<SfxDocumentInfoDialog> pDlg(CreateDocumentInfoDialog(aSet)); + + aCtx.mxOwner = pDlg; + aCtx.maEndDialogFn = [this, pDlg, xCmisDoc, pReq](sal_Int32 nResult) { - const SfxDocumentInfoItem* pDocInfoItem = SfxItemSet::GetItem<SfxDocumentInfoItem>(pDlg->GetOutputItemSet(), SID_DOCINFO, false); - if ( pDocInfoItem ) + if (RET_OK == nResult) { - // user has done some changes to DocumentInfo - pDocInfoItem->UpdateDocumentInfo(getDocProperties()); - uno::Sequence< document::CmisProperty > aNewCmisProperties = - pDocInfoItem->GetCmisProperties( ); - if ( aNewCmisProperties.getLength( ) > 0 ) - xCmisDoc->updateCmisProperties( aNewCmisProperties ); - SetUseUserData( pDocInfoItem->IsUseUserData() ); - SetUseThumbnailSave( pDocInfoItem-> IsUseThumbnailSave() ); - // add data from dialog for possible recording purpose - rReq.AppendItem( SfxDocumentInfoItem( GetTitle(), - getDocProperties(), aNewCmisProperties, IsUseUserData(), IsUseThumbnailSave() ) ); + const SfxDocumentInfoItem* pDocInfoItem = SfxItemSet::GetItem<SfxDocumentInfoItem>(pDlg->GetOutputItemSet(), SID_DOCINFO, false); + if ( pDocInfoItem ) + { + // user has done some changes to DocumentInfo + pDocInfoItem->UpdateDocumentInfo(getDocProperties()); + uno::Sequence< document::CmisProperty > aNewCmisProperties = + pDocInfoItem->GetCmisProperties( ); + if ( aNewCmisProperties.getLength( ) > 0 ) + xCmisDoc->updateCmisProperties( aNewCmisProperties ); + SetUseUserData( pDocInfoItem->IsUseUserData() ); + SetUseThumbnailSave( pDocInfoItem-> IsUseThumbnailSave() ); + // add data from dialog for possible recording purpose + pReq->AppendItem( SfxDocumentInfoItem( GetTitle(), + getDocProperties(), aNewCmisProperties, IsUseUserData(), IsUseThumbnailSave() ) ); + } + pReq->Done(); } + else + // nothing done; no recording + pReq->Ignore(); + }; - rReq.Done(); - } - else - // nothing done; no recording - rReq.Ignore(); + pDlg->StartExecuteAsync(aCtx); + rReq.Ignore(); } return; |