diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-04-06 22:32:24 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-04-06 22:32:24 +0200 |
commit | eba4d5b2b76cefde90cb3d6638c736f435023a45 (patch) | |
tree | 43befa620475c11f3dde00e5ea141e1efd95a334 /reportdesign | |
parent | 6c14c27c75a03e2363f2b363ddf0a6f2f46cfa91 (diff) |
Revert "SOSAW080: Added first bunch of basic changes to helpers"
This reverts commit 6c14c27c75a03e2363f2b363ddf0a6f2f46cfa91.
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/inc/ReportDefinition.hxx | 7 | ||||
-rw-r--r-- | reportdesign/inc/RptObject.hxx | 55 | ||||
-rw-r--r-- | reportdesign/inc/RptPage.hxx | 9 | ||||
-rw-r--r-- | reportdesign/source/core/api/ReportDefinition.cxx | 32 | ||||
-rw-r--r-- | reportdesign/source/core/sdr/ReportDrawPage.cxx | 15 | ||||
-rw-r--r-- | reportdesign/source/core/sdr/ReportUndoFactory.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/core/sdr/RptObject.cxx | 221 | ||||
-rw-r--r-- | reportdesign/source/core/sdr/RptPage.cxx | 45 | ||||
-rw-r--r-- | reportdesign/source/ui/inc/SectionView.hxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportController.cxx | 12 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportSection.cxx | 11 | ||||
-rw-r--r-- | reportdesign/source/ui/report/SectionView.cxx | 8 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ViewsWindow.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/report/dlgedfac.cxx | 15 | ||||
-rw-r--r-- | reportdesign/source/ui/report/dlgedfunc.cxx | 30 |
15 files changed, 211 insertions, 265 deletions
diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx index 79c58c998600..6c0883c92a4a 100644 --- a/reportdesign/inc/ReportDefinition.hxx +++ b/reportdesign/inc/ReportDefinition.hxx @@ -186,14 +186,7 @@ namespace reportdesign css::uno::Reference< css::uno::XComponentContext > getContext(); - protected: - /** abstract SdrModel provider */ - virtual SdrModel* getSdrModelFromUnoModel() const override; - - public: - //TTTT Needed? Or same as above? static std::shared_ptr<rptui::OReportModel> getSdrModel(const css::uno::Reference< css::report::XReportDefinition >& _xReportDefinition); - private: DECLARE_XINTERFACE( ) DECLARE_XTYPEPROVIDER( ) diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx index 17f433629c56..201782857e68 100644 --- a/reportdesign/inc/RptObject.hxx +++ b/reportdesign/inc/RptObject.hxx @@ -112,9 +112,7 @@ public: */ void releaseUnoShape() { m_xKeepShapeAlive.clear(); } - static SdrObject* createObject( - SdrModel& rTargetModel, - const css::uno::Reference< css::report::XReportComponent>& _xComponent); + static SdrObject* createObject(const css::uno::Reference< css::report::XReportComponent>& _xComponent); static sal_uInt16 getObjectType(const css::uno::Reference< css::report::XReportComponent>& _xComponent); }; @@ -125,11 +123,9 @@ class REPORTDESIGN_DLLPUBLIC OCustomShape final : public SdrObjCustomShape , pub friend class OReportPage; friend class DlgEdFactory; public: - static OCustomShape* Create( - SdrModel& rSdrModel, - const css::uno::Reference< css::report::XReportComponent>& _xComponent) + static OCustomShape* Create( const css::uno::Reference< css::report::XReportComponent>& _xComponent ) { - return new OCustomShape(rSdrModel, _xComponent ); + return new OCustomShape( _xComponent ); } virtual ~OCustomShape() override; @@ -143,12 +139,8 @@ public: private: virtual void impl_setUnoShape( const css::uno::Reference< css::uno::XInterface >& rxUnoShape ) override; - OCustomShape( - SdrModel& rSdrModel, - const css::uno::Reference< css::report::XReportComponent>& _xComponent); - OCustomShape( - SdrModel& rSdrModel, - const OUString& _sComponentName); + OCustomShape(const css::uno::Reference< css::report::XReportComponent>& _xComponent); + OCustomShape(const OUString& _sComponentName); virtual void NbcMove( const Size& rSize ) override; virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; @@ -166,12 +158,9 @@ class REPORTDESIGN_DLLPUBLIC OOle2Obj final : public SdrOle2Obj , public OObject friend class OReportPage; friend class DlgEdFactory; public: - static OOle2Obj* Create( - SdrModel& rSdrModel, - const css::uno::Reference< css::report::XReportComponent>& _xComponent, - sal_uInt16 _nType) + static OOle2Obj* Create( const css::uno::Reference< css::report::XReportComponent>& _xComponent,sal_uInt16 _nType ) { - return new OOle2Obj(rSdrModel, _xComponent, _nType); + return new OOle2Obj( _xComponent,_nType ); } virtual ~OOle2Obj() override; @@ -182,7 +171,7 @@ public: virtual sal_uInt16 GetObjIdentifier() const override; virtual SdrInventor GetObjInventor() const override; // Clone() should make a complete copy of the object. - virtual OOle2Obj* Clone(SdrModel* pTargetModel = nullptr) const override; + virtual OOle2Obj* Clone() const override; virtual void initializeOle() override; OOle2Obj& operator=(const OOle2Obj& rObj); @@ -190,14 +179,9 @@ public: void initializeChart( const css::uno::Reference< css::frame::XModel>& _xModel); private: - OOle2Obj( - SdrModel& rSdrModel, - const css::uno::Reference< css::report::XReportComponent>& _xComponent, - sal_uInt16 _nType); - OOle2Obj( - SdrModel& rSdrModel, - const OUString& _sComponentName, - sal_uInt16 _nType); + OOle2Obj(const css::uno::Reference< css::report::XReportComponent>& _xComponent,sal_uInt16 _nType); + OOle2Obj(const OUString& _sComponentName,sal_uInt16 _nType); + virtual void NbcMove( const Size& rSize ) override; virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; @@ -224,15 +208,12 @@ class REPORTDESIGN_DLLPUBLIC OUnoObject: public SdrUnoObj , public OObjectBase sal_uInt16 m_nObjectType; protected: - OUnoObject(SdrModel& rSdrModel, - const OUString& _sComponentName, - const OUString& rModelName, - sal_uInt16 _nObjectType); - OUnoObject( - SdrModel& rSdrModel, - const css::uno::Reference< css::report::XReportComponent>& _xComponent, - const OUString& rModelName, - sal_uInt16 _nObjectType); + OUnoObject(const OUString& _sComponentName + ,const OUString& rModelName + ,sal_uInt16 _nObjectType); + OUnoObject( const css::uno::Reference< css::report::XReportComponent>& _xComponent + ,const OUString& rModelName + ,sal_uInt16 _nObjectType); virtual ~OUnoObject() override; @@ -259,7 +240,7 @@ public: virtual css::uno::Reference< css::uno::XInterface > getUnoShape() override; virtual sal_uInt16 GetObjIdentifier() const override; virtual SdrInventor GetObjInventor() const override; - virtual OUnoObject* Clone(SdrModel* pTargetModel = nullptr) const override; + virtual OUnoObject* Clone() const override; OUnoObject& operator=(const OUnoObject& rObj); diff --git a/reportdesign/inc/RptPage.hxx b/reportdesign/inc/RptPage.hxx index 2c45c93a8331..c168cd5f942f 100644 --- a/reportdesign/inc/RptPage.hxx +++ b/reportdesign/inc/RptPage.hxx @@ -35,21 +35,20 @@ class OReportModel; class REPORTDESIGN_DLLPUBLIC OReportPage : public SdrPage { OReportPage& operator=(const OReportPage&) = delete; - OReportPage(const OReportPage&) = delete; OReportModel& rModel; css::uno::Reference< css::report::XSection > m_xSection; bool m_bSpecialInsertMode; std::vector<SdrObject*> m_aTemporaryObjectList; + OReportPage(const OReportPage&); + // method to remove temporary objects, created by 'special mode' // (BegDragObj) void removeTempObject(SdrObject const *_pToRemoveObj); virtual ~OReportPage() override; - OReportModel& getOReportModelFromOReportPage() const { return rModel; } - protected: virtual css::uno::Reference< css::uno::XInterface > createUnoPage() override; public: @@ -57,7 +56,9 @@ public: OReportPage( OReportModel& rModel ,const css::uno::Reference< css::report::XSection >& _xSection ); - virtual SdrPage* Clone(SdrModel* pNewModel = nullptr) const override; + + virtual SdrPage* Clone() const override; + virtual SdrPage* Clone( SdrModel* pNewModel ) const override; virtual void NbcInsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE) override; virtual SdrObject* RemoveObject(size_t nObjNum) override; diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 11064f21d36e..641b88d95e12 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -532,12 +532,10 @@ struct OReportDefinitionImpl }; OReportDefinition::OReportDefinition(uno::Reference< uno::XComponentContext > const & _xContext) -: ::cppu::BaseMutex(), - ReportDefinitionBase(m_aMutex), - ReportDefinitionPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >()), - ::comphelper::IEmbeddedHelper(), - m_aProps(new OReportComponentProperties(_xContext)), - m_pImpl(new OReportDefinitionImpl(m_aMutex)) +: ReportDefinitionBase(m_aMutex) +,ReportDefinitionPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >()) +,m_aProps(new OReportComponentProperties(_xContext)) +,m_pImpl(new OReportDefinitionImpl(m_aMutex)) { m_aProps->m_sName = RptResId(RID_STR_REPORT); osl_atomic_increment(&m_refCount); @@ -550,16 +548,13 @@ OReportDefinition::OReportDefinition(uno::Reference< uno::XComponentContext > co osl_atomic_decrement( &m_refCount ); } -OReportDefinition::OReportDefinition( - uno::Reference< uno::XComponentContext > const & _xContext, - const uno::Reference< lang::XMultiServiceFactory>& _xFactory, - uno::Reference< drawing::XShape >& _xShape) -: ::cppu::BaseMutex(), - ReportDefinitionBase(m_aMutex), - ReportDefinitionPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >()), - ::comphelper::IEmbeddedHelper(), - m_aProps(new OReportComponentProperties(_xContext)), - m_pImpl(new OReportDefinitionImpl(m_aMutex)) +OReportDefinition::OReportDefinition(uno::Reference< uno::XComponentContext > const & _xContext + ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory + ,uno::Reference< drawing::XShape >& _xShape) +: ReportDefinitionBase(m_aMutex) +,ReportDefinitionPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >()) +,m_aProps(new OReportComponentProperties(_xContext)) +,m_pImpl(new OReportDefinitionImpl(m_aMutex)) { m_aProps->m_sName = RptResId(RID_STR_REPORT); m_aProps->m_xFactory = _xFactory; @@ -2020,11 +2015,6 @@ std::shared_ptr<rptui::OReportModel> OReportDefinition::getSdrModel(const uno::R return pReportModel; } -SdrModel* OReportDefinition::getSdrModelFromUnoModel() const -{ - return m_pImpl->m_pReportModel.get(); -} - uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstanceWithArguments( const OUString& aServiceSpecifier, const uno::Sequence< uno::Any >& _aArgs) { ::osl::MutexGuard aGuard(m_aMutex); diff --git a/reportdesign/source/core/sdr/ReportDrawPage.cxx b/reportdesign/source/core/sdr/ReportDrawPage.cxx index cf73d9c04c4b..e67f7a91626d 100644 --- a/reportdesign/source/core/sdr/ReportDrawPage.cxx +++ b/reportdesign/source/core/sdr/ReportDrawPage.cxx @@ -29,9 +29,9 @@ #include <svx/svdmodel.hxx> #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/embed/Aspects.hpp> + #include <tools/diagnose_ex.h> #include <svx/unoshape.hxx> -#include <svx/svdpage.hxx> namespace reportdesign { @@ -49,12 +49,7 @@ SdrObject* OReportDrawPage::CreateSdrObject_(const uno::Reference< drawing::XSha { uno::Reference< report::XReportComponent> xReportComponent(xDescr,uno::UNO_QUERY); if ( xReportComponent.is() ) - { - return OObjectBase::createObject( - GetSdrPage()->getSdrModelFromSdrPage(), - xReportComponent); - } - + return OObjectBase::createObject(xReportComponent); return SvxDrawPage::CreateSdrObject_( xDescr ); } @@ -106,7 +101,7 @@ uno::Reference< drawing::XShape > OReportDrawPage::CreateShape( SdrObject *pObj sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT; uno::Reference < embed::XEmbeddedObject > xObj; OUString sName; - xObj = pObj->getSdrModelFromSdrObject().GetPersist()->getEmbeddedObjectContainer().CreateEmbeddedObject( + xObj = pObj->GetModel()->GetPersist()->getEmbeddedObjectContainer().CreateEmbeddedObject( ::comphelper::MimeConfigurationHelper::GetSequenceClassIDRepresentation( "80243D39-6741-46C5-926E-069164FF87BB"), sName ); OSL_ENSURE(xObj.is(),"Embedded Object could not be created!"); @@ -136,8 +131,8 @@ uno::Reference< drawing::XShape > OReportDrawPage::CreateShape( SdrObject *pObj try { - OReportModel& rRptModel(static_cast< OReportModel& >(pObj->getSdrModelFromSdrObject())); - xRet.set( rRptModel.createShape(sServiceName,xShape,bChangeOrientation ? 0 : 1), uno::UNO_QUERY_THROW ); + OReportModel* pRptModel = static_cast<OReportModel*>(pObj->GetModel()); + xRet.set( pRptModel->createShape(sServiceName,xShape,bChangeOrientation ? 0 : 1), uno::UNO_QUERY_THROW ); } catch( const uno::Exception& ) { diff --git a/reportdesign/source/core/sdr/ReportUndoFactory.cxx b/reportdesign/source/core/sdr/ReportUndoFactory.cxx index ee64aed0e003..e40411c3b2ec 100644 --- a/reportdesign/source/core/sdr/ReportUndoFactory.cxx +++ b/reportdesign/source/core/sdr/ReportUndoFactory.cxx @@ -35,9 +35,9 @@ SdrUndoAction* lcl_createUndo(SdrObject& rObject, Action _eAction, const char* p uno::Reference< report::XGroup> xGroup = xSection->getGroup(); SdrUndoAction* pUndo = nullptr; if ( xGroup.is() ) - pUndo = new OUndoGroupSectionAction(rObject.getSdrModelFromSdrObject(),_eAction,OGroupHelper::getMemberFunction(xSection),xGroup,xReportComponent,pCommentId); + pUndo = new OUndoGroupSectionAction(*rObject.GetModel(),_eAction,OGroupHelper::getMemberFunction(xSection),xGroup,xReportComponent,pCommentId); else - pUndo = new OUndoReportSectionAction(rObject.getSdrModelFromSdrObject(),_eAction,OReportHelper::getMemberFunction(xSection),xSection->getReportDefinition(),xReportComponent,pCommentId); + pUndo = new OUndoReportSectionAction(*rObject.GetModel(),_eAction,OReportHelper::getMemberFunction(xSection),xSection->getReportDefinition(),xReportComponent,pCommentId); return pUndo; } diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 737c87e3b1fe..a0af522a616c 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -107,9 +107,7 @@ sal_uInt16 OObjectBase::getObjectType(const uno::Reference< report::XReportCompo return 0; } -SdrObject* OObjectBase::createObject( - SdrModel& rTargetModel, - const uno::Reference< report::XReportComponent>& _xComponent) +SdrObject* OObjectBase::createObject(const uno::Reference< report::XReportComponent>& _xComponent) { SdrObject* pNewObj = nullptr; sal_uInt16 nType = OObjectBase::getObjectType(_xComponent); @@ -117,11 +115,9 @@ SdrObject* OObjectBase::createObject( { case OBJ_DLG_FIXEDTEXT: { - OUnoObject* pUnoObj = new OUnoObject( - rTargetModel, - _xComponent, - OUString("com.sun.star.form.component.FixedText"), - OBJ_DLG_FIXEDTEXT); + OUnoObject* pUnoObj = new OUnoObject( _xComponent + ,OUString("com.sun.star.form.component.FixedText") + ,OBJ_DLG_FIXEDTEXT); pNewObj = pUnoObj; uno::Reference<beans::XPropertySet> xControlModel(pUnoObj->GetUnoControlModel(),uno::UNO_QUERY); @@ -130,31 +126,23 @@ SdrObject* OObjectBase::createObject( } break; case OBJ_DLG_IMAGECONTROL: - pNewObj = new OUnoObject( - rTargetModel, - _xComponent, - OUString("com.sun.star.form.component.DatabaseImageControl"), - OBJ_DLG_IMAGECONTROL); + pNewObj = new OUnoObject(_xComponent + ,OUString("com.sun.star.form.component.DatabaseImageControl") + ,OBJ_DLG_IMAGECONTROL); break; case OBJ_DLG_FORMATTEDFIELD: - pNewObj = new OUnoObject( - rTargetModel, - _xComponent, - OUString("com.sun.star.form.component.FormattedField"), - OBJ_DLG_FORMATTEDFIELD); + pNewObj = new OUnoObject( _xComponent + ,OUString("com.sun.star.form.component.FormattedField") + ,OBJ_DLG_FORMATTEDFIELD); break; case OBJ_DLG_HFIXEDLINE: case OBJ_DLG_VFIXEDLINE: - pNewObj = new OUnoObject( - rTargetModel, - _xComponent, - OUString("com.sun.star.awt.UnoControlFixedLineModel"), - nType); + pNewObj = new OUnoObject( _xComponent + ,OUString("com.sun.star.awt.UnoControlFixedLineModel") + ,nType); break; case OBJ_CUSTOMSHAPE: - pNewObj = OCustomShape::Create( - rTargetModel, - _xComponent); + pNewObj = OCustomShape::Create( _xComponent ); try { bool bOpaque = false; @@ -168,10 +156,7 @@ SdrObject* OObjectBase::createObject( break; case OBJ_DLG_SUBREPORT: case OBJ_OLE2: - pNewObj = OOle2Obj::Create( - rTargetModel, - _xComponent, - nType); + pNewObj = OOle2Obj::Create( _xComponent,nType ); break; default: OSL_FAIL("Unknown object id"); @@ -470,21 +455,19 @@ uno::Reference< uno::XInterface > OObjectBase::getUnoShapeOf( SdrObject& _rSdrOb return xShape; } -OCustomShape::OCustomShape( - SdrModel& rSdrModel, - const uno::Reference< report::XReportComponent>& _xComponent) -: SdrObjCustomShape(rSdrModel) - ,OObjectBase(_xComponent) + +OCustomShape::OCustomShape(const uno::Reference< report::XReportComponent>& _xComponent + ) + :SdrObjCustomShape() + ,OObjectBase(_xComponent) { impl_setUnoShape( uno::Reference< uno::XInterface >(_xComponent,uno::UNO_QUERY) ); m_bIsListening = true; } -OCustomShape::OCustomShape( - SdrModel& rSdrModel, - const OUString& _sComponentName) -: SdrObjCustomShape(rSdrModel) - ,OObjectBase(_sComponentName) +OCustomShape::OCustomShape(const OUString& _sComponentName) + :SdrObjCustomShape() + ,OObjectBase(_sComponentName) { m_bIsListening = true; } @@ -517,8 +500,8 @@ void OCustomShape::NbcMove( const Size& rSize ) if ( m_xReportComponent.is() ) { - OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject())); - OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv()); + OReportModel* pRptModel = static_cast<OReportModel*>(GetModel()); + OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv()); m_xReportComponent->setPositionX(m_xReportComponent->getPositionX() + rSize.Width()); m_xReportComponent->setPositionY(m_xReportComponent->getPositionY() + rSize.Height()); } @@ -550,12 +533,13 @@ bool OCustomShape::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) bool bResult = SdrObjCustomShape::EndCreate(rStat, eCmd); if ( bResult ) { - OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject())); - OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv()); - - if ( !m_xReportComponent.is() ) - m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY); - + OReportModel* pRptModel = static_cast<OReportModel*>(GetModel()); + if ( pRptModel ) + { + OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv()); + if ( !m_xReportComponent.is() ) + m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY); + } SetPropsFromRect(GetSnapRect()); } @@ -574,8 +558,8 @@ uno::Reference< uno::XInterface > OCustomShape::getUnoShape() uno::Reference< uno::XInterface> xShape = OObjectBase::getUnoShapeOf( *this ); if ( !m_xReportComponent.is() ) { - OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject())); - OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv()); + OReportModel* pRptModel = static_cast<OReportModel*>(GetModel()); + OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv()); m_xReportComponent.set(xShape,uno::UNO_QUERY); } return xShape; @@ -588,27 +572,24 @@ void OCustomShape::impl_setUnoShape( const uno::Reference< uno::XInterface >& rx m_xReportComponent.clear(); } -OUnoObject::OUnoObject( - SdrModel& rSdrModel, - const OUString& _sComponentName, - const OUString& rModelName, - sal_uInt16 _nObjectType) -: SdrUnoObj(rSdrModel, rModelName) - ,OObjectBase(_sComponentName) - ,m_nObjectType(_nObjectType) + +OUnoObject::OUnoObject(const OUString& _sComponentName + ,const OUString& rModelName + ,sal_uInt16 _nObjectType) + :SdrUnoObj(rModelName) + ,OObjectBase(_sComponentName) + ,m_nObjectType(_nObjectType) { if ( !rModelName.isEmpty() ) impl_initializeModel_nothrow(); } -OUnoObject::OUnoObject( - SdrModel& rSdrModel, - const uno::Reference< report::XReportComponent>& _xComponent, - const OUString& rModelName, - sal_uInt16 _nObjectType) -: SdrUnoObj(rSdrModel, rModelName) - ,OObjectBase(_xComponent) - ,m_nObjectType(_nObjectType) +OUnoObject::OUnoObject(const uno::Reference< report::XReportComponent>& _xComponent + ,const OUString& rModelName + ,sal_uInt16 _nObjectType) + :SdrUnoObj(rModelName) + ,OObjectBase(_xComponent) + ,m_nObjectType(_nObjectType) { impl_setUnoShape( uno::Reference< uno::XInterface >( _xComponent, uno::UNO_QUERY ) ); @@ -645,8 +626,12 @@ void OUnoObject::impl_setReportComponent_nothrow() if ( m_xReportComponent.is() ) return; - OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject())); - OXUndoEnvironment::OUndoEnvLock aLock( rRptModel.GetUndoEnv() ); + OReportModel* pReportModel = static_cast<OReportModel*>(GetModel()); + OSL_ENSURE( pReportModel, "OUnoObject::impl_setReportComponent_nothrow: no report model!" ); + if ( !pReportModel ) + return; + + OXUndoEnvironment::OUndoEnvLock aLock( pReportModel->GetUndoEnv() ); m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY); impl_initializeModel_nothrow(); @@ -680,14 +665,13 @@ void OUnoObject::NbcMove( const Size& rSize ) if ( m_xReportComponent.is() ) { bool bUndoMode = false; - OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject())); - - if (rRptModel.GetUndoEnv().IsUndoMode()) + OReportModel* pRptModel = static_cast<OReportModel*>(GetModel()); + if (pRptModel->GetUndoEnv().IsUndoMode()) { // if we are locked from outside, then we must not handle wrong moves, we are in UNDO mode bUndoMode = true; } - OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv()); + OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv()); // LLA: why there exists getPositionX and getPositionY and NOT getPosition() which return a Point? int nNewX = m_xReportComponent->getPositionX() + rSize.Width(); @@ -703,7 +687,7 @@ void OUnoObject::NbcMove( const Size& rSize ) } if (bPositionFixed) { - getSdrModelFromSdrObject().AddUndo(getSdrModelFromSdrObject().GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize)); + GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize)); } // set geometry properties SetPropsFromRect(GetLogicRect()); @@ -883,11 +867,6 @@ void OUnoObject::impl_setUnoShape( const uno::Reference< uno::XInterface >& rxUn releaseUnoShape(); } -OUnoObject* OUnoObject::Clone(SdrModel* pTargetModel) const -{ - return CloneHelper< OUnoObject >(pTargetModel); -} - OUnoObject& OUnoObject::operator=(const OUnoObject& rObj) { if( this == &rObj ) @@ -902,28 +881,29 @@ OUnoObject& OUnoObject::operator=(const OUnoObject& rObj) return *this; } +OUnoObject* OUnoObject::Clone() const +{ + return CloneHelper< OUnoObject >(); +} + // OOle2Obj -OOle2Obj::OOle2Obj( - SdrModel& rSdrModel, - const uno::Reference< report::XReportComponent>& _xComponent, - sal_uInt16 _nType) -: SdrOle2Obj(rSdrModel) - ,OObjectBase(_xComponent) - ,m_nType(_nType) - ,m_bOnlyOnce(true) + +OOle2Obj::OOle2Obj(const uno::Reference< report::XReportComponent>& _xComponent,sal_uInt16 _nType) + :SdrOle2Obj() + ,OObjectBase(_xComponent) + ,m_nType(_nType) + ,m_bOnlyOnce(true) { + impl_setUnoShape( uno::Reference< uno::XInterface >( _xComponent, uno::UNO_QUERY ) ); m_bIsListening = true; } -OOle2Obj::OOle2Obj( - SdrModel& rSdrModel, - const OUString& _sComponentName, - sal_uInt16 _nType) -: SdrOle2Obj(rSdrModel) - ,OObjectBase(_sComponentName) - ,m_nType(_nType) - ,m_bOnlyOnce(true) +OOle2Obj::OOle2Obj(const OUString& _sComponentName,sal_uInt16 _nType) + :SdrOle2Obj() + ,OObjectBase(_sComponentName) + ,m_nType(_nType) + ,m_bOnlyOnce(true) { m_bIsListening = true; } @@ -960,14 +940,13 @@ void OOle2Obj::NbcMove( const Size& rSize ) if ( m_xReportComponent.is() ) { bool bUndoMode = false; - OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject())); - - if (rRptModel.GetUndoEnv().IsUndoMode()) + OReportModel* pRptModel = static_cast<OReportModel*>(GetModel()); + if (pRptModel->GetUndoEnv().IsUndoMode()) { // if we are locked from outside, then we must not handle wrong moves, we are in UNDO mode bUndoMode = true; } - OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv()); + OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv()); // LLA: why there exists getPositionX and getPositionY and NOT getPosition() which return a Point? int nNewX = m_xReportComponent->getPositionX() + rSize.Width(); @@ -988,7 +967,7 @@ void OOle2Obj::NbcMove( const Size& rSize ) } if (bPositionFixed) { - getSdrModelFromSdrObject().AddUndo(getSdrModelFromSdrObject().GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize)); + GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize)); } // set geometry properties SetPropsFromRect(GetLogicRect()); @@ -1034,12 +1013,13 @@ bool OOle2Obj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) bool bResult = SdrOle2Obj::EndCreate(rStat, eCmd); if ( bResult ) { - OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject())); - OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv()); - - if ( !m_xReportComponent.is() ) - m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY); - + OReportModel* pRptModel = static_cast<OReportModel*>(GetModel()); + if ( pRptModel ) + { + OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv()); + if ( !m_xReportComponent.is() ) + m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY); + } // set geometry properties SetPropsFromRect(GetLogicRect()); } @@ -1058,8 +1038,8 @@ uno::Reference< uno::XInterface > OOle2Obj::getUnoShape() uno::Reference< uno::XInterface> xShape = OObjectBase::getUnoShapeOf( *this ); if ( !m_xReportComponent.is() ) { - OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject())); - OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv()); + OReportModel* pRptModel = static_cast<OReportModel*>(GetModel()); + OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv()); m_xReportComponent.set(xShape,uno::UNO_QUERY); } return xShape; @@ -1088,32 +1068,33 @@ uno::Reference< chart2::data::XDatabaseDataProvider > lcl_getDataProvider(const return xSource; } -// Clone() should make a complete copy of the object. -OOle2Obj* OOle2Obj::Clone(SdrModel* pTargetModel) const -{ - return CloneHelper< OOle2Obj >(pTargetModel); -} - OOle2Obj& OOle2Obj::operator=(const OOle2Obj& rObj) { if( this == &rObj ) return *this; SdrOle2Obj::operator=(rObj); - OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject())); + OReportModel* pRptModel = static_cast<OReportModel*>(rObj.GetModel()); svt::EmbeddedObjectRef::TryRunningState( GetObjRef() ); - impl_createDataProvider_nothrow(rRptModel.getReportDefinition().get()); + impl_createDataProvider_nothrow(pRptModel->getReportDefinition().get()); uno::Reference< chart2::data::XDatabaseDataProvider > xSource( lcl_getDataProvider(rObj.GetObjRef()) ); uno::Reference< chart2::data::XDatabaseDataProvider > xDest( lcl_getDataProvider(GetObjRef()) ); if ( xSource.is() && xDest.is() ) comphelper::copyProperties(xSource.get(),xDest.get()); - initializeChart(rRptModel.getReportDefinition().get()); + initializeChart(pRptModel->getReportDefinition().get()); return *this; } + +// Clone() should make a complete copy of the object. +OOle2Obj* OOle2Obj::Clone() const +{ + return CloneHelper< OOle2Obj >(); +} + void OOle2Obj::impl_createDataProvider_nothrow(const uno::Reference< frame::XModel>& _xModel) { try @@ -1142,8 +1123,8 @@ void OOle2Obj::initializeOle() { m_bOnlyOnce = false; uno::Reference < embed::XEmbeddedObject > xObj = GetObjRef(); - OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject())); - rRptModel.GetUndoEnv().AddElement(lcl_getDataProvider(xObj)); + OReportModel* pRptModel = static_cast<OReportModel*>(GetModel()); + pRptModel->GetUndoEnv().AddElement(lcl_getDataProvider(xObj)); uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY ); if( xCompSupp.is() ) @@ -1174,8 +1155,8 @@ void OOle2Obj::initializeChart( const uno::Reference< frame::XModel>& _xModel) if ( !lcl_getDataProvider(xObj).is() ) impl_createDataProvider_nothrow(_xModel); - OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject())); - rRptModel.GetUndoEnv().AddElement(lcl_getDataProvider(xObj)); + OReportModel* pRptModel = static_cast<OReportModel*>(GetModel()); + pRptModel->GetUndoEnv().AddElement(lcl_getDataProvider(xObj)); ::comphelper::NamedValueCollection aArgs; aArgs.put( "CellRangeRepresentation", uno::makeAny( OUString( "all" ) ) ); diff --git a/reportdesign/source/core/sdr/RptPage.cxx b/reportdesign/source/core/sdr/RptPage.cxx index b4e09805f04c..0d3465e93b30 100644 --- a/reportdesign/source/core/sdr/RptPage.cxx +++ b/reportdesign/source/core/sdr/RptPage.cxx @@ -28,29 +28,48 @@ namespace rptui { using namespace ::com::sun::star; -OReportPage::OReportPage( - OReportModel& _rModel, - const uno::Reference< report::XSection >& _xSection) -: SdrPage(_rModel, false/*bMasterPage*/) + +OReportPage::OReportPage( OReportModel& _rModel + ,const uno::Reference< report::XSection >& _xSection ) + :SdrPage( _rModel, false/*bMasterPage*/ ) ,rModel(_rModel) ,m_xSection(_xSection) - ,m_bSpecialInsertMode(false) + ,m_bSpecialInsertMode(false) +{ +} + + +OReportPage::OReportPage( const OReportPage& rPage ) + :SdrPage( rPage ) + ,rModel(rPage.rModel) + ,m_xSection(rPage.m_xSection) + ,m_bSpecialInsertMode(rPage.m_bSpecialInsertMode) + ,m_aTemporaryObjectList(rPage.m_aTemporaryObjectList) { } + OReportPage::~OReportPage() { } -SdrPage* OReportPage::Clone(SdrModel* pNewModel) const + +SdrPage* OReportPage::Clone() const +{ + return Clone(nullptr); +} + +SdrPage* OReportPage::Clone( SdrModel* const pNewModel ) const { - OReportModel& rOReportModel(static_cast< OReportModel& >(nullptr == pNewModel ? getSdrModelFromSdrPage() : *pNewModel)); - OReportPage* pClonedOReportPage( - new OReportPage( - rOReportModel, - m_xSection)); - pClonedOReportPage->SdrPage::lateInit(*this); - return pClonedOReportPage; + OReportPage *const pNewPage = new OReportPage( *this ); + OReportModel* pReportModel = nullptr; + if ( pNewModel ) + { + pReportModel = dynamic_cast<OReportModel*>( pNewModel ); + assert( pReportModel ); + } + pNewPage->lateInit( *this, pReportModel ); + return pNewPage; } diff --git a/reportdesign/source/ui/inc/SectionView.hxx b/reportdesign/source/ui/inc/SectionView.hxx index df3cbc7b060a..c5c48661c059 100644 --- a/reportdesign/source/ui/inc/SectionView.hxx +++ b/reportdesign/source/ui/inc/SectionView.hxx @@ -42,11 +42,7 @@ private: void operator =(const OSectionView&) = delete; public: - OSectionView( - SdrModel& rSdrModel, - OReportSection* _pSectionWindow, - OReportWindow* pEditor); - + OSectionView( SdrModel* pModel, OReportSection* _pSectionWindow, OReportWindow* pEditor ); virtual ~OSectionView() override; virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 84a8569b430b..10e813dae9b9 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -3107,11 +3107,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co uno::Reference< report::XReportComponent> xShapeProp; if ( _nObjectId == OBJ_CUSTOMSHAPE ) { - pNewControl = SdrObjFactory::MakeNewObject( - *m_aReportModel, - SdrInventor::ReportDesign, - _nObjectId, - pSectionWindow->getReportSection().getPage()); + pNewControl = SdrObjFactory::MakeNewObject( SdrInventor::ReportDesign, _nObjectId, pSectionWindow->getReportSection().getPage(),m_aReportModel.get() ); xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY); OUString sCustomShapeType = getDesignView()->GetInsertObjString(); if ( sCustomShapeType.isEmpty() ) @@ -3121,11 +3117,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co } else if ( _nObjectId == OBJ_OLE2 || OBJ_DLG_SUBREPORT == _nObjectId ) { - pNewControl = SdrObjFactory::MakeNewObject( - *m_aReportModel, - SdrInventor::ReportDesign, - _nObjectId, - pSectionWindow->getReportSection().getPage()); + pNewControl = SdrObjFactory::MakeNewObject( SdrInventor::ReportDesign, _nObjectId, pSectionWindow->getReportSection().getPage(),m_aReportModel.get() ); pNewControl->SetLogicRect(tools::Rectangle(3000,500,8000,5500)); // switch height and width xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY_THROW); diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 27e467105424..9cca7d85a9b8 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -183,10 +183,7 @@ void OReportSection::fill() m_pModel = m_pParent->getViewsWindow()->getView()->getReportView()->getController().getSdrModel(); m_pPage = m_pModel->getPage(m_xSection); - m_pView = new OSectionView( - *m_pModel, - this, - m_pParent->getViewsWindow()->getView()); + m_pView = new OSectionView( m_pModel.get(), this, m_pParent->getViewsWindow()->getView() ); // #i93597# tell SdrPage that only left and right page border is defined // instead of the full rectangle definition @@ -265,10 +262,10 @@ void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyC SdrObject* pObject = pShape ? pShape->GetSdrObject() : nullptr; if ( pObject ) { - // Clone to target SdrModel - SdrObject* pNewObj(pObject->Clone(m_pModel.get())); + SdrObject* pNewObj = pObject->Clone(); pNewObj->SetPage( m_pPage ); + pNewObj->SetModel( m_pModel.get() ); m_pPage->InsertObject(pNewObj, SAL_MAX_SIZE); tools::Rectangle aRet(VCLPoint((*pCopiesIter)->getPosition()),VCLSize((*pCopiesIter)->getSize())); @@ -609,7 +606,7 @@ void OReportSection::createDefault(const OUString& _sType,SdrObject* _pObj) { const SfxItemSet& rSource = pSourceObj->GetMergedItemSet(); SfxItemSet aDest( - _pObj->getSdrModelFromSdrObject().GetItemPool(), + _pObj->GetModel()->GetItemPool(), svl::Items< // Ranges from SdrAttrObj: SDRATTR_START, SDRATTR_SHADOW_LAST, diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx index ea01291b81f6..06b594f63d6e 100644 --- a/reportdesign/source/ui/report/SectionView.cxx +++ b/reportdesign/source/ui/report/SectionView.cxx @@ -34,11 +34,9 @@ namespace rptui { using namespace ::com::sun::star; -OSectionView::OSectionView( - SdrModel& rSdrModel, - OReportSection* _pSectionWindow, - OReportWindow* pEditor) -: SdrView(rSdrModel, _pSectionWindow) + +OSectionView::OSectionView( SdrModel* pModel, OReportSection* _pSectionWindow, OReportWindow* pEditor ) + :SdrView( pModel, _pSectionWindow ) ,m_pReportWindow( pEditor ) ,m_pSectionWindow(_pSectionWindow) { diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 72f74f2eff50..341dc465a397 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -1015,11 +1015,9 @@ void OViewsWindow::BegDragObj_createInvisibleObjectAtPosition(const tools::Recta if ( &rView != &_rSection ) { - SdrObject *pNewObj = new SdrUnoObj( - rView.getSdrModelFromSdrView(), - "com.sun.star.form.component.FixedText"); - + SdrObject *pNewObj = new SdrUnoObj("com.sun.star.form.component.FixedText"); pNewObj->SetLogicRect(_aRect); + pNewObj->Move(Size(0, aNewPos.Y())); bool bChanged = rView.GetModel()->IsChanged(); rReportSection.getPage()->InsertObject(pNewObj); diff --git a/reportdesign/source/ui/report/dlgedfac.cxx b/reportdesign/source/ui/report/dlgedfac.cxx index 4a416838ebda..1a59852f1029 100644 --- a/reportdesign/source/ui/report/dlgedfac.cxx +++ b/reportdesign/source/ui/report/dlgedfac.cxx @@ -47,30 +47,29 @@ IMPL_STATIC_LINK( DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* ) { SdrObject* pNewObj = nullptr; - if ( aParams.nInventor == SdrInventor::ReportDesign ) { switch( aParams.nObjIdentifier ) { case OBJ_DLG_FIXEDTEXT: - pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_FIXEDTEXT + pNewObj = new OUnoObject( SERVICE_FIXEDTEXT ,OUString("com.sun.star.form.component.FixedText") ,OBJ_DLG_FIXEDTEXT); break; case OBJ_DLG_IMAGECONTROL: - pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_IMAGECONTROL + pNewObj = new OUnoObject( SERVICE_IMAGECONTROL ,OUString("com.sun.star.form.component.DatabaseImageControl") ,OBJ_DLG_IMAGECONTROL); break; case OBJ_DLG_FORMATTEDFIELD: - pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_FORMATTEDFIELD + pNewObj = new OUnoObject( SERVICE_FORMATTEDFIELD ,OUString("com.sun.star.form.component.FormattedField") ,OBJ_DLG_FORMATTEDFIELD); break; case OBJ_DLG_VFIXEDLINE: case OBJ_DLG_HFIXEDLINE: { - OUnoObject* pObj = new OUnoObject(aParams.rSdrModel, SERVICE_FIXEDLINE + OUnoObject* pObj = new OUnoObject( SERVICE_FIXEDLINE ,OUString("com.sun.star.awt.UnoControlFixedLineModel") ,aParams.nObjIdentifier); pNewObj = pObj; @@ -82,13 +81,13 @@ IMPL_STATIC_LINK( } break; case OBJ_CUSTOMSHAPE: - pNewObj = new OCustomShape(aParams.rSdrModel, SERVICE_SHAPE); + pNewObj = new OCustomShape(SERVICE_SHAPE); break; case OBJ_DLG_SUBREPORT: - pNewObj = new OOle2Obj(aParams.rSdrModel, SERVICE_REPORTDEFINITION, OBJ_DLG_SUBREPORT); + pNewObj = new OOle2Obj(SERVICE_REPORTDEFINITION,OBJ_DLG_SUBREPORT); break; case OBJ_OLE2: - pNewObj = new OOle2Obj(aParams.rSdrModel, OUString("com.sun.star.chart2.ChartDocument"),OBJ_OLE2); + pNewObj = new OOle2Obj(OUString("com.sun.star.chart2.ChartDocument"),OBJ_OLE2); break; default: OSL_FAIL("Unknown object id"); diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index 0c465d1bb106..c66e3d00184d 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -450,15 +450,18 @@ void DlgEdFunc::colorizeOverlappedObject(SdrObject* _pOverlappedObj) uno::Reference<report::XReportComponent> xComponent = pObj->getReportComponent(); if (xComponent.is() && xComponent != m_xOverlappingObj) { - OReportModel& rRptModel(static_cast< OReportModel& >(_pOverlappedObj->getSdrModelFromSdrObject())); - OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv()); + OReportModel* pRptModel = static_cast<OReportModel*>(_pOverlappedObj->GetModel()); + if ( pRptModel ) + { + OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv()); - // uncolorize an old object, if there is one - unColorizeOverlappedObj(); + // uncolorize an old object, if there is one + unColorizeOverlappedObj(); - m_nOldColor = lcl_setColorOfObject(xComponent, m_nOverlappedControlColor); - m_xOverlappingObj = xComponent; - m_pOverlappingObj = _pOverlappedObj; + m_nOldColor = lcl_setColorOfObject(xComponent, m_nOverlappedControlColor); + m_xOverlappingObj = xComponent; + m_pOverlappingObj = _pOverlappedObj; + } } } } @@ -468,12 +471,15 @@ void DlgEdFunc::unColorizeOverlappedObj() // uncolorize an old object, if there is one if (m_xOverlappingObj.is()) { - OReportModel& rRptModel(static_cast< OReportModel& >(m_pOverlappingObj->getSdrModelFromSdrObject())); - OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv()); + OReportModel* pRptModel = static_cast<OReportModel*>(m_pOverlappingObj->GetModel()); + if ( pRptModel ) + { + OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv()); - lcl_setColorOfObject(m_xOverlappingObj, m_nOldColor); - m_xOverlappingObj = nullptr; - m_pOverlappingObj = nullptr; + lcl_setColorOfObject(m_xOverlappingObj, m_nOldColor); + m_xOverlappingObj = nullptr; + m_pOverlappingObj = nullptr; + } } } |