diff --git a/cppuhelper/inc/cppuhelper/weak.hxx b/cppuhelper/inc/cppuhelper/weak.hxx index f4b9c38d2215..9072ba6f6240 100644 --- a/cppuhelper/inc/cppuhelper/weak.hxx +++ b/cppuhelper/inc/cppuhelper/weak.hxx @@ -67,6 +67,12 @@ protected: */ virtual ~OWeakObject() SAL_THROW( (::com::sun::star::uno::RuntimeException) ); + /** disposes and resets m_pWeakConnectionPoint + @precond + m_refCount equals 0 + */ + void disposeWeakConnectionPoint(); + /** reference count. @attention diff --git a/cppuhelper/source/cc5_solaris_sparc.map b/cppuhelper/source/cc5_solaris_sparc.map index 0c3f1c556d64..0961c6830d1f 100755 --- a/cppuhelper/source/cc5_solaris_sparc.map +++ b/cppuhelper/source/cc5_solaris_sparc.map @@ -379,3 +379,8 @@ UDK_3.6 { # OOo 3.0 __1cEcppuSOPropertySetHelper2t5B6Mrn0ATOBroadcastHelperVar4n0AbIOMultiTypeInterfaceContainerHelper_nDcomDsunEstarDunoEType___pn0AWIEventNotificationHook_b_v_; __1cEcppuSOPropertySetHelper2t6Mrn0ATOBroadcastHelperVar4n0AbIOMultiTypeInterfaceContainerHelper_nDcomDsunEstarDunoEType___pn0AWIEventNotificationHook_b_v_; } UDK_3.5; + +UDK_3.7 { # OOo 3.3 + global: + __1cEcppuLOWeakObjectbAdisposeWeakConnectionPoint6M_v_; +} UDK_3.6; diff --git a/cppuhelper/source/component.cxx b/cppuhelper/source/component.cxx index d94614703be5..728f6815c309 100644 --- a/cppuhelper/source/component.cxx +++ b/cppuhelper/source/component.cxx @@ -90,6 +90,10 @@ void OComponentHelper::release() throw() { if (! rBHelper.bDisposed) { + // *before* again incrementing our ref count, ensure that our weak connection point + // will not create references to us anymore (via XAdapter::queryAdapted) + disposeWeakConnectionPoint(); + Reference xHoldAlive( *this ); // First dispose try diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map index 819c3e046b30..9348e91525c0 100644 --- a/cppuhelper/source/gcc3.map +++ b/cppuhelper/source/gcc3.map @@ -373,3 +373,9 @@ UDK_3.5 { # OOo 3.0 _ZN4cppu18OPropertySetHelperC1ERNS_19OBroadcastHelperVarINS_34OMultiTypeInterfaceContainerHelperEN3com3sun4star3uno4TypeEEEPNS_22IEventNotificationHookEb; _ZN4cppu18OPropertySetHelperC2ERNS_19OBroadcastHelperVarINS_34OMultiTypeInterfaceContainerHelperEN3com3sun4star3uno4TypeEEEPNS_22IEventNotificationHookEb; } UDK_3.4; + +UDK_3.6 { # OOo 3.3 + global: + _ZN4cppu11OWeakObject26disposeWeakConnectionPointEv; +} UDK_3.5; + diff --git a/cppuhelper/source/implbase.cxx b/cppuhelper/source/implbase.cxx index 9caa4ca93615..acf05724c71b 100644 --- a/cppuhelper/source/implbase.cxx +++ b/cppuhelper/source/implbase.cxx @@ -247,6 +247,8 @@ void WeakComponentImplHelperBase::release() throw () { if (osl_decrementInterlockedCount( &m_refCount ) == 0) { + // ensure no other references are created, via the weak connection point, from now on + disposeWeakConnectionPoint(); // restore reference count: osl_incrementInterlockedCount( &m_refCount ); if (! rBHelper.bDisposed) { @@ -381,6 +383,8 @@ void WeakAggComponentImplHelperBase::release() OWeakAggObject::release(); } else if (osl_decrementInterlockedCount( &m_refCount ) == 0) { + // ensure no other references are created, via the weak connection point, from now on + disposeWeakConnectionPoint(); // restore reference count: osl_incrementInterlockedCount( &m_refCount ); if (! rBHelper.bDisposed) { diff --git a/cppuhelper/source/msvc_win32_intel.map b/cppuhelper/source/msvc_win32_intel.map index a90ec88f3ca3..c999ae200ac2 100644 --- a/cppuhelper/source/msvc_win32_intel.map +++ b/cppuhelper/source/msvc_win32_intel.map @@ -271,3 +271,8 @@ UDK_3.5 { # OOo 3.0 global: ??0OPropertySetHelper@cppu@@QAE@AAU?$OBroadcastHelperVar@VOMultiTypeInterfaceContainerHelper@cppu@@VType@uno@star@sun@com@@@1@PAVIEventNotificationHook@1@_N@Z; } UDK_3.4; + +UDK_3.6 { # OOo 3.3 + global: + ?disposeWeakConnectionPoint@OWeakObject@cppu@@IAEXXZ; +} UDK_3.5; diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx index c4055eba4f8a..b518d2526e3b 100644 --- a/cppuhelper/source/weak.cxx +++ b/cppuhelper/source/weak.cxx @@ -216,25 +216,31 @@ void SAL_CALL OWeakObject::release() throw() if (osl_decrementInterlockedCount( &m_refCount ) == 0) { // notify/clear all weak-refs before object's dtor is executed // (which may check weak-refs to this object): - if (m_pWeakConnectionPoint != 0) { - OWeakConnectionPoint * const p = m_pWeakConnectionPoint; - m_pWeakConnectionPoint = 0; - try { - p->dispose(); - } - catch (RuntimeException const& exc) { - OSL_ENSURE( - false, OUStringToOString( - exc.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); - static_cast(exc); - } - p->release(); - } + disposeWeakConnectionPoint(); // destroy object: delete this; } } +void OWeakObject::disposeWeakConnectionPoint() +{ + OSL_PRECOND( m_refCount == 0, "OWeakObject::disposeWeakConnectionPoint: only to be called with a ref count of 0!" ); + if (m_pWeakConnectionPoint != 0) { + OWeakConnectionPoint * const p = m_pWeakConnectionPoint; + m_pWeakConnectionPoint = 0; + try { + p->dispose(); + } + catch (RuntimeException const& exc) { + OSL_ENSURE( + false, OUStringToOString( + exc.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + static_cast(exc); + } + p->release(); + } +} + OWeakObject::~OWeakObject() SAL_THROW( (RuntimeException) ) { } diff --git a/offapi/com/sun/star/awt/XTopWindow2.idl b/offapi/com/sun/star/awt/XTopWindow2.idl new file mode 100644 index 000000000000..0cc289d42b17 --- /dev/null +++ b/offapi/com/sun/star/awt/XTopWindow2.idl @@ -0,0 +1,76 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +#ifndef __com_sun_star_awt_XTopWindow2_idl__ +#define __com_sun_star_awt_XTopWindow2_idl__ + +#include +#include + +//============================================================================= + +module com { module sun { module star { module awt { + +//============================================================================= + +/** extends XTopWindow with additional functionality + */ +interface XTopWindow2 : XTopWindow +{ + /** controls whether the window is currently maximized + */ + [attribute] boolean IsMaximized; + + /** controls whether the window is currently minimized + */ + [attribute] boolean IsMinimized; + + /** controls on which display the window is shown. + +

When retrieving this property, in case the window is positioned on multiple displays, + the number returned will be of the display containing the upper left pixel of the frame + area (that is of the client area on system decorated windows, or the frame area of + undecorated resp. owner decorated windows).

+ + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if you attempt to set this property to a value which does not correspond to the number + of an existing screen. + + @see com::sun::star::awt::DisplayAccess + @see com::sun::star::awt::DisplayInfo + */ + [attribute] long Display + { + set raises (::com::sun::star::lang::IndexOutOfBoundsException); + }; +}; + +//============================================================================= + +}; }; }; }; + +//============================================================================= + +#endif diff --git a/offapi/com/sun/star/awt/makefile.mk b/offapi/com/sun/star/awt/makefile.mk index c0c501cbe2c5..dd2e9857124c 100644 --- a/offapi/com/sun/star/awt/makefile.mk +++ b/offapi/com/sun/star/awt/makefile.mk @@ -305,6 +305,7 @@ IDLFILES=\ XToggleButton.idl\ XToolkit.idl\ XTopWindow.idl\ + XTopWindow2.idl\ XTopWindowListener.idl\ XUnitConversion.idl\ XUnoControlContainer.idl\