summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2014-05-23 22:11:27 +0200
committerJulien Nabet <serval2412@yahoo.fr>2014-05-23 22:11:52 +0200
commitac76cc7e605b1bc9c0ff8e24d0b9995a8247074e (patch)
tree797df8cc9387fa70a0c09e574f49714ce4dc6710 /forms
parent3191d7d1302dbde2445b9f300b3eb853120ede65 (diff)
Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part20
Change-Id: If87cdfb2c605254f6d69baa4ca5aec09091caa68
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/Button.cxx2
-rw-r--r--forms/source/component/Columns.cxx14
-rw-r--r--forms/source/component/Edit.cxx2
-rw-r--r--forms/source/component/EditBase.cxx10
-rw-r--r--forms/source/component/FormComponent.cxx8
-rw-r--r--forms/source/component/FormattedFieldWrapper.cxx6
-rw-r--r--forms/source/component/Grid.cxx10
-rw-r--r--forms/source/component/ImageControl.cxx2
-rw-r--r--forms/source/component/clickableimage.cxx2
-rw-r--r--forms/source/component/refvaluecomponent.cxx2
-rw-r--r--forms/source/richtext/richtextunowrapper.cxx4
-rw-r--r--forms/source/xforms/datatyperepository.cxx2
-rw-r--r--forms/source/xforms/datatypes.hxx2
13 files changed, 33 insertions, 33 deletions
diff --git a/forms/source/component/Button.cxx b/forms/source/component/Button.cxx
index 9fb6e466dd1e..262bd89fadef 100644
--- a/forms/source/component/Button.cxx
+++ b/forms/source/component/Button.cxx
@@ -393,7 +393,7 @@ Any SAL_CALL OButtonControl::queryAggregation(const Type& _rType) throw (Runtime
{
// if asked for the XTypeProvider, don't let OButtonControl_BASE do this
Any aReturn;
- if ( !_rType.equals( ::getCppuType( static_cast< Reference< XTypeProvider >* >( NULL ) ) ) )
+ if ( !_rType.equals( cppu::UnoType<XTypeProvider>::get() ) )
aReturn = OButtonControl_BASE::queryInterface( _rType );
if ( !aReturn.hasValue() )
diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx
index 241476c57ca8..f53fa142a188 100644
--- a/forms/source/component/Columns.cxx
+++ b/forms/source/component/Columns.cxx
@@ -178,11 +178,11 @@ Any SAL_CALL OGridColumn::queryAggregation( const Type& _rType ) throw (RuntimeE
{
Any aReturn;
// some functionality at our aggregate cannot be reasonably fulfilled here.
- if ( _rType.equals(::getCppuType(static_cast< Reference< XFormComponent >* >(NULL)))
- || _rType.equals(::getCppuType(static_cast< Reference< XServiceInfo >* >(NULL)))
- || _rType.equals(::getCppuType(static_cast< Reference< XBindableValue >* >(NULL)))
- || _rType.equals(::getCppuType(static_cast< Reference< XPropertyContainer >* >(NULL)))
- || comphelper::isAssignableFrom(::getCppuType(static_cast< Reference< XTextRange >* >(NULL)),_rType)
+ if ( _rType.equals(cppu::UnoType<XFormComponent>::get())
+ || _rType.equals(cppu::UnoType<XServiceInfo>::get())
+ || _rType.equals(cppu::UnoType<XBindableValue>::get())
+ || _rType.equals(cppu::UnoType<XPropertyContainer>::get())
+ || comphelper::isAssignableFrom(cppu::UnoType<XTextRange>::get(),_rType)
)
return aReturn;
@@ -402,10 +402,10 @@ sal_Bool OGridColumn::convertFastPropertyValue( Any& rConvertedValue, Any& rOldV
bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aLabel);
break;
case PROPERTY_ID_WIDTH:
- bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aWidth, ::getCppuType((const sal_Int32*)NULL));
+ bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aWidth, cppu::UnoType<sal_Int32>::get());
break;
case PROPERTY_ID_ALIGN:
- bModified = tryPropertyValue( rConvertedValue, rOldValue, rValue, m_aAlign, ::getCppuType( (const sal_Int32*)NULL ) );
+ bModified = tryPropertyValue( rConvertedValue, rOldValue, rValue, m_aAlign, cppu::UnoType<sal_Int32>::get());
// strange enough, css.awt.TextAlign is a 32-bit integer, while the Align property (both here for grid controls
// and for ordinary toolkit controls) is a 16-bit integer. So, allow for 32 bit, but normalize it to 16 bit
if ( bModified )
diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx
index e4f3219ab3d1..c5f364317415 100644
--- a/forms/source/component/Edit.cxx
+++ b/forms/source/component/Edit.cxx
@@ -216,7 +216,7 @@ void OEditControl::keyPressed(const ::com::sun::star::awt::KeyEvent& e) throw (
return;
aTmp = xFormSet->getPropertyValue( PROPERTY_TARGET_URL );
- if (!aTmp.getValueType().equals(::getCppuType((const OUString*)NULL)) ||
+ if (!aTmp.getValueType().equals(cppu::UnoType<OUString>::get()) ||
getString(aTmp).isEmpty() )
return;
diff --git a/forms/source/component/EditBase.cxx b/forms/source/component/EditBase.cxx
index 55714e10a9f3..6b8ca643fdae 100644
--- a/forms/source/component/EditBase.cxx
+++ b/forms/source/component/EditBase.cxx
@@ -108,9 +108,9 @@ void OEditBaseModel::write(const Reference<XObjectOutputStream>& _rxOutStream) t
nAnyMask |= DEFAULT_LONG;
else if (m_aDefault.getValueType().getTypeClass() == TypeClass_DOUBLE)
nAnyMask |= DEFAULT_DOUBLE;
- else if (m_aDefault.getValueType() == ::getCppuType((const util::Time*)0))
+ else if (m_aDefault.getValueType() == cppu::UnoType<util::Time>::get())
nAnyMask |= DEFAULT_TIME;
- else if (m_aDefault.getValueType() == ::getCppuType((const util::Date*)0))
+ else if (m_aDefault.getValueType() == cppu::UnoType<util::Date>::get())
nAnyMask |= DEFAULT_DATE;
if (m_bFilterProposal) // Don't save a value, because it's boolean
@@ -308,13 +308,13 @@ sal_Bool OEditBaseModel::convertFastPropertyValue( Any& rConvertedValue, Any& rO
bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aDefaultText);
break;
case PROPERTY_ID_DEFAULT_VALUE:
- bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aDefault, ::getCppuType((const double*)0));
+ bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aDefault, cppu::UnoType<double>::get());
break;
case PROPERTY_ID_DEFAULT_DATE:
- bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aDefault, ::getCppuType((const util::Date*)0));
+ bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aDefault, cppu::UnoType<util::Date>::get());
break;
case PROPERTY_ID_DEFAULT_TIME:
- bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aDefault, ::getCppuType((const util::Time*)0));
+ bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aDefault, cppu::UnoType<util::Time>::get());
break;
default:
bModified = OBoundControlModel::convertFastPropertyValue(
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index 951a37ffb4fe..615688e69961 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -358,7 +358,7 @@ Any SAL_CALL OBoundControl::queryAggregation(const Type& _rType) throw(RuntimeEx
Any aReturn;
// XTypeProvider first - don't ask the OBoundControl_BASE, it would deliver incomplete types
- if ( _rType.equals( ::getCppuType( static_cast< Reference< XTypeProvider >* >( NULL ) ) ) )
+ if ( _rType.equals( cppu::UnoType<XTypeProvider>::get() ) )
aReturn = OControl::queryAggregation( _rType );
// ask our own interfaces
@@ -462,7 +462,7 @@ Any SAL_CALL OControlModel::queryAggregation(const Type& _rType) throw (RuntimeE
{
aReturn = OPropertySetAggregationHelper::queryInterface(_rType);
// our aggregate
- if (!aReturn.hasValue() && m_xAggregate.is() && !_rType.equals(::getCppuType(static_cast< Reference< XCloneable>* >(NULL))))
+ if (!aReturn.hasValue() && m_xAggregate.is() && !_rType.equals(cppu::UnoType<XCloneable>::get()))
aReturn = m_xAggregate->queryAggregation(_rType);
}
}
@@ -975,12 +975,12 @@ void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const A
switch (_nHandle)
{
case PROPERTY_ID_NAME:
- DBG_ASSERT(_rValue.getValueType() == getCppuType((const OUString*)NULL),
+ DBG_ASSERT(_rValue.getValueType() == cppu::UnoType<OUString>::get(),
"OControlModel::setFastPropertyValue_NoBroadcast : invalid type" );
_rValue >>= m_aName;
break;
case PROPERTY_ID_TAG:
- DBG_ASSERT(_rValue.getValueType() == getCppuType((const OUString*)NULL),
+ DBG_ASSERT(_rValue.getValueType() == cppu::UnoType<OUString>::get(),
"OControlModel::setFastPropertyValue_NoBroadcast : invalid type" );
_rValue >>= m_aTag;
break;
diff --git a/forms/source/component/FormattedFieldWrapper.cxx b/forms/source/component/FormattedFieldWrapper.cxx
index b30c53ec86c0..e3ae3ff9717f 100644
--- a/forms/source/component/FormattedFieldWrapper.cxx
+++ b/forms/source/component/FormattedFieldWrapper.cxx
@@ -140,7 +140,7 @@ Any SAL_CALL OFormattedFieldWrapper::queryAggregation(const Type& _rType) throw
{
Any aReturn;
- if (_rType.equals( ::getCppuType( static_cast< Reference< XTypeProvider >* >(NULL) ) ) )
+ if (_rType.equals( cppu::UnoType<XTypeProvider>::get() ) )
{ // a XTypeProvider interface needs a working aggregate - we don't want to give the type provider
// of our base class (OFormattedFieldWrapper_Base) to the caller as it supplies nearly nothing
ensureAggregate();
@@ -152,7 +152,7 @@ Any SAL_CALL OFormattedFieldWrapper::queryAggregation(const Type& _rType) throw
{
aReturn = OFormattedFieldWrapper_Base::queryAggregation(_rType);
- if ((_rType.equals( ::getCppuType( static_cast< Reference< XServiceInfo >* >(NULL) ) ) ) && aReturn.hasValue())
+ if ((_rType.equals( cppu::UnoType<XServiceInfo>::get() ) ) && aReturn.hasValue())
{ // somebody requested an XServiceInfo interface and our base class provided it
// check our aggregate if it has one, too
ensureAggregate();
@@ -200,7 +200,7 @@ Sequence< OUString > SAL_CALL OFormattedFieldWrapper::getSupportedServiceNames(
{
DBG_ASSERT(m_xAggregate.is(), "OFormattedFieldWrapper::getSupportedServiceNames: should never have made it 'til here without an aggregate!");
Reference< XServiceInfo > xSI;
- m_xAggregate->queryAggregation(::getCppuType(static_cast< Reference< XServiceInfo >* >(NULL))) >>= xSI;
+ m_xAggregate->queryAggregation(cppu::UnoType<XServiceInfo>::get()) >>= xSI;
return xSI->getSupportedServiceNames();
}
diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx
index 196f2c3281b7..e9a306dd7e4b 100644
--- a/forms/source/component/Grid.cxx
+++ b/forms/source/component/Grid.cxx
@@ -67,7 +67,7 @@ InterfaceRef SAL_CALL OGridControlModel_CreateInstance(const Reference<XMultiSer
}
OGridControlModel::OGridControlModel(const Reference<XComponentContext>& _rxFactory)
:OControlModel(_rxFactory, OUString())
- ,OInterfaceContainer(_rxFactory, m_aMutex, ::getCppuType(static_cast<Reference<XPropertySet>*>(NULL)))
+ ,OInterfaceContainer(_rxFactory, m_aMutex, cppu::UnoType<XPropertySet>::get())
,OErrorBroadcaster( OComponentHelper::rBHelper )
,FontControlModel( false )
,m_aSelectListeners(m_aMutex)
@@ -90,7 +90,7 @@ OGridControlModel::OGridControlModel(const Reference<XComponentContext>& _rxFact
OGridControlModel::OGridControlModel( const OGridControlModel* _pOriginal, const Reference< XComponentContext >& _rxFactory )
:OControlModel( _pOriginal, _rxFactory )
- ,OInterfaceContainer( _rxFactory, m_aMutex, ::getCppuType( static_cast<Reference<XPropertySet>*>( NULL ) ) )
+ ,OInterfaceContainer( _rxFactory, m_aMutex, cppu::UnoType<XPropertySet>::get() )
,OErrorBroadcaster( OComponentHelper::rBHelper )
,FontControlModel( _pOriginal )
,m_aSelectListeners( m_aMutex )
@@ -547,17 +547,17 @@ sal_Bool OGridControlModel::convertFastPropertyValue( Any& rConvertedValue, Any&
bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_nBorder);
break;
case PROPERTY_ID_BORDERCOLOR:
- bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aBorderColor, ::getCppuType((const sal_Int32*)NULL));
+ bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aBorderColor, cppu::UnoType<sal_Int32>::get());
break;
case PROPERTY_ID_DEFAULTCONTROL:
bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aDefaultControl);
break;
case PROPERTY_ID_BACKGROUNDCOLOR:
- bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aBackgroundColor, ::getCppuType((const sal_Int32*)NULL));
+ bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aBackgroundColor, cppu::UnoType<sal_Int32>::get());
break;
case PROPERTY_ID_ROWHEIGHT:
{
- bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aRowHeight, ::getCppuType((const sal_Int32*)NULL));
+ bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aRowHeight, cppu::UnoType<sal_Int32>::get());
sal_Int32 nNewVal( 0 );
if ( ( rConvertedValue >>= nNewVal ) && ( nNewVal <= 0 ) )
{
diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx
index c2691aeecf10..fc3b65a4332a 100644
--- a/forms/source/component/ImageControl.cxx
+++ b/forms/source/component/ImageControl.cxx
@@ -217,7 +217,7 @@ Any SAL_CALL OImageControlModel::queryAggregation(const Type& _rType) throw (Run
// BUT: _don't_ let it feel responsible for the XTypeProvider interface
// (as this is implemented by our base class in the proper way)
- if ( _rType.equals( ::getCppuType( static_cast< Reference< XTypeProvider >* >( NULL ) ) )
+ if ( _rType.equals( cppu::UnoType<XTypeProvider>::get() )
|| !aReturn.hasValue()
)
aReturn = OBoundControlModel::queryAggregation( _rType );
diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx
index a99066c9cd52..55bd6ca278db 100644
--- a/forms/source/component/clickableimage.cxx
+++ b/forms/source/component/clickableimage.cxx
@@ -595,7 +595,7 @@ namespace frm
// BUT: _don't_ let it feel responsible for the XTypeProvider interface
// (as this is implemented by our base class in the proper way)
- if ( _rType.equals( ::getCppuType( static_cast< Reference< XTypeProvider >* >( NULL ) ) )
+ if ( _rType.equals( cppu::UnoType<XTypeProvider>::get() )
|| !aReturn.hasValue()
)
aReturn = OControlModel::queryAggregation( _rType );
diff --git a/forms/source/component/refvaluecomponent.cxx b/forms/source/component/refvaluecomponent.cxx
index d2562bf0cbdb..b3f4afe30590 100644
--- a/forms/source/component/refvaluecomponent.cxx
+++ b/forms/source/component/refvaluecomponent.cxx
@@ -164,7 +164,7 @@ namespace frm
Sequence< Type > OReferenceValueComponent::getSupportedBindingTypes()
{
::std::list< Type > aTypes;
- aTypes.push_back( ::getCppuType( static_cast< sal_Bool* >( NULL ) ) );
+ aTypes.push_back( cppu::UnoType<sal_Bool>::get() );
if ( !m_sReferenceValue.isEmpty() )
aTypes.push_front( cppu::UnoType<OUString>::get() );
diff --git a/forms/source/richtext/richtextunowrapper.cxx b/forms/source/richtext/richtextunowrapper.cxx
index c65daeca8fa4..cd81e794f026 100644
--- a/forms/source/richtext/richtextunowrapper.cxx
+++ b/forms/source/richtext/richtextunowrapper.cxx
@@ -49,8 +49,8 @@ namespace frm
SVX_UNOEDIT_CHAR_PROPERTIES,
SVX_UNOEDIT_FONT_PROPERTIES,
SVX_UNOEDIT_PARA_PROPERTIES,
- { OUString("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, ::getCppuType( static_cast< const Reference< XNameContainer >* >( NULL ) ), 0, 0 },
- { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, ::getCppuType( static_cast< const Reference< XNameContainer >* >( NULL ) ), 0, 0 },
+ { OUString("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, cppu::UnoType<XNameContainer>::get(), 0, 0 },
+ { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, cppu::UnoType<XNameContainer>::get(), 0, 0 },
{ OUString(), 0, css::uno::Type(), 0, 0 }
};
static SvxItemPropertySet aTextEnginePropertySet( aTextEnginePropertyMap, SdrObject::GetGlobalDrawObjectItemPool() );
diff --git a/forms/source/xforms/datatyperepository.cxx b/forms/source/xforms/datatyperepository.cxx
index f665cdd04a15..2e304a264180 100644
--- a/forms/source/xforms/datatyperepository.cxx
+++ b/forms/source/xforms/datatyperepository.cxx
@@ -205,7 +205,7 @@ namespace xforms
Type SAL_CALL ODataTypeRepository::getElementType( ) throw (RuntimeException, std::exception)
{
- return ::getCppuType( static_cast< Reference< XDataType >* >( NULL ) );
+ return cppu::UnoType<XDataType>::get();
}
diff --git a/forms/source/xforms/datatypes.hxx b/forms/source/xforms/datatypes.hxx
index d436059a6dad..383624d59d0b 100644
--- a/forms/source/xforms/datatypes.hxx
+++ b/forms/source/xforms/datatypes.hxx
@@ -234,7 +234,7 @@ namespace xforms
protected:
typedef VALUE_TYPE ValueType;
inline const ::com::sun::star::uno::Type&
- getCppuType() const { return ::getCppuType( static_cast< ValueType* >( NULL ) ); }
+ getCppuType() const { return cppu::UnoType<ValueType>::get(); }
protected:
OValueLimitedType( const OUString& _rName, sal_Int16 _nTypeClass );