[Libreoffice-commits] core.git: comphelper/source extensions/Library_oleautobridge.mk extensions/source include/comphelper vbahelper/source
Michael Warner (via logerrit)
logerrit at kemper.freedesktop.org
Fri Aug 20 09:43:47 UTC 2021
comphelper/source/misc/asyncquithandler.cxx | 9 --
extensions/Library_oleautobridge.mk | 1
extensions/source/ole/unoobjw.cxx | 68 ----------------------
include/comphelper/asyncquithandler.hxx | 8 --
vbahelper/source/vbahelper/vbaapplicationbase.cxx | 4 -
5 files changed, 1 insertion(+), 89 deletions(-)
New commits:
commit 080e4550257a90597c241f83fd766b99c83ba6e8
Author: Michael Warner <michael.warner.ut+libreoffice at gmail.com>
AuthorDate: Wed Jul 7 21:12:28 2021 -0400
Commit: Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Fri Aug 20 11:43:06 2021 +0200
tdf#141097 Revert "Veto process exit while an OLE client is connected"
This reverts changes that were made to prevent process exit when an
OLE client is connected. These commits had the side effect of preventing
the use case of creating a document via OLE, and then allowing
the user to view/edit and ultimately quit from the GUI.
Revert "More hacks for quit requests from an OLE Automation client"
This reverts commit 05e03911cd1f8a355b6410d3997cffc2c794a1e9.
Revert "Veto process exit while an OLE client is connected"
This reverts commit 89f883bd90a50587868a57397b6350ed9559a20f.
Change-Id: I29a1e42a830815bc8d1ff0056c22d86b8f98cc1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118596
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml at collabora.com>
diff --git a/comphelper/source/misc/asyncquithandler.cxx b/comphelper/source/misc/asyncquithandler.cxx
index fd53cbd9bf4b..a04534ec92e8 100644
--- a/comphelper/source/misc/asyncquithandler.cxx
+++ b/comphelper/source/misc/asyncquithandler.cxx
@@ -24,10 +24,7 @@
#include <comphelper/asyncquithandler.hxx>
#include <comphelper/processfactory.hxx>
-AsyncQuitHandler::AsyncQuitHandler()
- : mbForceQuit(false)
-{
-}
+AsyncQuitHandler::AsyncQuitHandler() {}
AsyncQuitHandler& AsyncQuitHandler::instance()
{
@@ -42,10 +39,6 @@ void AsyncQuitHandler::QuitApplication()
xDesktop->terminate();
}
-void AsyncQuitHandler::SetForceQuit() { mbForceQuit = true; }
-
-bool AsyncQuitHandler::IsForceQuit() const { return mbForceQuit; }
-
IMPL_STATIC_LINK_NOARG(AsyncQuitHandler, OnAsyncQuit, void*, void) { QuitApplication(); }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/Library_oleautobridge.mk b/extensions/Library_oleautobridge.mk
index 6aaf5555e250..ec59f715c504 100644
--- a/extensions/Library_oleautobridge.mk
+++ b/extensions/Library_oleautobridge.mk
@@ -35,7 +35,6 @@ $(eval $(call gb_Library_use_libraries,oleautobridge,\
cppuhelper \
cppu \
sal \
- tl \
))
$(eval $(call gb_Library_use_system_win32_libs,oleautobridge,\
diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx
index 595d4276e3c4..a6cd0677d6ae 100644
--- a/extensions/source/ole/unoobjw.cxx
+++ b/extensions/source/ole/unoobjw.cxx
@@ -57,13 +57,9 @@
#include <salhelper/simplereferenceobject.hxx>
#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
-#include <tools/diagnose_ex.h>
#include <sal/log.hxx>
#include <com/sun/star/beans/MethodConcept.hpp>
#include <com/sun/star/beans/PropertyConcept.hpp>
-#include <com/sun/star/frame/Desktop.hpp>
-#include <com/sun/star/frame/TerminationVetoException.hpp>
-#include <com/sun/star/frame/XTerminateListener.hpp>
#include <com/sun/star/lang/NoSuchMethodException.hpp>
#include <com/sun/star/script/CannotConvertException.hpp>
#include <com/sun/star/script/FailReason.hpp>
@@ -86,7 +82,6 @@
#include <osl/interlck.h>
#include <com/sun/star/uno/genfunc.h>
#include <comphelper/automationinvokedzone.hxx>
-#include <comphelper/asyncquithandler.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/profilezone.hxx>
#include <comphelper/windowsdebugoutput.hxx>
@@ -117,64 +112,6 @@ static bool writeBackOutParameter(VARIANTARG* pDest, VARIANT* pSource);
static bool writeBackOutParameter2( VARIANTARG* pDest, VARIANT* pSource);
static HRESULT mapCannotConvertException(const CannotConvertException &e, unsigned int * puArgErr);
-namespace {
-
-class TerminationVetoer : public WeakImplHelper<css::frame::XTerminateListener>
-{
-public:
- int mnCount;
-
-private:
- TerminationVetoer()
- : mnCount(0)
- {
- try
- {
- Reference< css::frame::XDesktop > xDesktop =
- css::frame::Desktop::create( comphelper::getProcessComponentContext() );
- xDesktop->addTerminateListener( this );
- }
- catch ( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION("extensions.olebridge");
- }
- }
-
-public:
- static rtl::Reference< TerminationVetoer > get()
- {
- static rtl::Reference< TerminationVetoer > aInstance( new TerminationVetoer );
-
- return aInstance;
- }
-
- // XTerminateListener
- void SAL_CALL queryTermination( const EventObject& ) override
- {
- SAL_INFO("extensions.olebridge", "TerminationVetoer::queryTermination: count=" << mnCount);
- // Always veto termination while an OLE object is active, except if it is an OLE object that
- // has asked us to quit.
- if (!AsyncQuitHandler::instance().IsForceQuit() && mnCount > 0)
- {
- SAL_INFO("extensions.olebridge", "TerminationVetoer::queryTermination: Throwing!");
- throw css::frame::TerminationVetoException();
- }
- }
-
- void SAL_CALL notifyTermination( const EventObject& ) override
- {
- // ???
- }
-
- // XEventListener
- void SAL_CALL disposing( const css::lang::EventObject& ) override
- {
- // ???
- }
-};
-
-}
-
/* Does not throw any exceptions.
Param pInfo can be NULL.
*/
@@ -193,8 +130,6 @@ InterfaceOleWrapper::InterfaceOleWrapper( Reference<XMultiServiceFactory> const
UnoConversionUtilities<InterfaceOleWrapper>( xFactory, unoWrapperClass, comWrapperClass),
m_defaultValueType( 0)
{
- TerminationVetoer::get()->mnCount++;
- SAL_INFO("extensions.olebridge", "InterfaceOleWrapper CTOR, count=" << TerminationVetoer::get()->mnCount);
}
InterfaceOleWrapper::~InterfaceOleWrapper()
@@ -204,9 +139,6 @@ InterfaceOleWrapper::~InterfaceOleWrapper()
auto it = UnoObjToWrapperMap.find( reinterpret_cast<sal_uIntPtr>(m_xOrigin.get()));
if(it != UnoObjToWrapperMap.end())
UnoObjToWrapperMap.erase(it);
-
- TerminationVetoer::get()->mnCount--;
- SAL_INFO("extensions.olebridge", "InterfaceOleWrapper DTOR, count=" << TerminationVetoer::get()->mnCount);
}
COM_DECLSPEC_NOTHROW STDMETHODIMP InterfaceOleWrapper::QueryInterface(REFIID riid, void ** ppv)
diff --git a/include/comphelper/asyncquithandler.hxx b/include/comphelper/asyncquithandler.hxx
index 9d994d177592..ce3db23a147a 100644
--- a/include/comphelper/asyncquithandler.hxx
+++ b/include/comphelper/asyncquithandler.hxx
@@ -29,8 +29,6 @@ class COMPHELPER_DLLPUBLIC AsyncQuitHandler
{
AsyncQuitHandler();
- bool mbForceQuit;
-
public:
AsyncQuitHandler(const AsyncQuitHandler&) = delete;
const AsyncQuitHandler& operator=(const AsyncQuitHandler&) = delete;
@@ -38,12 +36,6 @@ public:
static AsyncQuitHandler& instance();
static void QuitApplication();
- // Hack for the TerminationVetoer in extensions/source/ole/unoobjw.cxx. When it is an Automation
- // client itself that explicitly requests a quit (see VbaApplicationBase::Quit()), we do quit.
- // The flag can only be set to true, not back to false.
- void SetForceQuit();
- bool IsForceQuit() const;
-
DECL_STATIC_LINK(AsyncQuitHandler, OnAsyncQuit, void*, void);
};
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 836781c95d78..382ad3eea6ab 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -471,13 +471,9 @@ void VbaApplicationBase::Quit()
{
// This is the case of a call from an (OLE) Automation client.
- // When an Automation client itself asks the process to quit, it should obey it.
- AsyncQuitHandler::instance().SetForceQuit();
-
// 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 ) );
}
}
More information about the Libreoffice-commits
mailing list