diff options
author | Michael Warner <michael.warner.ut+libreoffice@gmail.com> | 2021-07-07 21:12:28 -0400 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2021-08-20 11:43:06 +0200 |
commit | 080e4550257a90597c241f83fd766b99c83ba6e8 (patch) | |
tree | 52fb5665d85a8815fa4f50baf3111c3b65d0396a /extensions/source | |
parent | e367e59e37499d0efca381f0b41df52c7cfc2026 (diff) |
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@collabora.com>
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/ole/unoobjw.cxx | 68 |
1 files changed, 0 insertions, 68 deletions
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) |