25 #include <strings.hxx>
26 #include <strings.hrc>
27 #include <core_resource.hxx>
39 const OUString pProps[] = {
48 OShape::OShape(uno::Reference< uno::XComponentContext >
const & _xContext)
58 OShape::OShape(uno::Reference< uno::XComponentContext >
const & _xContext
59 ,
const uno::Reference< lang::XMultiServiceFactory>& _xFactory
60 ,uno::Reference< drawing::XShape >& _xShape
61 ,
const OUString& _sServiceName)
67 ,m_sServiceName(_sServiceName)
70 m_aProps.aComponent.m_xFactory = _xFactory;
71 osl_atomic_increment( &m_refCount );
73 uno::Reference<beans::XPropertySet> xProp(_xShape,uno::UNO_QUERY);
79 m_aProps.aComponent.setShape(_xShape,
this,m_refCount);
81 osl_atomic_decrement( &m_refCount );
93 uno::Any aReturn = ShapeBase::queryInterface(_rType);
95 aReturn = ShapePropertySet::queryInterface(_rType);
97 if ( !aReturn.
hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
100 return aReturn.
hasValue() ? aReturn : (
m_aProps.aComponent.m_xProxy.is() ?
m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
104 void SAL_CALL OShape::dispose()
106 ShapePropertySet::dispose();
107 cppu::WeakComponentImplHelperBase::dispose();
110 uno::Reference< uno::XInterface > OShape::create(uno::Reference< uno::XComponentContext >
const & xContext)
112 return *(
new OShape(xContext));
116 OUString OShape::getImplementationName_Static( )
118 return "com.sun.star.comp.report.Shape";
122 OUString SAL_CALL OShape::getImplementationName( )
124 return getImplementationName_Static();
127 uno::Sequence< OUString > OShape::getSupportedServiceNames_Static( )
132 uno::Sequence< OUString > SAL_CALL OShape::getSupportedServiceNames( )
134 if(m_sServiceName.isEmpty())
136 return getSupportedServiceNames_Static();
144 sal_Bool SAL_CALL OShape::supportsService(
const OUString& ServiceName)
155 ::sal_Int32 SAL_CALL OShape::getControlBackground()
157 throw beans::UnknownPropertyException();
160 void SAL_CALL OShape::setControlBackground( ::sal_Int32 )
162 throw beans::UnknownPropertyException();
165 sal_Bool SAL_CALL OShape::getControlBackgroundTransparent()
167 throw beans::UnknownPropertyException();
170 void SAL_CALL OShape::setControlBackgroundTransparent(
sal_Bool )
172 throw beans::UnknownPropertyException();
175 uno::Reference< beans::XPropertySetInfo > SAL_CALL OShape::getPropertySetInfo( )
186 uno::Sequence<beans::Property> aAggSeq;
187 if (
m_aProps.aComponent.m_xProperty.is() )
188 aAggSeq =
m_aProps.aComponent.m_xProperty->getPropertySetInfo()->getProperties();
191 return *m_pAggHelper;
195 void SAL_CALL OShape::setPropertyValue(
const OUString& aPropertyName,
const uno::Any& aValue )
198 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate )
199 m_aProps.aComponent.m_xProperty->setPropertyValue( aPropertyName,aValue);
201 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator )
202 ShapePropertySet::setPropertyValue( aPropertyName, aValue );
205 uno::Any SAL_CALL OShape::getPropertyValue(
const OUString& PropertyName )
208 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate )
209 return m_aProps.aComponent.m_xProperty->getPropertyValue( PropertyName);
211 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator )
212 return ShapePropertySet::getPropertyValue( PropertyName);
216 void SAL_CALL OShape::addPropertyChangeListener(
const OUString& aPropertyName,
const uno::Reference< beans::XPropertyChangeListener >& xListener )
219 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate || aPropertyName.isEmpty() )
220 m_aProps.aComponent.m_xProperty->addPropertyChangeListener( aPropertyName, xListener);
222 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator || aPropertyName.isEmpty() )
223 ShapePropertySet::addPropertyChangeListener( aPropertyName, xListener );
226 void SAL_CALL OShape::removePropertyChangeListener(
const OUString& aPropertyName,
const uno::Reference< beans::XPropertyChangeListener >& aListener )
229 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate || aPropertyName.isEmpty() )
230 m_aProps.aComponent.m_xProperty->removePropertyChangeListener( aPropertyName, aListener );
232 if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator || aPropertyName.isEmpty() )
233 ShapePropertySet::removePropertyChangeListener( aPropertyName, aListener );
236 void SAL_CALL OShape::addVetoableChangeListener(
const OUString& PropertyName,
const uno::Reference< beans::XVetoableChangeListener >& aListener )
239 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate || PropertyName.isEmpty() )
240 m_aProps.aComponent.m_xProperty->addVetoableChangeListener( PropertyName, aListener );
242 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator || PropertyName.isEmpty() )
243 ShapePropertySet::addVetoableChangeListener( PropertyName, aListener );
246 void SAL_CALL OShape::removeVetoableChangeListener(
const OUString& PropertyName,
const uno::Reference< beans::XVetoableChangeListener >& aListener )
249 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Aggregate || PropertyName.isEmpty() )
250 m_aProps.aComponent.m_xProperty->removeVetoableChangeListener( PropertyName, aListener );
252 if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::PropertyOrigin::Delegator || PropertyName.isEmpty() )
253 ShapePropertySet::removeVetoableChangeListener( PropertyName, aListener );
257 OUString SAL_CALL OShape::getDataField()
259 throw beans::UnknownPropertyException();
262 void SAL_CALL OShape::setDataField(
const OUString& )
264 throw beans::UnknownPropertyException();
267 sal_Bool SAL_CALL OShape::getPrintWhenGroupChange()
269 ::osl::MutexGuard aGuard(m_aMutex);
270 return m_aProps.bPrintWhenGroupChange;
273 void SAL_CALL OShape::setPrintWhenGroupChange(
sal_Bool _printwhengroupchange )
278 OUString SAL_CALL OShape::getConditionalPrintExpression()
280 ::osl::MutexGuard aGuard(m_aMutex);
281 return m_aProps.aConditionalPrintExpression;
284 void SAL_CALL OShape::setConditionalPrintExpression(
const OUString& _conditionalprintexpression )
291 uno::Reference< util::XCloneable > SAL_CALL OShape::createClone( )
293 uno::Reference< report::XReportComponent> xSource =
this;
294 uno::Reference< report::XReportComponent> xSet;
303 xSet.set(pClone->
getUnoShape(),uno::UNO_QUERY_THROW );
307 catch(
const uno::Exception&)
315 uno::Reference< uno::XInterface > SAL_CALL OShape::getParent( )
317 return OShapeHelper::getParent(
this);
320 void SAL_CALL OShape::setParent(
const uno::Reference< uno::XInterface >& Parent )
323 m_aProps.aComponent.m_xParent = uno::Reference< container::XChild >(Parent,uno::UNO_QUERY);
325 uno::Reference< report::XFormatCondition > SAL_CALL OShape::createFormatCondition( )
331 void SAL_CALL OShape::addContainerListener(
const uno::Reference< container::XContainerListener >& xListener )
333 m_aProps.addContainerListener(xListener);
336 void SAL_CALL OShape::removeContainerListener(
const uno::Reference< container::XContainerListener >& xListener )
338 m_aProps.removeContainerListener(xListener);
353 void SAL_CALL OShape::insertByIndex( ::sal_Int32
Index,
const uno::Any& Element )
355 m_aProps.insertByIndex(Index,Element);
358 void SAL_CALL OShape::removeByIndex( ::sal_Int32
Index )
364 void SAL_CALL OShape::replaceByIndex( ::sal_Int32
Index,
const uno::Any& Element )
366 m_aProps.replaceByIndex(Index,Element);
370 ::sal_Int32 SAL_CALL OShape::getCount( )
377 return m_aProps.getByIndex( Index );
381 awt::Point SAL_CALL OShape::getPosition( )
383 return OShapeHelper::getPosition(
this);
386 void SAL_CALL OShape::setPosition(
const awt::Point& aPosition )
388 OShapeHelper::setPosition(aPosition,
this);
391 awt::Size SAL_CALL OShape::getSize( )
393 return OShapeHelper::getSize(
this);
396 void SAL_CALL OShape::setSize(
const awt::Size& aSize )
398 OShapeHelper::setSize(aSize,
this);
403 OUString SAL_CALL OShape::getShapeType( )
406 if (
m_aProps.aComponent.m_xShape.is() )
407 return m_aProps.aComponent.m_xShape->getShapeType();
408 return "com.sun.star.drawing.CustomShape";
411 ::sal_Int32 SAL_CALL OShape::getZOrder()
418 void SAL_CALL OShape::setZOrder( ::sal_Int32 _zorder )
431 void SAL_CALL OShape::setOpaque(
sal_Bool _opaque )
437 drawing::HomogenMatrix3 SAL_CALL OShape::getTransformation()
441 return m_Transformation;
444 void SAL_CALL OShape::setTransformation(
const drawing::HomogenMatrix3& _transformation )
450 OUString SAL_CALL OShape::getCustomShapeEngine()
455 return m_CustomShapeEngine;
458 void SAL_CALL OShape::setCustomShapeEngine(
const OUString& _customshapeengine )
464 OUString SAL_CALL OShape::getCustomShapeData()
468 return m_CustomShapeData;
471 void SAL_CALL OShape::setCustomShapeData(
const OUString& _customshapedata )
477 uno::Sequence< beans::PropertyValue > SAL_CALL OShape::getCustomShapeGeometry()
481 return m_CustomShapeGeometry;
484 void SAL_CALL OShape::setCustomShapeGeometry(
const uno::Sequence< beans::PropertyValue >& _customshapegeometry )
static css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL createPropertySetInfo(IPropertyArrayHelper &rProperties)
uno::Sequence< beans::Property > m_aProps
#define PROPERTY_TRANSFORMATION
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
#define PROPERTY_PRINTWHENGROUPCHANGE
EmbeddedObjectRef * pObject
#define PROPERTY_CUSTOMSHAPEGEOMETRY
::cppu::WeakComponentImplHelper< css::report::XShape,css::lang::XServiceInfo > ShapeBase
#define PROPERTY_DATAFIELD
virtual css::uno::Reference< css::drawing::XShape > getUnoShape()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
#define PROPERTY_CONTROLBACKGROUNDTRANSPARENT
#define REPORTCOMPONENT_IMPL(clazz, arg)
#define SAL_N_ELEMENTS(arr)
#define PROPERTY_CUSTOMSHAPEDATA
#define PROPERTY_CONTROLBACKGROUND
#define DBG_UNHANDLED_EXCEPTION(...)
OUString RptResId(TranslateId aId)
#define REPORTCOMPONENT_IMPL2(clazz, arg)
SdrModel & getSdrModelFromSdrObject() const
OShape(const OShape &)=delete
css::uno::Type const & get()
constexpr OUStringLiteral SERVICE_SHAPE
#define IMPLEMENT_FORWARD_REFCOUNT(classname, refcountbase)
::cppu::PropertySetMixin< css::report::XShape > ShapePropertySet
static uno::Sequence< OUString > lcl_getShapeOptionals()
#define REPORTCONTROLFORMAT_IMPL2(clazz, varName)
virtual SdrObject * CloneSdrObject(SdrModel &rTargetModel) const
#define REPORTCOMPONENT_MASTERDETAIL(clazz, arg)
#define PROPERTY_CUSTOMSHAPEENGINE
#define PROPERTY_CONDITIONALPRINTEXPRESSION
void set(css::uno::UnoInterfaceReference const &value)
bool m_bDetectedRangeSegmentation false