Kaydet (Commit) d095a887 authored tarafından Noel Grandin's avatar Noel Grandin

make Insert->Header and Footer dialog async

Change-Id: Icb2c507970c35a8ddee47912915882dede87ebca
Reviewed-on: https://gerrit.libreoffice.org/66099
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst a2b78c13
...@@ -35,7 +35,8 @@ public: \ ...@@ -35,7 +35,8 @@ public: \
virtual BitmapEx createScreenshot() const override; \ virtual BitmapEx createScreenshot() const override; \
virtual OString GetScreenshotId() const override; \ virtual OString GetScreenshotId() const override; \
virtual ~Class() override; \ virtual ~Class() override; \
virtual short Execute() override ; virtual short Execute() override; \
virtual bool StartExecuteAsync(AsyncContext &ctx) override;
#define IMPL_ABSTDLG_BASE(Class) \ #define IMPL_ABSTDLG_BASE(Class) \
std::vector<OString> Class::getAllPageUIXMLDescriptions() const { return pDlg->getAllPageUIXMLDescriptions(); } \ std::vector<OString> Class::getAllPageUIXMLDescriptions() const { return pDlg->getAllPageUIXMLDescriptions(); } \
...@@ -48,6 +49,10 @@ Class::~Class() \ ...@@ -48,6 +49,10 @@ Class::~Class() \
short Class::Execute() \ short Class::Execute() \
{ \ { \
return pDlg->Execute(); \ return pDlg->Execute(); \
} \
bool Class::StartExecuteAsync(AsyncContext &ctx) \
{ \
return pDlg->StartExecuteAsync(ctx); \
} }
namespace sd { namespace sd {
......
...@@ -295,16 +295,16 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) ...@@ -295,16 +295,16 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
case SID_INSERT_DATE_TIME: case SID_INSERT_DATE_TIME:
{ {
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
ScopedVclPtr<AbstractHeaderFooterDialog> pDlg(pFact ? pFact->CreateHeaderFooterDialog( this, GetActiveWindow(), GetDoc(), mpActualPage ) : nullptr); VclPtr<AbstractHeaderFooterDialog> pDlg(pFact ? pFact->CreateHeaderFooterDialog( this, GetActiveWindow(), GetDoc(), mpActualPage ) : nullptr);
pDlg->Execute(); std::shared_ptr<SfxRequest> xRequest(new SfxRequest(rReq));
pDlg.disposeAndClear(); rReq.Ignore(); // the 'old' request is not relevant any more
pDlg->StartExecuteAsync([this, xRequest](sal_Int32 /*nResult*/){
GetActiveWindow()->Invalidate(); GetActiveWindow()->Invalidate();
UpdatePreview( mpActualPage ); UpdatePreview( mpActualPage );
Invalidate();
rReq.Done ();
Invalidate();
xRequest->Done();
});
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment