summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/dialogs/SignatureLineDialogBase.cxx6
-rw-r--r--cui/source/factory/dlgfact.cxx2
-rw-r--r--cui/source/factory/dlgfact.hxx4
-rw-r--r--cui/source/inc/SignSignatureLineDialog.hxx3
-rw-r--r--cui/source/inc/SignatureLineDialog.hxx4
-rw-r--r--cui/source/inc/SignatureLineDialogBase.hxx1
-rw-r--r--include/vcl/abstdlg.hxx4
-rw-r--r--sc/source/ui/view/tabvwshb.cxx18
-rw-r--r--sw/inc/view.hxx2
-rw-r--r--sw/source/uibase/uiview/viewdlg2.cxx20
10 files changed, 46 insertions, 18 deletions
diff --git a/cui/source/dialogs/SignatureLineDialogBase.cxx b/cui/source/dialogs/SignatureLineDialogBase.cxx
index e0ae28fe5040..fb154c34319d 100644
--- a/cui/source/dialogs/SignatureLineDialogBase.cxx
+++ b/cui/source/dialogs/SignatureLineDialogBase.cxx
@@ -26,10 +26,8 @@ SignatureLineDialogBase::SignatureLineDialogBase(weld::Widget* pParent, Referenc
short SignatureLineDialogBase::run()
{
- short nRet = GenericDialogController::run();
- if (nRet == RET_OK)
- Apply();
- return nRet;
+ assert(false && "these dialogs are async now");
+ return -1;
}
OUString SignatureLineDialogBase::getCDataString(std::u16string_view rString)
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 3e680e54ba91..a856d84c6901 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -113,7 +113,7 @@ IMPL_ABSTDLG_CLASS(AbstractHangulHanjaConversionDialog)
IMPL_ABSTDLG_CLASS(AbstractInsertObjectDialog)
IMPL_ABSTDLG_CLASS_ASYNC(AbstractLinksDialog, SvBaseLinksDlg)
IMPL_ABSTDLG_CLASS(AbstractScreenshotAnnotationDlg)
-IMPL_ABSTDLG_CLASS(AbstractSignatureLineDialog)
+IMPL_ABSTDLG_CLASS_ASYNC(AbstractSignatureLineDialog, SignatureLineDialog)
IMPL_ABSTDLG_CLASS_ASYNC(AbstractSignSignatureLineDialog, SignSignatureLineDialog)
IMPL_ABSTDLG_CLASS_ASYNC(AbstractSvxCharacterMapDialog, SvxCharacterMap)
IMPL_ABSTDLG_CLASS(AbstractSvxHpLinkDlg)
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index eccd43980bf0..0125c975ae79 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -403,7 +403,8 @@ DECL_ABSTDLG_CLASS(AbstractScreenshotAnnotationDlg,ScreenshotAnnotationDlg)
};
// AbstractSignatureLineDialog_Impl
-DECL_ABSTDLG_CLASS(AbstractSignatureLineDialog,SignatureLineDialog)
+DECL_ABSTDLG_CLASS_ASYNC(AbstractSignatureLineDialog,SignatureLineDialog)
+ virtual void Apply() override { m_xDlg->Apply(); }
};
// AbstractQrCodeGenDialog_Impl
@@ -412,6 +413,7 @@ DECL_ABSTDLG_CLASS_ASYNC(AbstractQrCodeGenDialog,QrCodeGenDialog)
// AbstractSignSignatureLineDialog_Impl
DECL_ABSTDLG_CLASS_ASYNC(AbstractSignSignatureLineDialog,SignSignatureLineDialog)
+ virtual void Apply() override { m_xDlg->Apply(); }
};
// AbstractAdditionsDialog_Impl
diff --git a/cui/source/inc/SignSignatureLineDialog.hxx b/cui/source/inc/SignSignatureLineDialog.hxx
index 5abe1969e32c..7c894a16a0b3 100644
--- a/cui/source/inc/SignSignatureLineDialog.hxx
+++ b/cui/source/inc/SignSignatureLineDialog.hxx
@@ -20,6 +20,8 @@ class SignSignatureLineDialog : public SignatureLineDialogBase
public:
SignSignatureLineDialog(weld::Widget* pParent, css::uno::Reference<css::frame::XModel> xModel);
+ void Apply();
+
private:
std::unique_ptr<weld::Entry> m_xEditName;
std::unique_ptr<weld::TextView> m_xEditComment;
@@ -42,7 +44,6 @@ private:
void ValidateFields();
css::uno::Reference<css::graphic::XGraphic> getSignedGraphic(bool bValid);
- virtual void Apply() override;
DECL_LINK(clearImage, weld::Button&, void);
DECL_LINK(loadImage, weld::Button&, void);
diff --git a/cui/source/inc/SignatureLineDialog.hxx b/cui/source/inc/SignatureLineDialog.hxx
index 73b093f601a5..e686cb4a4123 100644
--- a/cui/source/inc/SignatureLineDialog.hxx
+++ b/cui/source/inc/SignatureLineDialog.hxx
@@ -19,6 +19,8 @@ public:
SignatureLineDialog(weld::Widget* pParent, css::uno::Reference<css::frame::XModel> xModel,
bool bEditExisting);
+ void Apply();
+
private:
std::unique_ptr<weld::Entry> m_xEditName;
std::unique_ptr<weld::Entry> m_xEditTitle;
@@ -29,8 +31,6 @@ private:
css::uno::Reference<css::beans::XPropertySet> m_xExistingShapeProperties;
OUString m_aSignatureLineId;
-
- virtual void Apply() override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/cui/source/inc/SignatureLineDialogBase.hxx b/cui/source/inc/SignatureLineDialogBase.hxx
index dd114d81ab7d..4e0a3f298e5b 100644
--- a/cui/source/inc/SignatureLineDialogBase.hxx
+++ b/cui/source/inc/SignatureLineDialogBase.hxx
@@ -27,7 +27,6 @@ public:
protected:
css::uno::Reference<css::frame::XModel> m_xModel;
- virtual void Apply() = 0;
static OUString getCDataString(std::u16string_view rString);
};
diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx
index 9fbe53529cff..5eaf46061e69 100644
--- a/include/vcl/abstdlg.hxx
+++ b/include/vcl/abstdlg.hxx
@@ -119,12 +119,16 @@ class VCL_DLLPUBLIC AbstractSignatureLineDialog : public VclAbstractDialog
{
protected:
virtual ~AbstractSignatureLineDialog() override = default;
+public:
+ virtual void Apply() = 0;
};
class VCL_DLLPUBLIC AbstractSignSignatureLineDialog : public VclAbstractDialog
{
protected:
virtual ~AbstractSignSignatureLineDialog() override = default;
+public:
+ virtual void Apply() = 0;
};
class VCL_DLLPUBLIC AbstractQrCodeGenDialog : public VclAbstractDialog
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index 1db954039a36..098ea68d33d5 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -402,9 +402,19 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
const uno::Reference<frame::XModel> xModel( GetViewData().GetDocShell()->GetBaseModel() );
VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractSignatureLineDialog> pDialog(pFact->CreateSignatureLineDialog(
+ VclPtr<AbstractSignatureLineDialog> pDialog(pFact->CreateSignatureLineDialog(
pWin->GetFrameWeld(), xModel, rReq.GetSlot() == SID_EDIT_SIGNATURELINE));
- pDialog->Execute();
+ auto xRequest = std::make_shared<SfxRequest>(rReq);
+ rReq.Ignore(); // the 'old' request is not relevant any more
+ pDialog->StartExecuteAsync(
+ [pDialog, xRequest] (sal_Int32 nResult)->void
+ {
+ if (nResult == RET_OK)
+ pDialog->Apply();
+ pDialog->disposeOnce();
+ xRequest->Done();
+ }
+ );
break;
}
@@ -417,8 +427,10 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
VclPtr<AbstractSignSignatureLineDialog> pDialog(
pFact->CreateSignSignatureLineDialog(GetFrameWeld(), xModel));
pDialog->StartExecuteAsync(
- [pDialog] (sal_Int32 /*nResult*/)->void
+ [pDialog] (sal_Int32 nResult)->void
{
+ if (nResult == RET_OK)
+ pDialog->Apply();
pDialog->disposeOnce();
}
);
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index 3aa6524ac74b..d735e5e6e94a 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -518,7 +518,7 @@ public:
void Execute(SfxRequest&);
void ExecLingu(SfxRequest&);
void ExecDlg(SfxRequest const &);
- void ExecDlgExt(SfxRequest const &);
+ void ExecDlgExt(SfxRequest&);
void ExecColl(SfxRequest const &);
void ExecutePrint(SfxRequest&);
void ExecDraw(const SfxRequest&);
diff --git a/sw/source/uibase/uiview/viewdlg2.cxx b/sw/source/uibase/uiview/viewdlg2.cxx
index 38cdb7ecac54..696ce623a0a6 100644
--- a/sw/source/uibase/uiview/viewdlg2.cxx
+++ b/sw/source/uibase/uiview/viewdlg2.cxx
@@ -46,7 +46,7 @@
using namespace css;
-void SwView::ExecDlgExt(SfxRequest const& rReq)
+void SwView::ExecDlgExt(SfxRequest& rReq)
{
switch (rReq.GetSlot())
{
@@ -65,9 +65,19 @@ void SwView::ExecDlgExt(SfxRequest const& rReq)
{
VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();
const uno::Reference<frame::XModel> xModel(GetCurrentDocument());
- ScopedVclPtr<AbstractSignatureLineDialog> pDialog(pFact->CreateSignatureLineDialog(
+ VclPtr<AbstractSignatureLineDialog> pDialog(pFact->CreateSignatureLineDialog(
GetFrameWeld(), xModel, rReq.GetSlot() == SID_EDIT_SIGNATURELINE));
- pDialog->Execute();
+ auto xRequest = std::make_shared<SfxRequest>(rReq);
+ rReq.Ignore(); // the 'old' request is not relevant any more
+ pDialog->StartExecuteAsync(
+ [pDialog, xRequest] (sal_Int32 nResult)->void
+ {
+ if (nResult == RET_OK)
+ pDialog->Apply();
+ pDialog->disposeOnce();
+ xRequest->Done();
+ }
+ );
break;
}
case SID_INSERT_QRCODE:
@@ -108,8 +118,10 @@ void SwView::ExecDlgExt(SfxRequest const& rReq)
VclPtr<AbstractSignSignatureLineDialog> pDialog(
pFact->CreateSignSignatureLineDialog(GetFrameWeld(), xModel));
pDialog->StartExecuteAsync(
- [pDialog] (sal_Int32 /*nResult*/)->void
+ [pDialog] (sal_Int32 nResult)->void
{
+ if (nResult == RET_OK)
+ pDialog->Apply();
pDialog->disposeOnce();
}
);