summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-02-06 22:01:27 +0100
committerMichael Stahl <mstahl@redhat.com>2012-02-07 00:44:26 +0100
commit13424b43c25389e303774c3fb2f2beb3e20ceae5 (patch)
treecc03da29633667db470d2383d8226457b1476cd9
parent89b68f682e40f1bdc6c967bf38308504fae70d82 (diff)
fdo#38745: fix hilariously stupid stack guards:
The UndoRedoRedlineGuards that SwUndo::{Un,Re}doWithContext wants to put on the stack aren't actually variables, so the destructor gets invoked before the function call that the guard is supposed to protect. Regression from CWS undoapi.
-rw-r--r--sw/source/core/undo/undobj.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index f815398603b1..b2a5243483c8 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -249,7 +249,7 @@ void SwUndo::UndoWithContext(SfxUndoContext & rContext)
dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
OSL_ASSERT(pContext);
if (!pContext) { return; }
- UndoRedoRedlineGuard(*pContext, *this);
+ UndoRedoRedlineGuard const g(*pContext, *this);
UndoImpl(*pContext);
}
@@ -259,7 +259,7 @@ void SwUndo::RedoWithContext(SfxUndoContext & rContext)
dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
OSL_ASSERT(pContext);
if (!pContext) { return; }
- UndoRedoRedlineGuard(*pContext, *this);
+ UndoRedoRedlineGuard const g(*pContext, *this);
RedoImpl(*pContext);
}