summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/source/vbahelper/vbaapplicationbase.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 198c71fb6c45..a0268237efe6 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
@@ -37,6 +37,7 @@
#include <rtl/ref.hxx>
#include <tools/datetime.hxx>
#include <vcl/timer.hxx>
+#include <vcl/svapp.hxx>
#include <basic/sbx.hxx>
#include <basic/sbstar.hxx>
@@ -45,6 +46,8 @@
#include <basic/sbmod.hxx>
#include <basic/vbahelper.hxx>
+#include <comphelper/asyncquithandler.hxx>
+
#include "vbacommandbars.hxx"
#include <unordered_map>
@@ -440,6 +443,15 @@ void VbaApplicationBase::Quit()
pBasic->QuitAndExitApplication();
}
}
+ else
+ {
+ // This is the case of a call from an (OLE) Automation client.
+
+ // TODO: Probably we should just close any document windows open by the "application"
+ // (Writer or Calc) the call being handled is for. And only then, if no document windows
+ // are left open, quit the actual LibreOffice application.
+ Application::PostUserEvent( LINK( &AsyncQuitHandler::instance(), AsyncQuitHandler, OnAsyncQuit ) );
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */