summaryrefslogtreecommitdiff
path: root/sw/source/uibase/shells/textsh.cxx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2019-04-17 17:33:10 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2020-03-02 10:30:52 +0100
commited86b6250cd00ed6b7bdb81307bc66adba129cae (patch)
tree40649a37d732c53c4e951d3325724a4878c75bb1 /sw/source/uibase/shells/textsh.cxx
parent8e323fcacebad1afe9d867b846722a6b9bf20f78 (diff)
Make Chart Creation Wizard async
* FuInsertChart as a memeber in ScTabViewShell stores instance is needed to react on the dialog's result * CreationWizardUnoDlg converted to XAsynchronousExecutableDialog added dialog close handler which notifies listeners In the Online dialog become dead after closing, additional PostUserEvent was needed to kill the dialog after real close (without it user needed to select any cell to close dialog) * Reuse in Writer Change-Id: I9fe123d5c189d568f0edb4d36173a224a820a8a3 Reviewed-on: https://gerrit.libreoffice.org/79654 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/79571 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sw/source/uibase/shells/textsh.cxx')
-rw-r--r--sw/source/uibase/shells/textsh.cxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index ef1341d078bc..c16dcf1a7cfc 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -87,9 +87,30 @@ using namespace ::com::sun::star;
#include <drawdoc.hxx>
#include <svtools/embedhlp.hxx>
#include <sfx2/event.hxx>
+#include <com/sun/star/ui/dialogs/DialogClosedEvent.hpp>
+#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+#include <IDocumentUndoRedo.hxx>
SFX_IMPL_INTERFACE(SwTextShell, SwBaseShell)
+IMPL_STATIC_LINK( SwTextShell, DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, pEvent, void )
+{
+ SwView* pView = ::GetActiveView();
+ SwWrtShell& rWrtShell = pView->GetWrtShell();
+
+ sal_Int16 nDialogRet = pEvent->DialogResult;
+ if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL )
+ {
+ rWrtShell.Undo();
+ rWrtShell.GetIDocumentUndoRedo().ClearRedo();
+ }
+ else
+ {
+ OSL_ENSURE( nDialogRet == ui::dialogs::ExecutableDialogResults::OK,
+ "dialog execution failed" );
+ }
+}
+
void SwTextShell::InitInterface_Impl()
{
GetStaticInterface()->RegisterPopupMenu("text");
@@ -303,7 +324,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
break;
if(!rReq.IsAPI())
{
- SwInsertChart();
+ SwInsertChart( LINK( this, SwTextShell, DialogClosedHdl ) );
}
else
{