diff options
author | Andreas Schlüns <as@openoffice.org> | 2000-10-19 10:00:38 +0000 |
---|---|---|
committer | Andreas Schlüns <as@openoffice.org> | 2000-10-19 10:00:38 +0000 |
commit | 9a445409c7731eaeffdf5c15b9d2cf375effee0e (patch) | |
tree | a67184672922e7cb2af155bd2e1611cc8b9599fc /framework | |
parent | 044f5b85a29754c9ffe89a1f98c8e83f1b8a4386 (diff) |
use refcount for temp. quit timer
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/classes/framecontainer.hxx | 13 | ||||
-rw-r--r-- | framework/source/classes/framecontainer.cxx | 28 |
2 files changed, 22 insertions, 19 deletions
diff --git a/framework/inc/classes/framecontainer.hxx b/framework/inc/classes/framecontainer.hxx index 118a7b73a431..46ddf4463b19 100644 --- a/framework/inc/classes/framecontainer.hxx +++ b/framework/inc/classes/framecontainer.hxx @@ -2,9 +2,9 @@ * * $RCSfile: framecontainer.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: as $ $Date: 2000-10-16 13:36:26 $ + * last change: $Author: as $ $Date: 2000-10-19 11:00:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -94,16 +94,21 @@ #include <stl/vector> #endif +#ifndef _VOS_REF_HXX_ +#include <vos/ref.hxx> +#endif + //_________________________________________________________________________________________________________________ // namespace //_________________________________________________________________________________________________________________ namespace framework{ -#define XFRAME ::com::sun::star::frame::XFrame +#define OREF ::vos::ORef #define REFERENCE ::com::sun::star::uno::Reference #define SEQUENCE ::com::sun::star::uno::Sequence #define STLVECTOR ::std::vector +#define XFRAME ::com::sun::star::frame::XFrame //_________________________________________________________________________________________________________________ // exported const @@ -436,7 +441,7 @@ class FrameContainer sal_Bool m_bLock ; /// lock to block append()-, remove()- or clear()-calls STLVECTOR< REFERENCE< XFRAME > > m_aContainer ; /// list to hold all frames REFERENCE< XFRAME > m_xActiveFrame ; /// one container item can be the current active frame. Its neccessary for Desktop or Frame implementation. - AsyncQuit* m_pQuitTimer ; /// if an instance of these class used by desktop and last frame will be removed we must terminate the desktop + OREF< AsyncQuit > m_rQuitTimer ; /// if an instance of these class used by desktop and last frame will be removed we must terminate the desktop }; // class FrameContainer diff --git a/framework/source/classes/framecontainer.cxx b/framework/source/classes/framecontainer.cxx index 0bc5fbc7d6a1..62ac315061f5 100644 --- a/framework/source/classes/framecontainer.cxx +++ b/framework/source/classes/framecontainer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: framecontainer.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: as $ $Date: 2000-10-16 13:36:48 $ + * last change: $Author: as $ $Date: 2000-10-19 11:00:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -104,8 +104,7 @@ using namespace ::com::sun::star::frame ; // constructor //***************************************************************************************************************** FrameContainer::FrameContainer() - : m_bLock ( LOCK_OFF ) - , m_pQuitTimer ( NULL ) + : m_bLock( LOCK_OFF ) { } @@ -172,11 +171,11 @@ void FrameContainer::remove( const Reference< XFrame >& xFrame ) // If last frame was removed and special quit timer is enabled by the desktop // we must terminate the desktop by using this timer! if ( - ( getCount() < 1 ) && - ( m_pQuitTimer != NULL ) + ( getCount() < 1 ) && + ( m_rQuitTimer.isValid() == sal_True ) ) { - m_pQuitTimer->start(); + m_rQuitTimer->start(); } } } @@ -231,9 +230,9 @@ void FrameContainer::clear() m_xActiveFrame = Reference< XFrame >(); // If special quit timer is used - we must terminate the desktop. // He is the owner of this container and can't work without any visible tasks/frames! - if( m_pQuitTimer != NULL ) + if( m_rQuitTimer.isValid() == sal_True ) { - m_pQuitTimer->start(); + m_rQuitTimer->start(); } } } @@ -378,12 +377,12 @@ void FrameContainer::enableQuitTimer( const Reference< XDesktop >& xDesktop const TAsyncQuitMode& aMode ) { // If no current timer exist - create a new one. - if( m_pQuitTimer == NULL ) + if( m_rQuitTimer.isEmpty() == sal_True ) { - m_pQuitTimer = new AsyncQuit( xDesktop ); + m_rQuitTimer.bind( new AsyncQuit( xDesktop ) ); } // Set given mode on existing or created timer member! - m_pQuitTimer->setMode( aMode ); + m_rQuitTimer->setMode( aMode ); } //***************************************************************************************************************** @@ -393,10 +392,9 @@ void FrameContainer::disableQuitTimer() { // Delete current quit timer. // If user wish to create it again he must do it with "enableQuitTimer()". - if( m_pQuitTimer != NULL ) + if( m_rQuitTimer.isValid() == sal_True ) { - delete m_pQuitTimer; - m_pQuitTimer = NULL; + m_rQuitTimer.unbind(); } } |