diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-24 11:02:42 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-05-24 11:02:42 +0200 |
commit | 95d20a3799998b9816bd2e8aebdbc96c61cead3e (patch) | |
tree | 8206ecc848631432cb8b027d5e780483734f808a /reportdesign | |
parent | 3caf31b05d7bbf3d50a1bbda6c8b95982cb5c2b5 (diff) |
Revert "remove some manual ref-counting"
until I have a better understanding of the UNO reference
counting.
This reverts commit 111de438ea3e512a541281dc0716cc728ea8d152.
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/inc/RptModel.hxx | 4 | ||||
-rw-r--r-- | reportdesign/source/core/sdr/RptModel.cxx | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/reportdesign/inc/RptModel.hxx b/reportdesign/inc/RptModel.hxx index 7d16a9308b16..b37ed16fdec3 100644 --- a/reportdesign/inc/RptModel.hxx +++ b/reportdesign/inc/RptModel.hxx @@ -43,7 +43,7 @@ class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel friend class OReportPage; private: - css::uno::Reference<OXUndoEnvironment> m_xUndoEnv; + OXUndoEnvironment* m_pUndoEnv; ::dbaui::DBSubComponentController* m_pController; ::reportdesign::OReportDefinition* m_pReportDefinition; @@ -63,7 +63,7 @@ public: /** @returns the numbering type that is used to format page fields in drawing shapes */ virtual SvxNumType GetPageNumType() const override; - OXUndoEnvironment& GetUndoEnv() { return *m_xUndoEnv.get();} + OXUndoEnvironment& GetUndoEnv() { return *m_pUndoEnv;} void SetModified(bool _bModified); inline dbaui::DBSubComponentController* getController() const { return m_pController; } diff --git a/reportdesign/source/core/sdr/RptModel.cxx b/reportdesign/source/core/sdr/RptModel.cxx index 0358ecf64a77..f4d66d113386 100644 --- a/reportdesign/source/core/sdr/RptModel.cxx +++ b/reportdesign/source/core/sdr/RptModel.cxx @@ -50,7 +50,8 @@ OReportModel::OReportModel(::reportdesign::OReportDefinition* _pReportDefinition ,m_pController(nullptr) ,m_pReportDefinition(_pReportDefinition) { - m_xUndoEnv = new OXUndoEnvironment(*this); + m_pUndoEnv = new OXUndoEnvironment(*this); + m_pUndoEnv->acquire(); SetSdrUndoFactory(new OReportUndoFactory); } @@ -58,15 +59,16 @@ OReportModel::OReportModel(::reportdesign::OReportDefinition* _pReportDefinition OReportModel::~OReportModel() { detachController(); + m_pUndoEnv->release(); } void OReportModel::detachController() { m_pReportDefinition = nullptr; m_pController = nullptr; - m_xUndoEnv->EndListening( *this ); + m_pUndoEnv->EndListening( *this ); ClearUndoBuffer(); - m_xUndoEnv->Clear(OXUndoEnvironment::Accessor()); + m_pUndoEnv->Clear(OXUndoEnvironment::Accessor()); } SdrPage* OReportModel::AllocPage(bool /*bMasterPage*/) @@ -100,7 +102,7 @@ OReportPage* OReportModel::createNewPage(const uno::Reference< report::XSection SolarMutexGuard aSolarGuard; OReportPage* pPage = new OReportPage( *this ,_xSection); InsertPage(pPage); - m_xUndoEnv->AddSection(_xSection); + m_pUndoEnv->AddSection(_xSection); return pPage; } |