[Libreoffice-commits] core.git: 3 commits - comphelper/source connectivity/source dbaccess/source forms/source include/comphelper include/sfx2 include/svx sc/source svx/source toolkit/source
Stephan Bergmann
sbergman at redhat.com
Tue Apr 21 00:23:55 PDT 2015
comphelper/source/container/containermultiplexer.cxx | 5 +-
connectivity/source/drivers/ado/AStatement.cxx | 6 +--
connectivity/source/drivers/odbc/OStatement.cxx | 6 +--
dbaccess/source/ui/browser/brwctrlr.cxx | 4 +-
forms/source/component/Button.cxx | 4 +-
forms/source/component/Columns.cxx | 8 ++--
forms/source/component/DatabaseForm.cxx | 5 +-
forms/source/component/Edit.cxx | 4 +-
forms/source/component/EventThread.cxx | 9 ++--
forms/source/component/FormComponent.cxx | 28 +++++++-------
forms/source/component/FormattedField.cxx | 13 +++---
forms/source/component/FormattedFieldWrapper.cxx | 27 +++++++-------
forms/source/component/GroupManager.cxx | 6 +--
forms/source/component/ImageButton.cxx | 4 +-
forms/source/component/ImageControl.cxx | 4 +-
forms/source/component/ListBox.cxx | 4 +-
forms/source/component/RadioButton.cxx | 8 ++--
forms/source/component/clickableimage.cxx | 6 +--
forms/source/richtext/richtextmodel.cxx | 4 +-
include/comphelper/uno3.hxx | 36 -------------------
include/sfx2/StyleManager.hxx | 4 +-
include/svx/CommonStyleManager.hxx | 2 -
sc/source/ui/unoobj/dispuno.cxx | 5 +-
sc/source/ui/unoobj/docuno.cxx | 4 +-
sc/source/ui/unoobj/shapeuno.cxx | 6 +--
svx/source/form/fmobj.cxx | 3 +
svx/source/form/fmshimp.cxx | 4 +-
svx/source/form/formcontroller.cxx | 5 +-
svx/source/form/formdispatchinterceptor.cxx | 4 +-
svx/source/styles/CommonStyleManager.cxx | 4 +-
toolkit/source/controls/geometrycontrolmodel.cxx | 8 ++--
31 files changed, 102 insertions(+), 138 deletions(-)
New commits:
commit b4845f5dba90edf84909e6828d476f675606214e
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Apr 21 09:18:35 2015 +0200
loplugin:passstuffbyref
Change-Id: I4889b3d56b9e6f6926d1d094130c277588ff143c
diff --git a/include/sfx2/StyleManager.hxx b/include/sfx2/StyleManager.hxx
index 66159f7..962fbb9 100644
--- a/include/sfx2/StyleManager.hxx
+++ b/include/sfx2/StyleManager.hxx
@@ -36,8 +36,8 @@ public:
{}
virtual StylePreviewRenderer* CreateStylePreviewRenderer(
- OutputDevice& /*rOutputDev*/, OUString /*rName*/,
- SfxStyleFamily /*eFamily*/, long /*nMaxHeight*/ = 32) = 0;
+ OutputDevice& rOutputDev, OUString const & rName,
+ SfxStyleFamily eFamily, long nMaxHeight = 32) = 0;
};
} // end namespace sfx2
diff --git a/include/svx/CommonStyleManager.hxx b/include/svx/CommonStyleManager.hxx
index 43346aa..0ce0a3d 100644
--- a/include/svx/CommonStyleManager.hxx
+++ b/include/svx/CommonStyleManager.hxx
@@ -30,7 +30,7 @@ public:
{}
virtual sfx2::StylePreviewRenderer* CreateStylePreviewRenderer(
- OutputDevice& rOutputDev, OUString sName,
+ OutputDevice& rOutputDev, OUString const & rName,
SfxStyleFamily eFamily, long nMaxHeight = 32) SAL_OVERRIDE;
};
diff --git a/svx/source/styles/CommonStyleManager.cxx b/svx/source/styles/CommonStyleManager.cxx
index 4b3b6d1..d452ba4 100644
--- a/svx/source/styles/CommonStyleManager.cxx
+++ b/svx/source/styles/CommonStyleManager.cxx
@@ -15,7 +15,7 @@ namespace svx
{
sfx2::StylePreviewRenderer* CommonStyleManager::CreateStylePreviewRenderer(
- OutputDevice& rOutputDev, OUString sName,
+ OutputDevice& rOutputDev, OUString const & rName,
SfxStyleFamily eFamily, long nMaxHeight)
{
SfxStyleSheetBasePool* pPool = mrShell.GetStyleSheetPool();
@@ -28,7 +28,7 @@ sfx2::StylePreviewRenderer* CommonStyleManager::CreateStylePreviewRenderer(
while (pStyle)
{
- if (sName == pStyle->GetName())
+ if (rName == pStyle->GetName())
return new CommonStylePreviewRenderer(mrShell, rOutputDev, pStyle, nMaxHeight);
pStyle = pPool->Next();
}
commit 08a943fc379c5f8af25128c935e93e6a9d82d136
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Apr 21 08:56:05 2015 +0200
Get rid of trivial comphelper::query_interface wrapper
Change-Id: I2b9dafd2a34d055dcd8b8c4d894be30dc821d3be
diff --git a/connectivity/source/drivers/ado/AStatement.cxx b/connectivity/source/drivers/ado/AStatement.cxx
index 662daf4..a6a893a 100644
--- a/connectivity/source/drivers/ado/AStatement.cxx
+++ b/connectivity/source/drivers/ado/AStatement.cxx
@@ -21,7 +21,6 @@
#include "ado/AConnection.hxx"
#include "ado/AResultSet.hxx"
#include <comphelper/property.hxx>
-#include <comphelper/uno3.hxx>
#include <osl/thread.h>
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/queryinterface.hxx>
@@ -182,8 +181,9 @@ void OStatement_Base::clearMyResultSet () throw (SQLException)
try
{
- Reference<XCloseable> xCloseable;
- if ( ::comphelper::query_interface( m_xResultSet.get(), xCloseable ) )
+ Reference<XCloseable> xCloseable(
+ m_xResultSet.get(), css::uno::UNO_QUERY);
+ if ( xCloseable.is() )
xCloseable->close();
}
catch( const DisposedException& ) { }
diff --git a/connectivity/source/drivers/odbc/OStatement.cxx b/connectivity/source/drivers/odbc/OStatement.cxx
index 5df4197..2259ca9 100644
--- a/connectivity/source/drivers/odbc/OStatement.cxx
+++ b/connectivity/source/drivers/odbc/OStatement.cxx
@@ -25,7 +25,6 @@
#include "odbc/OResultSet.hxx"
#include <comphelper/property.hxx>
#include "odbc/OTools.hxx"
-#include <comphelper/uno3.hxx>
#include <osl/thread.h>
#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
#include <com/sun/star/sdbc/ResultSetType.hpp>
@@ -226,8 +225,9 @@ void OStatement_Base::clearMyResultSet()
try
{
- Reference<XCloseable> xCloseable;
- if ( ::comphelper::query_interface( m_xResultSet.get(), xCloseable ) )
+ Reference<XCloseable> xCloseable(
+ m_xResultSet.get(), css::uno::UNO_QUERY);
+ if ( xCloseable.is() )
xCloseable->close();
}
catch( const DisposedException& ) { }
diff --git a/forms/source/component/EventThread.cxx b/forms/source/component/EventThread.cxx
index 737774b..f03ac95 100644
--- a/forms/source/component/EventThread.cxx
+++ b/forms/source/component/EventThread.cxx
@@ -40,7 +40,7 @@ OComponentEventThread::OComponentEventThread( ::cppu::OComponentHelper* pCompImp
// Hold a reference of the Control
{
InterfaceRef xIFace(static_cast<XWeak*>(pCompImpl));
- query_interface(xIFace, m_xComp);
+ m_xComp.set(xIFace, css::uno::UNO_QUERY);
}
// and add us at the Control
@@ -189,7 +189,8 @@ void OComponentEventThread::run()
// the mutex is locked.
Reference<XControl> xControl;
if ( xControlAdapter.is() )
- query_interface(xControlAdapter->queryAdapted(), xControl);
+ xControl.set(
+ xControlAdapter->queryAdapted(), css::uno::UNO_QUERY);
if( xComp.is() )
processEvent( pCompImpl, pEvt.get(), xControl, bFlag );
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index 8f0aea6..33f584a 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -1748,8 +1748,8 @@ void OBoundControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, co
}
// Check if we and the given model have a common ancestor (up to the forms collection)
- Reference<XChild> xCont;
- query_interface(static_cast<XWeak*>(this), xCont);
+ Reference<XChild> xCont(
+ static_cast<XWeak*>(this), css::uno::UNO_QUERY);
Reference< XInterface > xMyTopLevel = xCont->getParent();
while (xMyTopLevel.is())
{
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx
index f28c347..ac7112d 100644
--- a/forms/source/component/FormattedField.cxx
+++ b/forms/source/component/FormattedField.cxx
@@ -509,8 +509,9 @@ Reference< XNumberFormatsSupplier > OFormattedModel::calcFormatsSupplier() const
Reference<XNumberFormatsSupplier> OFormattedModel::calcFormFormatsSupplier() const
{
- Reference<XChild> xMe;
- query_interface(static_cast<XWeak*>(const_cast<OFormattedModel*>(this)), xMe);
+ Reference<XChild> xMe(
+ static_cast<XWeak*>(const_cast<OFormattedModel*>(this)),
+ css::uno::UNO_QUERY);
// By this we make sure that we get the right object even when aggregating
DBG_ASSERT(xMe.is(), "OFormattedModel::calcFormFormatsSupplier : I should have a content interface !");
// Iterate through until we reach a StartForm (starting with an own Parent)
diff --git a/forms/source/component/FormattedFieldWrapper.cxx b/forms/source/component/FormattedFieldWrapper.cxx
index 3ae0267..963ab91 100644
--- a/forms/source/component/FormattedFieldWrapper.cxx
+++ b/forms/source/component/FormattedFieldWrapper.cxx
@@ -55,17 +55,17 @@ InterfaceRef OFormattedFieldWrapper::createFormattedFieldWrapper(const ::com::su
if (bActAsFormatted)
{
// instantiate an FormattedModel
- InterfaceRef xFormattedModel;
// (instantiate it directly ..., as the OFormattedModel isn't
// registered for any service names anymore)
OFormattedModel* pModel = new OFormattedModel(pRef->m_xContext);
- query_interface(static_cast<XWeak*>(pModel), xFormattedModel);
+ InterfaceRef xFormattedModel(
+ static_cast<XWeak*>(pModel), css::uno::UNO_QUERY);
pRef->m_xAggregate = Reference<XAggregation> (xFormattedModel, UNO_QUERY);
OSL_ENSURE(pRef->m_xAggregate.is(), "the OFormattedModel didn't have an XAggregation interface !");
// _before_ setting the delegator, give it to the member references
- query_interface(xFormattedModel, pRef->m_xFormattedPart);
+ pRef->m_xFormattedPart.set(xFormattedModel, css::uno::UNO_QUERY);
pRef->m_pEditPart = rtl::Reference< OEditModel >(new OEditModel(pRef->m_xContext));
}
@@ -98,7 +98,8 @@ Reference< XCloneable > SAL_CALL OFormattedFieldWrapper::createClone() throw (Ru
xRef->m_xAggregate = Reference< XAggregation >(xClone, UNO_QUERY);
OSL_ENSURE(xRef->m_xAggregate.is(), "invalid aggregate cloned !");
- query_interface( Reference< XInterface >(xClone.get() ), xRef->m_xFormattedPart);
+ xRef->m_xFormattedPart.set(
+ Reference< XInterface >(xClone.get()), css::uno::UNO_QUERY);
if ( m_pEditPart.is() )
{
@@ -217,8 +218,8 @@ void SAL_CALL OFormattedFieldWrapper::write(const Reference<XObjectOutputStream>
// for this we transfer the current props of the formatted part to the edit part
Reference<XPropertySet> xFormatProps(m_xFormattedPart, UNO_QUERY);
- Reference<XPropertySet> xEditProps;
- query_interface(static_cast<XWeak*>(m_pEditPart.get()), xEditProps);
+ Reference<XPropertySet> xEditProps(
+ static_cast<XWeak*>(m_pEditPart.get()), css::uno::UNO_QUERY);
Locale aAppLanguage = Application::GetSettings().GetUILanguageTag().getLocale();
dbtools::TransferFormComponentProperties(xFormatProps, xEditProps, aAppLanguage);
@@ -317,7 +318,7 @@ void OFormattedFieldWrapper::ensureAggregate()
{
// arghhh ... instantiate it directly ... it's dirty, but we really need this aggregate
OEditModel* pModel = new OEditModel(m_xContext);
- query_interface(static_cast<XWeak*>(pModel), xEditModel);
+ xEditModel.set(static_cast<XWeak*>(pModel), css::uno::UNO_QUERY);
}
m_xAggregate = Reference<XAggregation> (xEditModel, UNO_QUERY);
diff --git a/forms/source/component/RadioButton.cxx b/forms/source/component/RadioButton.cxx
index 03781be..e02f8e4 100644
--- a/forms/source/component/RadioButton.cxx
+++ b/forms/source/component/RadioButton.cxx
@@ -149,8 +149,8 @@ void ORadioButtonModel::SetSiblingPropsTo(const OUString& rPropName, const Any&
Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
if (xIndexAccess.is())
{
- Reference<XPropertySet> xMyProps;
- query_interface(static_cast<XWeak*>(this), xMyProps);
+ Reference<XPropertySet> xMyProps(
+ static_cast<XWeak*>(this), css::uno::UNO_QUERY);
OUString sCurrentGroup;
sal_Int32 nNumSiblings = xIndexAccess->getCount();
for (sal_Int32 i=0; i<nNumSiblings; ++i)
@@ -226,8 +226,8 @@ void ORadioButtonModel::setControlSource()
this->getPropertyValue(PROPERTY_GROUP_NAME) >>= sGroupName;
this->getPropertyValue(PROPERTY_NAME) >>= sName;
- Reference<XPropertySet> xMyProps;
- query_interface(static_cast<XWeak*>(this), xMyProps);
+ Reference<XPropertySet> xMyProps(
+ static_cast<XWeak*>(this), css::uno::UNO_QUERY);
for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i)
{
Reference<XPropertySet> xSiblingProperties(*static_cast<InterfaceRef const *>(xIndexAccess->getByIndex(i).getValue()), UNO_QUERY);
diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx
index f8c178a..d8d3bd3 100644
--- a/forms/source/component/clickableimage.cxx
+++ b/forms/source/component/clickableimage.cxx
@@ -738,7 +738,7 @@ namespace frm
{
Reference<XChild> xChild( xIfc, UNO_QUERY );
xIfc = xChild->getParent();
- query_interface(xIfc, xModel);
+ xModel.set(xIfc, css::uno::UNO_QUERY);
}
// Search for the Object shell by iterating over all Object shells
diff --git a/include/comphelper/uno3.hxx b/include/comphelper/uno3.hxx
index eae94a5..d53f4ab 100644
--- a/include/comphelper/uno3.hxx
+++ b/include/comphelper/uno3.hxx
@@ -180,31 +180,6 @@ namespace comphelper
}
return _rxOut.is();
}
-
- /** ask for an iface of an object
- usage:<br/>
- Reference<XFoo> xFoo;<br/>
- if (query_interface(xAnything, xFoo))<br/>
- ....
- */
- template <class iface>
- bool query_interface(const InterfaceRef& _rxObject, ::com::sun::star::uno::Reference<iface>& _rxOut)
- {
- _rxOut = static_cast<iface*>(NULL);
- if (_rxObject.is())
- {
- ::com::sun::star::uno::Any aCheck = _rxObject->queryInterface(
- cppu::UnoType<iface>::get());
- if(aCheck.hasValue())
- {
- _rxOut = *static_cast<const ::com::sun::star::uno::Reference<iface>*>(aCheck.getValue());
- return _rxOut.is();
- }
- }
- return false;
- }
-
-
} // namespace comphelper
diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx
index 7d7bd1b..f70af85 100644
--- a/svx/source/form/fmobj.cxx
+++ b/svx/source/form/fmobj.cxx
@@ -431,7 +431,8 @@ namespace
sReturn = sCurrentIndex;
// travel up
- if (::comphelper::query_interface(Reference< XInterface >(xParent),xChild))
+ xChild.set(xParent, css::uno::UNO_QUERY);
+ if (xChild.is())
xParent = Reference< ::com::sun::star::container::XIndexAccess>(xChild->getParent(), UNO_QUERY);
}
commit 4592d27dca75e73218ddca2039b1a1332adc828c
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Apr 21 08:39:10 2015 +0200
Get rid of trivial comphelper::in-/decrement wrappers
Change-Id: Id3a12ef9d56c30719f483e610c8a8b08caf05def
diff --git a/comphelper/source/container/containermultiplexer.cxx b/comphelper/source/container/containermultiplexer.cxx
index 7b8ecc7..7f67779 100644
--- a/comphelper/source/container/containermultiplexer.cxx
+++ b/comphelper/source/container/containermultiplexer.cxx
@@ -18,7 +18,6 @@
*/
#include <comphelper/containermultiplexer.hxx>
-#include <comphelper/uno3.hxx>
#include <osl/diagnose.h>
namespace comphelper
@@ -104,7 +103,7 @@ namespace comphelper
if (m_pListener)
m_pListener->setAdapter(this);
- ::comphelper::increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
try
{
m_xContainer->addContainerListener(this);
@@ -113,7 +112,7 @@ namespace comphelper
{
OSL_FAIL("Exception caught!");
}
- ::comphelper::decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
}
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index dc5d665..0bfddcc 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -546,13 +546,13 @@ SbaXDataBrowserController::SbaXDataBrowserController(const Reference< ::com::sun
,m_bCannotSelectUnfiltered( true )
{
// create the form controller aggregate
- ::comphelper::increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
{
m_pFormControllerImpl = new FormControllerImpl(this);
m_xFormControllerImpl = m_pFormControllerImpl;
m_xFormControllerImpl->setDelegator(*this);
}
- ::comphelper::decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
m_aInvalidateClipboard.SetTimeoutHdl(LINK(this, SbaXDataBrowserController, OnInvalidateClipboard));
m_aInvalidateClipboard.SetTimeout(300);
diff --git a/forms/source/component/Button.cxx b/forms/source/component/Button.cxx
index 9870aec..41e8e35 100644
--- a/forms/source/component/Button.cxx
+++ b/forms/source/component/Button.cxx
@@ -357,7 +357,7 @@ OButtonControl::OButtonControl(const Reference<XComponentContext>& _rxFactory)
,m_nTargetUrlFeatureId( -1 )
,m_bEnabledByPropertyValue( false )
{
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
{
// Register as ActionListener
Reference<XButton> xButton;
@@ -366,7 +366,7 @@ OButtonControl::OButtonControl(const Reference<XComponentContext>& _rxFactory)
xButton->addActionListener(this);
}
// For Listener: refcount at one
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
}
diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx
index 68e668e..944374e 100644
--- a/forms/source/component/Columns.cxx
+++ b/forms/source/component/Columns.cxx
@@ -206,7 +206,7 @@ OGridColumn::OGridColumn( const Reference<XComponentContext>& _rContext, const O
// Create the UnoControlModel
if ( !m_aModelName.isEmpty() ) // is there a to-be-aggregated model?
{
- increment( m_refCount );
+ osl_atomic_increment( &m_refCount );
{
m_xAggregate.set( _rContext->getServiceManager()->createInstanceWithContext( m_aModelName, _rContext ), UNO_QUERY );
@@ -219,7 +219,7 @@ OGridColumn::OGridColumn( const Reference<XComponentContext>& _rContext, const O
}
// Set refcount back to zero
- decrement( m_refCount );
+ osl_atomic_decrement( &m_refCount );
}
}
@@ -235,7 +235,7 @@ OGridColumn::OGridColumn( const OGridColumn* _pOriginal )
m_aModelName = _pOriginal->m_aModelName;
m_aLabel = _pOriginal->m_aLabel;
- increment( m_refCount );
+ osl_atomic_increment( &m_refCount );
{
{
m_xAggregate = createAggregateClone( _pOriginal );
@@ -247,7 +247,7 @@ OGridColumn::OGridColumn( const OGridColumn* _pOriginal )
m_xAggregate->setDelegator( static_cast< ::cppu::OWeakObject* >( this ) );
}
}
- decrement( m_refCount );
+ osl_atomic_decrement( &m_refCount );
}
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 1bf4af9..1ba1e15 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -61,7 +61,6 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/seqstream.hxx>
#include <comphelper/sequence.hxx>
-#include <comphelper/uno3.hxx>
#include <connectivity/dbtools.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/implbase2.hxx>
@@ -392,7 +391,7 @@ ODatabaseForm::ODatabaseForm( const ODatabaseForm& _cloneSource )
void ODatabaseForm::impl_construct()
{
// aggregate a row set
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
{
m_xAggregate = Reference< XAggregation >( m_xContext->getServiceManager()->createInstanceWithContext(SRV_SDB_ROWSET, m_xContext), UNO_QUERY_THROW );
m_xAggregateAsRowSet.set( m_xAggregate, UNO_QUERY_THROW );
@@ -424,7 +423,7 @@ void ODatabaseForm::impl_construct()
declareForwardedProperty( PROPERTY_ID_ACTIVE_CONNECTION );
}
- decrement( m_refCount );
+ osl_atomic_decrement( &m_refCount );
m_pGroupManager = new OGroupManager( this );
m_pGroupManager->acquire();
diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx
index f4aced1..ffcc37a 100644
--- a/forms/source/component/Edit.cxx
+++ b/forms/source/component/Edit.cxx
@@ -88,7 +88,7 @@ OEditControl::OEditControl(const Reference<XComponentContext>& _rxFactory)
,m_nKeyEvent( 0 )
{
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
{
Reference<XWindow> xComp;
if (query_aggregation(m_xAggregate, xComp))
@@ -97,7 +97,7 @@ OEditControl::OEditControl(const Reference<XComponentContext>& _rxFactory)
xComp->addKeyListener(this);
}
}
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
}
diff --git a/forms/source/component/EventThread.cxx b/forms/source/component/EventThread.cxx
index 47a192927..737774b 100644
--- a/forms/source/component/EventThread.cxx
+++ b/forms/source/component/EventThread.cxx
@@ -35,7 +35,7 @@ OComponentEventThread::OComponentEventThread( ::cppu::OComponentHelper* pCompImp
m_pCompImpl( pCompImpl )
{
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
// Hold a reference of the Control
{
@@ -49,7 +49,7 @@ OComponentEventThread::OComponentEventThread( ::cppu::OComponentHelper* pCompImp
m_xComp->addEventListener( xEvtLstnr );
}
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
}
OComponentEventThread::~OComponentEventThread()
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index 86ab00c..8f0aea6 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -122,12 +122,12 @@ OControl::OControl( const Reference< XComponentContext >& _rxContext, const OUSt
{
// Aggregate VCL Control
// Increment the RefCount for aggregates, because the aggregate by itself increments the RefCount in the setDelegator
- increment( m_refCount );
+ osl_atomic_increment( &m_refCount );
{
m_xAggregate.set(_rxContext->getServiceManager()->createInstanceWithContext(_rAggregateService, _rxContext), css::uno::UNO_QUERY);
m_xControl.set(m_xAggregate, css::uno::UNO_QUERY);
}
- decrement( m_refCount );
+ osl_atomic_decrement( &m_refCount );
if ( _bSetDelegator )
doSetDelegator();
@@ -146,14 +146,14 @@ void OControl::doResetDelegator()
void OControl::doSetDelegator()
{
- increment( m_refCount );
+ osl_atomic_increment( &m_refCount );
if ( m_xAggregate.is() )
{ // those brackets are important for some compilers, don't remove!
// (they ensure that the temporary object created in the line below
// is destroyed *before* the refcount-decrement)
m_xAggregate->setDelegator( static_cast< XWeak* >( this ) );
}
- decrement( m_refCount );
+ osl_atomic_decrement( &m_refCount );
}
// UNO Binding
@@ -516,7 +516,7 @@ OControlModel::OControlModel(
{
if (!_rUnoControlModelTypeName.isEmpty()) // the is a model we have to aggregate
{
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
{
m_xAggregate = Reference<XAggregation>(m_xContext->getServiceManager()->createInstanceWithContext(_rUnoControlModelTypeName, m_xContext), UNO_QUERY);
setAggregation(m_xAggregate);
@@ -539,7 +539,7 @@ OControlModel::OControlModel(
doSetDelegator();
// Refcount is at NULL again
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
}
}
@@ -567,7 +567,7 @@ OControlModel::OControlModel( const OControlModel* _pOriginal, const Reference<
if ( _bCloneAggregate )
{
// temporarily increment refcount because of temporary references to ourself in the following
- increment( m_refCount );
+ osl_atomic_increment( &m_refCount );
{
// transfer the (only, at the very moment!) ref count
m_xAggregate = createAggregateClone( _pOriginal );
@@ -581,7 +581,7 @@ OControlModel::OControlModel( const OControlModel* _pOriginal, const Reference<
doSetDelegator();
// decrement ref count
- decrement( m_refCount );
+ osl_atomic_decrement( &m_refCount );
}
}
@@ -604,12 +604,12 @@ void OControlModel::doResetDelegator()
void OControlModel::doSetDelegator()
{
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
if (m_xAggregate.is())
{
m_xAggregate->setDelegator(static_cast<XWeak*>(this));
}
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
}
// XChild
@@ -1263,14 +1263,14 @@ void OBoundControlModel::clonedFrom( const OControlModel* _pOriginal )
void OBoundControlModel::implInitAggMultiplexer( )
{
- increment( m_refCount );
+ osl_atomic_increment( &m_refCount );
if ( m_xAggregateSet.is() )
{
m_pAggPropMultiplexer = new OPropertyChangeMultiplexer( this, m_xAggregateSet, false );
m_pAggPropMultiplexer->acquire();
}
- decrement( m_refCount );
+ osl_atomic_decrement( &m_refCount );
doSetDelegator();
}
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx
index 1d2fada..f28c347 100644
--- a/forms/source/component/FormattedField.cxx
+++ b/forms/source/component/FormattedField.cxx
@@ -166,7 +166,7 @@ OFormattedControl::OFormattedControl(const Reference<XComponentContext>& _rxFact
:OBoundControl(_rxFactory, VCL_CONTROL_FORMATTEDFIELD)
,m_nKeyEvent(0)
{
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
{
Reference<XWindow> xComp;
if (query_aggregation(m_xAggregate, xComp))
@@ -174,7 +174,7 @@ OFormattedControl::OFormattedControl(const Reference<XComponentContext>& _rxFact
xComp->addKeyListener(this);
}
}
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
}
OFormattedControl::~OFormattedControl()
{
@@ -276,9 +276,9 @@ void OFormattedModel::implConstruct()
m_aNullDate = DBTypeConversion::getStandardDate();
m_nFieldType = DataType::OTHER;
// default our formats supplier
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
setPropertyToDefaultByHandle(PROPERTY_ID_FORMATSSUPPLIER);
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
startAggregatePropertyListening( PROPERTY_FORMATKEY );
startAggregatePropertyListening( PROPERTY_FORMATSSUPPLIER );
}
diff --git a/forms/source/component/FormattedFieldWrapper.cxx b/forms/source/component/FormattedFieldWrapper.cxx
index b368eac..3ae0267 100644
--- a/forms/source/component/FormattedFieldWrapper.cxx
+++ b/forms/source/component/FormattedFieldWrapper.cxx
@@ -69,7 +69,7 @@ InterfaceRef OFormattedFieldWrapper::createFormattedFieldWrapper(const ::com::su
pRef->m_pEditPart = rtl::Reference< OEditModel >(new OEditModel(pRef->m_xContext));
}
- increment(pRef->m_refCount);
+ osl_atomic_increment(&pRef->m_refCount);
if (pRef->m_xAggregate.is())
{ // has to be in it's own block because of the temporary variable created by *this
@@ -77,7 +77,7 @@ InterfaceRef OFormattedFieldWrapper::createFormattedFieldWrapper(const ::com::su
}
InterfaceRef xRef(*pRef);
- decrement(pRef->m_refCount);
+ osl_atomic_decrement(&pRef->m_refCount);
return xRef;
}
@@ -296,12 +296,12 @@ void SAL_CALL OFormattedFieldWrapper::read(const Reference<XObjectInputStream>&
}
// do the aggregation
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
if (m_xAggregate.is())
{ // has to be in it's own block because of the temporary variable created by *this
m_xAggregate->setDelegator(static_cast<XWeak*>(this));
}
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
}
void OFormattedFieldWrapper::ensureAggregate()
@@ -333,12 +333,12 @@ void OFormattedFieldWrapper::ensureAggregate()
}
}
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
if (m_xAggregate.is())
{ // has to be in it's own block because of the temporary variable created by *this
m_xAggregate->setDelegator(static_cast<XWeak*>(this));
}
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
}
extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
diff --git a/forms/source/component/GroupManager.cxx b/forms/source/component/GroupManager.cxx
index 8f6a40f..b8eedbd 100644
--- a/forms/source/component/GroupManager.cxx
+++ b/forms/source/component/GroupManager.cxx
@@ -21,7 +21,7 @@
#include <com/sun/star/beans/XFastPropertySet.hpp>
#include <com/sun/star/form/FormComponentType.hpp>
#include <comphelper/property.hxx>
-#include <comphelper/uno3.hxx>
+#include <osl/diagnose.h>
#include <tools/solar.h>
#include "property.hrc"
@@ -203,11 +203,11 @@ OGroupManager::OGroupManager(const Reference< XContainer >& _rxContainer)
:m_pCompGroup( new OGroup( OUString("AllComponentGroup") ) )
,m_xContainer(_rxContainer)
{
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
{
_rxContainer->addContainerListener(this);
}
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
}
OGroupManager::~OGroupManager()
diff --git a/forms/source/component/ImageButton.cxx b/forms/source/component/ImageButton.cxx
index 4889d9d..7a677d5 100644
--- a/forms/source/component/ImageButton.cxx
+++ b/forms/source/component/ImageButton.cxx
@@ -164,7 +164,7 @@ StringSequence OImageButtonControl::getSupportedServiceNames() throw(std::excep
OImageButtonControl::OImageButtonControl(const Reference<XComponentContext>& _rxFactory)
:OClickableImageBaseControl(_rxFactory, VCL_CONTROL_IMAGEBUTTON)
{
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
{
// Register as MouseListener
Reference< awt::XWindow > xComp;
@@ -172,7 +172,7 @@ OImageButtonControl::OImageButtonControl(const Reference<XComponentContext>& _rx
if (xComp.is())
xComp->addMouseListener( static_cast< awt::XMouseListener* >( this ) );
}
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
}
// UNO Binding
diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx
index e3789cf..8f66e1b 100644
--- a/forms/source/component/ImageControl.cxx
+++ b/forms/source/component/ImageControl.cxx
@@ -697,7 +697,7 @@ OImageControlControl::OImageControlControl(const Reference<XComponentContext>& _
:OBoundControl(_rxFactory, VCL_CONTROL_IMAGECONTROL)
,m_aModifyListeners( m_aMutex )
{
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
{
// Add as Focus- and MouseListener
Reference< XWindow > xComp;
@@ -705,7 +705,7 @@ OImageControlControl::OImageControlControl(const Reference<XComponentContext>& _
if ( xComp.is() )
xComp->addMouseListener( this );
}
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
}
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index f9d856b..5c8fd83 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -1770,7 +1770,7 @@ namespace frm
,m_aItemListeners( m_aMutex )
{
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
{
// Register as FocusListener
Reference<XWindow> xComp;
@@ -1782,7 +1782,7 @@ namespace frm
m_xAggregateListBox->addItemListener(this);
}
// Refcount at 2 for registered Listener
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
doSetDelegator();
diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx
index 7963357..f8c178a 100644
--- a/forms/source/component/clickableimage.cxx
+++ b/forms/source/component/clickableimage.cxx
@@ -497,7 +497,7 @@ namespace frm
void OClickableImageBaseModel::implConstruct()
{
m_pProducer = new ImageProducer;
- increment( m_refCount );
+ osl_atomic_increment( &m_refCount );
{
m_xProducer = m_pProducer;
@@ -507,7 +507,7 @@ namespace frm
pMultiplexer->addProperty( PROPERTY_IMAGE_URL );
}
}
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
}
diff --git a/forms/source/richtext/richtextmodel.cxx b/forms/source/richtext/richtextmodel.cxx
index 7db6a9f..313c28f 100644
--- a/forms/source/richtext/richtextmodel.cxx
+++ b/forms/source/richtext/richtextmodel.cxx
@@ -142,7 +142,7 @@ namespace frm
void ORichTextModel::implDoAggregation()
{
- increment( m_refCount );
+ osl_atomic_increment( &m_refCount );
{
m_xAggregate = new ORichTextUnoWrapper( *m_pEngine, this );
@@ -150,7 +150,7 @@ namespace frm
doSetDelegator();
}
- decrement( m_refCount );
+ osl_atomic_decrement( &m_refCount );
}
diff --git a/include/comphelper/uno3.hxx b/include/comphelper/uno3.hxx
index 62f3e7c..eae94a5 100644
--- a/include/comphelper/uno3.hxx
+++ b/include/comphelper/uno3.hxx
@@ -20,7 +20,6 @@
#ifndef INCLUDED_COMPHELPER_UNO3_HXX
#define INCLUDED_COMPHELPER_UNO3_HXX
-#include <osl/interlck.h>
#include <rtl/instance.hxx>
#include <comphelper/types.hxx>
#include <com/sun/star/uno/XAggregation.hpp>
@@ -30,16 +29,6 @@
namespace comphelper
{
-
-
-
-
- /// manipulate ref counts without calling acquire/release
- inline oslInterlockedCount increment(oslInterlockedCount& _counter) { return osl_atomic_increment(&_counter); }
- inline oslInterlockedCount decrement(oslInterlockedCount& _counter) { return osl_atomic_decrement(&_counter); }
-
-
-
/** used for declaring UNO3-Defaults, i.e. acquire/release
*/
#define DECLARE_UNO3_DEFAULTS(classname, baseclass) \
diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx
index ff084b9..cf99598 100644
--- a/sc/source/ui/unoobj/dispuno.cxx
+++ b/sc/source/ui/unoobj/dispuno.cxx
@@ -18,7 +18,6 @@
*/
#include <sfx2/viewfrm.hxx>
-#include <comphelper/uno3.hxx>
#include <svx/dataaccessdescriptor.hxx>
#include <svl/smplhint.hxx>
#include <vcl/svapp.hxx>
@@ -58,7 +57,7 @@ ScDispatchProviderInterceptor::ScDispatchProviderInterceptor(ScTabViewShell* pVi
m_xIntercepted.set(uno::Reference<frame::XDispatchProviderInterception>(pViewShell->GetViewFrame()->GetFrame().GetFrameInterface(), uno::UNO_QUERY));
if (m_xIntercepted.is())
{
- comphelper::increment( m_refCount );
+ osl_atomic_increment( &m_refCount );
m_xIntercepted->registerDispatchProviderInterceptor(
static_cast<frame::XDispatchProviderInterceptor*>(this));
@@ -68,7 +67,7 @@ ScDispatchProviderInterceptor::ScDispatchProviderInterceptor(ScTabViewShell* pVi
if (xInterceptedComponent.is())
xInterceptedComponent->addEventListener(static_cast<lang::XEventListener*>(this));
- comphelper::decrement( m_refCount );
+ osl_atomic_decrement( &m_refCount );
}
StartListening(*pViewShell);
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 6bbc540..2c84022 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -394,7 +394,7 @@ uno::Reference< uno::XAggregation> ScModelObj::GetFormatter()
{
// setDelegator veraendert den RefCount, darum eine Referenz selber halten
// (direkt am m_refCount, um sich beim release nicht selbst zu loeschen)
- comphelper::increment( m_refCount );
+ osl_atomic_increment( &m_refCount );
// waehrend des queryInterface braucht man ein Ref auf das
// SvNumberFormatsSupplierObj, sonst wird es geloescht.
uno::Reference<util::XNumberFormatsSupplier> xFormatter(new SvNumberFormatsSupplierObj(pDocShell->GetDocument().GetFormatTable() ));
@@ -408,7 +408,7 @@ uno::Reference< uno::XAggregation> ScModelObj::GetFormatter()
if (xNumberAgg.is())
xNumberAgg->setDelegator( (cppu::OWeakObject*)this );
- comphelper::decrement( m_refCount );
+ osl_atomic_decrement( &m_refCount );
} // if ( !xNumberAgg.is() )
return xNumberAgg;
}
diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index 43754db..4329501 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -19,7 +19,7 @@
#include <sal/config.h>
-#include <comphelper/uno3.hxx>
+#include <comphelper/sequence.hxx>
#include <svtools/unoevent.hxx>
#include <svtools/unoimap.hxx>
#include <svx/svdobj.hxx>
@@ -96,7 +96,7 @@ ScShapeObj::ScShapeObj( uno::Reference<drawing::XShape>& xShape ) :
bIsNoteCaption(false),
bInitializedNotifier(false)
{
- comphelper::increment( m_refCount );
+ osl_atomic_increment( &m_refCount );
{
mxShapeAgg = uno::Reference<uno::XAggregation>( xShape, uno::UNO_QUERY );
@@ -124,7 +124,7 @@ ScShapeObj::ScShapeObj( uno::Reference<drawing::XShape>& xShape ) :
}
}
- comphelper::decrement( m_refCount );
+ osl_atomic_decrement( &m_refCount );
}
ScShapeObj::~ScShapeObj()
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index e03d9a0..c82c85e 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -654,10 +654,10 @@ FmXFormShell::FmXFormShell( FmFormShell& _rShell, SfxViewFrame* _pViewFrame )
m_xAttachedFrame = _pViewFrame->GetFrame().GetFrameInterface();
// to prevent deletion of this we acquire our refcounter once
- ::comphelper::increment(FmXFormShell_BASE::m_refCount);
+ osl_atomic_increment(&m_refCount);
// correct the refcounter
- ::comphelper::decrement(FmXFormShell_BASE::m_refCount);
+ osl_atomic_decrement(&m_refCount);
// cache the current configuration settings we're interested in
implAdjustConfigCache();
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 04fddee..90daba6 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -71,7 +71,6 @@
#include <comphelper/propagg.hxx>
#include <comphelper/property.hxx>
#include <comphelper/sequence.hxx>
-#include <comphelper/uno3.hxx>
#include <comphelper/flagguard.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -570,13 +569,13 @@ FormController::FormController(const Reference< css::uno::XComponentContext > &
,m_bSuspendFilterTextListening( false )
{
- ::comphelper::increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
{
m_xTabController = TabController::create( m_xComponentContext );
m_xAggregate = Reference< XAggregation >( m_xTabController, UNO_QUERY_THROW );
m_xAggregate->setDelegator( *this );
}
- ::comphelper::decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
m_aTabActivationIdle.SetPriority( SchedulerPriority::LOWEST );
m_aTabActivationIdle.SetIdleHdl( LINK( this, FormController, OnActivateTabOrder ) );
diff --git a/svx/source/form/formdispatchinterceptor.cxx b/svx/source/form/formdispatchinterceptor.cxx
index 603f274..318fa8e 100644
--- a/svx/source/form/formdispatchinterceptor.cxx
+++ b/svx/source/form/formdispatchinterceptor.cxx
@@ -52,7 +52,7 @@ namespace svxform
{
::osl::MutexGuard aGuard( *m_pMutex );
- ::comphelper::increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
if (_rxToIntercept.is())
{
_rxToIntercept->registerDispatchProviderInterceptor((XDispatchProviderInterceptor*)this);
@@ -65,7 +65,7 @@ namespace svxform
m_bListening = true;
}
}
- ::comphelper::decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
}
diff --git a/toolkit/source/controls/geometrycontrolmodel.cxx b/toolkit/source/controls/geometrycontrolmodel.cxx
index f184213..ac09345 100644
--- a/toolkit/source/controls/geometrycontrolmodel.cxx
+++ b/toolkit/source/controls/geometrycontrolmodel.cxx
@@ -83,7 +83,7 @@
{
OSL_ENSURE(NULL != _pAggregateInstance, "OGeometryControlModel_Base::OGeometryControlModel_Base: invalid aggregate!");
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
{
m_xAggregate = _pAggregateInstance;
@@ -95,7 +95,7 @@
setAggregation(m_xAggregate);
m_xAggregate->setDelegator(static_cast< XWeak* >(this));
}
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
registerProperties();
}
@@ -113,7 +113,7 @@
,m_nStep(0)
,m_bCloneable(_rxAggregateInstance.is())
{
- increment(m_refCount);
+ osl_atomic_increment(&m_refCount);
{
{
// ensure that the temporary gets destructed NOW
@@ -128,7 +128,7 @@
setAggregation(m_xAggregate);
m_xAggregate->setDelegator(static_cast< XWeak* >(this));
}
- decrement(m_refCount);
+ osl_atomic_decrement(&m_refCount);
registerProperties();
}
More information about the Libreoffice-commits
mailing list