diff options
Diffstat (limited to 'extensions/source/ole/unoobjw.cxx')
-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) |