27#include <core_resource.hxx>
40 const OUString pProps[] = {
49OShape::OShape(uno::Reference< uno::XComponentContext >
const & _xContext)
59OShape::OShape(uno::Reference< uno::XComponentContext >
const & _xContext
60 ,
const uno::Reference< lang::XMultiServiceFactory>& _xFactory
61 ,uno::Reference< drawing::XShape >& _xShape
62 ,OUString _sServiceName)
68,m_sServiceName(
std::move(_sServiceName))
71 m_aProps.aComponent.m_xFactory = _xFactory;
72 osl_atomic_increment( &m_refCount );
74 uno::Reference<beans::XPropertySet> xProp(_xShape,uno::UNO_QUERY);
80 m_aProps.aComponent.setShape(_xShape,
this,m_refCount);
82 osl_atomic_decrement( &m_refCount );
94 uno::Any aReturn = ShapeBase::queryInterface(_rType);
96 aReturn = ShapePropertySet::queryInterface(_rType);
98 if ( !aReturn.
hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
101 return aReturn.
hasValue() ? aReturn : (
m_aProps.aComponent.m_xProxy.is() ?
m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
105void SAL_CALL OShape::dispose()
107 ShapePropertySet::dispose();
108 cppu::WeakComponentImplHelperBase::dispose();
111uno::Reference< uno::XInterface > OShape::create(uno::Reference< uno::XComponentContext >
const & xContext)
113 return *(
new OShape(xContext));
117OUString OShape::getImplementationName_Static( )
119 return "com.sun.star.comp.report.Shape";
123OUString SAL_CALL OShape::getImplementationName( )
125 return getImplementationName_Static();
128uno::Sequence< OUString > OShape::getSupportedServiceNames_Static( )
133uno::Sequence< OUString > SAL_CALL OShape::getSupportedServiceNames( )
135 if(m_sServiceName.isEmpty())
137 return getSupportedServiceNames_Static();
145sal_Bool SAL_CALL OShape::supportsService(
const OUString& ServiceName)
156::sal_Int32 SAL_CALL
OShape::getControlBackground()
158 throw beans::UnknownPropertyException();
161void SAL_CALL OShape::setControlBackground( ::sal_Int32 )
163 throw beans::UnknownPropertyException();
166sal_Bool SAL_CALL OShape::getControlBackgroundTransparent()
168 throw beans::UnknownPropertyException();
171void SAL_CALL OShape::setControlBackgroundTransparent(
sal_Bool )
173 throw beans::UnknownPropertyException();
176uno::Reference< beans::XPropertySetInfo > SAL_CALL OShape::getPropertySetInfo( )
187 uno::Sequence<beans::Property> aAggSeq;
188 if (
m_aProps.aComponent.m_xProperty.is() )
189 aAggSeq =
m_aProps.aComponent.m_xProperty->getPropertySetInfo()->getProperties();
192 return *m_pAggHelper;
196void SAL_CALL OShape::setPropertyValue(
const OUString& aPropertyName,
const uno::Any& aValue )
199 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate )
200 m_aProps.aComponent.m_xProperty->setPropertyValue( aPropertyName,aValue);
202 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator )
203 ShapePropertySet::setPropertyValue( aPropertyName, aValue );
206uno::Any SAL_CALL OShape::getPropertyValue(
const OUString& PropertyName )
209 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate )
210 return m_aProps.aComponent.m_xProperty->getPropertyValue( PropertyName);
212 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator )
213 return ShapePropertySet::getPropertyValue( PropertyName);
217void SAL_CALL OShape::addPropertyChangeListener(
const OUString& aPropertyName,
const uno::Reference< beans::XPropertyChangeListener >& xListener )
220 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate || aPropertyName.isEmpty() )
221 m_aProps.aComponent.m_xProperty->addPropertyChangeListener( aPropertyName, xListener);
223 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator || aPropertyName.isEmpty() )
224 ShapePropertySet::addPropertyChangeListener( aPropertyName, xListener );
227void SAL_CALL OShape::removePropertyChangeListener(
const OUString& aPropertyName,
const uno::Reference< beans::XPropertyChangeListener >& aListener )
230 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate || aPropertyName.isEmpty() )
231 m_aProps.aComponent.m_xProperty->removePropertyChangeListener( aPropertyName, aListener );
233 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator || aPropertyName.isEmpty() )
234 ShapePropertySet::removePropertyChangeListener( aPropertyName, aListener );
237void SAL_CALL OShape::addVetoableChangeListener(
const OUString& PropertyName,
const uno::Reference< beans::XVetoableChangeListener >& aListener )
240 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate || PropertyName.isEmpty() )
241 m_aProps.aComponent.m_xProperty->addVetoableChangeListener( PropertyName, aListener );
243 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator || PropertyName.isEmpty() )
244 ShapePropertySet::addVetoableChangeListener( PropertyName, aListener );
247void SAL_CALL OShape::removeVetoableChangeListener(
const OUString& PropertyName,
const uno::Reference< beans::XVetoableChangeListener >& aListener )
250 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate || PropertyName.isEmpty() )
251 m_aProps.aComponent.m_xProperty->removeVetoableChangeListener( PropertyName, aListener );
253 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator || PropertyName.isEmpty() )
254 ShapePropertySet::removeVetoableChangeListener( PropertyName, aListener );
258OUString SAL_CALL OShape::getDataField()
260 throw beans::UnknownPropertyException();
263void SAL_CALL OShape::setDataField(
const OUString& )
265 throw beans::UnknownPropertyException();
268sal_Bool SAL_CALL OShape::getPrintWhenGroupChange()
270 ::osl::MutexGuard aGuard(m_aMutex);
271 return m_aProps.bPrintWhenGroupChange;
274void SAL_CALL OShape::setPrintWhenGroupChange(
sal_Bool _printwhengroupchange )
279OUString SAL_CALL OShape::getConditionalPrintExpression()
281 ::osl::MutexGuard aGuard(m_aMutex);
282 return m_aProps.aConditionalPrintExpression;
285void SAL_CALL OShape::setConditionalPrintExpression(
const OUString& _conditionalprintexpression )
292uno::Reference< util::XCloneable > SAL_CALL OShape::createClone( )
294 uno::Reference< report::XReportComponent> xSource =
this;
295 uno::Reference< report::XReportComponent> xSet;
304 xSet.set(pClone->getUnoShape(),uno::UNO_QUERY_THROW );
308 catch(
const uno::Exception&)
316uno::Reference< uno::XInterface > SAL_CALL OShape::getParent( )
318 return OShapeHelper::getParent(
this);
321void SAL_CALL OShape::setParent(
const uno::Reference< uno::XInterface >& Parent )
324 m_aProps.aComponent.m_xParent = uno::Reference< container::XChild >(
Parent,uno::UNO_QUERY);
326uno::Reference< report::XFormatCondition > SAL_CALL OShape::createFormatCondition( )
332void SAL_CALL OShape::addContainerListener(
const uno::Reference< container::XContainerListener >& xListener )
334 m_aProps.addContainerListener(xListener);
337void SAL_CALL OShape::removeContainerListener(
const uno::Reference< container::XContainerListener >& xListener )
339 m_aProps.removeContainerListener(xListener);
354void SAL_CALL OShape::insertByIndex( ::sal_Int32
Index,
const uno::Any& Element )
359void SAL_CALL OShape::removeByIndex( ::sal_Int32
Index )
365void SAL_CALL OShape::replaceByIndex( ::sal_Int32
Index,
const uno::Any& Element )
371::sal_Int32 SAL_CALL OShape::getCount( )
382awt::Point SAL_CALL OShape::getPosition( )
384 return OShapeHelper::getPosition(
this);
387void SAL_CALL OShape::setPosition(
const awt::Point& aPosition )
389 OShapeHelper::setPosition(aPosition,
this);
392awt::Size SAL_CALL OShape::getSize( )
394 return OShapeHelper::getSize(
this);
397void SAL_CALL OShape::setSize(
const awt::Size& aSize )
399 OShapeHelper::setSize(aSize,
this);
404OUString SAL_CALL OShape::getShapeType( )
407 if (
m_aProps.aComponent.m_xShape.is() )
408 return m_aProps.aComponent.m_xShape->getShapeType();
409 return "com.sun.star.drawing.CustomShape";
412::sal_Int32 SAL_CALL OShape::getZOrder()
419void SAL_CALL OShape::setZOrder( ::sal_Int32 _zorder )
438drawing::HomogenMatrix3 SAL_CALL OShape::getTransformation()
442 return m_Transformation;
445void SAL_CALL OShape::setTransformation(
const drawing::HomogenMatrix3& _transformation )
451OUString SAL_CALL OShape::getCustomShapeEngine()
456 return m_CustomShapeEngine;
459void SAL_CALL OShape::setCustomShapeEngine(
const OUString& _customshapeengine )
465OUString SAL_CALL OShape::getCustomShapeData()
469 return m_CustomShapeData;
472void SAL_CALL OShape::setCustomShapeData(
const OUString& _customshapedata )
478uno::Sequence< beans::PropertyValue > SAL_CALL OShape::getCustomShapeGeometry()
482 return m_CustomShapeGeometry;
485void SAL_CALL OShape::setCustomShapeGeometry(
const uno::Sequence< beans::PropertyValue >& _customshapegeometry )
#define REPORTCOMPONENT_IMPL2(clazz, arg)
#define REPORTCOMPONENT_MASTERDETAIL(clazz, arg)
#define REPORTCONTROLFORMAT_IMPL2(clazz, varName)
#define REPORTCOMPONENT_IMPL(clazz, arg)
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
static css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL createPropertySetInfo(IPropertyArrayHelper &rProperties)
css::uno::Type const & get()
OShape(const OShape &)=delete
OUString RptResId(TranslateId aId)
#define DBG_UNHANDLED_EXCEPTION(...)
EmbeddedObjectRef * pObject
#define SAL_N_ELEMENTS(arr)
void set(css::uno::UnoInterfaceReference const &value)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
::cppu::PropertySetMixin< css::report::XShape > ShapePropertySet
static uno::Sequence< OUString > lcl_getShapeOptionals()
::cppu::WeakComponentImplHelper< css::report::XShape,css::lang::XServiceInfo > ShapeBase
uno::Sequence< beans::Property > m_aProps
constexpr OUStringLiteral PROPERTY_CONTROLBACKGROUNDTRANSPARENT
constexpr OUStringLiteral PROPERTY_DATAFIELD
constexpr OUStringLiteral PROPERTY_CUSTOMSHAPEGEOMETRY
constexpr OUStringLiteral PROPERTY_CUSTOMSHAPEDATA
constexpr OUStringLiteral SERVICE_SHAPE
constexpr OUStringLiteral PROPERTY_TRANSFORMATION
constexpr OUStringLiteral PROPERTY_ZORDER
constexpr OUStringLiteral PROPERTY_PRINTWHENGROUPCHANGE
constexpr OUStringLiteral PROPERTY_CONDITIONALPRINTEXPRESSION
constexpr OUStringLiteral PROPERTY_OPAQUE
constexpr OUStringLiteral PROPERTY_CUSTOMSHAPEENGINE
constexpr OUStringLiteral PROPERTY_CONTROLBACKGROUND
#define IMPLEMENT_FORWARD_REFCOUNT(classname, refcountbase)
Reference< XComponentContext > _xContext