Kaydet (Commit) c24272c7 authored tarafından Caolán McNamara's avatar Caolán McNamara

the dubious SfxModelSubComponent and friends aren't used outside sfx2

so move out of the globals headers and drop their public visibility
markup

Change-Id: Ie0a852c962a9d05488022397e83152d1c73cfa29
üst a65b6a46
......@@ -894,82 +894,6 @@ private:
} ; // class SfxBaseModel
/** base class for sub components of an SfxBaseModel, which share their ref count and lifetime with the SfxBaseModel
*/
class SFX2_DLLPUBLIC SfxModelSubComponent
{
public:
/** checks whether the instance is alive, i.e. properly initialized, and not yet disposed
*/
void MethodEntryCheck()
{
m_rModel.MethodEntryCheck( true );
}
// called when the SfxBaseModel which the component is superordinate of is being disposed
virtual void disposing();
protected:
SfxModelSubComponent( SfxBaseModel& i_model )
:m_rModel( i_model )
{
}
virtual ~SfxModelSubComponent();
void acquireModel() { m_rModel.acquire(); }
void releaseModel() { m_rModel.release(); }
bool isDisposed() const { return m_rModel.IsDisposed(); }
protected:
const SfxBaseModel& getBaseModel() const { return m_rModel; }
SfxBaseModel& getBaseModel() { return m_rModel; }
::osl::Mutex& getMutex() { return m_rModel.getMutex(); }
private:
SfxBaseModel& m_rModel;
};
class SFX2_DLLPUBLIC SfxModelGuard
{
public:
enum AllowedModelState
{
// not yet initialized
E_INITIALIZING,
// fully alive, i.e. initialized, and not yet disposed
E_FULLY_ALIVE
};
SfxModelGuard( SfxBaseModel& i_rModel, const AllowedModelState i_eState = E_FULLY_ALIVE )
: m_aGuard()
{
i_rModel.MethodEntryCheck( i_eState != E_INITIALIZING );
}
SfxModelGuard( SfxModelSubComponent& i_rSubComponent )
:m_aGuard()
{
i_rSubComponent.MethodEntryCheck();
}
~SfxModelGuard()
{
}
void reset()
{
m_aGuard.reset();
}
void clear()
{
m_aGuard.clear();
}
private:
SolarMutexResettableGuard m_aGuard;
};
#endif // INCLUDED_SFX2_SFXBASEMODEL_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -19,7 +19,6 @@
#include "docundomanager.hxx"
#include <cppuhelper/weak.hxx>
#include <sfx2/sfxbasemodel.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/viewfrm.hxx>
......
......@@ -29,12 +29,84 @@
#include <boost/scoped_ptr.hpp>
#include <boost/noncopyable.hpp>
/** base class for sub components of an SfxBaseModel, which share their ref count and lifetime with the SfxBaseModel
*/
class SfxModelSubComponent
{
public:
/** checks whether the instance is alive, i.e. properly initialized, and not yet disposed
*/
void MethodEntryCheck()
{
m_rModel.MethodEntryCheck( true );
}
namespace sfx2
// called when the SfxBaseModel which the component is superordinate of is being disposed
virtual void disposing();
protected:
SfxModelSubComponent( SfxBaseModel& i_model )
:m_rModel( i_model )
{
}
virtual ~SfxModelSubComponent();
void acquireModel() { m_rModel.acquire(); }
void releaseModel() { m_rModel.release(); }
bool isDisposed() const { return m_rModel.IsDisposed(); }
protected:
const SfxBaseModel& getBaseModel() const { return m_rModel; }
SfxBaseModel& getBaseModel() { return m_rModel; }
::osl::Mutex& getMutex() { return m_rModel.getMutex(); }
private:
SfxBaseModel& m_rModel;
};
class SfxModelGuard
{
public:
enum AllowedModelState
{
// not yet initialized
E_INITIALIZING,
// fully alive, i.e. initialized, and not yet disposed
E_FULLY_ALIVE
};
SfxModelGuard( SfxBaseModel& i_rModel, const AllowedModelState i_eState = E_FULLY_ALIVE )
: m_aGuard()
{
i_rModel.MethodEntryCheck( i_eState != E_INITIALIZING );
}
SfxModelGuard( SfxModelSubComponent& i_rSubComponent )
:m_aGuard()
{
i_rSubComponent.MethodEntryCheck();
}
~SfxModelGuard()
{
}
void reset()
{
m_aGuard.reset();
}
void clear()
{
m_aGuard.clear();
}
private:
SolarMutexResettableGuard m_aGuard;
};
namespace sfx2
{
//= DocumentUndoManager
typedef ::cppu::WeakImplHelper1 <css::document::XUndoManager> DocumentUndoManager_Base;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment