summaryrefslogtreecommitdiff
path: root/svl/source
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-03-15 20:54:02 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-07-02 14:43:34 +0100
commitcc290073a62e0a2c38990ff3a1311d79d0d61160 (patch)
treed14ce11170f1cee647e995181b59c8d70df547ba /svl/source
parent18f32039158fafb6281b4128f3c370133c954251 (diff)
fs34b: #i117039# restore old behavior of SfxUndoManager::EnableUndo: don't count the calls, but maintain a simple flag.
Consequently, let sw's UndoManager simply delegate now, and change the UndoManagerHelper to maintain a lock counter itself.
Diffstat (limited to 'svl/source')
-rw-r--r--svl/source/undo/undo.cxx17
1 files changed, 6 insertions, 11 deletions
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index e9166758cd17..4ce4bc0c9774 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -185,9 +185,9 @@ struct SVL_DLLPRIVATE SfxUndoManager_Data
SfxUndoArray* pActUndoArray;
SfxUndoArray* pFatherUndoArray;
- sal_Int32 mnLockCount;
sal_Int32 mnMarks;
sal_Int32 mnEmptyMark;
+ bool mbUndoEnabled;
bool mbDoing;
bool mbClearUntilTopLevel;
@@ -197,9 +197,9 @@ struct SVL_DLLPRIVATE SfxUndoManager_Data
:pUndoArray( new SfxUndoArray( i_nMaxUndoActionCount ) )
,pActUndoArray( NULL )
,pFatherUndoArray( NULL )
- ,mnLockCount( 0 )
,mnMarks( 0 )
,mnEmptyMark(MARK_INVALID)
+ ,mbUndoEnabled( true )
,mbDoing( false )
,mbClearUntilTopLevel( false )
{
@@ -420,14 +420,9 @@ void SfxUndoManager::EnableUndo( bool i_enable )
void SfxUndoManager::ImplEnableUndo_Lock( bool const i_enable )
{
- if ( !i_enable )
- ++m_pData->mnLockCount;
- else
- {
- OSL_PRECOND( m_pData->mnLockCount > 0, "SfxUndoManager::ImplEnableUndo_NoNotify: not disabled, so why enabling?" );
- if ( m_pData->mnLockCount > 0 )
- --m_pData->mnLockCount;
- }
+ if ( m_pData->mbUndoEnabled == i_enable )
+ return;
+ m_pData->mbUndoEnabled = i_enable;
}
//------------------------------------------------------------------------
@@ -442,7 +437,7 @@ bool SfxUndoManager::IsUndoEnabled() const
bool SfxUndoManager::ImplIsUndoEnabled_Lock() const
{
- return m_pData->mnLockCount == 0;
+ return m_pData->mbUndoEnabled;
}
//------------------------------------------------------------------------