Resolves: tdf#128667 crash in csv import from paste

Change-Id: Id50d0a7e4f176ccf83292495cb229da492fbf381
Reviewed-on: https://gerrit.libreoffice.org/82287
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 3c4b3ec..af0bcfd 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -75,6 +75,11 @@ short AbstractScImportAsciiDlg_Impl::Execute()
    return m_xDlg->run();
}

bool AbstractScImportAsciiDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx)
{
    return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
}

short AbstractScAutoFormatDlg_Impl::Execute()
{
    return m_xDlg->run();
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index d6790a7..60e5a6b 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -101,13 +101,14 @@ OString Class::GetScreenshotId() const              \

class AbstractScImportAsciiDlg_Impl : public AbstractScImportAsciiDlg
{
    std::unique_ptr<ScImportAsciiDlg> m_xDlg;
    std::shared_ptr<ScImportAsciiDlg> m_xDlg;
public:
    explicit AbstractScImportAsciiDlg_Impl(std::unique_ptr<ScImportAsciiDlg> p)
        : m_xDlg(std::move(p))
    {
    }
    virtual short Execute() override;
    virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override;
    virtual void                        GetOptions( ScAsciiOptions& rOpt ) override;
    virtual void                        SaveParameters() override;

diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 2cc61bc..1cffcef 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -378,6 +378,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,

                        if (bShowErrorDialog)
                            ErrorMessage(STR_PASTE_ERROR);
                        pDlg->disposeOnce();
                    });
                    return true;
                }