Kaydet (Commit) 28239c40 authored tarafından Noel Grandin's avatar Noel Grandin

simplify UNO getTypes methods

Change-Id: Ia8b07edec54527fb4904536fabb03a18e8452550
Reviewed-on: https://gerrit.libreoffice.org/68659
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 85b7e7fd
......@@ -21,6 +21,7 @@
#include "basdoc.hxx"
#include <iderdll.hxx>
#include <com/sun/star/io/IOException.hpp>
#include <comphelper/sequence.hxx>
#include <sfx2/objsh.hxx>
#include <vcl/svapp.hxx>
......@@ -70,13 +71,9 @@ void SAL_CALL SIDEModel::release() throw()
uno::Sequence< uno::Type > SAL_CALL SIDEModel::getTypes( )
{
uno::Sequence< uno::Type > aTypes = SfxBaseModel::getTypes();
sal_Int32 nLen = aTypes.getLength();
aTypes.realloc(nLen + 1);
uno::Type* pTypes = aTypes.getArray();
pTypes[nLen++] = cppu::UnoType<XServiceInfo>::get();
return aTypes;
return comphelper::concatSequences(
SfxBaseModel::getTypes(),
uno::Sequence { cppu::UnoType<XServiceInfo>::get() });
}
OUString SIDEModel::getImplementationName()
......
......@@ -38,6 +38,7 @@
#include <basic/basrdll.hxx>
#include <sbobjmod.hxx>
#include <basic/vbahelper.hxx>
#include <comphelper/sequence.hxx>
#include <cppuhelper/implbase.hxx>
#include <unotools/eventcfg.hxx>
#include <com/sun/star/frame/Desktop.hpp>
......@@ -175,19 +176,8 @@ Sequence< Type > SAL_CALL DocObjectWrapper::getTypes()
{
sTypes = m_xAggregateTypeProv->getTypes();
}
m_Types.realloc( sTypes.getLength() + 1 );
Type* pPtr = m_Types.getArray();
for ( int i=0; i<m_Types.getLength(); ++i, ++pPtr )
{
if ( i == 0 )
{
*pPtr = cppu::UnoType<XInvocation>::get();
}
else
{
*pPtr = sTypes[ i - 1 ];
}
}
m_Types = comphelper::concatSequences(sTypes,
Sequence { cppu::UnoType<XInvocation>::get() });
}
return m_Types;
}
......
......@@ -631,15 +631,9 @@ uno::Sequence< uno::Type > SAL_CALL ChartModel::getTypes()
if( (m_xOldModelAgg->queryAggregation( cppu::UnoType<decltype(xAggTypeProvider)>::get()) >>= xAggTypeProvider)
&& xAggTypeProvider.is())
{
uno::Sequence< uno::Type > aOwnTypes( impl::ChartModel_Base::getTypes());
uno::Sequence< uno::Type > aAggTypes( xAggTypeProvider->getTypes());
uno::Sequence< uno::Type > aResult( aOwnTypes.getLength() + aAggTypes.getLength());
sal_Int32 i=0;
for( ;i<aOwnTypes.getLength(); ++i )
aResult[i] = aOwnTypes[i];
for( sal_Int32 j=0; i<aResult.getLength(); ++j, ++i)
aResult[i] = aAggTypes[j];
return aResult;
return comphelper::concatSequences(
impl::ChartModel_Base::getTypes(),
xAggTypeProvider->getTypes());
}
return impl::ChartModel_Base::getTypes();
......
......@@ -206,14 +206,10 @@ namespace comphelper
Sequence< Type > SAL_CALL OComponentProxyAggregation::getTypes( )
{
Sequence< Type > aTypes( OComponentProxyAggregationHelper::getTypes() );
// append XComponent, coming from WeakComponentImplHelperBase
sal_Int32 nLen = aTypes.getLength();
aTypes.realloc( nLen + 1 );
aTypes[ nLen ] = cppu::UnoType<XComponent>::get();
return aTypes;
return comphelper::concatSequences(
OComponentProxyAggregationHelper::getTypes(),
// append XComponent, coming from WeakComponentImplHelperBase
Sequence { cppu::UnoType<XComponent>::get() });
}
......
......@@ -214,16 +214,12 @@ void SAL_CALL GenericPropertySet::release() throw()
uno::Sequence< uno::Type > SAL_CALL GenericPropertySet::getTypes()
{
uno::Sequence< uno::Type > aTypes( 5 );
uno::Type* pTypes = aTypes.getArray();
*pTypes++ = cppu::UnoType<XAggregation>::get();
*pTypes++ = cppu::UnoType<XServiceInfo>::get();
*pTypes++ = cppu::UnoType<XTypeProvider>::get();
*pTypes++ = cppu::UnoType<XPropertySet>::get();
*pTypes++ = cppu::UnoType<XMultiPropertySet>::get();
return aTypes;
return uno::Sequence {
cppu::UnoType<XAggregation>::get(),
cppu::UnoType<XServiceInfo>::get(),
cppu::UnoType<XTypeProvider>::get(),
cppu::UnoType<XPropertySet>::get(),
cppu::UnoType<XMultiPropertySet>::get() };
}
uno::Sequence< sal_Int8 > SAL_CALL GenericPropertySet::getImplementationId()
......
......@@ -187,12 +187,10 @@ namespace comphelper
Sequence< Type > SAL_CALL OStatefulPropertySet::getTypes()
{
Sequence< Type > aOwnTypes( 2 );
aOwnTypes[0] = cppu::UnoType<XWeak>::get();
aOwnTypes[1] = cppu::UnoType<XTypeProvider>::get();
return concatSequences(
aOwnTypes,
Sequence {
cppu::UnoType<XWeak>::get(),
cppu::UnoType<XTypeProvider>::get() },
OPropertyStateHelper::getTypes()
);
}
......
......@@ -115,13 +115,13 @@ namespace param
Sequence< Type > SAL_CALL ParameterWrapper::getTypes( )
{
Sequence< Type > aTypes( 5 );
aTypes[ 0 ] = cppu::UnoType<XWeak>::get();
aTypes[ 1 ] = cppu::UnoType<XTypeProvider>::get();
aTypes[ 2 ] = cppu::UnoType<XPropertySet>::get();
aTypes[ 3 ] = cppu::UnoType<XFastPropertySet>::get();
aTypes[ 4 ] = cppu::UnoType<XMultiPropertySet>::get();
return aTypes;
return Sequence< Type > {
cppu::UnoType<XWeak>::get(),
cppu::UnoType<XTypeProvider>::get(),
cppu::UnoType<XPropertySet>::get(),
cppu::UnoType<XFastPropertySet>::get(),
cppu::UnoType<XMultiPropertySet>::get()
};
}
......
......@@ -185,13 +185,9 @@ Any SAL_CALL SbaXGridControl::queryInterface(const Type& _rType)
Sequence< Type > SAL_CALL SbaXGridControl::getTypes( )
{
Sequence< Type > aTypes = FmXGridControl::getTypes();
sal_Int32 nTypes = aTypes.getLength();
aTypes.realloc(nTypes + 1);
aTypes[nTypes] = cppu::UnoType<css::frame::XDispatch>::get();
return aTypes;
return comphelper::concatSequences(
FmXGridControl::getTypes(),
Sequence { cppu::UnoType<css::frame::XDispatch>::get() });
}
Sequence< sal_Int8 > SAL_CALL SbaXGridControl::getImplementationId( )
......@@ -521,12 +517,9 @@ const Sequence< sal_Int8 > & SbaXGridPeer::getUnoTunnelId()
Sequence< Type > SAL_CALL SbaXGridPeer::getTypes()
{
Sequence< Type > aTypes = FmXGridPeer::getTypes();
sal_Int32 nOldLen = aTypes.getLength();
aTypes.realloc(nOldLen + 1);
aTypes.getArray()[nOldLen] = cppu::UnoType<css::frame::XDispatch>::get();
return aTypes;
return comphelper::concatSequences(
FmXGridPeer::getTypes(),
Sequence { cppu::UnoType<css::frame::XDispatch>::get() });
}
// return implementation specific data
......
......@@ -143,16 +143,9 @@ OUString SAL_CALL AccessibleComponentBase::getToolTipText()
uno::Sequence<uno::Type>
AccessibleComponentBase::getTypes()
{
// Get list of types from the context base implementation...
uno::Sequence<uno::Type> aTypeList (2);
// ...and add the additional type for the component.
const uno::Type aComponentType =
cppu::UnoType<XAccessibleComponent>::get();
const uno::Type aExtendedComponentType =
cppu::UnoType<XAccessibleExtendedComponent>::get();
aTypeList[0] = aComponentType;
aTypeList[1] = aExtendedComponentType;
static const uno::Sequence aTypeList {
cppu::UnoType<XAccessibleComponent>::get(),
cppu::UnoType<XAccessibleExtendedComponent>::get() };
return aTypeList;
}
......
......@@ -30,6 +30,7 @@
#include <editeng/measfld.hxx>
#include <editeng/unofield.hxx>
#include <editeng/unotext.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <sal/log.hxx>
......@@ -577,16 +578,13 @@ uno::Sequence< uno::Type > SAL_CALL SvxUnoTextField::getTypes()
{
if( maTypeSequence.getLength() == 0 )
{
maTypeSequence = OComponentHelper::getTypes();
sal_Int32 nOldCount = maTypeSequence.getLength();
maTypeSequence.realloc( nOldCount + 4 ); // !DANGER! keep this updated
uno::Type* pTypes = &maTypeSequence.getArray()[nOldCount];
*pTypes++ = cppu::UnoType<text::XTextField>::get();
*pTypes++ = cppu::UnoType<beans::XPropertySet>::get();
*pTypes++ = cppu::UnoType<lang::XServiceInfo>::get();
*pTypes++ = cppu::UnoType<lang::XUnoTunnel>::get();
maTypeSequence = comphelper::concatSequences(
OComponentHelper::getTypes(),
uno::Sequence {
cppu::UnoType<text::XTextField>::get(),
cppu::UnoType<beans::XPropertySet>::get(),
cppu::UnoType<lang::XServiceInfo>::get(),
cppu::UnoType<lang::XUnoTunnel>::get() });
}
return maTypeSequence;
}
......
......@@ -710,9 +710,8 @@ OUString SAL_CALL ScAccessibleCsvRuler::getImplementationName()
Sequence< css::uno::Type > SAL_CALL ScAccessibleCsvRuler::getTypes()
{
Sequence< css::uno::Type > aSeq( 1 );
aSeq[ 0 ] = cppu::UnoType<XAccessibleText>::get();
return ::comphelper::concatSequences( ScAccessibleCsvControl::getTypes(), aSeq );
return ::comphelper::concatSequences( ScAccessibleCsvControl::getTypes(),
Sequence { cppu::UnoType<XAccessibleText>::get() });
}
Sequence< sal_Int8 > SAL_CALL ScAccessibleCsvRuler::getImplementationId()
......@@ -1194,10 +1193,10 @@ OUString SAL_CALL ScAccessibleCsvGrid::getImplementationName()
Sequence< css::uno::Type > SAL_CALL ScAccessibleCsvGrid::getTypes()
{
Sequence< css::uno::Type > aSeq( 2 );
aSeq[ 0 ] = cppu::UnoType<XAccessibleTable>::get();
aSeq[ 1 ] = cppu::UnoType<XAccessibleSelection>::get();
return ::comphelper::concatSequences( ScAccessibleCsvControl::getTypes(), aSeq );
return ::comphelper::concatSequences( ScAccessibleCsvControl::getTypes(),
Sequence {
cppu::UnoType<XAccessibleTable>::get(),
cppu::UnoType<XAccessibleSelection>::get() });
}
Sequence< sal_Int8 > SAL_CALL ScAccessibleCsvGrid::getImplementationId()
......
......@@ -8483,10 +8483,9 @@ void SAL_CALL ScTableColumnObj::release() throw()
uno::Sequence<uno::Type> SAL_CALL ScTableColumnObj::getTypes()
{
static const uno::Sequence<uno::Type> aTypes = comphelper::concatSequences(
return comphelper::concatSequences(
ScCellRangeObj::getTypes(),
uno::Sequence<uno::Type> { cppu::UnoType<container::XNamed>::get() } );
return aTypes;
}
uno::Sequence<sal_Int8> SAL_CALL ScTableColumnObj::getImplementationId()
......
......@@ -67,7 +67,7 @@ void SAL_CALL ScCellCursorObj::release() throw()
uno::Sequence<uno::Type> SAL_CALL ScCellCursorObj::getTypes()
{
static const uno::Sequence<uno::Type> aTypes = comphelper::concatSequences(
return comphelper::concatSequences(
ScCellRangeObj::getTypes(),
uno::Sequence<uno::Type>
{
......@@ -75,7 +75,6 @@ uno::Sequence<uno::Type> SAL_CALL ScCellCursorObj::getTypes()
cppu::UnoType<sheet::XUsedAreaCursor>::get(),
cppu::UnoType<table::XCellCursor>::get()
} );
return aTypes;
}
uno::Sequence<sal_Int8> SAL_CALL ScCellCursorObj::getImplementationId()
......
......@@ -1091,14 +1091,13 @@ void SAL_CALL ScDataPilotTableObj::release() throw()
Sequence< uno::Type > SAL_CALL ScDataPilotTableObj::getTypes()
{
static const Sequence< uno::Type > aTypes = comphelper::concatSequences(
return comphelper::concatSequences(
ScDataPilotDescriptorBase::getTypes(),
Sequence< uno::Type >
{
cppu::UnoType<XDataPilotTable2>::get(),
cppu::UnoType<XModifyBroadcaster>::get()
} );
return aTypes;
}
Sequence<sal_Int8> SAL_CALL ScDataPilotTableObj::getImplementationId()
......
......@@ -1335,7 +1335,7 @@ uno::Sequence<OUString> SAL_CALL ScEditFieldObj::getSupportedServiceNames()
uno::Sequence<uno::Type> SAL_CALL ScEditFieldObj::getTypes()
{
static const uno::Sequence<uno::Type> aTypes = comphelper::concatSequences(
return comphelper::concatSequences(
OComponentHelper::getTypes(),
uno::Sequence<uno::Type>
{
......@@ -1344,7 +1344,6 @@ uno::Sequence<uno::Type> SAL_CALL ScEditFieldObj::getTypes()
cppu::UnoType<lang::XUnoTunnel>::get(),
cppu::UnoType<lang::XServiceInfo>::get()
} );
return aTypes;
}
uno::Sequence<sal_Int8> SAL_CALL ScEditFieldObj::getImplementationId()
......
......@@ -157,7 +157,7 @@ uno::Any SAL_CALL ScViewPaneBase::queryInterface( const uno::Type& rType )
uno::Sequence<uno::Type> SAL_CALL ScViewPaneBase::getTypes()
{
static uno::Sequence<uno::Type> aTypes
static const uno::Sequence<uno::Type> aTypes
{
cppu::UnoType<sheet::XViewPane>::get(),
cppu::UnoType<sheet::XCellRangeReferrer>::get(),
......@@ -576,7 +576,7 @@ void ScTabViewObj::SheetChanged( bool bSameTabButMoved )
uno::Sequence<uno::Type> SAL_CALL ScTabViewObj::getTypes()
{
static const uno::Sequence<uno::Type> aTypes = comphelper::concatSequences(
return comphelper::concatSequences(
ScViewPaneBase::getTypes(),
SfxBaseController::getTypes(),
uno::Sequence<uno::Type>
......@@ -594,7 +594,6 @@ uno::Sequence<uno::Type> SAL_CALL ScTabViewObj::getTypes()
cppu::UnoType<sheet::XActivationBroadcaster>::get(),
cppu::UnoType<datatransfer::XTransferableSupplier>::get()
} );
return aTypes;
}
uno::Sequence<sal_Int8> SAL_CALL ScTabViewObj::getImplementationId()
......
......@@ -428,40 +428,18 @@ css::uno::Sequence< css::uno::Type> SAL_CALL
{
ThrowIfDisposed ();
// Get list of types from the context base implementation, ...
uno::Sequence<uno::Type> aTypeList (AccessibleContextBase::getTypes());
// ... get list of types from component base implementation, ...
uno::Sequence<uno::Type> aComponentTypeList (AccessibleComponentBase::getTypes());
// ...and add the additional type for the component, ...
const uno::Type aLangEventListenerType =
cppu::UnoType<lang::XEventListener>::get();
const uno::Type aPropertyChangeListenerType =
cppu::UnoType<beans::XPropertyChangeListener>::get();
const uno::Type aWindowListenerType =
cppu::UnoType<awt::XWindowListener>::get();
const uno::Type aFocusListenerType =
cppu::UnoType<awt::XFocusListener>::get();
const uno::Type aEventBroadcaster =
cppu::UnoType<XAccessibleEventBroadcaster>::get();
// ... and merge them all into one list.
sal_Int32 nTypeCount (aTypeList.getLength()),
nComponentTypeCount (aComponentTypeList.getLength()),
i;
aTypeList.realloc (nTypeCount + nComponentTypeCount + 5);
for (i=0; i<nComponentTypeCount; i++)
aTypeList[nTypeCount + i] = aComponentTypeList[i];
aTypeList[nTypeCount + i++ ] = aLangEventListenerType;
aTypeList[nTypeCount + i++] = aPropertyChangeListenerType;
aTypeList[nTypeCount + i++] = aWindowListenerType;
aTypeList[nTypeCount + i++] = aFocusListenerType;
aTypeList[nTypeCount + i++] = aEventBroadcaster;
return aTypeList;
return comphelper::concatSequences(
// Get list of types from the context base implementation, ...
AccessibleContextBase::getTypes(),
// ... get list of types from component base implementation, ...
AccessibleComponentBase::getTypes(),
// ...and add the additional type for the component, ...
css::uno::Sequence {
cppu::UnoType<lang::XEventListener>::get(),
cppu::UnoType<beans::XPropertyChangeListener>::get(),
cppu::UnoType<awt::XWindowListener>::get(),
cppu::UnoType<awt::XFocusListener>::get(),
cppu::UnoType<XAccessibleEventBroadcaster>::get() });
}
void AccessibleDocumentViewBase::impl_dispose()
......
......@@ -375,35 +375,29 @@ uno::Sequence< uno::Type > SAL_CALL SdXImpressDocument::getTypes( )
if( maTypeSequence.getLength() == 0 )
{
const uno::Sequence< uno::Type > aBaseTypes( SfxBaseModel::getTypes() );
const sal_Int32 nBaseTypes = aBaseTypes.getLength();
const uno::Type* pBaseTypes = aBaseTypes.getConstArray();
const sal_Int32 nOwnTypes = mbImpressDoc ? 14 : 11; // !DANGER! Keep this updated!
maTypeSequence.realloc( nBaseTypes + nOwnTypes );
uno::Type* pTypes = maTypeSequence.getArray();
*pTypes++ = cppu::UnoType<beans::XPropertySet>::get();
*pTypes++ = cppu::UnoType<lang::XServiceInfo>::get();
*pTypes++ = cppu::UnoType<lang::XMultiServiceFactory>::get();
*pTypes++ = cppu::UnoType<drawing::XDrawPageDuplicator>::get();
*pTypes++ = cppu::UnoType<drawing::XLayerSupplier>::get();
*pTypes++ = cppu::UnoType<drawing::XMasterPagesSupplier>::get();
*pTypes++ = cppu::UnoType<drawing::XDrawPagesSupplier>::get();
*pTypes++ = cppu::UnoType<document::XLinkTargetSupplier>::get();
*pTypes++ = cppu::UnoType<style::XStyleFamiliesSupplier>::get();
*pTypes++ = cppu::UnoType<css::ucb::XAnyCompareFactory>::get();
*pTypes++ = cppu::UnoType<view::XRenderable>::get();
uno::Sequence< uno::Type > aTypes( SfxBaseModel::getTypes() );
aTypes = comphelper::concatSequences(aTypes,
uno::Sequence {
cppu::UnoType<beans::XPropertySet>::get(),
cppu::UnoType<lang::XServiceInfo>::get(),
cppu::UnoType<lang::XMultiServiceFactory>::get(),
cppu::UnoType<drawing::XDrawPageDuplicator>::get(),
cppu::UnoType<drawing::XLayerSupplier>::get(),
cppu::UnoType<drawing::XMasterPagesSupplier>::get(),
cppu::UnoType<drawing::XDrawPagesSupplier>::get(),
cppu::UnoType<document::XLinkTargetSupplier>::get(),
cppu::UnoType<style::XStyleFamiliesSupplier>::get(),
cppu::UnoType<css::ucb::XAnyCompareFactory>::get(),
cppu::UnoType<view::XRenderable>::get() });
if( mbImpressDoc )
{
*pTypes++ = cppu::UnoType<presentation::XPresentationSupplier>::get();
*pTypes++ = cppu::UnoType<presentation::XCustomPresentationSupplier>::get();
*pTypes++ = cppu::UnoType<presentation::XHandoutMasterSupplier>::get();
aTypes = comphelper::concatSequences(aTypes,
uno::Sequence {
cppu::UnoType<presentation::XPresentationSupplier>::get(),
cppu::UnoType<presentation::XCustomPresentationSupplier>::get(),
cppu::UnoType<presentation::XHandoutMasterSupplier>::get() });
}
for( sal_Int32 nType = 0; nType < nBaseTypes; nType++ )
*pTypes++ = *pBaseTypes++;
maTypeSequence = aTypes;
}
return maTypeSequence;
......
......@@ -2081,17 +2081,10 @@ Sequence< uno::Type > SAL_CALL SdDrawPage::getTypes()
aTypes.push_back(cppu::UnoType<XAnimationNodeSupplier>::get());
// Get types of base class.
const Sequence< uno::Type > aBaseTypes( SdGenericDrawPage::getTypes() );
const sal_Int32 nBaseTypes = aBaseTypes.getLength();
const uno::Type* pBaseTypes = aBaseTypes.getConstArray();
// Join those types in a sequence.
maTypeSequence.realloc(aTypes.size() + nBaseTypes);
uno::Type* pTypes = maTypeSequence.getArray();
for (const auto& rType : aTypes)
*pTypes++ = rType;
for( sal_Int32 nType = 0; nType < nBaseTypes; nType++ )
*pTypes++ = *pBaseTypes++;
return comphelper::concatSequences(
comphelper::containerToSequence(aTypes),
SdGenericDrawPage::getTypes() );
}
return maTypeSequence;
......@@ -2705,17 +2698,10 @@ Sequence< uno::Type > SAL_CALL SdMasterPage::getTypes()
aTypes.push_back(cppu::UnoType<XAnimationNodeSupplier>::get());
// Get types of base class.
const Sequence< uno::Type > aBaseTypes( SdGenericDrawPage::getTypes() );
const sal_Int32 nBaseTypes = aBaseTypes.getLength();
const uno::Type* pBaseTypes = aBaseTypes.getConstArray();
// Join those types in a sequence.
maTypeSequence.realloc(aTypes.size() + nBaseTypes);
uno::Type* pTypes = maTypeSequence.getArray();
for (const auto& rType : aTypes)
*pTypes++ = rType;
for( sal_Int32 nType = 0; nType < nBaseTypes; nType++ )
*pTypes++ = *pBaseTypes++;
return comphelper::concatSequences(
comphelper::containerToSequence(aTypes),
SdGenericDrawPage::getTypes() );
}
return maTypeSequence;
......
......@@ -34,6 +34,7 @@
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/script/XLibraryContainer.hpp>
#include <comphelper/propertysetinfo.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <unotools/moduleoptions.hxx>
......@@ -343,17 +344,12 @@ void SAL_CALL SmModel::release() throw()
uno::Sequence< uno::Type > SAL_CALL SmModel::getTypes( )
{
SolarMutexGuard aGuard;
uno::Sequence< uno::Type > aTypes = SfxBaseModel::getTypes();
sal_Int32 nLen = aTypes.getLength();
aTypes.realloc(nLen + 4);
uno::Type* pTypes = aTypes.getArray();
pTypes[nLen++] = cppu::UnoType<XServiceInfo>::get();
pTypes[nLen++] = cppu::UnoType<XPropertySet>::get();
pTypes[nLen++] = cppu::UnoType<XMultiPropertySet>::get();
pTypes[nLen++] = cppu::UnoType<XRenderable>::get();
return aTypes;
return comphelper::concatSequences(SfxBaseModel::getTypes(),
uno::Sequence {
cppu::UnoType<XServiceInfo>::get(),
cppu::UnoType<XPropertySet>::get(),
cppu::UnoType<XMultiPropertySet>::get(),
cppu::UnoType<XRenderable>::get() });
}
namespace
......
......@@ -18,6 +18,7 @@
*/
#include <osl/mutex.hxx>
#include <comphelper/sequence.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/weak.hxx>
......@@ -50,6 +51,7 @@
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <memory>
#include <vector>
#include <rtl/ustrbuf.hxx>
#include <rtl/strbuf.hxx>
......@@ -971,62 +973,38 @@ void Invocation_Impl::fillInfoForMethod
Sequence< Type > SAL_CALL Invocation_Impl::getTypes()
{
static Sequence<Type> s_types = [this]() {
Sequence<Type> types(4 + 10);
Type* pTypes = types.getArray();
sal_Int32 n = 0;
pTypes[n++] = cppu::UnoType<XTypeProvider>::get();
pTypes[n++] = cppu::UnoType<XWeak>::get();
pTypes[n++] = cppu::UnoType<XInvocation>::get();
pTypes[n++] = cppu::UnoType<XMaterialHolder>::get();
std::vector<Type> tmp {
cppu::UnoType<XTypeProvider>::get(),
cppu::UnoType<XWeak>::get(),
cppu::UnoType<XInvocation>::get(),
cppu::UnoType<XMaterialHolder>::get() };
// Invocation does not support XExactName if direct object supports
// XInvocation, but not XExactName.
if ((_xDirect.is() && _xENDirect.is()) || (!_xDirect.is() && _xENIntrospection.is()))
{
pTypes[n++] = cppu::UnoType<XExactName>::get();
}
tmp.push_back(cppu::UnoType<XExactName>::get());
if (_xNameContainer.is())
{
pTypes[n++] = cppu::UnoType<XNameContainer>::get();
}
tmp.push_back(cppu::UnoType<XNameContainer>::get());
if (_xNameReplace.is())
{
pTypes[n++] = cppu::UnoType<XNameReplace>::get();
}
tmp.push_back(cppu::UnoType<XNameReplace>::get());
if (_xNameAccess.is())
{
pTypes[n++] = cppu::UnoType<XNameAccess>::get();
}
tmp.push_back(cppu::UnoType<XNameAccess>::get());
if (_xIndexContainer.is())
{
pTypes[n++] = cppu::UnoType<XIndexContainer>::get();
}
tmp.push_back(cppu::UnoType<XIndexContainer>::get());
if (_xIndexReplace.is())
{
pTypes[n++] = cppu::UnoType<XIndexReplace>::get();
}
tmp.push_back(cppu::UnoType<XIndexReplace>::get());
if (_xIndexAccess.is())
{
pTypes[n++] = cppu::UnoType<XIndexAccess>::get();
}
tmp.push_back(cppu::UnoType<XIndexAccess>::get());
if (_xEnumerationAccess.is())
{
pTypes[n++] = cppu::UnoType<XEnumerationAccess>::get();
}
tmp.push_back(cppu::UnoType<XEnumerationAccess>::get());
if (_xElementAccess.is())
{
pTypes[n++] = cppu::UnoType<XElementAccess>::get();
}
tmp.push_back(cppu::UnoType<XElementAccess>::get());
// Invocation does not support XInvocation2, if direct object supports
// XInvocation, but not XInvocation2.
if ((_xDirect.is() && _xDirect2.is()) || (!_xDirect.is() && _xIntrospectionAccess.is()))
{
pTypes[n++] = cppu::UnoType<XInvocation2>::get();
}
tmp.push_back(cppu::UnoType<XInvocation2>::get());
types.realloc(n);
return types;
return comphelper::containerToSequence(tmp);
}();
return s_types;
}
......
......@@ -68,16 +68,11 @@ using namespace ::com::sun::star;
struct FSStorage_Impl
{
OUString const m_aURL;
::ucbhelper::Content m_aContent;
sal_Int32 const m_nMode;
std::unique_ptr<::comphelper::OInterfaceContainerHelper2> m_pListenersContainer; // list of listeners
std::unique_ptr<::cppu::OTypeCollection> m_pTypeCollection;
uno::Reference< uno::XComponentContext > m_xContext;
FSStorage_Impl( const ::ucbhelper::Content& aContent, sal_Int32 nMode, uno::Reference< uno::XComponentContext > const & xContext )
: m_aURL( aContent.getURL() )
, m_aContent( aContent )
......@@ -259,21 +254,12 @@ void SAL_CALL FSStorage::release() throw()
uno::Sequence< uno::Type > SAL_CALL FSStorage::getTypes()
{
if ( m_pImpl->m_pTypeCollection == nullptr )