summaryrefslogtreecommitdiff
path: root/sw/source/core/undo/docundo.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/undo/docundo.cxx')
-rw-r--r--sw/source/core/undo/docundo.cxx31
1 files changed, 18 insertions, 13 deletions
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index 0d7e260be1..35c09ac23b 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -679,22 +679,27 @@ SwUndoIdAndName * lcl_GetUndoIdAndName(const SwUndos & rUndos, sal_uInt16 nPos )
int nTmpPos = nPos + pUndoStart->GetEndOffset();
int nSubstitute = -1;
- SwUndo * pTmpUndo;
- do
+ // --> OD 2009-09-30 #i105457#
+ if ( nTmpPos > 0 )
+ // <--
{
- nTmpPos--;
- pTmpUndo = rUndos[ static_cast<USHORT>(nTmpPos) ];
+ SwUndo * pTmpUndo;
+ do
+ {
+ nTmpPos--;
+ pTmpUndo = rUndos[ static_cast<USHORT>(nTmpPos) ];
- if (pTmpUndo->GetEffectiveId() > UNDO_END)
- nSubstitute = nTmpPos;
- }
- while (nSubstitute < 0 && nTmpPos > nPos);
+ if (pTmpUndo->GetEffectiveId() > UNDO_END)
+ nSubstitute = nTmpPos;
+ }
+ while (nSubstitute < 0 && nTmpPos > nPos);
- if (nSubstitute >= 0)
- {
- SwUndo * pSubUndo = rUndos[ static_cast<USHORT>(nSubstitute) ];
- nId = pSubUndo->GetEffectiveId();
- sStr = pSubUndo->GetComment();
+ if (nSubstitute >= 0)
+ {
+ SwUndo * pSubUndo = rUndos[ static_cast<USHORT>(nSubstitute) ];
+ nId = pSubUndo->GetEffectiveId();
+ sStr = pSubUndo->GetComment();
+ }
}
}
else