From 750fc206113a796035cbc05fb904fbae0eb771a8 Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud Date: Sat, 22 Sep 2012 01:51:12 -0500 Subject: replace remaining InterlockedCount() with inlined version Change-Id: Ifcfa48fc87f905a91470a5b0fd597b02f220784c Reviewed-on: https://gerrit.libreoffice.org/671 Tested-by: Norbert Thiebaud Reviewed-by: Norbert Thiebaud --- forms/source/component/DatabaseForm.cxx | 8 ++++---- forms/source/component/Date.cxx | 4 ++-- forms/source/component/FormComponent.cxx | 4 ++-- forms/source/component/FormattedFieldWrapper.cxx | 4 ++-- forms/source/component/FormsCollection.cxx | 4 ++-- forms/source/component/Grid.cxx | 4 ++-- forms/source/component/ImageControl.cxx | 4 ++-- forms/source/component/clickableimage.cxx | 4 ++-- forms/source/helper/windowstateguard.cxx | 4 ++-- forms/source/richtext/rtattributehandler.cxx | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) (limited to 'forms') diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index d73487cd883d..7938066b0d30 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -370,7 +370,7 @@ ODatabaseForm::ODatabaseForm( const ODatabaseForm& _cloneSource ) impl_construct(); - osl_incrementInterlockedCount( &m_refCount ); + osl_atomic_increment( &m_refCount ); { // our aggregated rowset itself is not cloneable, so simply copy the properties ::comphelper::copyProperties( _cloneSource.m_xAggregateSet, m_xAggregateSet ); @@ -419,7 +419,7 @@ ODatabaseForm::ODatabaseForm( const ODatabaseForm& _cloneSource ) ); } } - osl_decrementInterlockedCount( &m_refCount ); + osl_atomic_decrement( &m_refCount ); } //------------------------------------------------------------------ @@ -1480,9 +1480,9 @@ void SAL_CALL ODatabaseForm::clearWarnings( ) throw (SQLException, RuntimeExcep Reference< XCloneable > SAL_CALL ODatabaseForm::createClone( ) throw (RuntimeException) { ODatabaseForm* pClone = new ODatabaseForm( *this ); - osl_incrementInterlockedCount( &pClone->m_refCount ); + osl_atomic_increment( &pClone->m_refCount ); pClone->clonedFrom( *this ); - osl_decrementInterlockedCount( &pClone->m_refCount ); + osl_atomic_decrement( &pClone->m_refCount ); return pClone; } diff --git a/forms/source/component/Date.cxx b/forms/source/component/Date.cxx index bdbaefa2148a..17460767631b 100644 --- a/forms/source/component/Date.cxx +++ b/forms/source/component/Date.cxx @@ -109,7 +109,7 @@ ODateModel::ODateModel(const Reference& _rxFactory) setAggregateSet(m_xAggregateFastSet, getOriginalHandle(PROPERTY_ID_DATEFORMAT)); - osl_incrementInterlockedCount( &m_refCount ); + osl_atomic_increment( &m_refCount ); try { if ( m_xAggregateSet.is() ) @@ -119,7 +119,7 @@ ODateModel::ODateModel(const Reference& _rxFactory) { OSL_FAIL( "ODateModel::ODateModel: caught an exception!" ); } - osl_decrementInterlockedCount( &m_refCount ); + osl_atomic_decrement( &m_refCount ); } //------------------------------------------------------------------------------ diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 27600cfe8cbc..588e369a0fd6 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -1184,14 +1184,14 @@ void SAL_CALL OControlModel::setPropertyValues( const Sequence< PropertyValue >& void OControlModel::lockInstance( LockAccess ) { m_aMutex.acquire(); - osl_incrementInterlockedCount( &m_lockCount ); + osl_atomic_increment( &m_lockCount ); } //-------------------------------------------------------------------- oslInterlockedCount OControlModel::unlockInstance( LockAccess ) { OSL_ENSURE( m_lockCount > 0, "OControlModel::unlockInstance: not locked!" ); - oslInterlockedCount lockCount = osl_decrementInterlockedCount( &m_lockCount ); + oslInterlockedCount lockCount = osl_atomic_decrement( &m_lockCount ); m_aMutex.release(); return lockCount; } diff --git a/forms/source/component/FormattedFieldWrapper.cxx b/forms/source/component/FormattedFieldWrapper.cxx index 355287d3c3c1..561fa25905d9 100644 --- a/forms/source/component/FormattedFieldWrapper.cxx +++ b/forms/source/component/FormattedFieldWrapper.cxx @@ -56,9 +56,9 @@ namespace { class RefCountGuard: private boost::noncopyable { public: explicit RefCountGuard(oslInterlockedCount & count): count_(count) - { osl_incrementInterlockedCount(&count_); } + { osl_atomic_increment(&count_); } - ~RefCountGuard() { osl_decrementInterlockedCount(&count_); } + ~RefCountGuard() { osl_atomic_decrement(&count_); } private: oslInterlockedCount & count_; diff --git a/forms/source/component/FormsCollection.cxx b/forms/source/component/FormsCollection.cxx index 5329349a9a46..f7bbcdb4d2b8 100644 --- a/forms/source/component/FormsCollection.cxx +++ b/forms/source/component/FormsCollection.cxx @@ -147,9 +147,9 @@ StringSequence SAL_CALL OFormsCollection::getSupportedServiceNames() throw(Runti Reference< XCloneable > SAL_CALL OFormsCollection::createClone( ) throw (RuntimeException) { OFormsCollection* pClone = new OFormsCollection( *this ); - osl_incrementInterlockedCount( &pClone->m_refCount ); + osl_atomic_increment( &pClone->m_refCount ); pClone->clonedFrom( *this ); - osl_decrementInterlockedCount( &pClone->m_refCount ); + osl_atomic_decrement( &pClone->m_refCount ); return pClone; } diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx index 9c71efbe432c..1ea66a71f30e 100644 --- a/forms/source/component/Grid.cxx +++ b/forms/source/component/Grid.cxx @@ -158,12 +158,12 @@ OGridControlModel::~OGridControlModel() Reference< XCloneable > SAL_CALL OGridControlModel::createClone( ) throw (RuntimeException) { OGridControlModel* pClone = new OGridControlModel( this, getContext().getLegacyServiceFactory() ); - osl_incrementInterlockedCount( &pClone->m_refCount ); + osl_atomic_increment( &pClone->m_refCount ); pClone->OControlModel::clonedFrom( this ); // do not call OInterfaceContainer::clonedFrom, it would clone the elements aka columns, which is // already done in the ctor //pClone->OInterfaceContainer::clonedFrom( *this ); - osl_decrementInterlockedCount( &pClone->m_refCount ); + osl_atomic_decrement( &pClone->m_refCount ); return static_cast< XCloneable* >( static_cast< OControlModel* >( pClone ) ); } diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index 57a871b1d368..083a3dfaa43a 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -176,13 +176,13 @@ OImageControlModel::OImageControlModel( const OImageControlModel* _pOriginal, co DBG_CTOR( OImageControlModel, NULL ); implConstruct(); - osl_incrementInterlockedCount( &m_refCount ); + osl_atomic_increment( &m_refCount ); { // simulate a propertyChanged event for the ImageURL ::osl::MutexGuard aGuard( m_aMutex ); impl_handleNewImageURL_lck( eOther ); } - osl_decrementInterlockedCount( &m_refCount ); + osl_atomic_decrement( &m_refCount ); } //------------------------------------------------------------------ diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx index 783a13f8d0fb..fbaa686012d4 100644 --- a/forms/source/component/clickableimage.cxx +++ b/forms/source/component/clickableimage.cxx @@ -495,14 +495,14 @@ namespace frm //------------------------------------------------------------------------------ void OClickableImageBaseModel::implInitializeImageURL( ) { - osl_incrementInterlockedCount( &m_refCount ); + osl_atomic_increment( &m_refCount ); { // simulate a propertyChanged event for the ImageURL Any aImageURL; getFastPropertyValue( aImageURL, PROPERTY_ID_IMAGE_URL ); _propertyChanged( PropertyChangeEvent( *this, PROPERTY_IMAGE_URL, sal_False, PROPERTY_ID_IMAGE_URL, Any( ), aImageURL ) ); } - osl_decrementInterlockedCount( &m_refCount ); + osl_atomic_decrement( &m_refCount ); } //------------------------------------------------------------------------------ diff --git a/forms/source/helper/windowstateguard.cxx b/forms/source/helper/windowstateguard.cxx index a06f16ee0817..a7d251f353ca 100644 --- a/forms/source/helper/windowstateguard.cxx +++ b/forms/source/helper/windowstateguard.cxx @@ -106,11 +106,11 @@ namespace frm if ( !m_xWindow.is() || !m_xModelProps.is() ) throw RuntimeException(); - osl_incrementInterlockedCount( &m_refCount ); + osl_atomic_increment( &m_refCount ); { m_xWindow->addWindowListener( this ); } - osl_decrementInterlockedCount( &m_refCount ); + osl_atomic_decrement( &m_refCount ); } //-------------------------------------------------------------------- diff --git a/forms/source/richtext/rtattributehandler.cxx b/forms/source/richtext/rtattributehandler.cxx index c390aab52a48..469a3f3e8dd5 100644 --- a/forms/source/richtext/rtattributehandler.cxx +++ b/forms/source/richtext/rtattributehandler.cxx @@ -60,13 +60,13 @@ namespace frm //-------------------------------------------------------------------- oslInterlockedCount SAL_CALL ReferenceBase::acquire() { - return osl_incrementInterlockedCount( &m_refCount ); + return osl_atomic_increment( &m_refCount ); } //-------------------------------------------------------------------- oslInterlockedCount SAL_CALL ReferenceBase::release() { - return osl_decrementInterlockedCount( &m_refCount ); + return osl_atomic_decrement( &m_refCount ); } //-------------------------------------------------------------------- -- cgit