friend class DlgEdFactory;
sal_uInt16 m_nObjectType;
+ // tdf#118730 remember if this object was created interactively (due to ::EndCreate being called)
+ bool m_bSetDefaultLabel;
+
protected:
OUnoObject(SdrModel& rSdrModel,
const OUString& _sComponentName,
virtual void NbcMove( const Size& rSize ) override;
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override;
virtual SdrPage* GetImplPage() const override;
: SdrUnoObj(rSdrModel, rModelName)
,OObjectBase(_sComponentName)
,m_nObjectType(_nObjectType)
+ // tdf#119067
+ ,m_bSetDefaultLabel(false)
{
if ( !rModelName.isEmpty() )
impl_initializeModel_nothrow();
: SdrUnoObj(rSdrModel, rModelName)
,OObjectBase(_xComponent)
,m_nObjectType(_nObjectType)
+ // tdf#119067
+ ,m_bSetDefaultLabel(false)
{
impl_setUnoShape( uno::Reference< uno::XInterface >( _xComponent, uno::UNO_QUERY ) );
OObjectBase::StartListening();
}
+bool OUnoObject::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+{
+ const bool bResult(SdrUnoObj::EndCreate(rStat, eCmd));
+
+ if(bResult)
+ {
+ // tdf#118730 remember if this object was created interactively (due to ::EndCreate being called)
+ m_bSetDefaultLabel = true;
+
+ // set geometry properties
+ SetPropsFromRect(GetLogicRect());
+ }
+
+ return bResult;
+}
+
OUString OUnoObject::GetDefaultName(const OUnoObject* _pObj)
{
OUString aDefaultName = "HERE WE HAVE TO INSERT OUR NAME!";
impl_initializeModel_nothrow();
}
- // tdf#118730 Directly do thinigs formerly done in
- // OUnoObject::EndCreate here
- if(m_xReportComponent.is())
+ if(m_xReportComponent.is() && m_bSetDefaultLabel)
{
- // set labels
- if ( m_xReportComponent.is() )
+ // tdf#118730 Directly do things formerly done in
+ // OUnoObject::EndCreate here
+ // tdf#119067 ...but *only* if result of interactive
+ // creation in Report DesignView
+ m_bSetDefaultLabel = false;
+
+ try
{
- try
+ if ( supportsService( SERVICE_FIXEDTEXT ) )
{
- if ( supportsService( SERVICE_FIXEDTEXT ) )
- {
- m_xReportComponent->setPropertyValue( PROPERTY_LABEL, uno::makeAny(GetDefaultName(this)) );
- }
+ m_xReportComponent->setPropertyValue(
+ PROPERTY_LABEL,
+ uno::makeAny(GetDefaultName(this)));
}
- catch(const uno::Exception&)
- {
- DBG_UNHANDLED_EXCEPTION("reportdesign");
- }
-
- impl_initializeModel_nothrow();
+ }
+ catch(const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION("reportdesign");
}
}
- // tdf#118730 set geometry properties
- SetPropsFromRect(GetLogicRect());
-
if(!m_xMediator.is() && m_xReportComponent.is())
{
Reference<XPropertySet> xControlModel(GetUnoControlModel(),uno::UNO_QUERY);