[Libreoffice-commits] core.git: vbahelper/source

Tor Lillqvist tml at collabora.com
Wed May 30 11:43:22 UTC 2018


 vbahelper/source/vbahelper/vbaapplicationbase.cxx |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit d7f69b1cb4dbdd39970d56d0c340d7abb92fbdc1
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Mar 5 22:00:54 2018 +0200

    Add code to VbaApplicationBase::Quit() for the Automation client case
    
    Change-Id: I4354adf5353bdfb0b080b24a5c49e3d22539eb23
    Reviewed-on: https://gerrit.libreoffice.org/55051
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

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: */


More information about the Libreoffice-commits mailing list