diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-10 15:07:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-18 14:26:44 +0100 |
commit | 9da3e7e5a0202538db0d35f74bd77be311ac54a9 (patch) | |
tree | bca197b5f21a107e71e2c91dd709f5bdbab9d088 /sd | |
parent | 171710c655061b3ac80b764cb234eec02224b639 (diff) |
make Insert->Header and Footer dialog async
Reviewed-on: https://gerrit.libreoffice.org/66099
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit d095a887a9b0cce81b4f828feed759b5d0b3ad3f)
Change-Id: Icb2c507970c35a8ddee47912915882dede87ebca
Reviewed-on: https://gerrit.libreoffice.org/66159
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Mert Tümer <mert.tumer@collabora.com>
Tested-by: Mert Tümer <mert.tumer@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/dlg/sddlgfact.hxx | 7 | ||||
-rw-r--r-- | sd/source/ui/view/drviews3.cxx | 17 |
2 files changed, 13 insertions, 11 deletions
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx index 17e8a10ae976..0627bb34c1b6 100644 --- a/sd/source/ui/dlg/sddlgfact.hxx +++ b/sd/source/ui/dlg/sddlgfact.hxx @@ -34,7 +34,8 @@ public: \ virtual Bitmap createScreenshot() const override; \ virtual OString GetScreenshotId() const override; \ virtual ~Class() override; \ - virtual short Execute() override ; + virtual short Execute() override; \ + virtual bool StartExecuteAsync(AsyncContext &ctx) override; #define IMPL_ABSTDLG_BASE(Class) \ std::vector<OString> Class::getAllPageUIXMLDescriptions() const { return pDlg->getAllPageUIXMLDescriptions(); } \ @@ -47,6 +48,10 @@ Class::~Class() \ short Class::Execute() \ { \ return pDlg->Execute(); \ +} \ +bool Class::StartExecuteAsync(AsyncContext &ctx) \ +{ \ + return pDlg->StartExecuteAsync(ctx); \ } namespace sd { diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index f8f398dd91ca..8f4d99283373 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -289,19 +289,16 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) case SID_INSERT_DATE_TIME: { SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractHeaderFooterDialog> pDlg(pFact ? pFact->CreateHeaderFooterDialog( this, GetActiveWindow(), GetDoc(), mpActualPage ) : nullptr); - if( pDlg ) - { - pDlg->Execute(); - pDlg.disposeAndClear(); - + VclPtr<AbstractHeaderFooterDialog> pDlg(pFact ? pFact->CreateHeaderFooterDialog( this, GetActiveWindow(), GetDoc(), mpActualPage ) : nullptr); + std::shared_ptr<SfxRequest> xRequest(new SfxRequest(rReq)); + rReq.Ignore(); // the 'old' request is not relevant any more + pDlg->StartExecuteAsync([this, xRequest](sal_Int32 /*nResult*/){ GetActiveWindow()->Invalidate(); UpdatePreview( mpActualPage ); - } - - Invalidate(); - rReq.Done (); + Invalidate(); + xRequest->Done(); + }); break; } |