summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-01-10 15:07:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-01-11 11:55:55 +0100
commitd095a887a9b0cce81b4f828feed759b5d0b3ad3f (patch)
treeb37708c6c599570cac3931479c9bcb8a03f66b65 /sd
parenta2b78c131db2bbe3555a89dfae32aefcd00949f5 (diff)
make Insert->Header and Footer dialog async
Change-Id: Icb2c507970c35a8ddee47912915882dede87ebca Reviewed-on: https://gerrit.libreoffice.org/66099 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/dlg/sddlgfact.hxx7
-rw-r--r--sd/source/ui/view/drviews3.cxx18
2 files changed, 15 insertions, 10 deletions
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index 6e206bbeb7b1..ebf4e4980b3c 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -35,7 +35,8 @@ public: \
virtual BitmapEx 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(); } \
@@ -48,6 +49,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 b2ab0cbbb573..7d0d48fed5d3 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -295,16 +295,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);
- pDlg->Execute();
- pDlg.disposeAndClear();
-
- GetActiveWindow()->Invalidate();
- UpdatePreview( mpActualPage );
-
- Invalidate();
- rReq.Done ();
+ 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();
+ xRequest->Done();
+ });
break;
}