CWS-TOOLING: integrate CWS dba33a

This commit is contained in:
Kurt Zenker 2009-12-01 13:17:08 +01:00
commit c57366aeed
9 changed files with 127 additions and 14 deletions

View file

@ -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

View file

@ -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;

View file

@ -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<XInterface > xHoldAlive( *this );
// First dispose
try

View file

@ -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;

View file

@ -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) {

View file

@ -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;

View file

@ -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<void>(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<void>(exc);
}
p->release();
}
}
OWeakObject::~OWeakObject() SAL_THROW( (RuntimeException) )
{
}

View file

@ -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
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
************************************************************************/
#ifndef __com_sun_star_awt_XTopWindow2_idl__
#define __com_sun_star_awt_XTopWindow2_idl__
#include <com/sun/star/awt/XTopWindow.idl>
#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
//=============================================================================
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.
<p>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).</p>
@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

View file

@ -305,6 +305,7 @@ IDLFILES=\
XToggleButton.idl\
XToolkit.idl\
XTopWindow.idl\
XTopWindow2.idl\
XTopWindowListener.idl\
XUnitConversion.idl\
XUnoControlContainer.idl\