chart2: inline local macros
make use of Sequence initializer_list constructor and use makeAny to simplify further. removed unused includes Change-Id: I7d5b901a8bb375533c8ab945632dc8668806ca1a Reviewed-on: https://gerrit.libreoffice.org/27173 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
parent
194d4a02b9
commit
176d54fa5d
@ -19,10 +19,7 @@
|
|||||||
|
|
||||||
#include "OPropertySet.hxx"
|
#include "OPropertySet.hxx"
|
||||||
#include "ImplOPropertySet.hxx"
|
#include "ImplOPropertySet.hxx"
|
||||||
#include "ContainerHelper.hxx"
|
|
||||||
#include <cppuhelper/queryinterface.hxx>
|
#include <cppuhelper/queryinterface.hxx>
|
||||||
#include <comphelper/servicehelper.hxx>
|
|
||||||
#include <comphelper/sequence.hxx>
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -30,8 +27,6 @@
|
|||||||
|
|
||||||
using namespace ::com::sun::star;
|
using namespace ::com::sun::star;
|
||||||
|
|
||||||
using ::com::sun::star::style::XStyleSupplier;
|
|
||||||
|
|
||||||
using ::com::sun::star::uno::Reference;
|
using ::com::sun::star::uno::Reference;
|
||||||
using ::com::sun::star::uno::Sequence;
|
using ::com::sun::star::uno::Sequence;
|
||||||
using ::com::sun::star::uno::Any;
|
using ::com::sun::star::uno::Any;
|
||||||
@ -85,34 +80,22 @@ Any SAL_CALL OPropertySet::queryInterface( const uno::Type& aType )
|
|||||||
static_cast< beans::XFastPropertySet * >( this ),
|
static_cast< beans::XFastPropertySet * >( this ),
|
||||||
static_cast< beans::XPropertyState * >( this ),
|
static_cast< beans::XPropertyState * >( this ),
|
||||||
static_cast< beans::XMultiPropertyStates * >( this ),
|
static_cast< beans::XMultiPropertyStates * >( this ),
|
||||||
static_cast< XStyleSupplier * >( this ) );
|
static_cast< style::XStyleSupplier * >( this ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LCL_PROP_CPPUTYPE(t) (cppu::UnoType<t>::get())
|
|
||||||
|
|
||||||
// ____ XTypeProvider ____
|
// ____ XTypeProvider ____
|
||||||
Sequence< uno::Type > SAL_CALL
|
Sequence< uno::Type > SAL_CALL
|
||||||
OPropertySet::getTypes()
|
OPropertySet::getTypes()
|
||||||
throw (uno::RuntimeException, std::exception)
|
throw (uno::RuntimeException, std::exception)
|
||||||
{
|
{
|
||||||
static Sequence< uno::Type > aTypeList;
|
static const Sequence< uno::Type > aTypeList{
|
||||||
|
cppu::UnoType<lang::XTypeProvider>::get(),
|
||||||
MutexGuard aGuard( m_rMutex );
|
cppu::UnoType<beans::XPropertySet>::get(),
|
||||||
|
cppu::UnoType<beans::XMultiPropertySet>::get(),
|
||||||
if( aTypeList.getLength() == 0 )
|
cppu::UnoType<beans::XFastPropertySet>::get(),
|
||||||
{
|
cppu::UnoType<beans::XPropertyState>::get(),
|
||||||
::std::vector< uno::Type > aTypes;
|
cppu::UnoType<beans::XMultiPropertyStates>::get(),
|
||||||
|
cppu::UnoType<style::XStyleSupplier>::get() };
|
||||||
aTypes.push_back( LCL_PROP_CPPUTYPE( lang::XTypeProvider ));
|
|
||||||
aTypes.push_back( LCL_PROP_CPPUTYPE( beans::XPropertySet ));
|
|
||||||
aTypes.push_back( LCL_PROP_CPPUTYPE( beans::XMultiPropertySet ));
|
|
||||||
aTypes.push_back( LCL_PROP_CPPUTYPE( beans::XFastPropertySet ));
|
|
||||||
aTypes.push_back( LCL_PROP_CPPUTYPE( beans::XPropertyState ));
|
|
||||||
aTypes.push_back( LCL_PROP_CPPUTYPE( beans::XMultiPropertyStates ));
|
|
||||||
aTypes.push_back( LCL_PROP_CPPUTYPE( XStyleSupplier ));
|
|
||||||
|
|
||||||
aTypeList = comphelper::containerToSequence( aTypes );
|
|
||||||
}
|
|
||||||
|
|
||||||
return aTypeList;
|
return aTypeList;
|
||||||
}
|
}
|
||||||
|
@ -1012,33 +1012,23 @@ DummyChart* DummyChart::getRootShape()
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define QUERYINT( xint ) \
|
|
||||||
if( rType == cppu::UnoType<xint>::get() ) \
|
|
||||||
aAny <<= uno::Reference< xint >(this)
|
|
||||||
|
|
||||||
#define QUERY_INTERFACE( xint ) \
|
|
||||||
if( rType == cppu::UnoType<xint>::get() ) \
|
|
||||||
return uno::makeAny(uno::Reference<xint>(this));
|
|
||||||
|
|
||||||
uno::Any SAL_CALL DummyXShapes::queryInterface( const uno::Type& rType )
|
uno::Any SAL_CALL DummyXShapes::queryInterface( const uno::Type& rType )
|
||||||
throw(uno::RuntimeException, std::exception)
|
throw(uno::RuntimeException, std::exception)
|
||||||
{
|
{
|
||||||
QUERY_INTERFACE( drawing::XShapes );
|
if( rType == cppu::UnoType<drawing::XShapes>::get() )
|
||||||
QUERY_INTERFACE( container::XIndexAccess );
|
return uno::makeAny(uno::Reference<drawing::XShapes>(this));
|
||||||
|
if( rType == cppu::UnoType<container::XIndexAccess>::get() )
|
||||||
|
return uno::makeAny(uno::Reference<container::XIndexAccess>(this));
|
||||||
return DummyXShape::queryInterface(rType);
|
return DummyXShape::queryInterface(rType);
|
||||||
}
|
}
|
||||||
|
|
||||||
uno::Any SAL_CALL DummyXShapes::queryAggregation( const uno::Type & rType )
|
uno::Any SAL_CALL DummyXShapes::queryAggregation( const uno::Type & rType )
|
||||||
throw(uno::RuntimeException, std::exception)
|
throw(uno::RuntimeException, std::exception)
|
||||||
{
|
{
|
||||||
uno::Any aAny;
|
if( rType == cppu::UnoType<drawing::XShapes>::get() )
|
||||||
|
return uno::makeAny(uno::Reference< drawing::XShapes >(this));
|
||||||
//QUERYINT( drawing::XShapeGroup );
|
|
||||||
QUERYINT( drawing::XShapes );
|
|
||||||
else
|
else
|
||||||
return DummyXShape::queryAggregation( rType );
|
return DummyXShape::queryAggregation( rType );
|
||||||
|
|
||||||
return aAny;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAL_CALL DummyXShapes::acquire()
|
void SAL_CALL DummyXShapes::acquire()
|
||||||
@ -1083,7 +1073,7 @@ uno::Type SAL_CALL DummyXShapes::getElementType()
|
|||||||
return cppu::UnoType<drawing::XShape>::get();
|
return cppu::UnoType<drawing::XShape>::get();
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool SAL_CALL SAL_CALL DummyXShapes::hasElements()
|
sal_Bool SAL_CALL DummyXShapes::hasElements()
|
||||||
throw(uno::RuntimeException, std::exception)
|
throw(uno::RuntimeException, std::exception)
|
||||||
{
|
{
|
||||||
return !maUNOShapes.empty();
|
return !maUNOShapes.empty();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user