summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2019-07-11 22:01:47 +0300
committerMuhammet Kara <muhammet.kara@collabora.com>2019-07-12 13:12:28 +0200
commit429faad8e7031a1483afcf3573b661648d5aa798 (patch)
treef93ecba92d7c18de67a92dfc9070ce501bb9b360 /sw/source
parent6193948d171a549a9902d68167f294732e618aaa (diff)
lokdialog: Convert the Paste Special dialog to async exec for sw
Change-Id: I0c75def6ea09bcb191a8023421b371b49205e712 Reviewed-on: https://gerrit.libreoffice.org/75378 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/75406 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/75434
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/shells/basesh.cxx33
1 files changed, 19 insertions, 14 deletions
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index 8a7f3ca4a2e3..649a48ab8eb2 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -370,34 +370,37 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
case SID_PASTE_SPECIAL:
{
- TransferableDataHelper aDataHelper(
- TransferableDataHelper::CreateFromSystemClipboard( &rSh.GetView().GetEditWin()) );
- if( aDataHelper.GetXTransferable().is()
- && SwTransferable::IsPaste( rSh, aDataHelper )
+ std::shared_ptr<TransferableDataHelper> aDataHelper;
+ aDataHelper.reset(new TransferableDataHelper( TransferableDataHelper::CreateFromSystemClipboard( &rSh.GetView().GetEditWin()) ));
+
+ if( aDataHelper->GetXTransferable().is()
+ && SwTransferable::IsPaste( rSh, *aDataHelper )
&& !rSh.CursorInsideInputField() )
{
- // Temporary variables, because the shell could already be
- // destroyed after the paste.
- SwView* pView = &rView;
- SotClipboardFormatId nFormatId = SotClipboardFormatId::NONE;
-
rReq.Ignore();
bIgnore = true;
- bool bRet = false;
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
VclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( &rSh.GetView().GetEditWin() ));
// Prepare the dialog
- SwTransferable::PrePasteSpecial(rSh, aDataHelper, pDlg);
- pDlg->PreGetFormat(aDataHelper);
+ SwTransferable::PrePasteSpecial(rSh, *aDataHelper, pDlg);
+ pDlg->PreGetFormat(*aDataHelper);
- if (pDlg->Execute() == RET_OK)
+ pDlg->StartExecuteAsync([=, &rSh](sal_Int32 nResult){
+ if (nResult == RET_OK)
{
+
+ // Temporary variables, because the shell could already be
+ // destroyed after the paste.
+ SwView* pView = &rView;
+ SotClipboardFormatId nFormatId = SotClipboardFormatId::NONE;
+ bool bRet = false;
+
nFormatId = pDlg->GetFormatOnly();
if( nFormatId != SotClipboardFormatId::NONE )
- bRet = SwTransferable::PasteFormat( rSh, aDataHelper, nFormatId );
+ bRet = SwTransferable::PasteFormat( rSh, *aDataHelper, nFormatId );
if (bRet)
{
@@ -417,6 +420,8 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
}
pDlg->disposeOnce();
+
+ });
}
else
return;