diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-02-09 17:26:40 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-02-09 17:26:40 +0100 |
commit | d8352bc6e00ae778fb060a0124ee98db3c76d6cf (patch) | |
tree | cf18b5a4b49d13b67d2b1c6ffbb7d137f55c01e4 /dbaccess | |
parent | 05e2a9183ccb47ed1a20df5e72c26353aed985eb (diff) |
autorecovery: make m_pView a private member of the GenericController, with defined access methods
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/inc/genericcontroller.hxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppController.cxx | 14 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/brwctrlr.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/genericcontroller.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/RelationController.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/brwctrlr.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/querycontroller.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/JoinController.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/querycontroller.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/relationdesign/RelationController.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableController.cxx | 4 |
11 files changed, 26 insertions, 26 deletions
diff --git a/dbaccess/inc/genericcontroller.hxx b/dbaccess/inc/genericcontroller.hxx index 33c315a843a2..c35e166d374a 100644 --- a/dbaccess/inc/genericcontroller.hxx +++ b/dbaccess/inc/genericcontroller.hxx @@ -222,9 +222,10 @@ namespace dbaui ::std::auto_ptr< OGenericUnoController_Data > m_pData; + ODataView* m_pView; // our (VCL) "main window" #ifdef DBG_UTIL - bool m_bDescribingSupportedFeatures; + bool m_bDescribingSupportedFeatures; #endif protected: @@ -258,7 +259,6 @@ namespace dbaui ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xDatabaseContext; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle > m_xTitleHelper; - ODataView* m_pView; // our (VCL) "main window" sal_Bool m_bPreview; sal_Bool m_bReadOnly; @@ -416,7 +416,9 @@ namespace dbaui public: ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const { return m_xServiceFactory; } - ODataView* getView() const { return m_pView; } + ODataView* getView() const { return m_pView; } + void setView( ODataView& i_rView ) { m_pView = &i_rView; } + void clearView() { m_pView = NULL; } // shows a error box if the SQLExceptionInfo is valid void showError(const ::dbtools::SQLExceptionInfo& _rInfo); diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 47547413d90d..a274b29d2bc9 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -345,8 +345,8 @@ OApplicationController::~OApplicationController() osl_incrementInterlockedCount( &m_refCount ); dispose(); } - ::std::auto_ptr< Window> aTemp(m_pView); - m_pView = NULL; + ::std::auto_ptr< Window> aTemp( getView() ); + clearView(); DBG_DTOR(OApplicationController,NULL); } @@ -455,15 +455,15 @@ void SAL_CALL OApplicationController::disposing() DBG_UNHANDLED_EXCEPTION(); } - m_pView = NULL; + clearView(); OApplicationController_CBASE::disposing(); // here the m_refCount must be equal 5 } //-------------------------------------------------------------------- sal_Bool OApplicationController::Construct(Window* _pParent) { - m_pView = new OApplicationView( _pParent, getORB(), *this, m_ePreviewMode ); - m_pView->SetUniqueId(UID_APP_VIEW); + setView( * new OApplicationView( _pParent, getORB(), *this, m_ePreviewMode ) ); + getView()->SetUniqueId(UID_APP_VIEW); // late construction sal_Bool bSuccess = sal_False; @@ -482,8 +482,8 @@ sal_Bool OApplicationController::Construct(Window* _pParent) if ( !bSuccess ) { - ::std::auto_ptr< Window> aTemp(m_pView); - m_pView = NULL; + ::std::auto_ptr< Window> aTemp( getView() ); + clearView(); return sal_False; } diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 20523c1339f8..5277afb37500 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -829,7 +829,7 @@ sal_Bool SbaXDataBrowserController::Construct(Window* pParent) // --------------- // create the view - m_pView = new UnoDataBrowserView( pParent, *this, getORB() ); + setView( * new UnoDataBrowserView( pParent, *this, getORB() ) ); if (!getBrowserView()) return sal_False; @@ -1345,7 +1345,7 @@ void SbaXDataBrowserController::disposing() { removeControlListeners(getBrowserView()->getGridControl()); // don't delete explicitly, this is done by the owner (and user) of this controller (me hopes ...) - m_pView = NULL; + clearView(); } if(m_aInvalidateClipboard.IsActive()) diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 052aaf34e7fa..150c701aab20 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -251,6 +251,7 @@ DBG_NAME(OGenericUnoController) // ------------------------------------------------------------------------- OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFactory >& _rM) :OGenericUnoController_Base( getMutex() ) + ,m_pView(NULL) #ifdef DBG_UTIL ,m_bDescribingSupportedFeatures( false ) #endif @@ -258,7 +259,6 @@ OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFacto ,m_aAsyncCloseTask(LINK(this, OGenericUnoController, OnAsyncCloseTask)) ,m_xServiceFactory(_rM) ,m_aCurrentFrame( *this ) - ,m_pView(NULL) ,m_bPreview(sal_False) ,m_bReadOnly(sal_False) ,m_bCurrentlyModified(sal_False) @@ -286,13 +286,13 @@ OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFacto // ----------------------------------------------------------------------------- OGenericUnoController::OGenericUnoController() :OGenericUnoController_Base( getMutex() ) + ,m_pView(NULL) #ifdef DBG_UTIL ,m_bDescribingSupportedFeatures( false ) #endif ,m_aAsyncInvalidateAll(LINK(this, OGenericUnoController, OnAsyncInvalidateAll)) ,m_aAsyncCloseTask(LINK(this, OGenericUnoController, OnAsyncCloseTask)) ,m_aCurrentFrame( *this ) - ,m_pView(NULL) ,m_bPreview(sal_False) ,m_bReadOnly(sal_False) ,m_bCurrentlyModified(sal_False) @@ -415,7 +415,7 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen // no one clears my view if I won't ::std::auto_ptr<Window> aTemp(m_pView); m_pView = NULL; - throw e; + throw; } } diff --git a/dbaccess/source/ui/inc/RelationController.hxx b/dbaccess/source/ui/inc/RelationController.hxx index 6bc1561e0785..fe080672a5bf 100644 --- a/dbaccess/source/ui/inc/RelationController.hxx +++ b/dbaccess/source/ui/inc/RelationController.hxx @@ -60,7 +60,7 @@ namespace dbaui // execute a feature virtual void Execute(sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); - ORelationDesignView* getRelationView() { return static_cast<ORelationDesignView*>(m_pView); } + ORelationDesignView* getRelationView() { return static_cast<ORelationDesignView*>( getView() ); } void loadData(); TTableWindowData::value_type existsTable(const ::rtl::OUString& _rComposedTableName,sal_Bool _bCase) const; diff --git a/dbaccess/source/ui/inc/brwctrlr.hxx b/dbaccess/source/ui/inc/brwctrlr.hxx index 128b20178e8a..a4f05670252b 100644 --- a/dbaccess/source/ui/inc/brwctrlr.hxx +++ b/dbaccess/source/ui/inc/brwctrlr.hxx @@ -164,7 +164,7 @@ namespace dbaui public: SbaXDataBrowserController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM); - UnoDataBrowserView* getBrowserView() const { return static_cast< UnoDataBrowserView*>(m_pView); } + UnoDataBrowserView* getBrowserView() const { return static_cast< UnoDataBrowserView*>(getView()); } // late construction virtual sal_Bool Construct(Window* pParent); diff --git a/dbaccess/source/ui/inc/querycontroller.hxx b/dbaccess/source/ui/inc/querycontroller.hxx index 6db721095c15..42382f41277d 100644 --- a/dbaccess/source/ui/inc/querycontroller.hxx +++ b/dbaccess/source/ui/inc/querycontroller.hxx @@ -142,7 +142,7 @@ namespace dbaui virtual void reconnect( sal_Bool _bUI ); virtual ::rtl::OUString getPrivateTitle( ) const; - OQueryContainerWindow* getContainer() const { return static_cast< OQueryContainerWindow* >( getView() ); } + OQueryContainerWindow* getContainer() const { return static_cast< OQueryContainerWindow* >( getView() ); } public: OQueryController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM); diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index 95531ed3bbaa..00f537686d38 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -283,7 +283,7 @@ void OJoinController::disposing() OJoinController_BASE::disposing(); - m_pView = NULL; + clearView(); m_vTableConnectionData.clear(); m_vTableData.clear(); diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index ca1bc56f01ef..79adb58af366 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -1014,7 +1014,7 @@ sal_Bool OQueryController::Construct(Window* pParent) { // TODO: we have to check if we should create the text- or the design- view - m_pView = new OQueryContainerWindow( pParent, *this, getORB() ); + setView( * new OQueryContainerWindow( pParent, *this, getORB() ) ); return OJoinController::Construct(pParent); } diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx index 3bd2aa12a8ae..96a426a06bd8 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -202,7 +202,7 @@ void ORelationController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue } break; case SID_RELATION_ADD_RELATION: - static_cast<ORelationTableView*>(static_cast<ORelationDesignView*>(m_pView)->getTableView())->AddNewRelation(); + static_cast<ORelationTableView*>(static_cast<ORelationDesignView*>( getView() )->getTableView())->AddNewRelation(); break; default: OJoinController::Execute(_nId,aArgs); @@ -263,10 +263,8 @@ void ORelationController::impl_initialize() // ----------------------------------------------------------------------------- sal_Bool ORelationController::Construct(Window* pParent) { - m_pView = new ORelationDesignView( pParent, *this, getORB() ); + setView( * new ORelationDesignView( pParent, *this, getORB() ) ); OJoinController::Construct(pParent); -// m_pView->Construct(); -// m_pView->Show(); return sal_True; } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 1eed02543cda..4296082b1c7b 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -207,7 +207,7 @@ void OTableController::stopTableListening() void OTableController::disposing() { OTableController_BASE::disposing(); - m_pView = NULL; + clearView(); m_vRowList.clear(); } @@ -579,7 +579,7 @@ void OTableController::impl_initialize() // ----------------------------------------------------------------------------- sal_Bool OTableController::Construct(Window* pParent) { - m_pView = new OTableDesignView( pParent, getORB(), *this ); + setView( * new OTableDesignView( pParent, getORB(), *this ) ); OTableController_BASE::Construct(pParent); // m_pView->Construct(); // m_pView->Show(); |